@@ -83,6 +83,13 @@ scanbotsdk_error_code_t process_frame(scanbotsdk_barcode_scanner_t *scanner, fra
83
83
scanbotsdk_barcode_scanner_result_t * result = NULL ;
84
84
85
85
// region create scanbotsdk_image_t from frame
86
+
87
+ // Setting image_is_live lets the scanner know that we're running in live mode.
88
+ // In this mode we maintain the highest FPS because we spread the work of scanning barcodes across multiple frames.
89
+ // If you set image_is_live = false, the scanner will run in single-shot mode which is much slower,
90
+ // but has a much higher probability of finding all barcodes in the input image.
91
+ // As an alternative, you can explicitly set the scanner mode,
92
+ // by creating it with e.g. SCANBOTSDK_PROCESSING_MODE_LIVE for live mode instead of SCANBOTSDK_PROCESSING_MODE_AUTO.
86
93
bool image_is_live = true;
87
94
scanbotsdk_raw_image_load_options_create_with_defaults (image_is_live , & image_load_options );
88
95
@@ -129,7 +136,7 @@ scanbotsdk_error_code_t create_barcode_scanner(bool use_tensor_rt, scanbotsdk_ba
129
136
scanbotsdk_error_code_t ec = SCANBOTSDK_OK ;
130
137
131
138
scanbotsdk_barcode_format_common_configuration_t * common_format_configuration = NULL ;
132
- scanbotsdk_accelerator_t * accelerator = NULL ;
139
+ scanbotsdk_accelerator_t * accelerator = NULL ;
133
140
scanbotsdk_barcode_scanner_configuration_t * barcode_scanner_configuration = NULL ;
134
141
135
142
// region create barcode scanner configuration
@@ -172,6 +179,12 @@ scanbotsdk_error_code_t create_barcode_scanner(bool use_tensor_rt, scanbotsdk_ba
172
179
goto exit ;
173
180
}
174
181
182
+ ec = scanbotsdk_barcode_scanner_configuration_set_processing_mode (
183
+ barcode_scanner_configuration , SCANBOTSDK_PROCESSING_MODE_AUTO );
184
+ if (ec != SCANBOTSDK_OK ) {
185
+ goto exit ;
186
+ }
187
+
175
188
if (use_tensor_rt ) {
176
189
scanbotsdk_tensor_rt_accelerator_t * tensor_rt_accelerator = NULL ;
177
190
ec = scanbotsdk_tensor_rt_accelerator_create ("./" , & tensor_rt_accelerator );
0 commit comments