Scanbot SDK
Loading...
Searching...
No Matches
Scanbot C SDK Generic document

Typedefs

typedef enum scanbotsdk_common_field_type_t scanbotsdk_common_field_type_t
 scanbotsdk_common_field_type_t enum
 
typedef struct scanbotsdk_ocr_result_t scanbotsdk_ocr_result_t
 scanbotsdk_ocr_result_t class
 
typedef enum scanbotsdk_field_validation_status_t scanbotsdk_field_validation_status_t
 scanbotsdk_field_validation_status_t enum
 
typedef enum scanbotsdk_field_data_format_t scanbotsdk_field_data_format_t
 scanbotsdk_field_data_format_t enum
 
typedef struct scanbotsdk_field_parsed_data_t scanbotsdk_field_parsed_data_t
 scanbotsdk_field_parsed_data_t class
 
typedef struct scanbotsdk_field_type_t scanbotsdk_field_type_t
 scanbotsdk_field_type_t class
 
typedef struct scanbotsdk_field_t scanbotsdk_field_t
 scanbotsdk_field_t class
 
typedef struct scanbotsdk_generic_document_type_t scanbotsdk_generic_document_type_t
 scanbotsdk_generic_document_type_t class
 
typedef struct scanbotsdk_generic_document_t scanbotsdk_generic_document_t
 scanbotsdk_generic_document_t class
 

Enumerations

enum  scanbotsdk_common_field_type_t {
  SCANBOTSDK_COMMON_FIELD_TYPE_ID = 0 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_SURNAME = 1 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_MAIDEN_NAME = 2 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_GIVEN_NAMES = 3 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_BIRTH_DATE = 4 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_NATIONALITY = 5 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_BIRTHPLACE = 6 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_EXPIRY_DATE = 7 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_EYE_COLOR = 8 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_HEIGHT = 9 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_ISSUE_DATE = 10 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_ISSUING_AUTHORITY = 11 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_ADDRESS = 12 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_PSEUDONYM = 13 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_MRZ = 14 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_ISSUING_COUNTRY = 15 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_GENDER = 16 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_SIGNATURE = 17 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_PHOTO = 18 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_VALID_FROM_DATE = 19 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_ROUTING_NUMBER = 20 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_ACCOUNT_NUMBER = 21 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_PLACE_OF_ISSUE = 22 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_TITLE_TYPE = 23 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_REMARKS = 24 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_NAME = 25 ,
  SCANBOTSDK_COMMON_FIELD_TYPE_CARD_ACCESS_NUMBER = 26
}
 scanbotsdk_common_field_type_t enum More...
 
enum  scanbotsdk_field_validation_status_t {
  SCANBOTSDK_FIELD_VALIDATION_STATUS_INVALID = 0 ,
  SCANBOTSDK_FIELD_VALIDATION_STATUS_OBSTRUCTED = 1 ,
  SCANBOTSDK_FIELD_VALIDATION_STATUS_NONE = 2 ,
  SCANBOTSDK_FIELD_VALIDATION_STATUS_CONFIRMED = 3 ,
  SCANBOTSDK_FIELD_VALIDATION_STATUS_INFERRED = 4 ,
  SCANBOTSDK_FIELD_VALIDATION_STATUS_VALID = 5 ,
  SCANBOTSDK_FIELD_VALIDATION_STATUS_IGNORED = 6
}
 scanbotsdk_field_validation_status_t enum More...
 
enum  scanbotsdk_field_data_format_t {
  SCANBOTSDK_FIELD_DATA_FORMAT_ISO_DATE = 0 ,
  SCANBOTSDK_FIELD_DATA_FORMAT_ISO_COUNTRY_ALPHA_2 = 1 ,
  SCANBOTSDK_FIELD_DATA_FORMAT_ISO_COUNTRY_ALPHA_3 = 2 ,
  SCANBOTSDK_FIELD_DATA_FORMAT_ISO_COUNTRY_NUMERIC = 3 ,
  SCANBOTSDK_FIELD_DATA_FORMAT_ISO_COUNTRY_NAME = 4 ,
  SCANBOTSDK_FIELD_DATA_FORMAT_GENDER = 5
}
 scanbotsdk_field_data_format_t enum More...
 

Functions

SBSDK_API scanbotsdk_error_code_t scanbotsdk_common_field_type_t_to_string (scanbotsdk_common_field_type_t value, const char **result)
 Returns the string representation of the given scanbotsdk_common_field_type_t value.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_result_create (const char *text, double confidence, scanbotsdk_ocr_result_t **result)
 Creates a new instance of scanbotsdk_ocr_result with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_result_free (scanbotsdk_ocr_result_t *object)
 Frees the memory allocated for the instance of scanbotsdk_ocr_result_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_result_get_text (scanbotsdk_ocr_result_t *self, const char **text)
 Returns value of text 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_ocr_result_get_confidence (scanbotsdk_ocr_result_t *self, double *confidence)
 Returns value of confidence field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_validation_status_t_to_string (scanbotsdk_field_validation_status_t value, const char **result)
 Returns the string representation of the given scanbotsdk_field_validation_status_t value.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_data_format_t_to_string (scanbotsdk_field_data_format_t value, const char **result)
 Returns the string representation of the given scanbotsdk_field_data_format_t value.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_parsed_data_create (scanbotsdk_field_data_format_t type, const char *value, scanbotsdk_field_parsed_data_t **result)
 Creates a new instance of scanbotsdk_field_parsed_data with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_parsed_data_free (scanbotsdk_field_parsed_data_t *object)
 Frees the memory allocated for the instance of scanbotsdk_field_parsed_data_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_parsed_data_get_type (scanbotsdk_field_parsed_data_t *self, scanbotsdk_field_data_format_t *type)
 Returns value of type field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_parsed_data_get_value (scanbotsdk_field_parsed_data_t *self, const char **value)
 Returns value of value 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_field_type_create (const char *name, const char *full_name, const char *normalized_name, scanbotsdk_common_field_type_t *common_type, int *list_index, scanbotsdk_field_type_t **result)
 Creates a new instance of scanbotsdk_field_type with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_type_create_with_defaults (const char *name, const char *full_name, const char *normalized_name, scanbotsdk_common_field_type_t *common_type, scanbotsdk_field_type_t **result)
 Creates a new instance of scanbotsdk_field_type_t with given required params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_type_free (scanbotsdk_field_type_t *object)
 Frees the memory allocated for the instance of scanbotsdk_field_type_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_type_get_name (scanbotsdk_field_type_t *self, const char **name)
 Returns value of name 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_field_type_get_full_name (scanbotsdk_field_type_t *self, const char **full_name)
 Returns value of full_name 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_field_type_get_normalized_name (scanbotsdk_field_type_t *self, const char **normalized_name)
 Returns value of normalized_name 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_field_type_get_common_type (scanbotsdk_field_type_t *self, scanbotsdk_common_field_type_t **common_type)
 Returns value of common_type 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_field_type_get_list_index (scanbotsdk_field_type_t *self, int **list_index)
 Returns value of list_index 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_field_create (scanbotsdk_field_type_t *type, scanbotsdk_ocr_result_t *value, double confidence_weight, scanbotsdk_image_t *image, scanbotsdk_pointf_t *polygon_in_root, size_t polygon_in_root_size, scanbotsdk_field_validation_status_t validation_status, scanbotsdk_field_parsed_data_t **parsed_data, size_t parsed_data_size, scanbotsdk_field_t **result)
 Creates a new instance of scanbotsdk_field with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_create_with_defaults (scanbotsdk_field_type_t *type, scanbotsdk_ocr_result_t *value, scanbotsdk_pointf_t *polygon_in_root, size_t polygon_in_root_size, scanbotsdk_field_t **result)
 Creates a new instance of scanbotsdk_field_t with given required params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_free (scanbotsdk_field_t *object)
 Frees the memory allocated for the instance of scanbotsdk_field_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_type (scanbotsdk_field_t *self, scanbotsdk_field_type_t **type)
 Returns value of type 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_field_get_value (scanbotsdk_field_t *self, scanbotsdk_ocr_result_t **value)
 Returns value of value 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_field_get_confidence_weight (scanbotsdk_field_t *self, double *confidence_weight)
 Returns value of confidence_weight field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_image (scanbotsdk_field_t *self, scanbotsdk_image_t **image)
 Returns value of image 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_field_get_polygon_in_root (scanbotsdk_field_t *self, scanbotsdk_pointf_t **polygon_in_root)
 Returns value of polygon_in_root field of the given object. The returned value is direct view into memory, no pre-allocations needed.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_polygon_in_root_size (scanbotsdk_field_t *self, size_t *size)
 Returns size of polygon_in_root array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_validation_status (scanbotsdk_field_t *self, scanbotsdk_field_validation_status_t *validation_status)
 Returns value of validation_status field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_parsed_data (scanbotsdk_field_t *self, scanbotsdk_field_parsed_data_t **parsed_data, size_t size)
 Returns value of parsed_data 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_field_get_parsed_data_size (scanbotsdk_field_t *self, size_t *size)
 Returns size of parsed_data array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_type_create (const char *name, const char *full_name, const char *normalized_name, int *list_index, scanbotsdk_generic_document_type_t **result)
 Creates a new instance of scanbotsdk_generic_document_type with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_type_create_with_defaults (const char *name, const char *full_name, const char *normalized_name, scanbotsdk_generic_document_type_t **result)
 Creates a new instance of scanbotsdk_generic_document_type_t with given required params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_type_free (scanbotsdk_generic_document_type_t *object)
 Frees the memory allocated for the instance of scanbotsdk_generic_document_type_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_type_get_name (scanbotsdk_generic_document_type_t *self, const char **name)
 Returns value of name 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_generic_document_type_get_full_name (scanbotsdk_generic_document_type_t *self, const char **full_name)
 Returns value of full_name 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_generic_document_type_get_normalized_name (scanbotsdk_generic_document_type_t *self, const char **normalized_name)
 Returns value of normalized_name 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_generic_document_type_get_list_index (scanbotsdk_generic_document_type_t *self, int **list_index)
 Returns value of list_index 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_generic_document_create (scanbotsdk_generic_document_type_t *type, scanbotsdk_field_t **fields, size_t fields_size, scanbotsdk_generic_document_t **children, size_t children_size, scanbotsdk_pointf_t *quad, size_t quad_size, scanbotsdk_pointf_t *quad_in_root, size_t quad_in_root_size, scanbotsdk_image_t *crop, double confidence, double confidence_weight, scanbotsdk_generic_document_t **result)
 Creates a new instance of scanbotsdk_generic_document with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_create_with_defaults (scanbotsdk_generic_document_type_t *type, scanbotsdk_field_t **fields, size_t fields_size, scanbotsdk_generic_document_t **children, size_t children_size, scanbotsdk_pointf_t *quad, size_t quad_size, scanbotsdk_pointf_t *quad_in_root, size_t quad_in_root_size, scanbotsdk_generic_document_t **result)
 Creates a new instance of scanbotsdk_generic_document_t with given required params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_free (scanbotsdk_generic_document_t *object)
 Frees the memory allocated for the instance of scanbotsdk_generic_document_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_type (scanbotsdk_generic_document_t *self, scanbotsdk_generic_document_type_t **type)
 Returns value of type 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_generic_document_get_fields (scanbotsdk_generic_document_t *self, scanbotsdk_field_t **fields, size_t size)
 Returns value of fields 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_generic_document_get_fields_size (scanbotsdk_generic_document_t *self, size_t *size)
 Returns size of fields array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_children (scanbotsdk_generic_document_t *self, scanbotsdk_generic_document_t **children, size_t size)
 Returns value of children 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_generic_document_get_children_size (scanbotsdk_generic_document_t *self, size_t *size)
 Returns size of children array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_quad (scanbotsdk_generic_document_t *self, scanbotsdk_pointf_t **quad)
 Returns value of quad field of the given object. The returned value is direct view into memory, no pre-allocations needed.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_quad_size (scanbotsdk_generic_document_t *self, size_t *size)
 Returns size of quad array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_quad_in_root (scanbotsdk_generic_document_t *self, scanbotsdk_pointf_t **quad_in_root)
 Returns value of quad_in_root field of the given object. The returned value is direct view into memory, no pre-allocations needed.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_quad_in_root_size (scanbotsdk_generic_document_t *self, size_t *size)
 Returns size of quad_in_root array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_crop (scanbotsdk_generic_document_t *self, scanbotsdk_image_t **crop)
 Returns value of crop 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_generic_document_get_confidence (scanbotsdk_generic_document_t *self, double *confidence)
 Returns value of confidence field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_confidence_weight (scanbotsdk_generic_document_t *self, double *confidence_weight)
 Returns value of confidence_weight field of the given object.
 

Detailed Description

Typedef Documentation

◆ scanbotsdk_common_field_type_t

◆ scanbotsdk_field_data_format_t

◆ scanbotsdk_field_parsed_data_t

◆ scanbotsdk_field_t

scanbotsdk_field_t class

Generic document field.

◆ scanbotsdk_field_type_t

scanbotsdk_field_type_t class

Generic Document Type.

◆ scanbotsdk_field_validation_status_t

scanbotsdk_field_validation_status_t enum

Field validation status.

Optical character recognition (OCR) invariably introduces errors in the recognized text. There are numerous ways to verify that what has been recognized is, in fact, what was written in the document.

The best way to validate the value of a field is for it to have a known format or validation logic. For example, an IBAN number has a known format and two check digits that make it very unlikely that a value with OCR errors will pass validation. Fields with known validation rules will have a validation status of either VALID or INVALID.

Fields whose value can be inferred from other fields, or from domain knowledge (for example, the field may have the same value in every instance of this type of document), will have the status INFERRED. Inferring the value of a field is a strong validation method, provided that there are no unexpected changes to the document format.

Fields that do not have validation rules and cannot be inferred can still be validated by checking whether the same value is recognized from multiple attempts, e.g. across multiple frames of a camera stream. If the same value is recognized in multiple frames, the value is considered CONFIRMED, otherwise it will have the status NONE. This is the least strict validation method, as it does not protect from systemic OCR errors, but in practice it still provides good results for most fields.

◆ scanbotsdk_generic_document_t

◆ scanbotsdk_generic_document_type_t

◆ scanbotsdk_ocr_result_t

scanbotsdk_ocr_result_t class

Result of OCR text recognition.

Enumeration Type Documentation

◆ scanbotsdk_common_field_type_t

scanbotsdk_common_field_type_t enum

Common field types.

Enumerator
SCANBOTSDK_COMMON_FIELD_TYPE_ID 

Document ID.

SCANBOTSDK_COMMON_FIELD_TYPE_SURNAME 

Person surname field.

SCANBOTSDK_COMMON_FIELD_TYPE_MAIDEN_NAME 

Person maiden name field.

SCANBOTSDK_COMMON_FIELD_TYPE_GIVEN_NAMES 

Person given names field.

SCANBOTSDK_COMMON_FIELD_TYPE_BIRTH_DATE 

Person birth date field.

SCANBOTSDK_COMMON_FIELD_TYPE_NATIONALITY 

Person nationality field.

SCANBOTSDK_COMMON_FIELD_TYPE_BIRTHPLACE 

Person birthplace field.

SCANBOTSDK_COMMON_FIELD_TYPE_EXPIRY_DATE 

Document expiry date field.

SCANBOTSDK_COMMON_FIELD_TYPE_EYE_COLOR 

Person eye color field.

SCANBOTSDK_COMMON_FIELD_TYPE_HEIGHT 

Person height field.

SCANBOTSDK_COMMON_FIELD_TYPE_ISSUE_DATE 

Document issue date field.

SCANBOTSDK_COMMON_FIELD_TYPE_ISSUING_AUTHORITY 

Document issuing authority field.

SCANBOTSDK_COMMON_FIELD_TYPE_ADDRESS 

Address field.

SCANBOTSDK_COMMON_FIELD_TYPE_PSEUDONYM 

Pseudonym field.

SCANBOTSDK_COMMON_FIELD_TYPE_MRZ 

MRZ field.

SCANBOTSDK_COMMON_FIELD_TYPE_ISSUING_COUNTRY 

Issuing country field.

SCANBOTSDK_COMMON_FIELD_TYPE_GENDER 

Gender field.

SCANBOTSDK_COMMON_FIELD_TYPE_SIGNATURE 

Signature field.

SCANBOTSDK_COMMON_FIELD_TYPE_PHOTO 

Photo field.

SCANBOTSDK_COMMON_FIELD_TYPE_VALID_FROM_DATE 

Date of start of validity field.

SCANBOTSDK_COMMON_FIELD_TYPE_ROUTING_NUMBER 

Check routing number.

SCANBOTSDK_COMMON_FIELD_TYPE_ACCOUNT_NUMBER 

Check account number.

SCANBOTSDK_COMMON_FIELD_TYPE_PLACE_OF_ISSUE 

Place of issue for the identity card.

SCANBOTSDK_COMMON_FIELD_TYPE_TITLE_TYPE 

Type of the title field in the identity document.

SCANBOTSDK_COMMON_FIELD_TYPE_REMARKS 

Remarks field in the identity document.

SCANBOTSDK_COMMON_FIELD_TYPE_NAME 

Full name field.

SCANBOTSDK_COMMON_FIELD_TYPE_CARD_ACCESS_NUMBER 

Card access number field.

◆ scanbotsdk_field_data_format_t

scanbotsdk_field_data_format_t enum

Type of parsing applied to field.

Enumerator
SCANBOTSDK_FIELD_DATA_FORMAT_ISO_DATE 

Field value is parsed as ISO 8601 date in format YYYY-MM-DD.

SCANBOTSDK_FIELD_DATA_FORMAT_ISO_COUNTRY_ALPHA_2 

Field value is parsed as ISO 3166-1 alpha-2 country code. E.g. "DE" for Germany.

SCANBOTSDK_FIELD_DATA_FORMAT_ISO_COUNTRY_ALPHA_3 

Field value is parsed as ISO 3166-1 alpha-3 country code. E.g. "DEU" for Germany.

SCANBOTSDK_FIELD_DATA_FORMAT_ISO_COUNTRY_NUMERIC 

Field value is parsed as ISO 3166-1 numeric country code. E.g. "276" for Germany.

SCANBOTSDK_FIELD_DATA_FORMAT_ISO_COUNTRY_NAME 

Field value is parsed as ISO 3166-1 country name. E.g. "Germany".

SCANBOTSDK_FIELD_DATA_FORMAT_GENDER 

Field value is parsed as "Male", "Female".

◆ scanbotsdk_field_validation_status_t

scanbotsdk_field_validation_status_t enum

Field validation status.

Optical character recognition (OCR) invariably introduces errors in the recognized text. There are numerous ways to verify that what has been recognized is, in fact, what was written in the document.

The best way to validate the value of a field is for it to have a known format or validation logic. For example, an IBAN number has a known format and two check digits that make it very unlikely that a value with OCR errors will pass validation. Fields with known validation rules will have a validation status of either VALID or INVALID.

Fields whose value can be inferred from other fields, or from domain knowledge (for example, the field may have the same value in every instance of this type of document), will have the status INFERRED. Inferring the value of a field is a strong validation method, provided that there are no unexpected changes to the document format.

Fields that do not have validation rules and cannot be inferred can still be validated by checking whether the same value is recognized from multiple attempts, e.g. across multiple frames of a camera stream. If the same value is recognized in multiple frames, the value is considered CONFIRMED, otherwise it will have the status NONE. This is the least strict validation method, as it does not protect from systemic OCR errors, but in practice it still provides good results for most fields.

Enumerator
SCANBOTSDK_FIELD_VALIDATION_STATUS_INVALID 

Field value failed validation. This status is used for fields that have validation rules, like IBAN, date fields, etc. that have check digits or a known format that can be validated.

SCANBOTSDK_FIELD_VALIDATION_STATUS_OBSTRUCTED 

Field value was not recognized because it was obstructed by e.g. a light reflection or a shadow.

SCANBOTSDK_FIELD_VALIDATION_STATUS_NONE 

Field value was not validated, typically because the field does not support validation and the value has not been seen enough times to confirm it. If the same value is seen in multiple frames, the validation status will transition to CONFIRMED, but only if that particular recognizer supports multiple frame accumulation.

SCANBOTSDK_FIELD_VALIDATION_STATUS_CONFIRMED 

The same field value was recognized in multiple frames, thereby confirming the value. Occurs only for fields that have no validation rules otherwise. A CONFIRMED value gives a strong guarantee that the field value has been read out without errors, but not as strong as VALID. The value may still be incorrect, due to systemic OCR errors. In case of OCR errors, increase the number of frames needed to confirm the value in the recognizer configuration.

SCANBOTSDK_FIELD_VALIDATION_STATUS_INFERRED 

Field value was inferred from other fields or from domain knowledge. The field value may differ from what is actually written in the document in unexpected situations.

SCANBOTSDK_FIELD_VALIDATION_STATUS_VALID 

Field value passed validation. This status is used for fields that have validation rules, like IBAN, date fields, etc. that have check digits or a known format that can be validated. The VALID status gives the strongest guarantee that the field value has been read out without errors.

SCANBOTSDK_FIELD_VALIDATION_STATUS_IGNORED 

The document contains a field of this type, but recognition for this field is disabled. The value of this field is always empty, although the field may be non-empty in the document.

Function Documentation

◆ scanbotsdk_common_field_type_t_to_string()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_common_field_type_t_to_string ( scanbotsdk_common_field_type_t value,
const char ** result )

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

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_create ( scanbotsdk_field_type_t * type,
scanbotsdk_ocr_result_t * value,
double confidence_weight,
scanbotsdk_image_t * image,
scanbotsdk_pointf_t * polygon_in_root,
size_t polygon_in_root_size,
scanbotsdk_field_validation_status_t validation_status,
scanbotsdk_field_parsed_data_t ** parsed_data,
size_t parsed_data_size,
scanbotsdk_field_t ** result )

Creates a new instance of scanbotsdk_field 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
typeThe type of the field. The value must not be null.
valueValue of the field. Applicable only to text fields. The value can be null.
confidence_weightConfidence weight.

Default is 1.0

Parameters
imageCrop of the field. The value can be null.
polygon_in_rootCoordinates of the field in the root document coordinate system.
polygon_in_root_sizeSize of the array polygon_in_root
validation_statusField validation status. Applicable only to fields that support some kind of validation.

Default is NONE

Parameters
parsed_dataParsed data. Entries of the array must not be null.
parsed_data_sizeSize of the array parsed_data
resultPointer to a variable that will store the created instance of scanbotsdk_field_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_field_create_with_defaults()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_create_with_defaults ( scanbotsdk_field_type_t * type,
scanbotsdk_ocr_result_t * value,
scanbotsdk_pointf_t * polygon_in_root,
size_t polygon_in_root_size,
scanbotsdk_field_t ** result )

Creates a new instance of scanbotsdk_field_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
typeThe type of the field. The value must not be null.
valueValue of the field. Applicable only to text fields. The value can be null.
polygon_in_rootCoordinates of the field in the root document coordinate system.
polygon_in_root_sizeSize of the array polygon_in_root
resultPointer to a variable that will store the created instance of scanbotsdk_field_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_field_data_format_t_to_string()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_data_format_t_to_string ( scanbotsdk_field_data_format_t value,
const char ** result )

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

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_free ( scanbotsdk_field_t * object)

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

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

◆ scanbotsdk_field_get_confidence_weight()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_confidence_weight ( scanbotsdk_field_t * self,
double * confidence_weight )

Returns value of confidence_weight field of the given object.

Confidence weight.

Default is 1.0

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

◆ scanbotsdk_field_get_image()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_image ( scanbotsdk_field_t * self,
scanbotsdk_image_t ** image )

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

Crop of the field.

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

◆ scanbotsdk_field_get_parsed_data()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_parsed_data ( scanbotsdk_field_t * self,
scanbotsdk_field_parsed_data_t ** parsed_data,
size_t size )

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

Parsed data.

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

◆ scanbotsdk_field_get_parsed_data_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_parsed_data_size ( scanbotsdk_field_t * self,
size_t * size )

Returns size of parsed_data array.

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

◆ scanbotsdk_field_get_polygon_in_root()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_polygon_in_root ( scanbotsdk_field_t * self,
scanbotsdk_pointf_t ** polygon_in_root )

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

Coordinates of the field in the root document coordinate system.

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

◆ scanbotsdk_field_get_polygon_in_root_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_polygon_in_root_size ( scanbotsdk_field_t * self,
size_t * size )

Returns size of polygon_in_root array.

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

◆ scanbotsdk_field_get_type()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_type ( scanbotsdk_field_t * self,
scanbotsdk_field_type_t ** type )

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

The type of the field.

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

◆ scanbotsdk_field_get_validation_status()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_validation_status ( scanbotsdk_field_t * self,
scanbotsdk_field_validation_status_t * validation_status )

Returns value of validation_status field of the given object.

Field validation status. Applicable only to fields that support some kind of validation.

Default is NONE

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

◆ scanbotsdk_field_get_value()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_get_value ( scanbotsdk_field_t * self,
scanbotsdk_ocr_result_t ** value )

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

Value of the field. Applicable only to text fields.

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

◆ scanbotsdk_field_parsed_data_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_parsed_data_create ( scanbotsdk_field_data_format_t type,
const char * value,
scanbotsdk_field_parsed_data_t ** result )

Creates a new instance of scanbotsdk_field_parsed_data 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
typeParsing type.
valueParsed value. The value must not be null.
resultPointer to a variable that will store the created instance of scanbotsdk_field_parsed_data_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_field_parsed_data_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_parsed_data_free ( scanbotsdk_field_parsed_data_t * object)

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

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

◆ scanbotsdk_field_parsed_data_get_type()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_parsed_data_get_type ( scanbotsdk_field_parsed_data_t * self,
scanbotsdk_field_data_format_t * type )

Returns value of type field of the given object.

Parsing type.

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

◆ scanbotsdk_field_parsed_data_get_value()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_parsed_data_get_value ( scanbotsdk_field_parsed_data_t * self,
const char ** value )

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

Parsed value.

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

◆ scanbotsdk_field_type_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_type_create ( const char * name,
const char * full_name,
const char * normalized_name,
scanbotsdk_common_field_type_t * common_type,
int * list_index,
scanbotsdk_field_type_t ** result )

Creates a new instance of scanbotsdk_field_type 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
nameLocal field type name scoped to the containing document type. The value must not be null.
full_nameUnique global field type name prefixed with the document types of all containing documents. The value must not be null.
normalized_nameNormalized global field type name. Fields in document types derived from the same base document type in the schema will have the same normalized name. The value must not be null.
common_typeCommonly occurring fields that have the same semantic meaning in different document types will often have a set common type. The value can be null.
list_indexA document can contain multiple fields of the same name, the property serves for storing natural order of such fields, null if multiple entries aren't allowed for this field. The value can be null.
resultPointer to a variable that will store the created instance of scanbotsdk_field_type_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_field_type_create_with_defaults()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_type_create_with_defaults ( const char * name,
const char * full_name,
const char * normalized_name,
scanbotsdk_common_field_type_t * common_type,
scanbotsdk_field_type_t ** result )

Creates a new instance of scanbotsdk_field_type_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
nameLocal field type name scoped to the containing document type. The value must not be null.
full_nameUnique global field type name prefixed with the document types of all containing documents. The value must not be null.
normalized_nameNormalized global field type name. Fields in document types derived from the same base document type in the schema will have the same normalized name. The value must not be null.
common_typeCommonly occurring fields that have the same semantic meaning in different document types will often have a set common type. The value can be null.
resultPointer to a variable that will store the created instance of scanbotsdk_field_type_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_field_type_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_type_free ( scanbotsdk_field_type_t * object)

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

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

◆ scanbotsdk_field_type_get_common_type()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_type_get_common_type ( scanbotsdk_field_type_t * self,
scanbotsdk_common_field_type_t ** common_type )

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

Commonly occurring fields that have the same semantic meaning in different document types will often have a set common type.

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

◆ scanbotsdk_field_type_get_full_name()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_type_get_full_name ( scanbotsdk_field_type_t * self,
const char ** full_name )

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

Unique global field type name prefixed with the document types of all containing documents.

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

◆ scanbotsdk_field_type_get_list_index()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_type_get_list_index ( scanbotsdk_field_type_t * self,
int ** list_index )

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

A document can contain multiple fields of the same name, the property serves for storing natural order of such fields, null if multiple entries aren't allowed for this field.

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

◆ scanbotsdk_field_type_get_name()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_type_get_name ( scanbotsdk_field_type_t * self,
const char ** name )

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

Local field type name scoped to the containing document type.

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

◆ scanbotsdk_field_type_get_normalized_name()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_type_get_normalized_name ( scanbotsdk_field_type_t * self,
const char ** normalized_name )

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

Normalized global field type name. Fields in document types derived from the same base document type in the schema will have the same normalized name.

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

◆ scanbotsdk_field_validation_status_t_to_string()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_field_validation_status_t_to_string ( scanbotsdk_field_validation_status_t value,
const char ** result )

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

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_create ( scanbotsdk_generic_document_type_t * type,
scanbotsdk_field_t ** fields,
size_t fields_size,
scanbotsdk_generic_document_t ** children,
size_t children_size,
scanbotsdk_pointf_t * quad,
size_t quad_size,
scanbotsdk_pointf_t * quad_in_root,
size_t quad_in_root_size,
scanbotsdk_image_t * crop,
double confidence,
double confidence_weight,
scanbotsdk_generic_document_t ** result )

Creates a new instance of scanbotsdk_generic_document 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
typeDocument type. The value must not be null.
fieldsList of document fields. Entries of the array must not be null.
fields_sizeSize of the array fields
childrenList of document sub-documents. Entries of the array must not be null.
children_sizeSize of the array children
quadCoordinates of the document in the parent document coordinate system.
quad_sizeSize of the array quad
quad_in_rootCoordinates of the document in the root document coordinate system.
quad_in_root_sizeSize of the array quad_in_root
cropImage crop of the document. The value can be null.
confidenceThe average confidence in the accuracy of the document recognition result.

Default is 0

Parameters
confidence_weightThe weight of the confidence. Can be used to calculate the weighted average confidence of two documents.

Default is 0

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

◆ scanbotsdk_generic_document_create_with_defaults()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_create_with_defaults ( scanbotsdk_generic_document_type_t * type,
scanbotsdk_field_t ** fields,
size_t fields_size,
scanbotsdk_generic_document_t ** children,
size_t children_size,
scanbotsdk_pointf_t * quad,
size_t quad_size,
scanbotsdk_pointf_t * quad_in_root,
size_t quad_in_root_size,
scanbotsdk_generic_document_t ** result )

Creates a new instance of scanbotsdk_generic_document_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
typeDocument type. The value must not be null.
fieldsList of document fields. Entries of the array must not be null.
fields_sizeSize of the array fields
childrenList of document sub-documents. Entries of the array must not be null.
children_sizeSize of the array children
quadCoordinates of the document in the parent document coordinate system.
quad_sizeSize of the array quad
quad_in_rootCoordinates of the document in the root document coordinate system.
quad_in_root_sizeSize of the array quad_in_root
resultPointer to a variable that will store the created instance of scanbotsdk_generic_document_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_generic_document_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_free ( scanbotsdk_generic_document_t * object)

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

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

◆ scanbotsdk_generic_document_get_children()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_children ( scanbotsdk_generic_document_t * self,
scanbotsdk_generic_document_t ** children,
size_t size )

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

List of document sub-documents.

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

◆ scanbotsdk_generic_document_get_children_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_children_size ( scanbotsdk_generic_document_t * self,
size_t * size )

Returns size of children array.

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

◆ scanbotsdk_generic_document_get_confidence()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_confidence ( scanbotsdk_generic_document_t * self,
double * confidence )

Returns value of confidence field of the given object.

The average confidence in the accuracy of the document recognition result.

Default is 0

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

◆ scanbotsdk_generic_document_get_confidence_weight()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_confidence_weight ( scanbotsdk_generic_document_t * self,
double * confidence_weight )

Returns value of confidence_weight field of the given object.

The weight of the confidence. Can be used to calculate the weighted average confidence of two documents.

Default is 0

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

◆ scanbotsdk_generic_document_get_crop()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_crop ( scanbotsdk_generic_document_t * self,
scanbotsdk_image_t ** crop )

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

Image crop of the document.

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

◆ scanbotsdk_generic_document_get_fields()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_fields ( scanbotsdk_generic_document_t * self,
scanbotsdk_field_t ** fields,
size_t size )

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

List of document fields.

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

◆ scanbotsdk_generic_document_get_fields_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_fields_size ( scanbotsdk_generic_document_t * self,
size_t * size )

Returns size of fields array.

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

◆ scanbotsdk_generic_document_get_quad()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_quad ( scanbotsdk_generic_document_t * self,
scanbotsdk_pointf_t ** quad )

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

Coordinates of the document in the parent document coordinate system.

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

◆ scanbotsdk_generic_document_get_quad_in_root()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_quad_in_root ( scanbotsdk_generic_document_t * self,
scanbotsdk_pointf_t ** quad_in_root )

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

Coordinates of the document in the root document coordinate system.

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

◆ scanbotsdk_generic_document_get_quad_in_root_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_quad_in_root_size ( scanbotsdk_generic_document_t * self,
size_t * size )

Returns size of quad_in_root array.

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

◆ scanbotsdk_generic_document_get_quad_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_quad_size ( scanbotsdk_generic_document_t * self,
size_t * size )

Returns size of quad array.

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

◆ scanbotsdk_generic_document_get_type()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_get_type ( scanbotsdk_generic_document_t * self,
scanbotsdk_generic_document_type_t ** type )

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

Document type.

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

◆ scanbotsdk_generic_document_type_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_type_create ( const char * name,
const char * full_name,
const char * normalized_name,
int * list_index,
scanbotsdk_generic_document_type_t ** result )

Creates a new instance of scanbotsdk_generic_document_type 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
nameLocal document type name. The value must not be null.
full_nameUnique global document type name prefixed with the document types of all containing documents. The value must not be null.
normalized_nameNormalized global document type name. Common document types appearing as child documents in different places will often have the same normalized type name. The value must not be null.
list_indexA document can contain multiple fields of the same name, the property serves for storing natural order of such fields, null if multiple entries aren't allowed for this field. The value can be null.
resultPointer to a variable that will store the created instance of scanbotsdk_generic_document_type_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_generic_document_type_create_with_defaults()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_type_create_with_defaults ( const char * name,
const char * full_name,
const char * normalized_name,
scanbotsdk_generic_document_type_t ** result )

Creates a new instance of scanbotsdk_generic_document_type_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
nameLocal document type name. The value must not be null.
full_nameUnique global document type name prefixed with the document types of all containing documents. The value must not be null.
normalized_nameNormalized global document type name. Common document types appearing as child documents in different places will often have the same normalized type name. The value must not be null.
resultPointer to a variable that will store the created instance of scanbotsdk_generic_document_type_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_generic_document_type_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_type_free ( scanbotsdk_generic_document_type_t * object)

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

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

◆ scanbotsdk_generic_document_type_get_full_name()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_type_get_full_name ( scanbotsdk_generic_document_type_t * self,
const char ** full_name )

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

Unique global document type name prefixed with the document types of all containing documents.

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

◆ scanbotsdk_generic_document_type_get_list_index()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_type_get_list_index ( scanbotsdk_generic_document_type_t * self,
int ** list_index )

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

A document can contain multiple fields of the same name, the property serves for storing natural order of such fields, null if multiple entries aren't allowed for this field.

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

◆ scanbotsdk_generic_document_type_get_name()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_type_get_name ( scanbotsdk_generic_document_type_t * self,
const char ** name )

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

Local document type name.

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

◆ scanbotsdk_generic_document_type_get_normalized_name()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_generic_document_type_get_normalized_name ( scanbotsdk_generic_document_type_t * self,
const char ** normalized_name )

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

Normalized global document type name. Common document types appearing as child documents in different places will often have the same normalized type name.

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

◆ scanbotsdk_ocr_result_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_result_create ( const char * text,
double confidence,
scanbotsdk_ocr_result_t ** result )

Creates a new instance of scanbotsdk_ocr_result 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
textMaximum number of accumulated frames to inspect before actual result is returned. The value must not be null.
confidenceMinimum number of accumulated frames that have equal result.
resultPointer to a variable that will store the created instance of scanbotsdk_ocr_result_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_result_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_result_free ( scanbotsdk_ocr_result_t * object)

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

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

◆ scanbotsdk_ocr_result_get_confidence()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_result_get_confidence ( scanbotsdk_ocr_result_t * self,
double * confidence )

Returns value of confidence field of the given object.

Minimum number of accumulated frames that have equal result.

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

◆ scanbotsdk_ocr_result_get_text()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_result_get_text ( scanbotsdk_ocr_result_t * self,
const char ** text )

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

Maximum number of accumulated frames to inspect before actual result is returned.

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