|
Scanbot SDK
|
| typedef struct scanbotsdk_document_classifier_configuration_t scanbotsdk_document_classifier_configuration_t |
scanbotsdk_document_classifier_configuration_t class
Configuration for the document classifier.
scanbotsdk_document_classifier_result_t class
Contains the result of running the document classifier.
scanbotsdk_document_classifier_status_t enum
The status of the classification result.
| typedef struct scanbotsdk_document_classifier_t scanbotsdk_document_classifier_t |
scanbotsdk_document_classifier_t class
API for document classification.
Required licence feature(s): DocumentClassification.
| typedef enum scanbotsdk_document_type_t scanbotsdk_document_type_t |
scanbotsdk_document_type_t enum
The type of the document.
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 enum
The type of the document.
| 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.
| crop | If true, image will be scanned for a valid document first. |
Default is true
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_classifier_configuration_t |
| 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.
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_classifier_configuration_t |
| 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.
| object | Pointer to the instance of scanbotsdk_document_classifier_configuration_t to be freed |
| 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
| self | Pointer to the instance of scanbotsdk_document_classifier_configuration_t |
| crop | Pointer to a variable that will store the value of the field. |
| 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.
| configuration | The configuration to use for the classifier. The value must not be null. |
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_classifier_t |
| 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.
| self | Pointer to the instance of scanbotsdk_document_classifier_t to be freed |
| 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.
| object | Pointer to the instance of scanbotsdk_document_classifier_result_t to be freed |
| 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.
| self | Pointer to the instance of scanbotsdk_document_classifier_result_t |
| confidence | Pointer to a variable that will store the value of the field. |
| 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.
| self | Pointer to the instance of scanbotsdk_document_classifier_result_t |
| document_scanning_result | Pointer to a variable that will store the value of the field. |
| 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.
| self | Pointer to the instance of scanbotsdk_document_classifier_result_t |
| document_type | Pointer to a variable that will store the value of the field. |
| 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.
| self | Pointer to the instance of scanbotsdk_document_classifier_result_t |
| status | Pointer to a variable that will store the value of the field. |
| 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.
| self | Pointer to the instance of scanbotsdk_document_classifier_t method to be called on |
| image | The image to classify. The value must not be null. |
| result | Pointer to a variable that will store the created instance of scanbotsdk_document_classifier_t |
| 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.
| value | The value to be converted to string. |
| result | Pointer to a variable that will store the string representation of the value. |
| SBSDK_API scanbotsdk_error_code_t scanbotsdk_document_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.
| value | The value to be converted to string. |
| result | Pointer to a variable that will store the string representation of the value. |