C

Typedefs

typedefvoid OPENALPR

typedefvoid OPENALPRIMAGEBATCH

Enums

enumAlprCHardwareAcceleration

Values:

enumeratorALPRC_CPU

enumeratorALPRCNVIDIAGPU

Functions

OPENALPRarrow-up-right *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 openalpr_cleanup()arrow-up-right

ReturnAn OpenALPR instance that can be used with other openalpr functions

OPENALPRarrow-up-right *openalprinitgpu(const char *country, const char *configFile, const char *runtimeDir, const char *licenseKey, AlprCHardwareAccelerationarrow-up-right 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.

see also openalpr_cleanup()arrow-up-right

ReturnAn OpenALPR instance that can be used with other openalpr functions

int openalprisloaded(OPENALPRarrow-up-right *instance)

Verify that the OpenALPR library loaded correctly and can accept image inputs

see also alpr::Alpr::isLoaded()arrow-up-right

ReturnReturns 1 if the library was loaded successfully, 0 otherwise

void openalprsetcountry(OPENALPRarrow-up-right *instance, const char *country)

Set the country used for plate recognition see also alpr::Alpr::setCountry()arrow-up-right

void openalprsetprewarp(OPENALPRarrow-up-right *instance, const char *prewarp_config)

Update the prewarp setting without reloading the library

see also alpr::Alpr::setPrewarp()arrow-up-right

void openalprsetmask(OPENALPRarrow-up-right *instance, unsigned char *pixelData, int bytesPerPixel, int imgWidth, int imgHeight)

Update the detection mask without reloading the library

see also alpr::Alpr::setMask()arrow-up-right

void openalprsetdetect_region(OPENALPRarrow-up-right *instance, int detectRegion)

/deprecated Enables/disables state/province detection. Set this in openalpr.conf

see also alpr::Alpr::setDetectRegion()arrow-up-right

void openalprsettopn(OPENALPRarrow-up-right *instance, int topN)

Specify a region to use when applying patterns.

see also alpr::Alpr::setTopN()arrow-up-right

void openalprsetdefault_region(OPENALPRarrow-up-right *instance, const char *region)

Specify a region to use when applying patterns.

see also alpr::Alpr::setDefaultRegion()arrow-up-right

char *openalprrecognizerawimage(OPENALPRarrow-up-right *instance, unsigned char *pixelData, int bytesPerPixel, int imgWidth, int imgHeight, struct AlprCRegionOfInterestarrow-up-right roi)

Recognizes the provided image and responds with JSON. Image is expected to be raw pixel data (BGR, 3 channels) Caller must call openalpr_free_response_string()arrow-up-right on the returned object

see also alpr::Alpr::recognize()arrow-up-right

ReturnJSON formatted plate recognition results

char *openalprrecognizeencodedimage(OPENALPRarrow-up-right *instance, unsigned char *bytes, long long length, struct AlprCRegionOfInterestarrow-up-right roi)

Recognizes the encoded (e.g., JPEG, PNG) image. bytes are the raw bytes for the image data. Caller must call openalpr_free_response_string()arrow-up-right on the returned object

see also alpr::Alpr::recognize()arrow-up-right, openalpr_recognize_rawimage()arrow-up-right

ReturnJSON formatted plate recognition results

OPENALPR_IMAGE_BATCHarrow-up-right *openalprcreateimage_batch()

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

void openalpraddimagetobatch(OPENALPR_IMAGE_BATCHarrow-up-right *batch, unsigned char *pixelData, int bytesPerPixel, int imgWidth, int imgHeight, struct AlprCRegionOfInterestarrow-up-right roi)

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

void openalpraddencodedimageto_batch(OPENALPR_IMAGE_BATCHarrow-up-right *batch, unsigned char *bytes, long long length, struct AlprCRegionOfInterestarrow-up-right roi)

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

char *openalprrecognizebatch(OPENALPRarrow-up-right *instance, OPENALPR_IMAGE_BATCHarrow-up-right *batch)

Recognizes the provided batch of images and responds with JSON. Caller must call openalpr_free_response_string()arrow-up-right on the returned object

ReturnJSON formatted plate recognition results for each image in the batch

void openalprreleaseimage_batch(OPENALPR_IMAGE_BATCHarrow-up-right *batch)

Free memory associated with an image batch crated by openalpr_create_image_batch()arrow-up-right

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

void openalpr_cleanup(OPENALPRarrow-up-right *instance)

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

Was this helpful?