Last active
June 6, 2018 11:56
-
-
Save msinnema/481cd0a3ec488297fd2adcfc8b05ca00 to your computer and use it in GitHub Desktop.
Initialize Intrada
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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