API Documentation (C language)
API Documentation#
Enum: StatusCode#
Represents the status codes returned by the API.Good
(0): The program is running normally.
NotStarted
(1): The program has not been started. Call start_service
to start recognition.
NotRegister
(2): The SDK is not registered. Call register
to activate.
AuthorizationExpired
(3): The trial activation has expired. Please reactivate.
NotModelLoaded
(5): The model has not been loaded.
CameraImageNotFetched
(6): Unable to fetch the camera image.
RemoteLocked
(7): Locked in the network version.
Struct: Product#
Represents information about a recognized product.sku
(char[16]): SKU of the product.
name
(char[64]): Name of the product.
price
(int32_t): Price of the product in cents.
Struct: PredictOutput#
Represents the output of a prediction.products
(Product[16]): Array of up to 16 product information.
products_size
(int32_t): Number of products recognized in the current prediction.
has_prediction
(bool): Indicates whether there is a prediction result (there may be AI recognition but no corresponding product).
Function: start_service#
assets_root
(const char*): Path to the resource storage.
version
(const char*): Version number of the software (if unknown, use "Unknown").
Returns: int32_t
status code.
Function: check_status#
Checks the status of the service.Returns: StatusCode
representing the status.
Function: register#
Activates recognition authorization.passphrase
(const char*): Activation code. If empty, the system will be reinitialized.
channel_id
(const char*): Channel ID.
branch
(const char*): Branch.
Returns: int32_t
status code.
Function: crop_image#
Crops an image using four points.p_1_x
to p_4_y
(int32_t): X and Y coordinates of the four points (range: [0, 100]).
Returns: int32_t
status code.
Function: product_import#
Imports products using a CSV format list.clear
(bool): Whether to perform a full import (clears products not in the list).
data
(const char*): CSV formatted product list.
Returns: int32_t
status code.
Function: product_import_path#
Imports products from a file path.clear
(bool): Whether to perform a full import (clears products not in the list).
path
(const char*): Absolute path to the file.
Returns: int32_t
status code.
Function: clear_product#
Clears the product table.Returns: int32_t
status code.
Function: prediction#
output
(PredictOutput*): Output of the recognition result.
Returns: int32_t
status code.
Function: raw_prediction#
Performs raw recognition.width
(uint32_t): Width of the image.
height
(uint32_t): Height of the image.
image_bytes
(const uint8_t*): Image bytes.
image_len
(uint32_t): Length of the image bytes.
output
(uint8_t*): Output of the recognition result.
output_len
(uint32_t): Length of the output buffer.
Returns: int32_t
status code.
Function: feedback#
Provides recognition feedback.sku
(const char*): SKU of the selected product.
name
(const char*): Name of the selected product.
backpropagation
(bool): Whether to learn from this selection result.
Returns: int32_t
status code.
Function: clear_learning#
Clears the learning results.Returns: int32_t
status code.
Function: export_learning#
Exports the learning data to a file.path
(const char*): Absolute path to the export file.
Returns: int32_t
status code.
Function: import_learning#
Imports the learning data from a file.path
(const char*): Absolute path to the import file.
Returns: int32_t
status code.
Function: save#
Saves the recognition data before program exit.Returns: int32_t
status code.
Function: download_update_zip#
Downloads an update package.arch
(const char*): Architecture.
os
(const char*): Operating system.
version
(const char*): Version.
path
(const char*): Absolute path to save the update package.
Returns: int32_t
status code.
Modified at 2023-11-16 06:23:54