Scanbot SDK
Loading...
Searching...
No Matches
Scanbot C SDK Document scanner

Typedefs

typedef struct scanbotsdk_document_scanner_t scanbotsdk_document_scanner_t
 scanbotsdk_document_scanner_t class
 
typedef enum scanbotsdk_document_scanner_engine_mode_t scanbotsdk_document_scanner_engine_mode_t
 scanbotsdk_document_scanner_engine_mode_t enum
 
typedef struct scanbotsdk_document_scanner_parameters_t scanbotsdk_document_scanner_parameters_t
 scanbotsdk_document_scanner_parameters_t class
 
typedef struct scanbotsdk_partially_visible_document_configuration_t scanbotsdk_partially_visible_document_configuration_t
 scanbotsdk_partially_visible_document_configuration_t class
 
typedef struct scanbotsdk_document_scanner_configuration_t scanbotsdk_document_scanner_configuration_t
 scanbotsdk_document_scanner_configuration_t class
 
typedef enum scanbotsdk_document_displacement_t scanbotsdk_document_displacement_t
 scanbotsdk_document_displacement_t enum
 
typedef enum scanbotsdk_document_detection_status_t scanbotsdk_document_detection_status_t
 scanbotsdk_document_detection_status_t enum
 
typedef struct scanbotsdk_document_detection_scores_t scanbotsdk_document_detection_scores_t
 scanbotsdk_document_detection_scores_t class
 
typedef struct scanbotsdk_document_detection_result_t scanbotsdk_document_detection_result_t
 scanbotsdk_document_detection_result_t class
 
typedef struct scanbotsdk_document_scanning_result_t scanbotsdk_document_scanning_result_t
 scanbotsdk_document_scanning_result_t class
 

Enumerations

enum  scanbotsdk_document_scanner_engine_mode_t {
  SCANBOTSDK_DOCUMENT_SCANNER_ENGINE_MODE_ML = 0 ,
  SCANBOTSDK_DOCUMENT_SCANNER_ENGINE_MODE_LEGACY = 1
}
 scanbotsdk_document_scanner_engine_mode_t enum More...
 
enum  scanbotsdk_document_displacement_t {
  SCANBOTSDK_DOCUMENT_DISPLACEMENT_NONE = 0 ,
  SCANBOTSDK_DOCUMENT_DISPLACEMENT_UP = 1 ,
  SCANBOTSDK_DOCUMENT_DISPLACEMENT_UPPER_RIGHT = 2 ,
  SCANBOTSDK_DOCUMENT_DISPLACEMENT_RIGHT = 3 ,
  SCANBOTSDK_DOCUMENT_DISPLACEMENT_LOWER_RIGHT = 4 ,
  SCANBOTSDK_DOCUMENT_DISPLACEMENT_DOWN = 5 ,
  SCANBOTSDK_DOCUMENT_DISPLACEMENT_LOWER_LEFT = 6 ,
  SCANBOTSDK_DOCUMENT_DISPLACEMENT_LEFT = 7 ,
  SCANBOTSDK_DOCUMENT_DISPLACEMENT_UPPER_LEFT = 8
}
 scanbotsdk_document_displacement_t enum More...
 
enum  scanbotsdk_document_detection_status_t {
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_NOT_ACQUIRED = 0 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK = 1 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_TOO_SMALL = 2 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_BAD_ANGLES = 3 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_BAD_ASPECT_RATIO = 4 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_ORIENTATION_MISMATCH = 5 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_OFF_CENTER = 6 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_TOO_DARK = 7 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_ERROR_NOTHING_DETECTED = 8 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_ERROR_PARTIALLY_VISIBLE = 9 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_ERROR_PARTIALLY_VISIBLE_TOO_CLOSE = 10 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_ERROR_TOO_DARK = 11 ,
  SCANBOTSDK_DOCUMENT_DETECTION_STATUS_ERROR_TOO_NOISY = 12
}
 scanbotsdk_document_detection_status_t enum More...
 

Functions

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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 

Detailed Description

Typedef Documentation

◆ scanbotsdk_document_detection_result_t

◆ scanbotsdk_document_detection_scores_t

scanbotsdk_document_detection_scores_t class

The total and partial scores for the detected document contour.

◆ scanbotsdk_document_detection_status_t

◆ scanbotsdk_document_displacement_t

scanbotsdk_document_displacement_t enum

The displacement of the document from the image center if the document is partially visible.

◆ scanbotsdk_document_scanner_configuration_t

◆ scanbotsdk_document_scanner_engine_mode_t

◆ scanbotsdk_document_scanner_parameters_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

scanbotsdk_document_scanning_result_t class

Result of the document detection followed by cropping of the found document.

◆ scanbotsdk_partially_visible_document_configuration_t

Enumeration Type Documentation

◆ scanbotsdk_document_detection_status_t

scanbotsdk_document_detection_status_t enum

Status of the document detection.

Enumerator
SCANBOTSDK_DOCUMENT_DETECTION_STATUS_NOT_ACQUIRED 

Detection has not yet happened.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK 

An acceptable document was detected.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_TOO_SMALL 

A document was detected, but it is too small.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_BAD_ANGLES 

A document was detected, but it has too much perspective distortion.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_BAD_ASPECT_RATIO 

A document was detected, but its aspect ratio is not acceptable.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_ORIENTATION_MISMATCH 

A document was detected, but its orientation does not match the input image orientation.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_OFF_CENTER 

A document was detected, but its center is too far away from the input image center.

Deprecation Warning: This status is never returned by the document scanner.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_OK_BUT_TOO_DARK 

A document was detected, but it is too dark.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_ERROR_NOTHING_DETECTED 

No document was detected.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_ERROR_PARTIALLY_VISIBLE 

A document was detected, but not all of its corners are visible.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_ERROR_PARTIALLY_VISIBLE_TOO_CLOSE 

A document was detected, but not all of its corners are visible and the document is too close to the camera.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_ERROR_TOO_DARK 

No document was detected, likely because the input image is too dark.

SCANBOTSDK_DOCUMENT_DETECTION_STATUS_ERROR_TOO_NOISY 

No document was detected, likely because the input image is too noisy or has a complex background.

Deprecation Warning: This status is never returned by the document scanner.

◆ scanbotsdk_document_displacement_t

scanbotsdk_document_displacement_t enum

The displacement of the document from the image center if the document is partially visible.

Enumerator
SCANBOTSDK_DOCUMENT_DISPLACEMENT_NONE 

The document is fully visible.

SCANBOTSDK_DOCUMENT_DISPLACEMENT_UP 

The document is partially visible and occupies the upper part of the image.

SCANBOTSDK_DOCUMENT_DISPLACEMENT_UPPER_RIGHT 

The document is partially visible and occupies the upper right part of the image.

SCANBOTSDK_DOCUMENT_DISPLACEMENT_RIGHT 

The document is partially visible and occupies the right part of the image.

SCANBOTSDK_DOCUMENT_DISPLACEMENT_LOWER_RIGHT 

The document is partially visible and occupies the lower right part of the image.

SCANBOTSDK_DOCUMENT_DISPLACEMENT_DOWN 

The document is partially visible and occupies the lower part of the image.

SCANBOTSDK_DOCUMENT_DISPLACEMENT_LOWER_LEFT 

The document is partially visible and occupies the lower left part of the image.

SCANBOTSDK_DOCUMENT_DISPLACEMENT_LEFT 

The document is partially visible and occupies the left part of the image.

SCANBOTSDK_DOCUMENT_DISPLACEMENT_UPPER_LEFT 

The document is partially visible and occupies the upper left part of the image.

◆ scanbotsdk_document_scanner_engine_mode_t

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.

Function Documentation

◆ scanbotsdk_document_detection_result_free()

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.

Parameters
objectPointer to the instance of scanbotsdk_document_detection_result_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_detection_result_get_aspect_ratio()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
aspect_ratioPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_average_brightness()

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:

  • the whole image, if no document was detected
  • the document crop, if a document was detected Ranges from 0 to 255.

Default is 0

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
average_brightnessPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_detection_scores()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
detection_scoresPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_displacement()

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

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
displacementPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_displacement_vector()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
displacement_vectorPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_horizontal_lines()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
sizeSize of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function.
horizontal_linesPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_horizontal_lines_normalized()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
sizeSize of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function.
horizontal_lines_normalizedPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_horizontal_lines_normalized_size()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
sizePointer to a variable that will store the size.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_horizontal_lines_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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
sizePointer to a variable that will store the size.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_points()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
pointsPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_points_normalized()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
points_normalizedPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_points_normalized_size()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
sizePointer to a variable that will store the size.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_points_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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
sizePointer to a variable that will store the size.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_status()

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

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
statusPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_vertical_lines()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
sizeSize of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function.
vertical_linesPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_vertical_lines_normalized()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
sizeSize of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function.
vertical_lines_normalizedPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_vertical_lines_normalized_size()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
sizePointer to a variable that will store the size.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_result_get_vertical_lines_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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_result_t
sizePointer to a variable that will store the size.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_scores_create()

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.

Parameters
total_scoreWeighted sum of all partial scores.
distance_score100 points, if the center of the contour is exactly in the image center.
angle_score100 points, if all angles are 90 degrees.
size_score100 points, if the contour occupies at least 50% of the area of the image.
aspect_ratio_score100 points, if the aspect ratio matches exactly one of the given aspect ratios.
line_coverage_scorePercentage of the document contour that the edge detector was able to find (in LEGACY engine mode only).
width_scorePercentage of the image width taken by the detected document.
height_scorePercentage of the image height taken by the detected document.
resultPointer to a variable that will store the created instance of scanbotsdk_document_detection_scores_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_detection_scores_free()

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.

Parameters
objectPointer to the instance of scanbotsdk_document_detection_scores_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_detection_scores_get_angle_score()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_scores_t
angle_scorePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_scores_get_aspect_ratio_score()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_scores_t
aspect_ratio_scorePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_scores_get_distance_score()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_scores_t
distance_scorePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_scores_get_height_score()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_scores_t
height_scorePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_scores_get_line_coverage_score()

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).

Parameters
selfPointer to the instance of scanbotsdk_document_detection_scores_t
line_coverage_scorePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_scores_get_size_score()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_scores_t
size_scorePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_scores_get_total_score()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_scores_t
total_scorePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_scores_get_width_score()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_detection_scores_t
width_scorePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_detection_status_t_to_string()

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.

Parameters
valueThe value to be converted to string.
resultPointer to a variable that will store the string representation of the value.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_displacement_t_to_string()

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.

Parameters
valueThe value to be converted to string.
resultPointer to a variable that will store the string representation of the value.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_clear_result()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_t method to be called on
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_configuration_create()

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.

Parameters
engine_modeThe engine to use for document scanning.

Default is ML

Parameters
processing_modeIn 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
parametersInitial parameters for the document scanner. The value must not be null.
partially_visible_document_configurationConfiguration for handling partially visible documents. The value must not be null.
resultPointer to a variable that will store the created instance of scanbotsdk_document_scanner_configuration_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_configuration_create_with_defaults()

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.

Parameters
resultPointer to a variable that will store the created instance of scanbotsdk_document_scanner_configuration_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_configuration_free()

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.

Parameters
objectPointer to the instance of scanbotsdk_document_scanner_configuration_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_configuration_get_engine_mode()

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

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_configuration_t
engine_modePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_configuration_get_parameters()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_configuration_t
parametersPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_configuration_get_partially_visible_document_configuration()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_configuration_t
partially_visible_document_configurationPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_configuration_get_processing_mode()

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

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_configuration_t
processing_modePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_configuration_set_engine_mode()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_configuration_t, the field of which will be set
engine_modeThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_configuration_set_parameters()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_configuration_t, the field of which will be set
parametersThe value to be set. Must not be null.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_configuration_set_partially_visible_document_configuration()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_configuration_t, the field of which will be set
partially_visible_document_configurationThe value to be set. Must not be null.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_configuration_set_processing_mode()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_configuration_t, the field of which will be set
processing_modeThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_create()

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.

Parameters
configurationThe configuration for the document detector. The value must not be null.
resultPointer to a variable that will store the created instance of scanbotsdk_document_scanner_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_engine_mode_t_to_string()

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.

Parameters
valueThe value to be converted to string.
resultPointer to a variable that will store the string representation of the value.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_free()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_parameters_create()

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.

Parameters
accepted_angle_scoreThe 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

Parameters
accepted_size_scoreThe 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

Parameters
accepted_brightness_thresholdThe minimum brightness value (0-255) to accept a detected document.

Default is 0

Parameters
accepted_aspect_ratio_scoreThe 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

Parameters
aspect_ratiosThe 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_sizeSize of the array aspect_ratios
ignore_orientation_mismatchIf 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

Parameters
resultPointer to a variable that will store the created instance of scanbotsdk_document_scanner_parameters_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_parameters_create_with_defaults()

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.

Parameters
resultPointer to a variable that will store the created instance of scanbotsdk_document_scanner_parameters_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_parameters_free()

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.

Parameters
objectPointer to the instance of scanbotsdk_document_scanner_parameters_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_parameters_get_accepted_angle_score()

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

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t
accepted_angle_scorePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_parameters_get_accepted_aspect_ratio_score()

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

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t
accepted_aspect_ratio_scorePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_parameters_get_accepted_brightness_threshold()

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

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t
accepted_brightness_thresholdPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_parameters_get_accepted_size_score()

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

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t
accepted_size_scorePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_parameters_get_aspect_ratios()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t
sizeSize of the pre-allocated array. Must be equal to the size obtained by calling the corresponding _size function.
aspect_ratiosPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_parameters_get_aspect_ratios_size()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t
sizePointer to a variable that will store the size.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_parameters_get_ignore_orientation_mismatch()

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

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t
ignore_orientation_mismatchPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanner_parameters_set_accepted_angle_score()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set
accepted_angle_scoreThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_parameters_set_accepted_aspect_ratio_score()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set
accepted_aspect_ratio_scoreThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_parameters_set_accepted_brightness_threshold()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set
accepted_brightness_thresholdThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_parameters_set_accepted_size_score()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set
accepted_size_scoreThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_parameters_set_aspect_ratios()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set
aspect_ratiosThe value to be set.
aspect_ratios_sizeSize of the array.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_parameters_set_ignore_orientation_mismatch()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_parameters_t, the field of which will be set
ignore_orientation_mismatchThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_run()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_t method to be called on
imageThe image to detect the document contour in. The value must not be null.
resultPointer to a variable that will store the created instance of scanbotsdk_document_scanner_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanner_scan()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanner_t method to be called on
imageThe image to detect the document contour in. The value must not be null.
resultPointer to a variable that will store the created instance of scanbotsdk_document_scanner_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanning_result_free()

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.

Parameters
objectPointer to the instance of scanbotsdk_document_scanning_result_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_scanning_result_get_cropped_image()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanning_result_t
cropped_imagePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_scanning_result_get_detection_result()

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.

Parameters
selfPointer to the instance of scanbotsdk_document_scanning_result_t
detection_resultPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_partially_visible_document_configuration_create()

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.

Parameters
allow_partially_visible_documentsIf 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

Parameters
accumulation_durationDuration 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

Parameters
retention_timeTime 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

Parameters
minimum_brightnessMinimum brightness of a partially visible potential document. Increasing this value can reduce the number of spurious detections.

Default is 0

Parameters
resultPointer to a variable that will store the created instance of scanbotsdk_partially_visible_document_configuration_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_partially_visible_document_configuration_create_with_defaults()

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.

Parameters
resultPointer to a variable that will store the created instance of scanbotsdk_partially_visible_document_configuration_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_partially_visible_document_configuration_free()

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.

Parameters
objectPointer to the instance of scanbotsdk_partially_visible_document_configuration_t to be freed
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_partially_visible_document_configuration_get_accumulation_duration()

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

Parameters
selfPointer to the instance of scanbotsdk_partially_visible_document_configuration_t
accumulation_durationPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_partially_visible_document_configuration_get_allow_partially_visible_documents()

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

Parameters
selfPointer to the instance of scanbotsdk_partially_visible_document_configuration_t
allow_partially_visible_documentsPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_partially_visible_document_configuration_get_minimum_brightness()

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

Parameters
selfPointer to the instance of scanbotsdk_partially_visible_document_configuration_t
minimum_brightnessPointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_partially_visible_document_configuration_get_retention_time()

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

Parameters
selfPointer to the instance of scanbotsdk_partially_visible_document_configuration_t
retention_timePointer to a variable that will store the value of the field.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_partially_visible_document_configuration_set_accumulation_duration()

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.

Parameters
selfPointer to the instance of scanbotsdk_partially_visible_document_configuration_t, the field of which will be set
accumulation_durationThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_partially_visible_document_configuration_set_allow_partially_visible_documents()

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.

Parameters
selfPointer to the instance of scanbotsdk_partially_visible_document_configuration_t, the field of which will be set
allow_partially_visible_documentsThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_partially_visible_document_configuration_set_minimum_brightness()

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.

Parameters
selfPointer to the instance of scanbotsdk_partially_visible_document_configuration_t, the field of which will be set
minimum_brightnessThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_partially_visible_document_configuration_set_retention_time()

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.

Parameters
selfPointer to the instance of scanbotsdk_partially_visible_document_configuration_t, the field of which will be set
retention_timeThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered