BlinkID C SDK version 5.16.0
|
MBRecognizerImage data structure. Holds image on which recognition will bw performed. More...
#include <RecognizerImage.h>
Public Member Functions | |
MB_API MBRecognizerErrorStatus MB_CALL | recognizerImageCreateFromRawImage (MBRecognizerImage **image, MBByte const *input, uint16_t width, uint16_t height, uint16_t bytesPerRow, MBRawImageType rawType) |
Allocates and creates MBRecognizerImage object from raw image. NOTE: This function will not make copy of the given buffer, so make sure that buffer stays alive and unchanged while this MBRecognizerImage is in use. More... | |
MB_API MBRecognizerErrorStatus MB_CALL | recognizerImageLoadFromFile (MBRecognizerImage **image, char const *path) |
Allocates and creates MBRecognizerImage object from given file. NOTE: Only JPG and PNG file types are supported. All other file types will fail to load. If you need to load a different file type, please load it manually and then create MBRecognizerImage using recognizerImageCreateFromRawImage. More... | |
MB_API MBRecognizerErrorStatus MB_CALL | recognizerImageSetNewRawBuffer (MBRecognizerImage *image, MBByte const *input, uint16_t width, uint16_t height, uint16_t bytesPerRow, MBRawImageType rawType) |
Sets a new buffer to the given MBRecognizerImage. NOTE: This function will not make copy of the given buffer, so make sure that buffer stays alive and unchanged while this MBRecognizerImage is in use. More... | |
MB_API MBRecognizerErrorStatus MB_CALL | recognizerImageCreateCopyFromImage (MBRecognizerImage **image, MBRecognizerImage const *original) |
Allocates and creates MBRecognizerImage by copying another MBRecognizerImage. This method will copy pixel data, so it may be slow. More... | |
MB_API MBRecognizerErrorStatus MB_CALL | recognizerImageDelete (MBRecognizerImage **image) |
Deletes the image object and sets pointer to NULL. More... | |
MB_API MBRecognizerErrorStatus MB_CALL | recognizerImageSetImageOrientation (MBRecognizerImage *image, MBImageOrientation orientation) |
Sets the orientation of the image. When created, each image has default orientation IMAGE_ORIENTATION_LANDSCAPE_RIGHT, which corresponds to 'natural' orientation of all images. However, if image was taken in different orientation, you should set correct orientation with this method to ensure best recognition quality. More... | |
MB_API MBImageOrientation MB_CALL | recognizerImageGetImageOrientation (MBRecognizerImage const *image) |
Gets the orientation of the image. More... | |
MB_API MBByte const *MB_CALL | recognizerImageGetRawBytes (MBRecognizerImage const *image) |
Gets buffer containing raw image bytes. More... | |
MB_API MBByte *MB_CALL | recognizerImageGetMutableRawBytes (MBRecognizerImage *image) |
Gets modifiable buffer containing raw image bytes. More... | |
MB_API uint16_t MB_CALL | recognizerImageGetWidth (MBRecognizerImage const *image) |
Gets width of image in number of pixels. More... | |
MB_API uint16_t MB_CALL | recognizerImageGetHeight (MBRecognizerImage const *image) |
Gets height of image in number of pixels. More... | |
MB_API uint16_t MB_CALL | recognizerImageGetBytesPerRow (MBRecognizerImage const *image) |
Gets bytes per row for given image. More... | |
MB_API MBRawImageType MB_CALL | recognizerImageGetRawImageType (MBRecognizerImage const *image) |
Gets raw image type for given image. More... | |
MBRecognizerImage data structure. Holds image on which recognition will bw performed.
MB_API MBRecognizerErrorStatus MB_CALL recognizerImageCreateCopyFromImage | ( | MBRecognizerImage ** | image, |
MBRecognizerImage const * | original | ||
) |
Allocates and creates MBRecognizerImage by copying another MBRecognizerImage. This method will copy pixel data, so it may be slow.
image | Pointer to pointer referencing the created MBRecognizerImage object, set to NULL if error occured. |
original | Pointer to original MBRecognizerImage object that should be copied. |
MB_API MBRecognizerErrorStatus MB_CALL recognizerImageCreateFromRawImage | ( | MBRecognizerImage ** | image, |
MBByte const * | input, | ||
uint16_t | width, | ||
uint16_t | height, | ||
uint16_t | bytesPerRow, | ||
MBRawImageType | rawType | ||
) |
Allocates and creates MBRecognizerImage object from raw image. NOTE: This function will not make copy of the given buffer, so make sure that buffer stays alive and unchanged while this MBRecognizerImage is in use.
Example:
Raw image type is the type without any encoding. List of supported raw image types is given in enum MBRawImageType.
image | Pointer to pointer referencing the created MBRecognizerImage object, set to NULL if error occured. |
input | Pointer to a buffer with raw image pixels. |
width | Width of the image, in pixels |
height | Height of the image, in pixels |
bytesPerRow | Number of bytes contained in every row of the image |
rawType | Type of the image. |
MB_API MBRecognizerErrorStatus MB_CALL recognizerImageDelete | ( | MBRecognizerImage ** | image | ) |
Deletes the image object and sets pointer to NULL.
image | Double pointer to image object which is to be deleted. |
MB_API uint16_t MB_CALL recognizerImageGetBytesPerRow | ( | MBRecognizerImage const * | image | ) |
Gets bytes per row for given image.
image | Pointer to MBRecognizerImage object of interest. |
MB_API uint16_t MB_CALL recognizerImageGetHeight | ( | MBRecognizerImage const * | image | ) |
Gets height of image in number of pixels.
image | Pointer to MBRecognizerImage object of interest. |
MB_API MBImageOrientation MB_CALL recognizerImageGetImageOrientation | ( | MBRecognizerImage const * | image | ) |
Gets the orientation of the image.
image | Image from which orientation will be obtained. |
MB_API MBByte *MB_CALL recognizerImageGetMutableRawBytes | ( | MBRecognizerImage * | image | ) |
Gets modifiable buffer containing raw image bytes.
image | Pointer to MBRecognizerImage object of interest. |
MB_API MBByte const *MB_CALL recognizerImageGetRawBytes | ( | MBRecognizerImage const * | image | ) |
Gets buffer containing raw image bytes.
image | Pointer to MBRecognizerImage object of interest. |
MB_API MBRawImageType MB_CALL recognizerImageGetRawImageType | ( | MBRecognizerImage const * | image | ) |
Gets raw image type for given image.
image | Pointer to MBRecognizerImage object of interest. |
MB_API uint16_t MB_CALL recognizerImageGetWidth | ( | MBRecognizerImage const * | image | ) |
Gets width of image in number of pixels.
image | Pointer to MBRecognizerImage object of interest. |
MB_API MBRecognizerErrorStatus MB_CALL recognizerImageLoadFromFile | ( | MBRecognizerImage ** | image, |
char const * | path | ||
) |
Allocates and creates MBRecognizerImage object from given file. NOTE: Only JPG and PNG file types are supported. All other file types will fail to load. If you need to load a different file type, please load it manually and then create MBRecognizerImage using recognizerImageCreateFromRawImage.
Example:
Image metadata, such as orientation, will not be read from the image. Instead, the loaded image will always have the default orientation MB_IMAGE_ORIENTATION_NO_ROTATION.
image | Pointer to pointer referencing the created MBRecognizerImage object, set to NULL if error occured. |
path | Path to file to be loaded. |
MB_API MBRecognizerErrorStatus MB_CALL recognizerImageSetImageOrientation | ( | MBRecognizerImage * | image, |
MBImageOrientation | orientation | ||
) |
Sets the orientation of the image. When created, each image has default orientation IMAGE_ORIENTATION_LANDSCAPE_RIGHT, which corresponds to 'natural' orientation of all images. However, if image was taken in different orientation, you should set correct orientation with this method to ensure best recognition quality.
image | Image to which orientation will be set. |
orientation | Orientation that will be set. |
MB_API MBRecognizerErrorStatus MB_CALL recognizerImageSetNewRawBuffer | ( | MBRecognizerImage * | image, |
MBByte const * | input, | ||
uint16_t | width, | ||
uint16_t | height, | ||
uint16_t | bytesPerRow, | ||
MBRawImageType | rawType | ||
) |
Sets a new buffer to the given MBRecognizerImage. NOTE: This function will not make copy of the given buffer, so make sure that buffer stays alive and unchanged while this MBRecognizerImage is in use.
Example:
Raw image type is the type without any encoding. List of supported raw image types is given in enum MBRawImageType.
image | Pointer referencing the created MBRecognizerImage object, must be non-NULL. |
input | Pointer to a buffer with raw image pixels. |
width | Width of the image, in pixels |
height | Height of the image, in pixels |
bytesPerRow | Number of bytes contained in every row of the image |
rawType | Type of the image. |