C
Was this helpful?
Was this helpful?
Typedefs
typedefvoid OPENALPR
typedefvoid OPENALPRIMAGEBATCH
Enums
enumAlprCHardwareAcceleration
Values:
enumeratorALPRC_CPU
enumeratorALPRCNVIDIAGPU
Functions
*openalpr_init
(const char *country, const char *configFile, const char *runtimeDir, const char *licenseKey)
Initializes the openALPR library and returns a pointer to the OpenALPR instance
The instance should be reused many times. Eventually you will want to destroy the instance when you are finished recognizing license plates.
see also
ReturnAn OpenALPR instance that can be used with other openalpr functions
*openalprinitgpu
(const char *country, const char *configFile, const char *runtimeDir, const char *licenseKey, acceleration_type, int gpu_id, int batch_size)
Initializes the openALPR library, overriding the openalpr.conf configuration for GPU returns a pointer to the OpenALPR instance
The instance should be reused many times. Eventually you will want to destroy the instance when you are finished recognizing license plates.
ReturnAn OpenALPR instance that can be used with other openalpr functions
Verify that the OpenALPR library loaded correctly and can accept image inputs
ReturnReturns 1 if the library was loaded successfully, 0 otherwise
Update the prewarp setting without reloading the library
Update the detection mask without reloading the library
/deprecated Enables/disables state/province detection. Set this in openalpr.conf
Specify a region to use when applying patterns.
Specify a region to use when applying patterns.
ReturnJSON formatted plate recognition results
ReturnJSON formatted plate recognition results
Creates an object that can be used to send a batch of images to OpenALPR Make sure to free the memory with openalprreleaseimage_batch after you finish with the batch
Return a pointer that can be passed into openalpraddimagetobatch and openalprrecognizebatch
Add an image to an OpenALPR batch object. Image is expected to be raw pixel data (BGR, 3 channels) The number of images should not exceed the configured batch_size property in openalpr.conf
Add an encoded image (e.g., JPEG, PNG, BMP, etc) to the batch
Parameters
bytes
: raw bytes for the encoded image
length
: length of the data
roi
: region of interest to look for license plates
ReturnJSON formatted plate recognition results for each image in the batch
void openalprfreeresponse_string
(char *response)
Frees a char* response that was provided from a recognition request. You must call this function on every response to avoid memory leaks.
Parameters
response
: The string returned from an openalpr_recognize function
Free the memory for the OpenALPR instance created with openalpr_init
Parameters
instance
: OpenALPR instance object
structAlprCRegionOfInterest
#include <alpr_c.h>
Specifies a region of interest to restrict the area that OpenALPR analyzes. The region(s) must be rectangular. The x,y positions are specified in pixels and correspond to the top left corners of the rectangle. The width and height are also specified in pixels. The coordinate system origin (0,0) is the top left of the image
Public Members
int x
int y
int width
int height
see also
int openalprisloaded
( *instance)
see also
void openalprsetcountry
( *instance, const char *country)
Set the country used for plate recognition see also
void openalprsetprewarp
( *instance, const char *prewarp_config)
see also
void openalprsetmask
( *instance, unsigned char *pixelData, int bytesPerPixel, int imgWidth, int imgHeight)
see also
void openalprsetdetect_region
( *instance, int detectRegion)
see also
void openalprsettopn
( *instance, int topN)
see also
void openalprsetdefault_region
( *instance, const char *region)
see also
char *openalprrecognizerawimage
( *instance, unsigned char *pixelData, int bytesPerPixel, int imgWidth, int imgHeight, struct roi)
Recognizes the provided image and responds with JSON. Image is expected to be raw pixel data (BGR, 3 channels) Caller must call on the returned object
see also
char *openalprrecognizeencodedimage
( *instance, unsigned char *bytes, long long length, struct roi)
Recognizes the encoded (e.g., JPEG, PNG) image. bytes are the raw bytes for the image data. Caller must call on the returned object
see also ,
*openalprcreateimage_batch
()
void openalpraddimagetobatch
( *batch, unsigned char *pixelData, int bytesPerPixel, int imgWidth, int imgHeight, struct roi)
void openalpraddencodedimageto_batch
( *batch, unsigned char *bytes, long long length, struct roi)
char *openalprrecognizebatch
( *instance, *batch)
Recognizes the provided batch of images and responds with JSON. Caller must call on the returned object
void openalprreleaseimage_batch
( *batch)
Free memory associated with an image batch crated by
void openalpr_cleanup
( *instance)