forked from nishushah93/LicensePlateReaders
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fpex.c
59 lines (43 loc) · 1.17 KB
/
fpex.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "fp.h"
#include "database.h"
#include "lpstate.h"
int main( int argc, char ** argv )
{
//Declarations
IplImage * template_img;
IplImage * plate_img;
int numContours;
plateInfo * plate_info;
charInfo * char_info;
char** plate_number;
char pNumber[7];
int i;
if( argc < 5 )
exit (0);
else
{
char *state = findState(argv);
//Load template image
template_img = cvLoadImage( argv[1], CV_LOAD_IMAGE_GRAYSCALE);
//Load original license image
plate_img = cvLoadImage( argv[2], CV_LOAD_IMAGE_COLOR );
plate_info = processPlateChars( plate_img );
char_info = processTemplateChars( template_img, &numContours );
plate_number = compareChar( char_info, plate_info, &numContours );
//Mkay, this should do it..
//Print that bad boy!
printf("\nPlate number: ");
for(i = 1; i < 8; i++)
{
printf("%s", plate_number[i]);
strcpy((pNumber + (i-1)), plate_number[i]);
}
printf("\n");
// char * number = pNumber[6];
printf("%s", pNumber);
Owner owner;
owner = newOwner(state, pNumber);
WriteToXML(owner);
return EXIT_SUCCESS;
}
}