44 std::string licenseKey;
55 initParams.license_key = params.licenseKey.c_str();
81 std::vector<scanbotsdk_barcode_format_t>
formats;
105 .formats = params.
formats.data(),
106 .formats_count =
static_cast<int>(params.
formats.size()),
114 if (ret != scanbotsdk_error_code_t::SCANBOTSDK_OK) {
115 recognizer =
nullptr;
120 if (recognizer !=
nullptr){
132 if (recognizer ==
nullptr){
143 std::vector<BarCodeItem> retval;
149 for (
int barcode_idx = 0; barcode_idx < count; barcode_idx++) {
152 const char* cText =
nullptr;
157 item.
text = std::string(cText);
159 int rawBytesLength = 0;
160 const unsigned char* cRawBytes =
nullptr;
165 item.
rawBytes = std::vector<unsigned char>(cRawBytes, cRawBytes + rawBytesLength);
176 retval.push_back(item);
scanbotsdk_error_code_t
The error codes returned by most of the Scanbot SDK functions.
Definition ScanbotSDK.h:30
@ SCANBOTSDK_OK
Definition ScanbotSDK.h:32
The barcode recognizer is capable of detecting and decoding barcodes in images.
Definition ScanbotSDK.hpp:71
BarcodeRecognizer(const BarcodeRecognizer::InitializationParams ¶ms)
Creates a new barcode recognizer.
Definition ScanbotSDK.hpp:102
std::vector< BarCodeItem > recognize(scanbotsdk_image_t image)
Recognizes barcodes in the given image.
Definition ScanbotSDK.hpp:130
scanbotsdk_barcode_engine_mode_t engine_mode
The barcode recognition engine mode.
Definition ScanbotSDK.h:151
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_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.
scanbotsdk_barcode_engine_mode_t
Barcode recognition engine modes.
Definition ScanbotSDK.h:114
struct scanbotsdk_barcode_result_t scanbotsdk_barcode_result_t
Represents the result of a call to scanbotsdk_barcode_recognizer_recognize.
Definition ScanbotSDK.h:213
SBSDK_API scanbotsdk_error_code_t scanbotsdk_barcode_recognizer_free(scanbotsdk_barcode_recognizer_t *recognizer)
Destroys the barcode recognizer instance.
scanbotsdk_barcode_format_t
Barcode format, also called symbology.
Definition ScanbotSDK.h:79
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_free(scanbotsdk_barcode_result_t *result)
Destroys the barcode result instance.
struct scanbotsdk_barcode_recognizer_t scanbotsdk_barcode_recognizer_t
Represents an instance of the barcode recognizer.
Definition ScanbotSDK.h:207
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_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.
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_recognizer_recognize(scanbotsdk_barcode_recognizer_t *recognizer, const scanbotsdk_image_t *input, scanbotsdk_barcode_result_t **result)
Recognize barcodes in an image.
@ SCANBOTSDK_BARCODE_ENGINE_MODE_BALANCED
Single-shot recognition mode for static images.
Definition ScanbotSDK.h:136
Barcode recognizer initialization parameters.
Definition ScanbotSDK.h:149
scanbotsdk_license_status_t
The status of the license.
Definition ScanbotSDK.h:58
SBSDK_API scanbotsdk_error_code_t scanbotsdk_get_license_status(scanbotsdk_license_status_t *status)
Returns the current license status.
SBSDK_API scanbotsdk_error_code_t scanbotsdk_initialize(const scanbotsdk_init_params_t *init_params)
Initialize the Scanbot SDK. You must always call this function before using any other Scanbot SDK fun...
SBSDK_API scanbotsdk_error_code_t scanbotsdk_log_error(const char *message)
Logs an error message using the Scanbot SDK logger.
Contains the information about a single barcode.
Definition ScanbotSDK.hpp:21
std::string text
The barcode data as text.
Definition ScanbotSDK.hpp:23
scanbotsdk_barcode_format_t format
The barcode format, also called its symbology.
Definition ScanbotSDK.hpp:25
std::vector< unsigned char > rawBytes
The barcode data as raw bytes.
Definition ScanbotSDK.hpp:40
std::array< int, 8 > quad
The coordinates of the barcode's quadrangle in the image.
Definition ScanbotSDK.hpp:38
The initialization parameters for the barcode recognizer.
Definition ScanbotSDK.hpp:77
std::vector< scanbotsdk_barcode_format_t > formats
The barcode formats to detect. If empty, all formats will be recognized.
Definition ScanbotSDK.hpp:81
size_t tensorrtMaxWorkspaceSize
The maximum workspace size in bytes for TensorRT. If 0, the default value will be used.
Definition ScanbotSDK.hpp:94
bool useTensorRT
If true, the barcode recognizer will use the TensorRT backend for GPU acceleration.
Definition ScanbotSDK.hpp:88
int tensorrtMaxInputWidth
The maximum input width in pixels for TensorRT. If 0, the default value will be used.
Definition ScanbotSDK.hpp:90
scanbotsdk_barcode_engine_mode_t engineMode
The barcode recognition engine mode.
Definition ScanbotSDK.hpp:79
int tensorrtMaxInputHeight
The maximum input height in pixels for TensorRT. If 0, the default value will be used.
Definition ScanbotSDK.hpp:92
Definition ScanbotSDK.hpp:43
Wrapper for image data.
Definition ScanbotSDK.h:185
Definition ScanbotSDK.h:215