Skip to content

Instantly share code, notes, and snippets.

@msinnema msinnema/sample.c

Last active Jun 6, 2018
Embed
What would you like to do?
Initialize Intrada
#include <stdio.h>
#include <stdlib.h>
#include "intrada.h"
int main ()
{
IntradaImage image;
IntradaData data;
IntradaSettings settings;
char image_name[500];
int nr_plates;
int plate;
char reg_num[INTRADA_MAX_CHARS_REGISTRATION_NUMBER+1];
int confidence;
char *country;
IntradaSetErrorHandler (NULL, NULL);
IntradaInitLibrary ("Company Name", "Options",
"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX");
IntradaCreateSettings ("Settings", &settings);
IntradaSetCountries (settings, "I,NL");
IntradaCreateData (&data);
while (GetNextImageNameInDir(image_name))
{
printf ("%s -> ", image_name); fflush (stdout);
IntradaLoadImage (image_name, 1, &image);
IntradaDataSetImage (data, image);
IntradaRecognize (settings, data);
IntradaGetNumberOfPlates (data, &nr_plates);
if (nr_plates > 0)
{
plate = 0;
IntradaGetPlateRegistrationNumber (data, plate, reg_num,
INTRADA_MAX_CHARS_REGISTRATION_NUMBER+1);
IntradaGetPlateConfidence (data, plate, &confidence);
IntradaGetPlateCountry (data, plate, &country);
printf ("%s [%d] <%s>\n", reg_num, confidence, country);
}
else
printf ("%s\n", "UNRECOGNIZED");
IntradaDestroyImage (image);
}
IntradaDestroyData (data);
IntradaDestroySettings (settings);
IntradaFinit ();
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.