|
Scanbot SDK
|
scanbotsdk_document_detection_result_t class
Result of the document contour detection.
scanbotsdk_document_detection_scores_t class
The total and partial scores for the detected document contour.
scanbotsdk_document_detection_status_t enum
Status of the document detection.
scanbotsdk_document_displacement_t enum
The displacement of the document from the image center if the document is partially visible.
| typedef struct scanbotsdk_document_scanner_configuration_t scanbotsdk_document_scanner_configuration_t |
scanbotsdk_document_scanner_configuration_t class
Configuration for the document scanner.
scanbotsdk_document_scanner_engine_mode_t enum
Engines for document scanning.
scanbotsdk_document_scanner_parameters_t class
Parameters for the document scanner.
| typedef struct scanbotsdk_document_scanner_t scanbotsdk_document_scanner_t |
scanbotsdk_document_scanner_t class
API for document detection and scanning.
Required licence feature(s): DocumentScanner.
scanbotsdk_document_scanning_result_t class
Result of the document detection followed by cropping of the found document.
| typedef struct scanbotsdk_partially_visible_document_configuration_t scanbotsdk_partially_visible_document_configuration_t |
scanbotsdk_partially_visible_document_configuration_t class
Configuration for handling partially visible documents.
scanbotsdk_document_detection_status_t enum
Status of the document detection.
scanbotsdk_document_displacement_t enum
The displacement of the document from the image center if the document is partially visible.
scanbotsdk_document_scanner_engine_mode_t enum
Engines for document scanning.
| Enumerator | |
|---|---|
| SCANBOTSDK_DOCUMENT_SCANNER_ENGINE_MODE_ML | Use the ML document scanner. |
| SCANBOTSDK_DOCUMENT_SCANNER_ENGINE_MODE_LEGACY | Use the legacy edge-based document scanner. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_free | ( | scanbotsdk_document_detection_result_t * | object | ) |
Frees the memory allocated for the instance of scanbotsdk_document_detection_result_t. If null is passed, the function does nothing.
| object | Pointer to the instance of scanbotsdk_document_detection_result_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_aspect_ratio | ( | scanbotsdk_document_detection_result_t * | self, |
| double * | aspect_ratio ) |
Returns value of aspect_ratio field of the given object.
Aspect ratio of the detected document contour.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| aspect_ratio | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_average_brightness | ( | scanbotsdk_document_detection_result_t * | self, |
| int * | average_brightness ) |
Returns value of average_brightness field of the given object.
Average brightness, calculated as the average of the Value channel in the HSV color space of:
Default is 0
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| average_brightness | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_detection_scores | ( | scanbotsdk_document_detection_result_t * | self, |
| scanbotsdk_document_detection_scores_t ** | detection_scores ) |
Returns value of detection_scores field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
The total and partial scores for the detected quad.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| detection_scores | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_displacement | ( | scanbotsdk_document_detection_result_t * | self, |
| scanbotsdk_document_displacement_t * | displacement ) |
Returns value of displacement field of the given object.
The displacement of the document from the image center if the document is partially visible.
Default is NONE
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| displacement | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_displacement_vector | ( | scanbotsdk_document_detection_result_t * | self, |
| scanbotsdk_pointf_t * | displacement_vector ) |
Returns value of displacement_vector field of the given object.
The displacement vector of the document from the image center if the document is partially visible in normalized coordinates.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| displacement_vector | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_horizontal_lines | ( | scanbotsdk_document_detection_result_t * | self, |
| scanbotsdk_line_segment_int_t ** | horizontal_lines, | ||
| size_t | size ) |
Returns value of horizontal_lines field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
All detected horizontal lines in image space.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| size | Size of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function. |
| horizontal_lines | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_horizontal_lines_normalized | ( | scanbotsdk_document_detection_result_t * | self, |
| scanbotsdk_line_segment_float_t ** | horizontal_lines_normalized, | ||
| size_t | size ) |
Returns value of horizontal_lines_normalized field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Normalized horizontal lines in image space.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| size | Size of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function. |
| horizontal_lines_normalized | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_horizontal_lines_normalized_size | ( | scanbotsdk_document_detection_result_t * | self, |
| size_t * | size ) |
Returns size of horizontal_lines_normalized array.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| size | Pointer to a variable that will store the size. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_horizontal_lines_size | ( | scanbotsdk_document_detection_result_t * | self, |
| size_t * | size ) |
Returns size of horizontal_lines array.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| size | Pointer to a variable that will store the size. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_points | ( | scanbotsdk_document_detection_result_t * | self, |
| scanbotsdk_point_t ** | points ) |
Returns value of points field of the given object. The returned value is direct view into memory, no pre-allocations needed.
Absolute coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| points | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_points_normalized | ( | scanbotsdk_document_detection_result_t * | self, |
| scanbotsdk_pointf_t ** | points_normalized ) |
Returns value of points_normalized field of the given object. The returned value is direct view into memory, no pre-allocations needed.
Normalized coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| points_normalized | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_points_normalized_size | ( | scanbotsdk_document_detection_result_t * | self, |
| size_t * | size ) |
Returns size of points_normalized array.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| size | Pointer to a variable that will store the size. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_points_size | ( | scanbotsdk_document_detection_result_t * | self, |
| size_t * | size ) |
Returns size of points array.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| size | Pointer to a variable that will store the size. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_status | ( | scanbotsdk_document_detection_result_t * | self, |
| scanbotsdk_document_detection_status_t * | status ) |
Returns value of status field of the given object.
Detection status.
Default is NOT_ACQUIRED
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| status | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_vertical_lines | ( | scanbotsdk_document_detection_result_t * | self, |
| scanbotsdk_line_segment_int_t ** | vertical_lines, | ||
| size_t | size ) |
Returns value of vertical_lines field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
All detected vertical lines in image space.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| size | Size of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function. |
| vertical_lines | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_vertical_lines_normalized | ( | scanbotsdk_document_detection_result_t * | self, |
| scanbotsdk_line_segment_float_t ** | vertical_lines_normalized, | ||
| size_t | size ) |
Returns value of vertical_lines_normalized field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Normalized vertical lines in image space.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| size | Size of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function. |
| vertical_lines_normalized | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_vertical_lines_normalized_size | ( | scanbotsdk_document_detection_result_t * | self, |
| size_t * | size ) |
Returns size of vertical_lines_normalized array.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| size | Pointer to a variable that will store the size. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_result_get_vertical_lines_size | ( | scanbotsdk_document_detection_result_t * | self, |
| size_t * | size ) |
Returns size of vertical_lines array.
| self | Pointer to the instance of scanbotsdk_document_detection_result_t |
| size | Pointer to a variable that will store the size. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_scores_create | ( | double | total_score, |
| double | distance_score, | ||
| double | angle_score, | ||
| double | size_score, | ||
| double | aspect_ratio_score, | ||
| double | line_coverage_score, | ||
| double | width_score, | ||
| double | height_score, | ||
| scanbotsdk_document_detection_scores_t ** | result ) |
Creates a new instance of scanbotsdk_document_detection_scores with given params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| total_score | Weighted sum of all partial scores. |
| distance_score | 100 points, if the center of the contour is exactly in the image center. |
| angle_score | 100 points, if all angles are 90 degrees. |
| size_score | 100 points, if the contour occupies at least 50% of the area of the image. |
| aspect_ratio_score | 100 points, if the aspect ratio matches exactly one of the given aspect ratios. |
| line_coverage_score | Percentage of the document contour that the edge detector was able to find (in LEGACY engine mode only). |
| width_score | Percentage of the image width taken by the detected document. |
| height_score | Percentage of the image height taken by the detected document. |
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_detection_scores_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_scores_free | ( | scanbotsdk_document_detection_scores_t * | object | ) |
Frees the memory allocated for the instance of scanbotsdk_document_detection_scores_t. If null is passed, the function does nothing.
| object | Pointer to the instance of scanbotsdk_document_detection_scores_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_scores_get_angle_score | ( | scanbotsdk_document_detection_scores_t * | self, |
| double * | angle_score ) |
Returns value of angle_score field of the given object.
100 points, if all angles are 90 degrees.
| self | Pointer to the instance of scanbotsdk_document_detection_scores_t |
| angle_score | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_scores_get_aspect_ratio_score | ( | scanbotsdk_document_detection_scores_t * | self, |
| double * | aspect_ratio_score ) |
Returns value of aspect_ratio_score field of the given object.
100 points, if the aspect ratio matches exactly one of the given aspect ratios.
| self | Pointer to the instance of scanbotsdk_document_detection_scores_t |
| aspect_ratio_score | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_scores_get_distance_score | ( | scanbotsdk_document_detection_scores_t * | self, |
| double * | distance_score ) |
Returns value of distance_score field of the given object.
100 points, if the center of the contour is exactly in the image center.
| self | Pointer to the instance of scanbotsdk_document_detection_scores_t |
| distance_score | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_scores_get_height_score | ( | scanbotsdk_document_detection_scores_t * | self, |
| double * | height_score ) |
Returns value of height_score field of the given object.
Percentage of the image height taken by the detected document.
| self | Pointer to the instance of scanbotsdk_document_detection_scores_t |
| height_score | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_scores_get_line_coverage_score | ( | scanbotsdk_document_detection_scores_t * | self, |
| double * | line_coverage_score ) |
Returns value of line_coverage_score field of the given object.
Percentage of the document contour that the edge detector was able to find (in LEGACY engine mode only).
| self | Pointer to the instance of scanbotsdk_document_detection_scores_t |
| line_coverage_score | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_scores_get_size_score | ( | scanbotsdk_document_detection_scores_t * | self, |
| double * | size_score ) |
Returns value of size_score field of the given object.
100 points, if the contour occupies at least 50% of the area of the image.
| self | Pointer to the instance of scanbotsdk_document_detection_scores_t |
| size_score | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_scores_get_total_score | ( | scanbotsdk_document_detection_scores_t * | self, |
| double * | total_score ) |
Returns value of total_score field of the given object.
Weighted sum of all partial scores.
| self | Pointer to the instance of scanbotsdk_document_detection_scores_t |
| total_score | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_scores_get_width_score | ( | scanbotsdk_document_detection_scores_t * | self, |
| double * | width_score ) |
Returns value of width_score field of the given object.
Percentage of the image width taken by the detected document.
| self | Pointer to the instance of scanbotsdk_document_detection_scores_t |
| width_score | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_detection_status_t_to_string | ( | scanbotsdk_document_detection_status_t | value, |
| const char ** | result ) |
Returns the string representation of the given scanbotsdk_document_detection_status_t value.
The returned string doesn't need to be freed.
| value | The value to be converted to string. |
| result | Pointer to a variable that will store the string representation of the value. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_displacement_t_to_string | ( | scanbotsdk_document_displacement_t | value, |
| const char ** | result ) |
Returns the string representation of the given scanbotsdk_document_displacement_t value.
The returned string doesn't need to be freed.
| value | The value to be converted to string. |
| result | Pointer to a variable that will store the string representation of the value. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_clear_result | ( | scanbotsdk_document_scanner_t * | self | ) |
Clears the accumulated results. Should be called after a document has been detected to the customers satisfaction to prevent a poisoned cache.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_t method to be called on |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_configuration_create | ( | scanbotsdk_document_scanner_engine_mode_t | engine_mode, |
| scanbotsdk_processing_mode_t | processing_mode, | ||
| scanbotsdk_document_scanner_parameters_t * | parameters, | ||
| scanbotsdk_partially_visible_document_configuration_t * | partially_visible_document_configuration, | ||
| scanbotsdk_document_scanner_configuration_t ** | result ) |
Creates a new instance of scanbotsdk_document_scanner_configuration with given params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| engine_mode | The engine to use for document scanning. |
Default is ML
| processing_mode | In live mode, the document scanner will return only the best document contour. In single-shot mode it will return additional document contours, suitable for use in the cropping screen. |
Default is AUTO
| parameters | Initial parameters for the document scanner. The value must not be null. |
| partially_visible_document_configuration | Configuration for handling partially visible documents. The value must not be null. |
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_scanner_configuration_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_configuration_create_with_defaults | ( | scanbotsdk_document_scanner_configuration_t ** | result | ) |
Creates a new instance of scanbotsdk_document_scanner_configuration_t with given required params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_scanner_configuration_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_configuration_free | ( | scanbotsdk_document_scanner_configuration_t * | object | ) |
Frees the memory allocated for the instance of scanbotsdk_document_scanner_configuration_t. If null is passed, the function does nothing.
| object | Pointer to the instance of scanbotsdk_document_scanner_configuration_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_configuration_get_engine_mode | ( | scanbotsdk_document_scanner_configuration_t * | self, |
| scanbotsdk_document_scanner_engine_mode_t * | engine_mode ) |
Returns value of engine_mode field of the given object.
The engine to use for document scanning.
Default is ML
| self | Pointer to the instance of scanbotsdk_document_scanner_configuration_t |
| engine_mode | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_configuration_get_parameters | ( | scanbotsdk_document_scanner_configuration_t * | self, |
| scanbotsdk_document_scanner_parameters_t ** | parameters ) |
Returns value of parameters field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Initial parameters for the document scanner.
| self | Pointer to the instance of scanbotsdk_document_scanner_configuration_t |
| parameters | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_configuration_get_partially_visible_document_configuration | ( | scanbotsdk_document_scanner_configuration_t * | self, |
| scanbotsdk_partially_visible_document_configuration_t ** | partially_visible_document_configuration ) |
Returns value of partially_visible_document_configuration field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Configuration for handling partially visible documents.
| self | Pointer to the instance of scanbotsdk_document_scanner_configuration_t |
| partially_visible_document_configuration | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_configuration_get_processing_mode | ( | scanbotsdk_document_scanner_configuration_t * | self, |
| scanbotsdk_processing_mode_t * | processing_mode ) |
Returns value of processing_mode field of the given object.
In live mode, the document scanner will return only the best document contour. In single-shot mode it will return additional document contours, suitable for use in the cropping screen.
Default is AUTO
| self | Pointer to the instance of scanbotsdk_document_scanner_configuration_t |
| processing_mode | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_configuration_set_engine_mode | ( | scanbotsdk_document_scanner_configuration_t * | self, |
| scanbotsdk_document_scanner_engine_mode_t | engine_mode ) |
Sets value of engine_mode field of the given object.
The engine to use for document scanning.
Default is ML
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_configuration_t, the field of which will be set |
| engine_mode | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_configuration_set_parameters | ( | scanbotsdk_document_scanner_configuration_t * | self, |
| scanbotsdk_document_scanner_parameters_t * | parameters ) |
Sets value of parameters field of the given object.
Initial parameters for the document scanner.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_configuration_t, the field of which will be set |
| parameters | The value to be set. Must not be null. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_configuration_set_partially_visible_document_configuration | ( | scanbotsdk_document_scanner_configuration_t * | self, |
| scanbotsdk_partially_visible_document_configuration_t * | partially_visible_document_configuration ) |
Sets value of partially_visible_document_configuration field of the given object.
Configuration for handling partially visible documents.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_configuration_t, the field of which will be set |
| partially_visible_document_configuration | The value to be set. Must not be null. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_configuration_set_processing_mode | ( | scanbotsdk_document_scanner_configuration_t * | self, |
| scanbotsdk_processing_mode_t | processing_mode ) |
Sets value of processing_mode field of the given object.
In live mode, the document scanner will return only the best document contour. In single-shot mode it will return additional document contours, suitable for use in the cropping screen.
Default is AUTO
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_configuration_t, the field of which will be set |
| processing_mode | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_create | ( | scanbotsdk_document_scanner_configuration_t * | configuration, |
| scanbotsdk_document_scanner_t ** | result ) |
Creates a new instance of scanbotsdk_document_scanner with given params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| configuration | The configuration for the document detector. The value must not be null. |
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_scanner_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_engine_mode_t_to_string | ( | scanbotsdk_document_scanner_engine_mode_t | value, |
| const char ** | result ) |
Returns the string representation of the given scanbotsdk_document_scanner_engine_mode_t value.
The returned string doesn't need to be freed.
| value | The value to be converted to string. |
| result | Pointer to a variable that will store the string representation of the value. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_free | ( | scanbotsdk_document_scanner_t * | self | ) |
Frees the memory allocated for the instance of scanbotsdk_document_scanner_t. If null is passed, the function does nothing.
| self | Pointer to the instance of scanbotsdk_document_scanner_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_create | ( | int | accepted_angle_score, |
| int | accepted_size_score, | ||
| int | accepted_brightness_threshold, | ||
| int | accepted_aspect_ratio_score, | ||
| scanbotsdk_aspect_ratio_t ** | aspect_ratios, | ||
| size_t | aspect_ratios_size, | ||
| bool | ignore_orientation_mismatch, | ||
| scanbotsdk_document_scanner_parameters_t ** | result ) |
Creates a new instance of scanbotsdk_document_scanner_parameters with given params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| accepted_angle_score | The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. Set lower values to accept more perspective distortion. |
Warning: Lower values result in more blurred document images.
Default is 75
| accepted_size_score | The minimum size in percent (0 - 100) of the screen size to accept a detected document. It is sufficient that height or width match the score. |
Warning: Lower values result in low resolution document images.
Default is 80
| accepted_brightness_threshold | The minimum brightness value (0-255) to accept a detected document. |
Default is 0
| accepted_aspect_ratio_score | The minimum score in percent (0 - 100) that the aspect ratio of the document must match one of the required aspect ratios (if any) to accept a detected document. If acceptedAspectRatioScore is more than 0, then the document is only accepted if the aspect ratio matches one of the given aspect ratios (if any), otherwise OK_BUT_BAD_ASPECT_RATIO is returned. |
Default is 85
| aspect_ratios | The possible desired aspect ratios for the detected document. A document matches if its aspect ratio matches any of the given aspect ratios. If acceptedAspectRatioScore is more than 0, then the document is only accepted if the aspect ratio matches one of the given aspect ratios, otherwise OK_BUT_BAD_ASPECT_RATIO is returned. If empty, no aspect ratio is preferred. Entries of the array must not be null. |
| aspect_ratios_size | Size of the array aspect_ratios |
| ignore_orientation_mismatch | If false, the document scanner will return OK_BUT_ORIENTATION_MISMATCH if the detected document orientation does not match the input image orientation, e.g. if the document is detected as landscape but the input image is portrait. If true, the document scanner will ignore orientation mismatches. |
Default is false
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_scanner_parameters_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_create_with_defaults | ( | scanbotsdk_document_scanner_parameters_t ** | result | ) |
Creates a new instance of scanbotsdk_document_scanner_parameters_t with given required params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_scanner_parameters_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_free | ( | scanbotsdk_document_scanner_parameters_t * | object | ) |
Frees the memory allocated for the instance of scanbotsdk_document_scanner_parameters_t. If null is passed, the function does nothing.
| object | Pointer to the instance of scanbotsdk_document_scanner_parameters_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_get_accepted_angle_score | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| int * | accepted_angle_score ) |
Returns value of accepted_angle_score field of the given object.
The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. Set lower values to accept more perspective distortion.
Warning: Lower values result in more blurred document images.
Default is 75
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t |
| accepted_angle_score | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_get_accepted_aspect_ratio_score | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| int * | accepted_aspect_ratio_score ) |
Returns value of accepted_aspect_ratio_score field of the given object.
The minimum score in percent (0 - 100) that the aspect ratio of the document must match one of the required aspect ratios (if any) to accept a detected document. If acceptedAspectRatioScore is more than 0, then the document is only accepted if the aspect ratio matches one of the given aspect ratios (if any), otherwise OK_BUT_BAD_ASPECT_RATIO is returned.
Default is 85
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t |
| accepted_aspect_ratio_score | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_get_accepted_brightness_threshold | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| int * | accepted_brightness_threshold ) |
Returns value of accepted_brightness_threshold field of the given object.
The minimum brightness value (0-255) to accept a detected document.
Default is 0
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t |
| accepted_brightness_threshold | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_get_accepted_size_score | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| int * | accepted_size_score ) |
Returns value of accepted_size_score field of the given object.
The minimum size in percent (0 - 100) of the screen size to accept a detected document. It is sufficient that height or width match the score.
Warning: Lower values result in low resolution document images.
Default is 80
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t |
| accepted_size_score | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_get_aspect_ratios | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| scanbotsdk_aspect_ratio_t ** | aspect_ratios, | ||
| size_t | size ) |
Returns value of aspect_ratios field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
The possible desired aspect ratios for the detected document. A document matches if its aspect ratio matches any of the given aspect ratios. If acceptedAspectRatioScore is more than 0, then the document is only accepted if the aspect ratio matches one of the given aspect ratios, otherwise OK_BUT_BAD_ASPECT_RATIO is returned. If empty, no aspect ratio is preferred.
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t |
| size | Size of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function. |
| aspect_ratios | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_get_aspect_ratios_size | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| size_t * | size ) |
Returns size of aspect_ratios array.
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t |
| size | Pointer to a variable that will store the size. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_get_ignore_orientation_mismatch | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| bool * | ignore_orientation_mismatch ) |
Returns value of ignore_orientation_mismatch field of the given object.
If false, the document scanner will return OK_BUT_ORIENTATION_MISMATCH if the detected document orientation does not match the input image orientation, e.g. if the document is detected as landscape but the input image is portrait. If true, the document scanner will ignore orientation mismatches.
Default is false
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t |
| ignore_orientation_mismatch | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_set_accepted_angle_score | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| int | accepted_angle_score ) |
Sets value of accepted_angle_score field of the given object.
The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. Set lower values to accept more perspective distortion.
Warning: Lower values result in more blurred document images.
Default is 75
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set |
| accepted_angle_score | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_set_accepted_aspect_ratio_score | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| int | accepted_aspect_ratio_score ) |
Sets value of accepted_aspect_ratio_score field of the given object.
The minimum score in percent (0 - 100) that the aspect ratio of the document must match one of the required aspect ratios (if any) to accept a detected document. If acceptedAspectRatioScore is more than 0, then the document is only accepted if the aspect ratio matches one of the given aspect ratios (if any), otherwise OK_BUT_BAD_ASPECT_RATIO is returned.
Default is 85
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set |
| accepted_aspect_ratio_score | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_set_accepted_brightness_threshold | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| int | accepted_brightness_threshold ) |
Sets value of accepted_brightness_threshold field of the given object.
The minimum brightness value (0-255) to accept a detected document.
Default is 0
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set |
| accepted_brightness_threshold | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_set_accepted_size_score | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| int | accepted_size_score ) |
Sets value of accepted_size_score field of the given object.
The minimum size in percent (0 - 100) of the screen size to accept a detected document. It is sufficient that height or width match the score.
Warning: Lower values result in low resolution document images.
Default is 80
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set |
| accepted_size_score | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_set_aspect_ratios | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| scanbotsdk_aspect_ratio_t ** | aspect_ratios, | ||
| size_t | aspect_ratios_size ) |
Sets value of aspect_ratios field of the given object.
The possible desired aspect ratios for the detected document. A document matches if its aspect ratio matches any of the given aspect ratios. If acceptedAspectRatioScore is more than 0, then the document is only accepted if the aspect ratio matches one of the given aspect ratios, otherwise OK_BUT_BAD_ASPECT_RATIO is returned. If empty, no aspect ratio is preferred.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set |
| aspect_ratios | The value to be set. |
| aspect_ratios_size | Size of the array. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_parameters_set_ignore_orientation_mismatch | ( | scanbotsdk_document_scanner_parameters_t * | self, |
| bool | ignore_orientation_mismatch ) |
Sets value of ignore_orientation_mismatch field of the given object.
If false, the document scanner will return OK_BUT_ORIENTATION_MISMATCH if the detected document orientation does not match the input image orientation, e.g. if the document is detected as landscape but the input image is portrait. If true, the document scanner will ignore orientation mismatches.
Default is false
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set |
| ignore_orientation_mismatch | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_run | ( | scanbotsdk_document_scanner_t * | self, |
| scanbotsdk_image_t * | image, | ||
| scanbotsdk_document_detection_result_t ** | result ) |
Detect the document contour in the given image.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_t method to be called on |
| image | The image to detect the document contour in. The value must not be null. |
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_scanner_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanner_scan | ( | scanbotsdk_document_scanner_t * | self, |
| scanbotsdk_image_t * | image, | ||
| scanbotsdk_document_scanning_result_t ** | result ) |
Detect the document contour in the given image and crop it.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_document_scanner_t method to be called on |
| image | The image to detect the document contour in. The value must not be null. |
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_scanner_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanning_result_free | ( | scanbotsdk_document_scanning_result_t * | object | ) |
Frees the memory allocated for the instance of scanbotsdk_document_scanning_result_t. If null is passed, the function does nothing.
| object | Pointer to the instance of scanbotsdk_document_scanning_result_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanning_result_get_cropped_image | ( | scanbotsdk_document_scanning_result_t * | self, |
| scanbotsdk_image_t ** | cropped_image ) |
Returns value of cropped_image field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Cropped document image.
| self | Pointer to the instance of scanbotsdk_document_scanning_result_t |
| cropped_image | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_scanning_result_get_detection_result | ( | scanbotsdk_document_scanning_result_t * | self, |
| scanbotsdk_document_detection_result_t ** | detection_result ) |
Returns value of detection_result field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
Result of the document contour detection.
| self | Pointer to the instance of scanbotsdk_document_scanning_result_t |
| detection_result | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_partially_visible_document_configuration_create | ( | bool | allow_partially_visible_documents, |
| int | accumulation_duration, | ||
| int | retention_time, | ||
| int | minimum_brightness, | ||
| scanbotsdk_partially_visible_document_configuration_t ** | result ) |
Creates a new instance of scanbotsdk_partially_visible_document_configuration with given params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| allow_partially_visible_documents | If true, the document scanner will return a status of ERROR_PARTIALLY_VISIBLE or ERROR_PARTIALLY_VISIBLE_TOO_CLOSE if a document-like shape is detected, but not all four corners of the document are visible. If false, a status of ERROR_NOTHING_DETECTED will be returned instead. |
Default is false
| accumulation_duration | Duration in milliseconds over which the document has to be detected as partially visible. If on any frame the document is not detected as partially visible, or detected as having a completely different Displacement, the accumulation will be reset. During the accumulation, the document scanner will return a status of ERROR_NOTHING_DETECTED instead of one of the partially visible statuses. Set to 0 to disable this behavior. |
Default is 700
| retention_time | Time in milliseconds during which the detection status ERROR_NOTHING_DETECTED is changed to ERROR_PARTIALLY_VISIBLE_TOO_CLOSE if no document was detected following the detection of a partially visible document. Set to 0 to disable this behavior. |
Default is 1500
| minimum_brightness | Minimum brightness of a partially visible potential document. Increasing this value can reduce the number of spurious detections. |
Default is 0
| result | Pointer to a variable that will store the created instance of scanbotsdk_partially_visible_document_configuration_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_partially_visible_document_configuration_create_with_defaults | ( | scanbotsdk_partially_visible_document_configuration_t ** | result | ) |
Creates a new instance of scanbotsdk_partially_visible_document_configuration_t with given required params and stores it in the location specified by the last argument.
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| result | Pointer to a variable that will store the created instance of scanbotsdk_partially_visible_document_configuration_t |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_partially_visible_document_configuration_free | ( | scanbotsdk_partially_visible_document_configuration_t * | object | ) |
Frees the memory allocated for the instance of scanbotsdk_partially_visible_document_configuration_t. If null is passed, the function does nothing.
| object | Pointer to the instance of scanbotsdk_partially_visible_document_configuration_t to be freed |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_partially_visible_document_configuration_get_accumulation_duration | ( | scanbotsdk_partially_visible_document_configuration_t * | self, |
| int * | accumulation_duration ) |
Returns value of accumulation_duration field of the given object.
Duration in milliseconds over which the document has to be detected as partially visible. If on any frame the document is not detected as partially visible, or detected as having a completely different Displacement, the accumulation will be reset. During the accumulation, the document scanner will return a status of ERROR_NOTHING_DETECTED instead of one of the partially visible statuses. Set to 0 to disable this behavior.
Default is 700
| self | Pointer to the instance of scanbotsdk_partially_visible_document_configuration_t |
| accumulation_duration | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_partially_visible_document_configuration_get_allow_partially_visible_documents | ( | scanbotsdk_partially_visible_document_configuration_t * | self, |
| bool * | allow_partially_visible_documents ) |
Returns value of allow_partially_visible_documents field of the given object.
If true, the document scanner will return a status of ERROR_PARTIALLY_VISIBLE or ERROR_PARTIALLY_VISIBLE_TOO_CLOSE if a document-like shape is detected, but not all four corners of the document are visible. If false, a status of ERROR_NOTHING_DETECTED will be returned instead.
Default is false
| self | Pointer to the instance of scanbotsdk_partially_visible_document_configuration_t |
| allow_partially_visible_documents | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_partially_visible_document_configuration_get_minimum_brightness | ( | scanbotsdk_partially_visible_document_configuration_t * | self, |
| int * | minimum_brightness ) |
Returns value of minimum_brightness field of the given object.
Minimum brightness of a partially visible potential document. Increasing this value can reduce the number of spurious detections.
Default is 0
| self | Pointer to the instance of scanbotsdk_partially_visible_document_configuration_t |
| minimum_brightness | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_partially_visible_document_configuration_get_retention_time | ( | scanbotsdk_partially_visible_document_configuration_t * | self, |
| int * | retention_time ) |
Returns value of retention_time field of the given object.
Time in milliseconds during which the detection status ERROR_NOTHING_DETECTED is changed to ERROR_PARTIALLY_VISIBLE_TOO_CLOSE if no document was detected following the detection of a partially visible document. Set to 0 to disable this behavior.
Default is 1500
| self | Pointer to the instance of scanbotsdk_partially_visible_document_configuration_t |
| retention_time | Pointer to a variable that will store the value of the field. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_partially_visible_document_configuration_set_accumulation_duration | ( | scanbotsdk_partially_visible_document_configuration_t * | self, |
| int | accumulation_duration ) |
Sets value of accumulation_duration field of the given object.
Duration in milliseconds over which the document has to be detected as partially visible. If on any frame the document is not detected as partially visible, or detected as having a completely different Displacement, the accumulation will be reset. During the accumulation, the document scanner will return a status of ERROR_NOTHING_DETECTED instead of one of the partially visible statuses. Set to 0 to disable this behavior.
Default is 700
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_partially_visible_document_configuration_t, the field of which will be set |
| accumulation_duration | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_partially_visible_document_configuration_set_allow_partially_visible_documents | ( | scanbotsdk_partially_visible_document_configuration_t * | self, |
| bool | allow_partially_visible_documents ) |
Sets value of allow_partially_visible_documents field of the given object.
If true, the document scanner will return a status of ERROR_PARTIALLY_VISIBLE or ERROR_PARTIALLY_VISIBLE_TOO_CLOSE if a document-like shape is detected, but not all four corners of the document are visible. If false, a status of ERROR_NOTHING_DETECTED will be returned instead.
Default is false
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_partially_visible_document_configuration_t, the field of which will be set |
| allow_partially_visible_documents | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_partially_visible_document_configuration_set_minimum_brightness | ( | scanbotsdk_partially_visible_document_configuration_t * | self, |
| int | minimum_brightness ) |
Sets value of minimum_brightness field of the given object.
Minimum brightness of a partially visible potential document. Increasing this value can reduce the number of spurious detections.
Default is 0
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_partially_visible_document_configuration_t, the field of which will be set |
| minimum_brightness | The value to be set. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_partially_visible_document_configuration_set_retention_time | ( | scanbotsdk_partially_visible_document_configuration_t * | self, |
| int | retention_time ) |
Sets value of retention_time field of the given object.
Time in milliseconds during which the detection status ERROR_NOTHING_DETECTED is changed to ERROR_PARTIALLY_VISIBLE_TOO_CLOSE if no document was detected following the detection of a partially visible document. Set to 0 to disable this behavior.
Default is 1500
As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.
| self | Pointer to the instance of scanbotsdk_partially_visible_document_configuration_t, the field of which will be set |
| retention_time | The value to be set. |