Vehicle Recognition Stream API Setup: C

C documentation for Vehicle Recognition Stream API setup

Typedefs

typedefvoid ALPRSTREAM

void ALPRSTREAM

The instantiated AlprStream object. This is created by the alprstream_init() function and should be passed into subsequent functions.

Functions

ALPRSTREAM *alprstream_init(int framequeuesize, int usemotiondetection = 1)

Initializes the ALPRSTREAM instance. Each stream of video should have its own AlprStream instance. This object is threadsafe.

Returnan ALPRSTREAM instance that can be used in future calls. Call alprstream_cleanup() once you’re finished with the object. See also alpr::AlprStream::AlprStream()

int alprstreamgetqueue_size(ALPRSTREAM *instance)

Check the size of the video buffer

See also alpr::AlprStream::get_queue_size()

void alprstreamconnectvideostreamurl(ALPRSTREAM *instanceconst char *url)

See alpr::AlprStream::connect_video_stream_url()

void alprstreamdisconnectvideo_stream(ALPRSTREAM *instance)

See alpr::AlprStream::disconnect_video_stream()

void alprstreamconnectvideo_file(ALPRSTREAM *instanceconst char *videofilepath, int64_t videostarttime)

See alpr::AlprStream::connect_video_file()

void alprstreamdisconnectvideo_file(ALPRSTREAM *instance)

See alpr::AlprStream::disconnect_video_file()

int alprstreamvideofile_active(ALPRSTREAM *instance)

See alpr::AlprStream::video_file_active()

int alprstreampushframe_encoded(ALPRSTREAM *instance, unsigned char *bytes, long long length, int64_t frameepochtime = -1)

See alpr::AlprStream::push_frame()

int alprstreampushframe(ALPRSTREAM *instance, unsigned char *pixelData, int bytesPerPixel, int imgWidth, int imgHeight, int64_t frameepochtime = -1)

See alpr::AlprStream::push_frame()

AlprStreamRecognizedFrameC *alprstreamprocessframe(ALPRSTREAM *instanceOPENALPR *alpr)

See alpr::AlprStream::process_frame(). Each response must be freed with alprstream_free_frame_response()

void alprstreamfreeframe_response(AlprStreamRecognizedFrameC *response)

Frees memory from an alprstreamprocess_frame() response.

void alprstreamfreebatch_response(AlprStreamRecognizedBatchC *response)

Frees memory from an alprstream_process_batch() response.

AlprStreamRecognizedFrameC *alprstreamskipframe(ALPRSTREAM *instance, int return_image)

See alpr::AlprStream::skip_frame()

AlprStreamRecognizedBatchC *alprstreamprocessbatch(ALPRSTREAM *instanceOPENALPR *alpr)

See alpr::AlprStream::process_batch()

char *alprstreampopcompleted_groups(ALPRSTREAM *instance)

See alpr::AlprStream::pop_completed_groups()

Returna JSON-formatted string describing the list of completed group results. Make sure to release the string memory using alprstream_free_response_string() after using it

char *alprstreampeekactive_groups(ALPRSTREAM *instance)

See alpr::AlprStream::peek_active_groups()

Returna JSON-formatted string describing the list of active group results. Make sure to release the string memory using alprstream_free_response_string() after using it

char *alprstreampopcompletedgroupsandrecognizevehicle(ALPRSTREAM *instance, VEHICLECLASSIFIER *vehicle_classifier)

Gets the completed groups from the list and performs vehicle make/model/color/type recognition before returning vehicle results. This is a CPU or GPU intensive operation so it may be best to perform on a separate thread.

Returna JSON-formatted string describing the list of completed group results. Each group result will contain vehicle information as well. Make sure to release the string memory using alprstream_free_response_string() after using itParameters

  • vehicle_classifier: An initialized instance of the VehicleClassifier that AlprStream will use to perform vehicle recognition

void alprstreamcombinegrouping(ALPRSTREAM *instanceALPRSTREAM *other_stream)

See alpr::AlprStream::combine_grouping()

void alprstreamsetuuid_format(ALPRSTREAM *instanceconst char *format)

See alpr::AlprStream::set_uuid_format()

void alprstreamsetgroup_parameters(ALPRSTREAM *instance, int minplatesto_group, int maxplatesper_group, float min_confidence, int maxdeltatime)

See alpr::AlprStream::set_group_parameters()

void alprstreamsetenv_parameters(ALPRSTREAM *instanceconst char *company_idconst char *agent_uid, int camera_id)

See alpr::AlprStream::set_env_parameters()

void alprstreamsetdetectionmaskencoded(ALPRSTREAM *instance, unsigned char *bytes, long long length)

See alpr::AlprStream::set_detection_mask()

void alprstreamsetdetection_mask(ALPRSTREAM *instance, unsigned char *pixelData, int bytesPerPixel, int imgWidth, int imgHeight)

See alpr::AlprStream::set_detection_mask()

void alprstreamsetjpeg_compression(ALPRSTREAM *instance, int compression_level)

See alpr::AlprStream::set_jpeg_compression()

void alprstreamsetencode_jpeg(ALPRSTREAM *instance, int alwaysreturnjpeg)

See alpr::AlprStream::set_encode_jpeg()

void alprstreamsetrecord_video(ALPRSTREAM *instance, int enabled, int maxstoragesize_gb, char *rollingdbpath)

See alpr::AlprStream::set_record_video()

void alprstreamfreeresponse_string(char *response)

Frees a char* response that was provided from a recognition request.

Parameters

  • response: A JSON character string from a previous pop/peek operation

void alprstream_cleanup(ALPRSTREAM *instance)

Free the memory for the OpenALPR instance created with alprstream_init()

structAlprStreamRecognizedFrameC
#include <alprstream_c.h>

See alpr::RecognizedFrame.

Public Members

bool image_available

char *jpeg_bytes

int64_t jpegbytessize

int64_t frameepochtime_ms

int64_t frame_number

char *results_str

structAlprStreamRecognizedBatchC

Public Members

AlprStreamRecognizedFrameC **results_array

size_t results_size

char *batch_results

 

Last Updated August 25, 2022