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

Typedefs

typedef struct scanbotsdk_document_classifier_t scanbotsdk_document_classifier_t
 scanbotsdk_document_classifier_t class
 
typedef struct scanbotsdk_document_classifier_configuration_t scanbotsdk_document_classifier_configuration_t
 scanbotsdk_document_classifier_configuration_t class
 
typedef enum scanbotsdk_document_classifier_status_t scanbotsdk_document_classifier_status_t
 scanbotsdk_document_classifier_status_t enum
 
typedef enum scanbotsdk_document_type_t scanbotsdk_document_type_t
 scanbotsdk_document_type_t enum
 
typedef struct scanbotsdk_document_classifier_result_t scanbotsdk_document_classifier_result_t
 scanbotsdk_document_classifier_result_t class
 

Enumerations

enum  scanbotsdk_document_classifier_status_t {
  SCANBOTSDK_DOCUMENT_CLASSIFIER_STATUS_SUCCESS = 0 ,
  SCANBOTSDK_DOCUMENT_CLASSIFIER_STATUS_FAILURE_SCANNING = 1
}
 scanbotsdk_document_classifier_status_t enum More...
 
enum  scanbotsdk_document_type_t {
  SCANBOTSDK_DOCUMENT_TYPE_UNKNOWN = 0 ,
  SCANBOTSDK_DOCUMENT_TYPE_BILL_OF_LADING = 1 ,
  SCANBOTSDK_DOCUMENT_TYPE_PAY_SHEET = 2 ,
  SCANBOTSDK_DOCUMENT_TYPE_SCALE_TICKET = 3 ,
  SCANBOTSDK_DOCUMENT_TYPE_TOLL_RECEIPT = 4 ,
  SCANBOTSDK_DOCUMENT_TYPE_WASH_RECEIPT = 5
}
 scanbotsdk_document_type_t enum More...
 

Functions

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_create (scanbotsdk_document_classifier_configuration_t *configuration, scanbotsdk_document_classifier_t **result)
 Creates a new instance of scanbotsdk_document_classifier with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_free (scanbotsdk_document_classifier_t *self)
 Frees the memory allocated for the instance of scanbotsdk_document_classifier_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_run (scanbotsdk_document_classifier_t *self, scanbotsdk_image_t *image, scanbotsdk_document_classifier_result_t **result)
 Classify the document in the given image.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_configuration_create (bool crop, scanbotsdk_document_classifier_configuration_t **result)
 Creates a new instance of scanbotsdk_document_classifier_configuration with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_configuration_create_with_defaults (scanbotsdk_document_classifier_configuration_t **result)
 Creates a new instance of scanbotsdk_document_classifier_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_classifier_configuration_free (scanbotsdk_document_classifier_configuration_t *object)
 Frees the memory allocated for the instance of scanbotsdk_document_classifier_configuration_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_configuration_get_crop (scanbotsdk_document_classifier_configuration_t *self, bool *crop)
 Returns value of crop field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_status_t_to_string (scanbotsdk_document_classifier_status_t value, const char **result)
 Returns the string representation of the given scanbotsdk_document_classifier_status_t value.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_type_t_to_string (scanbotsdk_document_type_t value, const char **result)
 Returns the string representation of the given scanbotsdk_document_type_t value.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_result_free (scanbotsdk_document_classifier_result_t *object)
 Frees the memory allocated for the instance of scanbotsdk_document_classifier_result_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_result_get_document_type (scanbotsdk_document_classifier_result_t *self, scanbotsdk_document_type_t *document_type)
 Returns value of document_type field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_result_get_confidence (scanbotsdk_document_classifier_result_t *self, double *confidence)
 Returns value of confidence field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_result_get_status (scanbotsdk_document_classifier_result_t *self, scanbotsdk_document_classifier_status_t *status)
 Returns value of status field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_result_get_document_scanning_result (scanbotsdk_document_classifier_result_t *self, scanbotsdk_document_scanning_result_t **document_scanning_result)
 Returns value of document_scanning_result 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_classifier_configuration_t

◆ scanbotsdk_document_classifier_result_t

scanbotsdk_document_classifier_result_t class

Contains the result of running the document classifier.

◆ scanbotsdk_document_classifier_status_t

◆ scanbotsdk_document_classifier_t

scanbotsdk_document_classifier_t class

API for document classification.

Required licence feature(s): DocumentClassification.

◆ scanbotsdk_document_type_t

Enumeration Type Documentation

◆ scanbotsdk_document_classifier_status_t

scanbotsdk_document_classifier_status_t enum

The status of the classification result.

Enumerator
SCANBOTSDK_DOCUMENT_CLASSIFIER_STATUS_SUCCESS 

The document was classified successfully.

SCANBOTSDK_DOCUMENT_CLASSIFIER_STATUS_FAILURE_SCANNING 

No document was detected.

◆ scanbotsdk_document_type_t

scanbotsdk_document_type_t enum

The type of the document.

Enumerator
SCANBOTSDK_DOCUMENT_TYPE_UNKNOWN 

The document type is unknown.

SCANBOTSDK_DOCUMENT_TYPE_BILL_OF_LADING 

Bill of lading.

SCANBOTSDK_DOCUMENT_TYPE_PAY_SHEET 

Pay sheet.

SCANBOTSDK_DOCUMENT_TYPE_SCALE_TICKET 

Scale ticket.

SCANBOTSDK_DOCUMENT_TYPE_TOLL_RECEIPT 

Toll receipt.

SCANBOTSDK_DOCUMENT_TYPE_WASH_RECEIPT 

Wash receipt.

Function Documentation

◆ scanbotsdk_document_classifier_configuration_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_configuration_create ( bool crop,
scanbotsdk_document_classifier_configuration_t ** result )

Creates a new instance of scanbotsdk_document_classifier_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
cropIf true, image will be scanned for a valid document first.

Default is true

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

◆ scanbotsdk_document_classifier_configuration_create_with_defaults()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_configuration_create_with_defaults ( scanbotsdk_document_classifier_configuration_t ** result)

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

◆ scanbotsdk_document_classifier_configuration_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_configuration_free ( scanbotsdk_document_classifier_configuration_t * object)

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

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

◆ scanbotsdk_document_classifier_configuration_get_crop()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_configuration_get_crop ( scanbotsdk_document_classifier_configuration_t * self,
bool * crop )

Returns value of crop field of the given object.

If true, image will be scanned for a valid document first.

Default is true

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

◆ scanbotsdk_document_classifier_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_create ( scanbotsdk_document_classifier_configuration_t * configuration,
scanbotsdk_document_classifier_t ** result )

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

◆ scanbotsdk_document_classifier_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_free ( scanbotsdk_document_classifier_t * self)

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

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

◆ scanbotsdk_document_classifier_result_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_result_free ( scanbotsdk_document_classifier_result_t * object)

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

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

◆ scanbotsdk_document_classifier_result_get_confidence()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_result_get_confidence ( scanbotsdk_document_classifier_result_t * self,
double * confidence )

Returns value of confidence field of the given object.

The confidence of the classification result.

Parameters
selfPointer to the instance of scanbotsdk_document_classifier_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_document_classifier_result_get_document_scanning_result()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_result_get_document_scanning_result ( scanbotsdk_document_classifier_result_t * self,
scanbotsdk_document_scanning_result_t ** document_scanning_result )

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

The result of the document scanning.

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

◆ scanbotsdk_document_classifier_result_get_document_type()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_result_get_document_type ( scanbotsdk_document_classifier_result_t * self,
scanbotsdk_document_type_t * document_type )

Returns value of document_type field of the given object.

The classification result.

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

◆ scanbotsdk_document_classifier_result_get_status()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_result_get_status ( scanbotsdk_document_classifier_result_t * self,
scanbotsdk_document_classifier_status_t * status )

Returns value of status field of the given object.

The status of the classification result.

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

◆ scanbotsdk_document_classifier_run()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_run ( scanbotsdk_document_classifier_t * self,
scanbotsdk_image_t * image,
scanbotsdk_document_classifier_result_t ** result )

Classify the document in the given image.

As a rule if a function argument is a pointer to a scanbotsdk structure (scanbotsdk_..._t*) then the corresponding objects after function execution are left in valid but unspecified state, the caller is still responsible for freeing them. Exceptions are scanbotsdk_image_t*, scanbotdk_random_access_source_t* (if applicable) which are guaranteed to be in the original state.

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

◆ scanbotsdk_document_classifier_status_t_to_string()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_classifier_status_t_to_string ( scanbotsdk_document_classifier_status_t value,
const char ** result )

Returns the string representation of the given scanbotsdk_document_classifier_status_t value.

The returned string doesn't need to be freed.

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

◆ scanbotsdk_document_type_t_to_string()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_type_t_to_string ( scanbotsdk_document_type_t value,
const char ** result )

Returns the string representation of the given scanbotsdk_document_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.