Scanbot SDK
Loading...
Searching...
No Matches
Scanbot C SDK Ocr

Typedefs

typedef struct scanbotsdk_ocr_engine_t scanbotsdk_ocr_engine_t
 scanbotsdk_ocr_engine_t class
 
typedef struct scanbotsdk_ocr_element_t scanbotsdk_ocr_element_t
 scanbotsdk_ocr_element_t class
 
typedef struct scanbotsdk_glyph_t scanbotsdk_glyph_t
 scanbotsdk_glyph_t class
 
typedef struct scanbotsdk_word_t scanbotsdk_word_t
 scanbotsdk_word_t class
 
typedef struct scanbotsdk_line_t scanbotsdk_line_t
 scanbotsdk_line_t class
 
typedef struct scanbotsdk_block_t scanbotsdk_block_t
 scanbotsdk_block_t class
 
typedef struct scanbotsdk_page_t scanbotsdk_page_t
 scanbotsdk_page_t class
 

Functions

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_engine_create (scanbotsdk_ocr_engine_t **result)
 Creates a new instance of scanbotsdk_ocr_engine with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_engine_free (scanbotsdk_ocr_engine_t *self)
 Frees the memory allocated for the instance of scanbotsdk_ocr_engine_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_engine_run (scanbotsdk_ocr_engine_t *self, scanbotsdk_image_t *image, scanbotsdk_page_t **result)
 Recognize text in the given image.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_free (scanbotsdk_ocr_element_t *object)
 Frees the memory allocated for the instance of scanbotsdk_ocr_element_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_get_text (scanbotsdk_ocr_element_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_element_get_confidence (scanbotsdk_ocr_element_t *self, double *confidence)
 Returns value of confidence field of the given object.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_get_roi (scanbotsdk_ocr_element_t *self, scanbotsdk_pointf_t **roi)
 Returns value of roi field of the given object. The returned value is direct view into memory, no pre-allocations needed.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_get_roi_size (scanbotsdk_ocr_element_t *self, size_t *size)
 Returns size of roi array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_glyph_create (const char *text, double confidence, scanbotsdk_pointf_t *roi, size_t roi_size, scanbotsdk_glyph_t **result)
 Creates a new instance of scanbotsdk_glyph with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_glyph_free (scanbotsdk_glyph_t *object)
 Frees the memory allocated for the instance of scanbotsdk_glyph_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_is_scanbotsdk_glyph (scanbotsdk_ocr_element_t *object, bool *result)
 Checks if the given instance of scanbotsdk_ocr_element_t is an instance of its subtype scanbotsdk_glyph_t.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_as_scanbotsdk_glyph (scanbotsdk_ocr_element_t *object, scanbotsdk_glyph_t **result)
 Casts the given instance of scanbotsdk_ocr_element_t to its subtype scanbotsdk_glyph_t. If the given instance is not an instance of the subtype, result will be null.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_glyph_as_scanbotsdk_ocr_element (scanbotsdk_glyph_t *object, scanbotsdk_ocr_element_t **result)
 Casts the given instance of scanbotsdk_glyph_t to its parent type scanbotsdk_ocr_element_t.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_word_create (const char *text, double confidence, scanbotsdk_pointf_t *roi, size_t roi_size, scanbotsdk_glyph_t **glyphs, size_t glyphs_size, scanbotsdk_word_t **result)
 Creates a new instance of scanbotsdk_word with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_word_free (scanbotsdk_word_t *object)
 Frees the memory allocated for the instance of scanbotsdk_word_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_is_scanbotsdk_word (scanbotsdk_ocr_element_t *object, bool *result)
 Checks if the given instance of scanbotsdk_ocr_element_t is an instance of its subtype scanbotsdk_word_t.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_as_scanbotsdk_word (scanbotsdk_ocr_element_t *object, scanbotsdk_word_t **result)
 Casts the given instance of scanbotsdk_ocr_element_t to its subtype scanbotsdk_word_t. If the given instance is not an instance of the subtype, result will be null.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_word_as_scanbotsdk_ocr_element (scanbotsdk_word_t *object, scanbotsdk_ocr_element_t **result)
 Casts the given instance of scanbotsdk_word_t to its parent type scanbotsdk_ocr_element_t.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_word_get_glyphs (scanbotsdk_word_t *self, scanbotsdk_glyph_t **glyphs, size_t size)
 Returns value of glyphs 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_word_get_glyphs_size (scanbotsdk_word_t *self, size_t *size)
 Returns size of glyphs array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_line_create (const char *text, double confidence, scanbotsdk_pointf_t *roi, size_t roi_size, scanbotsdk_word_t **words, size_t words_size, scanbotsdk_line_t **result)
 Creates a new instance of scanbotsdk_line with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_line_free (scanbotsdk_line_t *object)
 Frees the memory allocated for the instance of scanbotsdk_line_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_is_scanbotsdk_line (scanbotsdk_ocr_element_t *object, bool *result)
 Checks if the given instance of scanbotsdk_ocr_element_t is an instance of its subtype scanbotsdk_line_t.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_as_scanbotsdk_line (scanbotsdk_ocr_element_t *object, scanbotsdk_line_t **result)
 Casts the given instance of scanbotsdk_ocr_element_t to its subtype scanbotsdk_line_t. If the given instance is not an instance of the subtype, result will be null.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_line_as_scanbotsdk_ocr_element (scanbotsdk_line_t *object, scanbotsdk_ocr_element_t **result)
 Casts the given instance of scanbotsdk_line_t to its parent type scanbotsdk_ocr_element_t.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_line_get_words (scanbotsdk_line_t *self, scanbotsdk_word_t **words, size_t size)
 Returns value of words 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_line_get_words_size (scanbotsdk_line_t *self, size_t *size)
 Returns size of words array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_block_create (const char *text, double confidence, scanbotsdk_pointf_t *roi, size_t roi_size, scanbotsdk_line_t **lines, size_t lines_size, scanbotsdk_block_t **result)
 Creates a new instance of scanbotsdk_block with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_block_free (scanbotsdk_block_t *object)
 Frees the memory allocated for the instance of scanbotsdk_block_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_is_scanbotsdk_block (scanbotsdk_ocr_element_t *object, bool *result)
 Checks if the given instance of scanbotsdk_ocr_element_t is an instance of its subtype scanbotsdk_block_t.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_as_scanbotsdk_block (scanbotsdk_ocr_element_t *object, scanbotsdk_block_t **result)
 Casts the given instance of scanbotsdk_ocr_element_t to its subtype scanbotsdk_block_t. If the given instance is not an instance of the subtype, result will be null.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_block_as_scanbotsdk_ocr_element (scanbotsdk_block_t *object, scanbotsdk_ocr_element_t **result)
 Casts the given instance of scanbotsdk_block_t to its parent type scanbotsdk_ocr_element_t.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_block_get_lines (scanbotsdk_block_t *self, scanbotsdk_line_t **lines, size_t size)
 Returns value of lines field of the given object. The returned pointers do NOT own the underlying object, caller must not free them.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_block_get_lines_size (scanbotsdk_block_t *self, size_t *size)
 Returns size of lines array.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_create (const char *text, double confidence, scanbotsdk_pointf_t *roi, size_t roi_size, scanbotsdk_block_t **blocks, size_t blocks_size, scanbotsdk_page_t **result)
 Creates a new instance of scanbotsdk_page with given params and stores it in the location specified by the last argument.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_free (scanbotsdk_page_t *object)
 Frees the memory allocated for the instance of scanbotsdk_page_t. If null is passed, the function does nothing.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_is_scanbotsdk_page (scanbotsdk_ocr_element_t *object, bool *result)
 Checks if the given instance of scanbotsdk_ocr_element_t is an instance of its subtype scanbotsdk_page_t.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_as_scanbotsdk_page (scanbotsdk_ocr_element_t *object, scanbotsdk_page_t **result)
 Casts the given instance of scanbotsdk_ocr_element_t to its subtype scanbotsdk_page_t. If the given instance is not an instance of the subtype, result will be null.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_as_scanbotsdk_ocr_element (scanbotsdk_page_t *object, scanbotsdk_ocr_element_t **result)
 Casts the given instance of scanbotsdk_page_t to its parent type scanbotsdk_ocr_element_t.
 
SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_get_blocks (scanbotsdk_page_t *self, scanbotsdk_block_t **blocks, size_t size)
 Returns value of blocks 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_page_get_blocks_size (scanbotsdk_page_t *self, size_t *size)
 Returns size of blocks array.
 

Detailed Description

Typedef Documentation

◆ scanbotsdk_block_t

scanbotsdk_block_t class

Represents a single block, e.g. a paragraph. A block is made up of lines.

◆ scanbotsdk_glyph_t

scanbotsdk_glyph_t class

Represents a single glyph, i.e. a character.

◆ scanbotsdk_line_t

scanbotsdk_line_t class

Represents a single line. A line is made up of words.

◆ scanbotsdk_ocr_element_t

scanbotsdk_ocr_element_t class

Base class for units of text, e.g. glyphs, words, lines, blocks, pages.

◆ scanbotsdk_ocr_engine_t

scanbotsdk_ocr_engine_t class

API for optical character recognition.

Required licence feature(s): Ocr.

◆ scanbotsdk_page_t

scanbotsdk_page_t class

Represents result of performing OCR on an image. A page is made up of blocks.

◆ scanbotsdk_word_t

scanbotsdk_word_t class

Represents a single word. A word is made up of glyphs.

Function Documentation

◆ scanbotsdk_block_as_scanbotsdk_ocr_element()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_block_as_scanbotsdk_ocr_element ( scanbotsdk_block_t * object,
scanbotsdk_ocr_element_t ** result )

Casts the given instance of scanbotsdk_block_t to its parent type scanbotsdk_ocr_element_t.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be casted
resultPointer to a variable that will store the casted instance of scanbotsdk_block_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_block_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_block_create ( const char * text,
double confidence,
scanbotsdk_pointf_t * roi,
size_t roi_size,
scanbotsdk_line_t ** lines,
size_t lines_size,
scanbotsdk_block_t ** result )

Creates a new instance of scanbotsdk_block 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
textThe recognized text. The value must not be null.
confidenceText confidence. Range is [0-1].
roiQuad where the text was found in image coordinates. The order of the points is clockwise starting from the top left.
roi_sizeSize of the array roi
linesList of lines. Entries of the array must not be null.
lines_sizeSize of the array lines
resultPointer to a variable that will store the created instance of scanbotsdk_block_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_block_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_block_free ( scanbotsdk_block_t * object)

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

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

◆ scanbotsdk_block_get_lines()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_block_get_lines ( scanbotsdk_block_t * self,
scanbotsdk_line_t ** lines,
size_t size )

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

List of lines.

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

◆ scanbotsdk_block_get_lines_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_block_get_lines_size ( scanbotsdk_block_t * self,
size_t * size )

Returns size of lines array.

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

◆ scanbotsdk_glyph_as_scanbotsdk_ocr_element()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_glyph_as_scanbotsdk_ocr_element ( scanbotsdk_glyph_t * object,
scanbotsdk_ocr_element_t ** result )

Casts the given instance of scanbotsdk_glyph_t to its parent type scanbotsdk_ocr_element_t.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be casted
resultPointer to a variable that will store the casted instance of scanbotsdk_glyph_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_glyph_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_glyph_create ( const char * text,
double confidence,
scanbotsdk_pointf_t * roi,
size_t roi_size,
scanbotsdk_glyph_t ** result )

Creates a new instance of scanbotsdk_glyph 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
textThe recognized text. The value must not be null.
confidenceText confidence. Range is [0-1].
roiQuad where the text was found in image coordinates. The order of the points is clockwise starting from the top left.
roi_sizeSize of the array roi
resultPointer to a variable that will store the created instance of scanbotsdk_glyph_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_glyph_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_glyph_free ( scanbotsdk_glyph_t * object)

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

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

◆ scanbotsdk_line_as_scanbotsdk_ocr_element()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_line_as_scanbotsdk_ocr_element ( scanbotsdk_line_t * object,
scanbotsdk_ocr_element_t ** result )

Casts the given instance of scanbotsdk_line_t to its parent type scanbotsdk_ocr_element_t.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be casted
resultPointer to a variable that will store the casted instance of scanbotsdk_line_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_line_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_line_create ( const char * text,
double confidence,
scanbotsdk_pointf_t * roi,
size_t roi_size,
scanbotsdk_word_t ** words,
size_t words_size,
scanbotsdk_line_t ** result )

Creates a new instance of scanbotsdk_line 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
textThe recognized text. The value must not be null.
confidenceText confidence. Range is [0-1].
roiQuad where the text was found in image coordinates. The order of the points is clockwise starting from the top left.
roi_sizeSize of the array roi
wordsList of words. Entries of the array must not be null.
words_sizeSize of the array words
resultPointer to a variable that will store the created instance of scanbotsdk_line_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_line_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_line_free ( scanbotsdk_line_t * object)

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

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

◆ scanbotsdk_line_get_words()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_line_get_words ( scanbotsdk_line_t * self,
scanbotsdk_word_t ** words,
size_t size )

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

List of words.

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

◆ scanbotsdk_line_get_words_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_line_get_words_size ( scanbotsdk_line_t * self,
size_t * size )

Returns size of words array.

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

◆ scanbotsdk_ocr_element_as_scanbotsdk_block()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_as_scanbotsdk_block ( scanbotsdk_ocr_element_t * object,
scanbotsdk_block_t ** result )

Casts the given instance of scanbotsdk_ocr_element_t to its subtype scanbotsdk_block_t. If the given instance is not an instance of the subtype, result will be null.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be casted
resultPointer to a variable that will store the casted instance of scanbotsdk_block_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_element_as_scanbotsdk_glyph()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_as_scanbotsdk_glyph ( scanbotsdk_ocr_element_t * object,
scanbotsdk_glyph_t ** result )

Casts the given instance of scanbotsdk_ocr_element_t to its subtype scanbotsdk_glyph_t. If the given instance is not an instance of the subtype, result will be null.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be casted
resultPointer to a variable that will store the casted instance of scanbotsdk_glyph_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_element_as_scanbotsdk_line()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_as_scanbotsdk_line ( scanbotsdk_ocr_element_t * object,
scanbotsdk_line_t ** result )

Casts the given instance of scanbotsdk_ocr_element_t to its subtype scanbotsdk_line_t. If the given instance is not an instance of the subtype, result will be null.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be casted
resultPointer to a variable that will store the casted instance of scanbotsdk_line_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_element_as_scanbotsdk_page()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_as_scanbotsdk_page ( scanbotsdk_ocr_element_t * object,
scanbotsdk_page_t ** result )

Casts the given instance of scanbotsdk_ocr_element_t to its subtype scanbotsdk_page_t. If the given instance is not an instance of the subtype, result will be null.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be casted
resultPointer to a variable that will store the casted instance of scanbotsdk_page_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_element_as_scanbotsdk_word()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_as_scanbotsdk_word ( scanbotsdk_ocr_element_t * object,
scanbotsdk_word_t ** result )

Casts the given instance of scanbotsdk_ocr_element_t to its subtype scanbotsdk_word_t. If the given instance is not an instance of the subtype, result will be null.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be casted
resultPointer to a variable that will store the casted instance of scanbotsdk_word_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_element_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_free ( scanbotsdk_ocr_element_t * object)

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

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

◆ scanbotsdk_ocr_element_get_confidence()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_get_confidence ( scanbotsdk_ocr_element_t * self,
double * confidence )

Returns value of confidence field of the given object.

Text confidence. Range is [0-1].

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

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_get_roi ( scanbotsdk_ocr_element_t * self,
scanbotsdk_pointf_t ** roi )

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

Quad where the text was found in image coordinates. The order of the points is clockwise starting from the top left.

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

◆ scanbotsdk_ocr_element_get_roi_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_get_roi_size ( scanbotsdk_ocr_element_t * self,
size_t * size )

Returns size of roi array.

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

◆ scanbotsdk_ocr_element_get_text()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_get_text ( scanbotsdk_ocr_element_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.

The recognized text.

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

◆ scanbotsdk_ocr_element_is_scanbotsdk_block()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_is_scanbotsdk_block ( scanbotsdk_ocr_element_t * object,
bool * result )

Checks if the given instance of scanbotsdk_ocr_element_t is an instance of its subtype scanbotsdk_block_t.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be checked
resultPointer to a variable that will store the result of the check
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_element_is_scanbotsdk_glyph()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_is_scanbotsdk_glyph ( scanbotsdk_ocr_element_t * object,
bool * result )

Checks if the given instance of scanbotsdk_ocr_element_t is an instance of its subtype scanbotsdk_glyph_t.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be checked
resultPointer to a variable that will store the result of the check
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_element_is_scanbotsdk_line()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_is_scanbotsdk_line ( scanbotsdk_ocr_element_t * object,
bool * result )

Checks if the given instance of scanbotsdk_ocr_element_t is an instance of its subtype scanbotsdk_line_t.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be checked
resultPointer to a variable that will store the result of the check
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_element_is_scanbotsdk_page()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_is_scanbotsdk_page ( scanbotsdk_ocr_element_t * object,
bool * result )

Checks if the given instance of scanbotsdk_ocr_element_t is an instance of its subtype scanbotsdk_page_t.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be checked
resultPointer to a variable that will store the result of the check
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_element_is_scanbotsdk_word()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_element_is_scanbotsdk_word ( scanbotsdk_ocr_element_t * object,
bool * result )

Checks if the given instance of scanbotsdk_ocr_element_t is an instance of its subtype scanbotsdk_word_t.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be checked
resultPointer to a variable that will store the result of the check
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_engine_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_engine_create ( scanbotsdk_ocr_engine_t ** result)

Creates a new instance of scanbotsdk_ocr_engine 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
resultPointer to a variable that will store the created instance of scanbotsdk_ocr_engine_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_ocr_engine_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_engine_free ( scanbotsdk_ocr_engine_t * self)

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

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

◆ scanbotsdk_ocr_engine_run()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_ocr_engine_run ( scanbotsdk_ocr_engine_t * self,
scanbotsdk_image_t * image,
scanbotsdk_page_t ** result )

Recognize text 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_ocr_engine_t method to be called on
imageThe image to recognize text in. The value must not be null.
resultPointer to a variable that will store the created instance of scanbotsdk_ocr_engine_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_page_as_scanbotsdk_ocr_element()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_as_scanbotsdk_ocr_element ( scanbotsdk_page_t * object,
scanbotsdk_ocr_element_t ** result )

Casts the given instance of scanbotsdk_page_t to its parent type scanbotsdk_ocr_element_t.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be casted
resultPointer to a variable that will store the casted instance of scanbotsdk_page_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_page_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_create ( const char * text,
double confidence,
scanbotsdk_pointf_t * roi,
size_t roi_size,
scanbotsdk_block_t ** blocks,
size_t blocks_size,
scanbotsdk_page_t ** result )

Creates a new instance of scanbotsdk_page 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
textThe recognized text. The value must not be null.
confidenceText confidence. Range is [0-1].
roiQuad where the text was found in image coordinates. The order of the points is clockwise starting from the top left.
roi_sizeSize of the array roi
blocksList of blocks. Entries of the array must not be null.
blocks_sizeSize of the array blocks
resultPointer to a variable that will store the created instance of scanbotsdk_page_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_page_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_free ( scanbotsdk_page_t * object)

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

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

◆ scanbotsdk_page_get_blocks()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_get_blocks ( scanbotsdk_page_t * self,
scanbotsdk_block_t ** blocks,
size_t size )

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

List of blocks.

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

◆ scanbotsdk_page_get_blocks_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_page_get_blocks_size ( scanbotsdk_page_t * self,
size_t * size )

Returns size of blocks array.

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

◆ scanbotsdk_word_as_scanbotsdk_ocr_element()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_word_as_scanbotsdk_ocr_element ( scanbotsdk_word_t * object,
scanbotsdk_ocr_element_t ** result )

Casts the given instance of scanbotsdk_word_t to its parent type scanbotsdk_ocr_element_t.

Parameters
objectPointer to the instance of scanbotsdk_ocr_element_t to be casted
resultPointer to a variable that will store the casted instance of scanbotsdk_word_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_word_create()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_word_create ( const char * text,
double confidence,
scanbotsdk_pointf_t * roi,
size_t roi_size,
scanbotsdk_glyph_t ** glyphs,
size_t glyphs_size,
scanbotsdk_word_t ** result )

Creates a new instance of scanbotsdk_word 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
textThe recognized text. The value must not be null.
confidenceText confidence. Range is [0-1].
roiQuad where the text was found in image coordinates. The order of the points is clockwise starting from the top left.
roi_sizeSize of the array roi
glyphsList of glyphs. Entries of the array must not be null.
glyphs_sizeSize of the array glyphs
resultPointer to a variable that will store the created instance of scanbotsdk_word_t
Returns
: Error code, SCANBOTSDK_OK if no errors were encountered

◆ scanbotsdk_word_free()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_word_free ( scanbotsdk_word_t * object)

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

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

◆ scanbotsdk_word_get_glyphs()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_word_get_glyphs ( scanbotsdk_word_t * self,
scanbotsdk_glyph_t ** glyphs,
size_t size )

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

List of glyphs.

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

◆ scanbotsdk_word_get_glyphs_size()

SBSDK_API scanbotsdk_error_code_t scanbotsdk_word_get_glyphs_size ( scanbotsdk_word_t * self,
size_t * size )

Returns size of glyphs array.

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