Scanbot SDK
|
Classes | |
struct | scanbotsdk_barcode_recognizer_init_params_t |
Barcode recognizer initialization parameters. More... | |
Typedefs | |
typedef enum scanbotsdk_barcode_format_t | scanbotsdk_barcode_format_t |
Barcode format, also called symbology. | |
typedef enum scanbotsdk_barcode_engine_mode_t | scanbotsdk_barcode_engine_mode_t |
Barcode recognition engine modes. | |
typedef struct scanbotsdk_barcode_recognizer_init_params_t | scanbotsdk_barcode_recognizer_init_params_t |
Barcode recognizer initialization parameters. | |
typedef struct scanbotsdk_barcode_recognizer_t | scanbotsdk_barcode_recognizer_t |
Represents an instance of the barcode recognizer. | |
typedef struct scanbotsdk_barcode_result_t | scanbotsdk_barcode_result_t |
Represents the result of a call to scanbotsdk_barcode_recognizer_recognize. | |
Enumerations | |
enum | scanbotsdk_barcode_format_t { SCANBOTSDK_BARCODE_FORMAT_UNKNOWN = 0 , SCANBOTSDK_BARCODE_FORMAT_AZTEC , SCANBOTSDK_BARCODE_FORMAT_CODABAR , SCANBOTSDK_BARCODE_FORMAT_CODE_39 , SCANBOTSDK_BARCODE_FORMAT_CODE_93 , SCANBOTSDK_BARCODE_FORMAT_CODE_128 , SCANBOTSDK_BARCODE_FORMAT_DATA_MATRIX , SCANBOTSDK_BARCODE_FORMAT_EAN_8 , SCANBOTSDK_BARCODE_FORMAT_EAN_13 , SCANBOTSDK_BARCODE_FORMAT_ITF , SCANBOTSDK_BARCODE_FORMAT_PDF_417 , SCANBOTSDK_BARCODE_FORMAT_QR_CODE , SCANBOTSDK_BARCODE_FORMAT_RSS_14 , SCANBOTSDK_BARCODE_FORMAT_RSS_EXPANDED , SCANBOTSDK_BARCODE_FORMAT_UPC_A , SCANBOTSDK_BARCODE_FORMAT_UPC_E , SCANBOTSDK_BARCODE_FORMAT_UPC_EAN_EXTENSION , SCANBOTSDK_BARCODE_FORMAT_MSI_PLESSEY , SCANBOTSDK_BARCODE_FORMAT_IATA_2_OF_5 , SCANBOTSDK_BARCODE_FORMAT_INDUSTRIAL_2_OF_5 , SCANBOTSDK_BARCODE_FORMAT_ONE_D } |
Barcode format, also called symbology. More... | |
enum | scanbotsdk_barcode_engine_mode_t { SCANBOTSDK_BARCODE_ENGINE_MODE_LEGACY_FAST = 0 , SCANBOTSDK_BARCODE_ENGINE_MODE_FASTEST , SCANBOTSDK_BARCODE_ENGINE_MODE_FAST , SCANBOTSDK_BARCODE_ENGINE_MODE_BALANCED , SCANBOTSDK_BARCODE_ENGINE_MODE_BEST } |
Barcode recognition engine modes. More... | |
Functions | |
SBSDK_API scanbotsdk_error_code_t | scanbotsdk_barcode_recognizer_create (const scanbotsdk_barcode_recognizer_init_params_t *params, scanbotsdk_barcode_recognizer_t **recognizer) |
Creates a new instance of the barcode recognizer. | |
SBSDK_API scanbotsdk_error_code_t | scanbotsdk_barcode_recognizer_free (scanbotsdk_barcode_recognizer_t *recognizer) |
Destroys the barcode recognizer instance. | |
SBSDK_API scanbotsdk_error_code_t | scanbotsdk_barcode_recognizer_recognize (scanbotsdk_barcode_recognizer_t *recognizer, const scanbotsdk_image_t *input, scanbotsdk_barcode_result_t **result) |
Recognize barcodes in an image. | |
SBSDK_API scanbotsdk_error_code_t | scanbotsdk_barcode_result_free (scanbotsdk_barcode_result_t *result) |
Destroys the barcode result instance. | |
SBSDK_API scanbotsdk_error_code_t | scanbotsdk_barcode_result_get_count (const scanbotsdk_barcode_result_t *result, int *count) |
Returns the count of detected barcodes in a result. | |
SBSDK_API scanbotsdk_error_code_t | scanbotsdk_barcode_result_get_format (const scanbotsdk_barcode_result_t *result, int index, scanbotsdk_barcode_format_t *format) |
Returns the barcode format of a the given barcode in a result. | |
SBSDK_API scanbotsdk_error_code_t | scanbotsdk_barcode_result_get_text (const scanbotsdk_barcode_result_t *result, int index, const char **text) |
Returns the barcode text as a null-terminated UTF8-encoded string of the given barcode in a result. | |
SBSDK_API scanbotsdk_error_code_t | scanbotsdk_barcode_result_get_quad (const scanbotsdk_barcode_result_t *result, int barcode_index, int *quad) |
Returns the coordinates in pixel space of the four corners of a given barcode in the result. | |
SBSDK_API scanbotsdk_error_code_t | scanbotsdk_barcode_result_get_raw_bytes (const scanbotsdk_barcode_result_t *result, int index, const unsigned char **raw_bytes, int *length) |
Returns the raw bytes of a given barcode from the result. | |
struct scanbotsdk_barcode_recognizer_init_params_t |
Barcode recognizer initialization parameters.
Public Attributes | |
scanbotsdk_barcode_engine_mode_t | engine_mode |
The barcode recognition engine mode. | |
const scanbotsdk_barcode_format_t * | formats |
An array of barcode formats to be detected. If null or empty, all formats will be recognized. | |
int | formats_count |
If formats is a valid pointer, set this field to the number of elements in the array. | |
bool | use_tensorrt |
If true, the barcode recognizer will use the TensorRT backend for GPU acceleration. | |
int | tensorrt_max_input_width |
The maximum input width in pixels for TensorRT. If 0, the default value will be used. | |
int | tensorrt_max_input_height |
The maximum input height in pixels for TensorRT. If 0, the default value will be used. | |
size_t | tensorrt_max_workspace_size |
The maximum workspace size in bytes for TensorRT. If 0, the default value will be used. | |
bool use_tensorrt |
If true, the barcode recognizer will use the TensorRT backend for GPU acceleration.
When enabling TensorRT, use the smallest input image size that fits your use case. The bigger the image size, the more memory is required model at runtime. It takes around 3 minutes to build the TensorRT engine for the first time. The engine is then cached on disk and reused. The cached engine can be copied to other devices with the same device model, Jetpack version, CUDA version and TensorRT version.
Barcode recognition engine modes.
The engine mode controls the trade-off between speed and recall. Faster modes are not guaranteed to recognize all barcodes in the image.
typedef enum scanbotsdk_barcode_format_t scanbotsdk_barcode_format_t |
Barcode format, also called symbology.
The values are used both to set the barcode formats to be recognized, and to indicate the format of a recognized barcode.
typedef struct scanbotsdk_barcode_recognizer_t scanbotsdk_barcode_recognizer_t |
Represents an instance of the barcode recognizer.
Must be destroyed with scanbotsdk_barcode_recognizer_free after use.
typedef struct scanbotsdk_barcode_result_t scanbotsdk_barcode_result_t |
Represents the result of a call to scanbotsdk_barcode_recognizer_recognize.
Must be destroyed with scanbotsdk_barcode_result_free after use.
Barcode recognition engine modes.
The engine mode controls the trade-off between speed and recall. Faster modes are not guaranteed to recognize all barcodes in the image.
Barcode format, also called symbology.
The values are used both to set the barcode formats to be recognized, and to indicate the format of a recognized barcode.
SBSDK_API scanbotsdk_error_code_t scanbotsdk_barcode_recognizer_create | ( | const scanbotsdk_barcode_recognizer_init_params_t * | params, |
scanbotsdk_barcode_recognizer_t ** | recognizer | ||
) |
Creates a new instance of the barcode recognizer.
params | The barcode recognizer initialization parameters |
recognizer | Pointer to a variable that will be set to the new barcode recognizer instance. |
SBSDK_API scanbotsdk_error_code_t scanbotsdk_barcode_recognizer_free | ( | scanbotsdk_barcode_recognizer_t * | recognizer | ) |
Destroys the barcode recognizer instance.
recognizer | Pointer to the barcode recognizer |
SBSDK_API scanbotsdk_error_code_t scanbotsdk_barcode_recognizer_recognize | ( | scanbotsdk_barcode_recognizer_t * | recognizer, |
const scanbotsdk_image_t * | input, | ||
scanbotsdk_barcode_result_t ** | result | ||
) |
Recognize barcodes in an image.
recognizer | Pointer to the barcode recognizer |
input | Pointer to the input image data |
result | Pointer to a variable that will be set to the barcode result |
SBSDK_API scanbotsdk_error_code_t scanbotsdk_barcode_result_free | ( | scanbotsdk_barcode_result_t * | result | ) |
Destroys the barcode result instance.
result | Pointer to the barcode result instance |
SBSDK_API scanbotsdk_error_code_t scanbotsdk_barcode_result_get_count | ( | const scanbotsdk_barcode_result_t * | result, |
int * | count | ||
) |
Returns the count of detected barcodes in a result.
result | Pointer to the barcode result |
count | Pointer to an int variable to hold the count of detected barcodes |
SBSDK_API scanbotsdk_error_code_t scanbotsdk_barcode_result_get_format | ( | const scanbotsdk_barcode_result_t * | result, |
int | index, | ||
scanbotsdk_barcode_format_t * | format | ||
) |
Returns the barcode format of a the given barcode in a result.
result | Pointer to the barcode result |
index | The index of the barcode in the result, must be in the range [0, count - 1] |
format | Pointer to a scanbotsdk_barcode_format_t variable to hold the returned barcode format. |
SBSDK_API scanbotsdk_error_code_t scanbotsdk_barcode_result_get_quad | ( | const scanbotsdk_barcode_result_t * | result, |
int | barcode_index, | ||
int * | quad | ||
) |
Returns the coordinates in pixel space of the four corners of a given barcode in the result.
The coordinates are returned in the following order:
result | Pointer to the barcode result |
barcode_index | The index of the barcode |
quad | An int[8] array to hold the returned coordinates. |
SBSDK_API scanbotsdk_error_code_t scanbotsdk_barcode_result_get_raw_bytes | ( | const scanbotsdk_barcode_result_t * | result, |
int | index, | ||
const unsigned char ** | raw_bytes, | ||
int * | length | ||
) |
Returns the raw bytes of a given barcode from the result.
result | Pointer to the barcode result |
index | The index of the barcode |
raw_bytes | Pointer to a const unsigned char* var to hold the returned barcode raw bytes |
length | Pointer to an int variable to hold the length of the returned barcode raw bytes |
SBSDK_API scanbotsdk_error_code_t scanbotsdk_barcode_result_get_text | ( | const scanbotsdk_barcode_result_t * | result, |
int | index, | ||
const char ** | text | ||
) |
Returns the barcode text as a null-terminated UTF8-encoded string of the given barcode in a result.
result | Pointer to the barcode result |
index | The index of the barcode in the result, must be in the range [0, count - 1] |
text | Pointer to a const char* variable to hold the returned barcode text. The returned pointer is only valid until the barcode result is destroyed. |