Scanbot SDK
Loading...
Searching...
No Matches
Scanbot C SDK Document quality analyzer

Typedefs

typedef struct scanbotsdk_document_quality_analyzer_t scanbotsdk_document_quality_analyzer_t
 scanbotsdk_document_quality_analyzer_t class
 
typedef enum scanbotsdk_document_quality_t scanbotsdk_document_quality_t
 scanbotsdk_document_quality_t enum
 
typedef struct scanbotsdk_document_quality_threshold_t scanbotsdk_document_quality_threshold_t
 scanbotsdk_document_quality_threshold_t class
 
typedef struct scanbotsdk_document_quality_analyzer_configuration_t scanbotsdk_document_quality_analyzer_configuration_t
 scanbotsdk_document_quality_analyzer_configuration_t class
 
typedef struct scanbotsdk_document_quality_analyzer_result_t scanbotsdk_document_quality_analyzer_result_t
 scanbotsdk_document_quality_analyzer_result_t class
 

Enumerations

enum  scanbotsdk_document_quality_t {
  SCANBOTSDK_DOCUMENT_QUALITY_VERY_POOR = 0 ,
  SCANBOTSDK_DOCUMENT_QUALITY_POOR = 1 ,
  SCANBOTSDK_DOCUMENT_QUALITY_REASONABLE = 2 ,
  SCANBOTSDK_DOCUMENT_QUALITY_GOOD = 3 ,
  SCANBOTSDK_DOCUMENT_QUALITY_EXCELLENT = 4
}
 scanbotsdk_document_quality_t enum More...
 

Functions

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_create (scanbotsdk_document_quality_analyzer_configuration_t *configuration, scanbotsdk_document_quality_analyzer_t **result)
 Creates a new instance of scanbotsdk_document_quality_analyzer with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_free (scanbotsdk_document_quality_analyzer_t *self)
 Frees the memory allocated for the instance of scanbotsdk_document_quality_analyzer_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_run (scanbotsdk_document_quality_analyzer_t *self, scanbotsdk_image_t *image, scanbotsdk_document_quality_analyzer_result_t **result)
 analyze document quality of the given image.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_t_to_string (scanbotsdk_document_quality_t value, const char **result)
 Returns the string representation of the given scanbotsdk_document_quality_t value.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_threshold_create (double symbol_quality, double symbol_ratio, scanbotsdk_document_quality_threshold_t **result)
 Creates a new instance of scanbotsdk_document_quality_threshold with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_threshold_free (scanbotsdk_document_quality_threshold_t *object)
 Frees the memory allocated for the instance of scanbotsdk_document_quality_threshold_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_threshold_get_symbol_quality (scanbotsdk_document_quality_threshold_t *self, double *symbol_quality)
 Returns value of symbol_quality field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_threshold_get_symbol_ratio (scanbotsdk_document_quality_threshold_t *self, double *symbol_ratio)
 Returns value of symbol_ratio field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_create (scanbotsdk_document_quality_threshold_t **quality_thresholds, size_t quality_thresholds_size, scanbotsdk_document_quality_t *quality_indices, size_t quality_indices_size, bool detect_orientation, bool inspect_small_text, int max_image_size, int min_estimated_number_of_symbols_for_document, double min_processed_fraction, double max_processed_fraction, int min_number_of_required_symbols, double min_required_orientation_confidence, int tile_size, bool return_quality_heatmap, scanbotsdk_document_quality_analyzer_configuration_t **result)
 Creates a new instance of scanbotsdk_document_quality_analyzer_configuration with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_create_with_defaults (scanbotsdk_document_quality_analyzer_configuration_t **result)
 Creates a new instance of scanbotsdk_document_quality_analyzer_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_quality_analyzer_configuration_free (scanbotsdk_document_quality_analyzer_configuration_t *object)
 Frees the memory allocated for the instance of scanbotsdk_document_quality_analyzer_configuration_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_quality_thresholds (scanbotsdk_document_quality_analyzer_configuration_t *self, scanbotsdk_document_quality_threshold_t **quality_thresholds, size_t size)
 Returns value of quality_thresholds 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_quality_analyzer_configuration_get_quality_thresholds_size (scanbotsdk_document_quality_analyzer_configuration_t *self, size_t *size)
 Returns size of quality_thresholds array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_quality_thresholds (scanbotsdk_document_quality_analyzer_configuration_t *self, scanbotsdk_document_quality_threshold_t **quality_thresholds, size_t quality_thresholds_size)
 Sets value of quality_thresholds field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_quality_indices (scanbotsdk_document_quality_analyzer_configuration_t *self, scanbotsdk_document_quality_t **quality_indices)
 Returns value of quality_indices 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_quality_analyzer_configuration_get_quality_indices_size (scanbotsdk_document_quality_analyzer_configuration_t *self, size_t *size)
 Returns size of quality_indices array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_quality_indices (scanbotsdk_document_quality_analyzer_configuration_t *self, scanbotsdk_document_quality_t *quality_indices, size_t quality_indices_size)
 Sets value of quality_indices field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_detect_orientation (scanbotsdk_document_quality_analyzer_configuration_t *self, bool *detect_orientation)
 Returns value of detect_orientation field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_detect_orientation (scanbotsdk_document_quality_analyzer_configuration_t *self, bool detect_orientation)
 Sets value of detect_orientation field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_inspect_small_text (scanbotsdk_document_quality_analyzer_configuration_t *self, bool *inspect_small_text)
 Returns value of inspect_small_text field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_inspect_small_text (scanbotsdk_document_quality_analyzer_configuration_t *self, bool inspect_small_text)
 Sets value of inspect_small_text field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_max_image_size (scanbotsdk_document_quality_analyzer_configuration_t *self, int *max_image_size)
 Returns value of max_image_size field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_max_image_size (scanbotsdk_document_quality_analyzer_configuration_t *self, int max_image_size)
 Sets value of max_image_size field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_min_estimated_number_of_symbols_for_document (scanbotsdk_document_quality_analyzer_configuration_t *self, int *min_estimated_number_of_symbols_for_document)
 Returns value of min_estimated_number_of_symbols_for_document field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_min_estimated_number_of_symbols_for_document (scanbotsdk_document_quality_analyzer_configuration_t *self, int min_estimated_number_of_symbols_for_document)
 Sets value of min_estimated_number_of_symbols_for_document field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_min_processed_fraction (scanbotsdk_document_quality_analyzer_configuration_t *self, double *min_processed_fraction)
 Returns value of min_processed_fraction field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_min_processed_fraction (scanbotsdk_document_quality_analyzer_configuration_t *self, double min_processed_fraction)
 Sets value of min_processed_fraction field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_max_processed_fraction (scanbotsdk_document_quality_analyzer_configuration_t *self, double *max_processed_fraction)
 Returns value of max_processed_fraction field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_max_processed_fraction (scanbotsdk_document_quality_analyzer_configuration_t *self, double max_processed_fraction)
 Sets value of max_processed_fraction field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_min_number_of_required_symbols (scanbotsdk_document_quality_analyzer_configuration_t *self, int *min_number_of_required_symbols)
 Returns value of min_number_of_required_symbols field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_min_number_of_required_symbols (scanbotsdk_document_quality_analyzer_configuration_t *self, int min_number_of_required_symbols)
 Sets value of min_number_of_required_symbols field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_min_required_orientation_confidence (scanbotsdk_document_quality_analyzer_configuration_t *self, double *min_required_orientation_confidence)
 Returns value of min_required_orientation_confidence field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_min_required_orientation_confidence (scanbotsdk_document_quality_analyzer_configuration_t *self, double min_required_orientation_confidence)
 Sets value of min_required_orientation_confidence field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_tile_size (scanbotsdk_document_quality_analyzer_configuration_t *self, int *tile_size)
 Returns value of tile_size field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_tile_size (scanbotsdk_document_quality_analyzer_configuration_t *self, int tile_size)
 Sets value of tile_size field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_return_quality_heatmap (scanbotsdk_document_quality_analyzer_configuration_t *self, bool *return_quality_heatmap)
 Returns value of return_quality_heatmap field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_return_quality_heatmap (scanbotsdk_document_quality_analyzer_configuration_t *self, bool return_quality_heatmap)
 Sets value of return_quality_heatmap field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_free (scanbotsdk_document_quality_analyzer_result_t *object)
 Frees the memory allocated for the instance of scanbotsdk_document_quality_analyzer_result_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_document_found (scanbotsdk_document_quality_analyzer_result_t *self, bool *document_found)
 Returns value of document_found field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_quality (scanbotsdk_document_quality_analyzer_result_t *self, scanbotsdk_document_quality_t **quality)
 Returns value of quality 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_quality_analyzer_result_get_orientation (scanbotsdk_document_quality_analyzer_result_t *self, double **orientation)
 Returns value of orientation 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_quality_analyzer_result_get_orientation_confidence (scanbotsdk_document_quality_analyzer_result_t *self, double **orientation_confidence)
 Returns value of orientation_confidence 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_quality_analyzer_result_get_cumulative_quality_histogram (scanbotsdk_document_quality_analyzer_result_t *self, int **cumulative_quality_histogram)
 Returns value of cumulative_quality_histogram 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_quality_analyzer_result_get_cumulative_quality_histogram_size (scanbotsdk_document_quality_analyzer_result_t *self, size_t *size)
 Returns size of cumulative_quality_histogram array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_cumulative_contrast_histogram (scanbotsdk_document_quality_analyzer_result_t *self, int **cumulative_contrast_histogram)
 Returns value of cumulative_contrast_histogram 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_quality_analyzer_result_get_cumulative_contrast_histogram_size (scanbotsdk_document_quality_analyzer_result_t *self, size_t *size)
 Returns size of cumulative_contrast_histogram array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_cumulative_text_size_histogram (scanbotsdk_document_quality_analyzer_result_t *self, int **cumulative_text_size_histogram)
 Returns value of cumulative_text_size_histogram 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_quality_analyzer_result_get_cumulative_text_size_histogram_size (scanbotsdk_document_quality_analyzer_result_t *self, size_t *size)
 Returns size of cumulative_text_size_histogram array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_quality_heatmap (scanbotsdk_document_quality_analyzer_result_t *self, scanbotsdk_image_t **quality_heatmap)
 Returns value of quality_heatmap 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_quality_analyzer_configuration_t

◆ scanbotsdk_document_quality_analyzer_result_t

scanbotsdk_document_quality_analyzer_result_t class

Result of document quality analysis. It can be used to determine, e.g., if a document is good enough to be used for OCR processing.

◆ scanbotsdk_document_quality_analyzer_t

scanbotsdk_document_quality_analyzer_t class

API for analyzing document quality.

Required licence feature(s): ImageProcessing.

◆ scanbotsdk_document_quality_t

scanbotsdk_document_quality_t enum

Result of document quality analysis.

◆ scanbotsdk_document_quality_threshold_t

scanbotsdk_document_quality_threshold_t class

Point in the quality-number of symbols space to separate quality levels.

Enumeration Type Documentation

◆ scanbotsdk_document_quality_t

scanbotsdk_document_quality_t enum

Result of document quality analysis.

Enumerator
SCANBOTSDK_DOCUMENT_QUALITY_VERY_POOR 

Very poor quality.

SCANBOTSDK_DOCUMENT_QUALITY_POOR 

Poor quality.

SCANBOTSDK_DOCUMENT_QUALITY_REASONABLE 

Reasonable quality.

SCANBOTSDK_DOCUMENT_QUALITY_GOOD 

Good quality.

SCANBOTSDK_DOCUMENT_QUALITY_EXCELLENT 

Excellent quality.

Function Documentation

◆ scanbotsdk_document_quality_analyzer_configuration_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_create ( scanbotsdk_document_quality_threshold_t ** quality_thresholds,
size_t quality_thresholds_size,
scanbotsdk_document_quality_t * quality_indices,
size_t quality_indices_size,
bool detect_orientation,
bool inspect_small_text,
int max_image_size,
int min_estimated_number_of_symbols_for_document,
double min_processed_fraction,
double max_processed_fraction,
int min_number_of_required_symbols,
double min_required_orientation_confidence,
int tile_size,
bool return_quality_heatmap,
scanbotsdk_document_quality_analyzer_configuration_t ** result )

Creates a new instance of scanbotsdk_document_quality_analyzer_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
quality_thresholdsQuality thresholds to separate quality levels. Entries of the array must not be null.
quality_thresholds_sizeSize of the array quality_thresholds
quality_indicesquality levels.
quality_indices_sizeSize of the array quality_indices
detect_orientationEnable orientation detection. Document orientation will be returned in DocumentQualityAnalyzerResult.orientation.

Default is false

Parameters
inspect_small_textInspect small text (typically less than 12 pixels height) when analyzing the document quality. If true, processing will be slower, but when the quality issue with a document is the low resolution of the text, then the issue will be caught.

Default is false

Parameters
max_image_sizeMaximum image size in pixels, if image is bigger, it will be resized.

Default is 2000

Parameters
min_estimated_number_of_symbols_for_documentIf estimated number of symbols is less than this value, return that document is not found.

Default is 20

Parameters
min_processed_fractionAt least this fraction of the image will be processed, range is from 0 to 1. Decreasing this value below 1.0 can lead to faster processing but may result in less accurate prediction, as only a subset of the image tiles will be analyzed.

Default is 1

Parameters
max_processed_fractionAt most this fraction of the image will be processed, range is from 0 to 1. Decreasing this value below 1.0 can lead to faster processing but may result in less accurate prediction, as only a subset of the image tiles will be analyzed.

Default is 1

Parameters
min_number_of_required_symbolsIf this number of symbols is found and minProcessedFraction of the image is processed, the processing stops.

Default is 100

Parameters
min_required_orientation_confidenceIf detectOrientation is True, minNumberOfRequiredSymbols is found, and orientationConfidence is bigger than this threshold, the processing stops. If the maxProcessedFraction part of the image is processed and orientationConfidence is lower than the threshold, the returned orientation will be 0.

Default is 0

Parameters
tile_sizeImage will be processed in tiles of this size; will be ignored if image is small.

Default is 300

Parameters
return_quality_heatmapIf true, will return the quality heatmap as a part of the result. In this case, the entire image will be processed and the minProcessedFraction will be ignored. Useful for debugging situations where the returned quality doesn't appear to match the perceived quality.

Default is false

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

◆ scanbotsdk_document_quality_analyzer_configuration_create_with_defaults()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_create_with_defaults ( scanbotsdk_document_quality_analyzer_configuration_t ** result)

Creates a new instance of scanbotsdk_document_quality_analyzer_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_quality_analyzer_configuration_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_free ( scanbotsdk_document_quality_analyzer_configuration_t * object)

Frees the memory allocated for the instance of scanbotsdk_document_quality_analyzer_configuration_t. If null is passed, the function does nothing.

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_detect_orientation()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_detect_orientation ( scanbotsdk_document_quality_analyzer_configuration_t * self,
bool * detect_orientation )

Returns value of detect_orientation field of the given object.

Enable orientation detection. Document orientation will be returned in DocumentQualityAnalyzerResult.orientation.

Default is false

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_inspect_small_text()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_inspect_small_text ( scanbotsdk_document_quality_analyzer_configuration_t * self,
bool * inspect_small_text )

Returns value of inspect_small_text field of the given object.

Inspect small text (typically less than 12 pixels height) when analyzing the document quality. If true, processing will be slower, but when the quality issue with a document is the low resolution of the text, then the issue will be caught.

Default is false

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_max_image_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_max_image_size ( scanbotsdk_document_quality_analyzer_configuration_t * self,
int * max_image_size )

Returns value of max_image_size field of the given object.

Maximum image size in pixels, if image is bigger, it will be resized.

Default is 2000

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_max_processed_fraction()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_max_processed_fraction ( scanbotsdk_document_quality_analyzer_configuration_t * self,
double * max_processed_fraction )

Returns value of max_processed_fraction field of the given object.

At most this fraction of the image will be processed, range is from 0 to 1. Decreasing this value below 1.0 can lead to faster processing but may result in less accurate prediction, as only a subset of the image tiles will be analyzed.

Default is 1

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_min_estimated_number_of_symbols_for_document()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_min_estimated_number_of_symbols_for_document ( scanbotsdk_document_quality_analyzer_configuration_t * self,
int * min_estimated_number_of_symbols_for_document )

Returns value of min_estimated_number_of_symbols_for_document field of the given object.

If estimated number of symbols is less than this value, return that document is not found.

Default is 20

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_min_number_of_required_symbols()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_min_number_of_required_symbols ( scanbotsdk_document_quality_analyzer_configuration_t * self,
int * min_number_of_required_symbols )

Returns value of min_number_of_required_symbols field of the given object.

If this number of symbols is found and minProcessedFraction of the image is processed, the processing stops.

Default is 100

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_min_processed_fraction()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_min_processed_fraction ( scanbotsdk_document_quality_analyzer_configuration_t * self,
double * min_processed_fraction )

Returns value of min_processed_fraction field of the given object.

At least this fraction of the image will be processed, range is from 0 to 1. Decreasing this value below 1.0 can lead to faster processing but may result in less accurate prediction, as only a subset of the image tiles will be analyzed.

Default is 1

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_min_required_orientation_confidence()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_min_required_orientation_confidence ( scanbotsdk_document_quality_analyzer_configuration_t * self,
double * min_required_orientation_confidence )

Returns value of min_required_orientation_confidence field of the given object.

If detectOrientation is True, minNumberOfRequiredSymbols is found, and orientationConfidence is bigger than this threshold, the processing stops. If the maxProcessedFraction part of the image is processed and orientationConfidence is lower than the threshold, the returned orientation will be 0.

Default is 0

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_quality_indices()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_quality_indices ( scanbotsdk_document_quality_analyzer_configuration_t * self,
scanbotsdk_document_quality_t ** quality_indices )

Returns value of quality_indices field of the given object. The returned value is direct view into memory, no pre-allocations needed.

quality levels.

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_quality_indices_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_quality_indices_size ( scanbotsdk_document_quality_analyzer_configuration_t * self,
size_t * size )

Returns size of quality_indices array.

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_quality_thresholds()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_quality_thresholds ( scanbotsdk_document_quality_analyzer_configuration_t * self,
scanbotsdk_document_quality_threshold_t ** quality_thresholds,
size_t size )

Returns value of quality_thresholds field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.

Quality thresholds to separate quality levels.

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_quality_thresholds_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_quality_thresholds_size ( scanbotsdk_document_quality_analyzer_configuration_t * self,
size_t * size )

Returns size of quality_thresholds array.

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_return_quality_heatmap()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_return_quality_heatmap ( scanbotsdk_document_quality_analyzer_configuration_t * self,
bool * return_quality_heatmap )

Returns value of return_quality_heatmap field of the given object.

If true, will return the quality heatmap as a part of the result. In this case, the entire image will be processed and the minProcessedFraction will be ignored. Useful for debugging situations where the returned quality doesn't appear to match the perceived quality.

Default is false

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

◆ scanbotsdk_document_quality_analyzer_configuration_get_tile_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_get_tile_size ( scanbotsdk_document_quality_analyzer_configuration_t * self,
int * tile_size )

Returns value of tile_size field of the given object.

Image will be processed in tiles of this size; will be ignored if image is small.

Default is 300

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

◆ scanbotsdk_document_quality_analyzer_configuration_set_detect_orientation()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_detect_orientation ( scanbotsdk_document_quality_analyzer_configuration_t * self,
bool detect_orientation )

Sets value of detect_orientation field of the given object.

Enable orientation detection. Document orientation will be returned in DocumentQualityAnalyzerResult.orientation.

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_quality_analyzer_configuration_t, the field of which will be set
detect_orientationThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_set_inspect_small_text()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_inspect_small_text ( scanbotsdk_document_quality_analyzer_configuration_t * self,
bool inspect_small_text )

Sets value of inspect_small_text field of the given object.

Inspect small text (typically less than 12 pixels height) when analyzing the document quality. If true, processing will be slower, but when the quality issue with a document is the low resolution of the text, then the issue will be caught.

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_quality_analyzer_configuration_t, the field of which will be set
inspect_small_textThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_set_max_image_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_max_image_size ( scanbotsdk_document_quality_analyzer_configuration_t * self,
int max_image_size )

Sets value of max_image_size field of the given object.

Maximum image size in pixels, if image is bigger, it will be resized.

Default is 2000

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_quality_analyzer_configuration_t, the field of which will be set
max_image_sizeThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_set_max_processed_fraction()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_max_processed_fraction ( scanbotsdk_document_quality_analyzer_configuration_t * self,
double max_processed_fraction )

Sets value of max_processed_fraction field of the given object.

At most this fraction of the image will be processed, range is from 0 to 1. Decreasing this value below 1.0 can lead to faster processing but may result in less accurate prediction, as only a subset of the image tiles will be analyzed.

Default is 1

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_quality_analyzer_configuration_t, the field of which will be set
max_processed_fractionThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_set_min_estimated_number_of_symbols_for_document()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_min_estimated_number_of_symbols_for_document ( scanbotsdk_document_quality_analyzer_configuration_t * self,
int min_estimated_number_of_symbols_for_document )

Sets value of min_estimated_number_of_symbols_for_document field of the given object.

If estimated number of symbols is less than this value, return that document is not found.

Default is 20

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_quality_analyzer_configuration_t, the field of which will be set
min_estimated_number_of_symbols_for_documentThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_set_min_number_of_required_symbols()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_min_number_of_required_symbols ( scanbotsdk_document_quality_analyzer_configuration_t * self,
int min_number_of_required_symbols )

Sets value of min_number_of_required_symbols field of the given object.

If this number of symbols is found and minProcessedFraction of the image is processed, the processing stops.

Default is 100

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_quality_analyzer_configuration_t, the field of which will be set
min_number_of_required_symbolsThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_set_min_processed_fraction()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_min_processed_fraction ( scanbotsdk_document_quality_analyzer_configuration_t * self,
double min_processed_fraction )

Sets value of min_processed_fraction field of the given object.

At least this fraction of the image will be processed, range is from 0 to 1. Decreasing this value below 1.0 can lead to faster processing but may result in less accurate prediction, as only a subset of the image tiles will be analyzed.

Default is 1

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_quality_analyzer_configuration_t, the field of which will be set
min_processed_fractionThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_set_min_required_orientation_confidence()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_min_required_orientation_confidence ( scanbotsdk_document_quality_analyzer_configuration_t * self,
double min_required_orientation_confidence )

Sets value of min_required_orientation_confidence field of the given object.

If detectOrientation is True, minNumberOfRequiredSymbols is found, and orientationConfidence is bigger than this threshold, the processing stops. If the maxProcessedFraction part of the image is processed and orientationConfidence is lower than the threshold, the returned orientation will be 0.

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_quality_analyzer_configuration_t, the field of which will be set
min_required_orientation_confidenceThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_set_quality_indices()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_quality_indices ( scanbotsdk_document_quality_analyzer_configuration_t * self,
scanbotsdk_document_quality_t * quality_indices,
size_t quality_indices_size )

Sets value of quality_indices field of the given object.

quality levels.

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_quality_analyzer_configuration_t, the field of which will be set
quality_indicesThe value to be set.
quality_indices_sizeSize of the array.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_set_quality_thresholds()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_quality_thresholds ( scanbotsdk_document_quality_analyzer_configuration_t * self,
scanbotsdk_document_quality_threshold_t ** quality_thresholds,
size_t quality_thresholds_size )

Sets value of quality_thresholds field of the given object.

Quality thresholds to separate quality levels.

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_quality_analyzer_configuration_t, the field of which will be set
quality_thresholdsThe value to be set.
quality_thresholds_sizeSize of the array.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_set_return_quality_heatmap()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_return_quality_heatmap ( scanbotsdk_document_quality_analyzer_configuration_t * self,
bool return_quality_heatmap )

Sets value of return_quality_heatmap field of the given object.

If true, will return the quality heatmap as a part of the result. In this case, the entire image will be processed and the minProcessedFraction will be ignored. Useful for debugging situations where the returned quality doesn't appear to match the perceived quality.

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_quality_analyzer_configuration_t, the field of which will be set
return_quality_heatmapThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_configuration_set_tile_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_configuration_set_tile_size ( scanbotsdk_document_quality_analyzer_configuration_t * self,
int tile_size )

Sets value of tile_size field of the given object.

Image will be processed in tiles of this size; will be ignored if image is small.

Default is 300

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_quality_analyzer_configuration_t, the field of which will be set
tile_sizeThe value to be set.
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_create ( scanbotsdk_document_quality_analyzer_configuration_t * configuration,
scanbotsdk_document_quality_analyzer_t ** result )

Creates a new instance of scanbotsdk_document_quality_analyzer 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 to use for the document quality analyzer. The value must not be null.
resultPointer to a variable that will store the created instance of scanbotsdk_document_quality_analyzer_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_analyzer_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_free ( scanbotsdk_document_quality_analyzer_t * self)

Frees the memory allocated for the instance of scanbotsdk_document_quality_analyzer_t. If null is passed, the function does nothing.

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

◆ scanbotsdk_document_quality_analyzer_result_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_free ( scanbotsdk_document_quality_analyzer_result_t * object)

Frees the memory allocated for the instance of scanbotsdk_document_quality_analyzer_result_t. If null is passed, the function does nothing.

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

◆ scanbotsdk_document_quality_analyzer_result_get_cumulative_contrast_histogram()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_cumulative_contrast_histogram ( scanbotsdk_document_quality_analyzer_result_t * self,
int ** cumulative_contrast_histogram )

Returns value of cumulative_contrast_histogram field of the given object. The returned value is direct view into memory, no pre-allocations needed.

Cumulative histogram where every entry is equal to the number of symbols with contrast equal or lower than N percent, where N is the index of the entry in the array.

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

◆ scanbotsdk_document_quality_analyzer_result_get_cumulative_contrast_histogram_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_cumulative_contrast_histogram_size ( scanbotsdk_document_quality_analyzer_result_t * self,
size_t * size )

Returns size of cumulative_contrast_histogram array.

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

◆ scanbotsdk_document_quality_analyzer_result_get_cumulative_quality_histogram()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_cumulative_quality_histogram ( scanbotsdk_document_quality_analyzer_result_t * self,
int ** cumulative_quality_histogram )

Returns value of cumulative_quality_histogram field of the given object. The returned value is direct view into memory, no pre-allocations needed.

Cumulative histogram where every entry is equal to the number of symbols with quality equal or lower than N percent, where N is the index of the entry in the array.

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

◆ scanbotsdk_document_quality_analyzer_result_get_cumulative_quality_histogram_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_cumulative_quality_histogram_size ( scanbotsdk_document_quality_analyzer_result_t * self,
size_t * size )

Returns size of cumulative_quality_histogram array.

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

◆ scanbotsdk_document_quality_analyzer_result_get_cumulative_text_size_histogram()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_cumulative_text_size_histogram ( scanbotsdk_document_quality_analyzer_result_t * self,
int ** cumulative_text_size_histogram )

Returns value of cumulative_text_size_histogram field of the given object. The returned value is direct view into memory, no pre-allocations needed.

Cumulative histogram where every entry is equal to the number of symbols with text size equal or lower than N percent, where N is the index of the entry in the array.

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

◆ scanbotsdk_document_quality_analyzer_result_get_cumulative_text_size_histogram_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_cumulative_text_size_histogram_size ( scanbotsdk_document_quality_analyzer_result_t * self,
size_t * size )

Returns size of cumulative_text_size_histogram array.

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

◆ scanbotsdk_document_quality_analyzer_result_get_document_found()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_document_found ( scanbotsdk_document_quality_analyzer_result_t * self,
bool * document_found )

Returns value of document_found field of the given object.

True if a document was found.

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

◆ scanbotsdk_document_quality_analyzer_result_get_orientation()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_orientation ( scanbotsdk_document_quality_analyzer_result_t * self,
double ** orientation )

Returns value of orientation field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.

Dominant orientation of the document, if found and if orientation detection is enabled. The value is in degrees counter-clockwise, where 0 corresponds to the document being straight, and the value is in the range of [-180, 180]. To rotate the document to be straight, rotate the image clockwise by this value.

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

◆ scanbotsdk_document_quality_analyzer_result_get_orientation_confidence()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_orientation_confidence ( scanbotsdk_document_quality_analyzer_result_t * self,
double ** orientation_confidence )

Returns value of orientation_confidence field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.

Confidence that the reported orientation of the document is correct. Returned if orientation detection is enabled. The value is in the range of [0, 1]. Possible reasons for low confidence are:

  • Document contains text with multiple orientations.
  • Text on the document is poorly readable.
  • Text on the document is on the edge of detectable text range (text is too small or too big).
  • Insufficient statistics because only part of the image was processed. See minProcessedFraction, maxProcessedFraction, and earlyStopIfNSymbolsFound options in the DocumentQualityAnalyzerConfiguration.
    Parameters
    selfPointer to the instance of scanbotsdk_document_quality_analyzer_result_t
    orientation_confidencePointer to a variable that will store the value of the field.
    Returns
    : Error code, SCANBOTSDK_OK if no errors were encountered.

◆ scanbotsdk_document_quality_analyzer_result_get_quality()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_quality ( scanbotsdk_document_quality_analyzer_result_t * self,
scanbotsdk_document_quality_t ** quality )

Returns value of quality field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.

Quality of the document, if found.

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

◆ scanbotsdk_document_quality_analyzer_result_get_quality_heatmap()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_result_get_quality_heatmap ( scanbotsdk_document_quality_analyzer_result_t * self,
scanbotsdk_image_t ** quality_heatmap )

Returns value of quality_heatmap field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.

Quality heatmap. Black marks areas of no detected text. Colors represent the quality of detected text, with red meaning the lowest quality and yellow and green meaning progressively higher quality.

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

◆ scanbotsdk_document_quality_analyzer_run()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_analyzer_run ( scanbotsdk_document_quality_analyzer_t * self,
scanbotsdk_image_t * image,
scanbotsdk_document_quality_analyzer_result_t ** result )

analyze document quality of 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_quality_analyzer_t method to be called on
imageThe image to analyze. The value must not be null.
resultPointer to a variable that will store the created instance of scanbotsdk_document_quality_analyzer_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_t_to_string()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_t_to_string ( scanbotsdk_document_quality_t value,
const char ** result )

Returns the string representation of the given scanbotsdk_document_quality_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_quality_threshold_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_threshold_create ( double symbol_quality,
double symbol_ratio,
scanbotsdk_document_quality_threshold_t ** result )

Creates a new instance of scanbotsdk_document_quality_threshold 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
symbol_qualitySymbol quality.
symbol_ratioSymbol ratio.
resultPointer to a variable that will store the created instance of scanbotsdk_document_quality_threshold_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_document_quality_threshold_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_threshold_free ( scanbotsdk_document_quality_threshold_t * object)

Frees the memory allocated for the instance of scanbotsdk_document_quality_threshold_t. If null is passed, the function does nothing.

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

◆ scanbotsdk_document_quality_threshold_get_symbol_quality()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_threshold_get_symbol_quality ( scanbotsdk_document_quality_threshold_t * self,
double * symbol_quality )

Returns value of symbol_quality field of the given object.

Symbol quality.

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

◆ scanbotsdk_document_quality_threshold_get_symbol_ratio()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_quality_threshold_get_symbol_ratio ( scanbotsdk_document_quality_threshold_t * self,
double * symbol_ratio )

Returns value of symbol_ratio field of the given object.

Symbol ratio.

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