Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
MAY 2009
ii
iii
iv
ACKNOWLEDGEMENT
Alhamdulillah, praise to Allah for without his guidance and blessing I will not
have been able to complete my final year project. Working on this project was a
valuable experience and many people have contributed towards my understanding and
thoughts in making it success. In particular, I wish to express my sincere appreciation to
my project supervisor, Dr. Yusri bin Md. Yunos for encouragement, guidance, critics
and friendship.
I would like to convey my deepest gratitude to my family for their support, love
and blessing. I am also very thankful to my friends who were always there by my side at
every moment. My sincere appreciation also extends to all of my course mate and
others who have provided assistance at various occasions. Their views and tips are
useful indeed.
ABSTRACT
The vehicle registration plate identification system aims the program that could
identify the characters that appear on a registration plate in Malaysia. Many types of
applications can be applied using this system which it used the extracted plate number
and optional images to create automated solutions for various problems. Amongst the
various application of this systems are likes parking, access control, tolling, traffic
control and also for marketing tool. This project involves the design of graphical user
interface (GUI) that was developed using Microsoft Visual C++ to carry out the
characters by using a combination of advanced algorithm such as digital image
processing technique for reduce the noise and to enhance the quality of image and
characters recognition that used to classify the character. The identification process was
done using the Pattern Matching and Normalized Cross Correlation algorithm. The
characters are matched with predefined font template and the correlation value is
calculated to get the result. The system is an offline system that will be executed using a
computer, thus the vehicle image are pre stored in the hard disk for objective of
identification.
vi
ABSTRAK
menggunakan komputer dan gambar- gambar kenderaan telah disimpan di cakera keras
komputer untuk tujuan pengenalpastian.
vii
TABLE OF CONTENT
CHAPTER
TITLE
DECLARATION
ii
DEDICATION
iii
ACKNOWLEDGEMENT
iv
ABSTRACT
ABSTRAK
vi
TABLE OF CONTENT
vii
LIST OF FIGURES
xii
INTRODUCTION
1.1
Introduction
1.1.1
1.1.2
Overall System
1.2
PAGE
1.3
Problem Statement
1.4
Project Objectives
1.5
Scope of Project
LITERATURE REVIEW
2.1
Introduction
2.2
Literature Review
viii
2.2.1
System
2.2.2
2.2.3
2.2.4
2.3
2.4
2.3.1
Image Smoothing
2.3.2
Image Sharpening
10
2.3.3
Threshold
10
2.3.4
Negation
11
Pattern Matching
11
13
3.1
System Requirement
13
3.1.1
Hardware Requirement
13
3.1.2
Software Requirement
14
14
3.2
15
3.3
System Design
17
3.3.1
17
3.3.2
18
18
19
19
20
21
22
23
24
25
ix
4
27
4.1
Introduction
27
4.2
Results
27
4.3
4.2.1
Load Image
27
4.2.2
Smoothen Image
28
4.2.3
Sharpen Image
29
4.2.4
Threshold Image
29
4.2.5
Negate Image
30
4.2.6
Search Location
31
4.2.7
Recognize
31
Analysis
34
CONCLUSION
35
5.1
Conclusion
35
5.2
Limitation
36
5.3
Problem Faced
36
5.4
Recommendations
36
REFERENCES
38
APPENDIX A
39
LIST OF FIGURES
FIGURE NO.
TITLE
PAGE
1.1
2.1
Kernel (weight=9)
10
2.2
Kernel (weight=1)
10
3.1
15
3.2
16
3.3
3.4
18
18
3.5
3.6
20
3.7
21
3.8
22
3.9
22
3.10
23
3.11
23
3.12
24
3.13
25
3.14
Error Massage
26
4.1
28
4.2
Smoothen Image
28
4.3
Sharpen Image
29
xi
4.4
Threshold Image
30
4.5
Negated Image
30
4.6
31
4.7
Recognize Result
32
xii
GUI
MFC
MIL
MSDN
VRPI
CHAPTER 1
INTRODUCTION
1.1
Introduction
In this chapter we will introduce about the vehicle registration plate identification
(VRPI) system and how it works.
1.1.1
2
The vehicle registration plate identification system is also known in different
references as automatic vehicle identification (AVI), car plate recognition (CPR),
automatic number plate recognition (ANPR), car plate reader (CPR) and optical
character recognition (OCR) for cars. Since the vehicle registration plates are based on
different country standards, where it is usually different in form, shape or material.
Therefore this systems are followed the country specification and are only applied to the
country where they are installed and used. Some vehicle registration plates have
additional information written or attached to the plate, such as state identification as in
USA plates, province initials such as in China, vehicle type likes in Korea, country flag
as in Europe and many more. For most applications this additional information is not
required and is usually not recognized due to the complexity, variation or quality.
1.1.2
Overall System
3
The VRPI unit analyzes the
image, detects the plate
position and identifies the
fonts using special artificial
intelligence methods.
1.2
Many types of applications can be applied using the vehicle registration plate
identification system which it used the extracted plate number and optional images to
create automated solutions for various problems. Amongst the various application of
this systems are:
a. Parking
When the vehicle is entering a shopping center, the vehicle registration plate
is identify and stored. This registration plate number is used to automatically
4
enter pre-paid members and will calculate parking fee for non-members. The
registration plate will be read again when the vehicle was exit and parking
fee will be calculated by comparing the exit and entry times. The gate will
automatically open after payment of the charged.
b. Access Control
After being recognized the vehicle registration plate by the system, a gate
automatically will opens for authorized members in a secured area, thus
replacing or assisting the security guard. The events such as result, time and
image are logged on a database and could be used in the future as a reference
in case if something bad was happened at that area.
c. Tolling
When the vehicle enters the toll lane and presents a pass card, the vehicle
registration plate was read. The registration plate number is used to calculate
the travel fee in a toll-road, or can be used to double-check the ticket. The
information of the vehicle is get back from the database and will be
compared against the pass information.
d. Traffic control
The vehicles can be directed to different lanes according to their entry
permits classification either it is authorized, known visitors or unknown
vehicles for inquiry. The system effectively reduces traffic congestions such
as long waiting lines and it is also can reduces the security officers work
load.
e. Marketing Tool
The vehicle registration plate numbers may be used to compile a list of
frequent visitors for marketing purposes. Beside that, it can also be used to
build traffic profile, for example the frequency of entry verses the hour or
day.
5
1.3
Problem Statement
1.4
Project Objectives
1.5
Scope of Project
The scope of the project is to develop an offline system for vehicle registration
plate identification system. A GUI was creating using Microsoft Visual C++ 6.0 to
perform the image processing process. Image processing techniques will be applied to
enhance the uploaded images include Pattern Matching and Normalized Cross
Correlation algorithm for identify the characters.
CHAPTER 2
LITERATURE REVIEW
2.1
Introduction
This chapter will discuss about researches had been done before this on
developing vehicle registration plate identification system and the image processing and
identification techniques used in this project.
2.2
Literature Review
Many researches had been done before this on developing vehicle registration
plate identification system where the researcher have to sacrifice their time and money
to make sure the design system a well implement and success. Some of their work are
reviewed and enlighten in this chapter.
7
2.2.1
This project was done by Mohamad Rahmat bin Wahab [2]. This project was
using Blob Analysis method for identification of vehicles plate and container. The
computer capability and vision system in term of repaired processing time, accurate of
location and segmentation each of character can be increase using Blob Analysis
method. Besides that, regardless of any position, this system has the capability to
extract accurately each of character in the required image. Meanwhile, for characters
recognition, neural network techniques were used where this technique had been used
to refer to a network or circuit of biological neurons and using the Matrox Imaging
Library (MIL) and Borland C++ Builder3 interface of this system was built.
2.2.2
This project was done by Lee Seow Sung [3]. An aim of this project is to
develop a program that can recognize the vehicle license plate in Malaysia. A program
developing is involves the design of software to carry out the vehicle license plate
characters by using a combination of advance algorithm such as digital image processing
technique that was be used to reduce the noise and enhance the image quality. Besides
that, feature extraction technique also be used to extract the significant features for each
character and the character recognition technique was used to classify the characters.
The software programming for this project was used the Visual C++ 6.0 programming
language and will be executed using a computer.
8
2.2.3
This project was done by Anoop Sehgal A/L Paras Ram [4]. For this project,
window based software was develop using Microsoft Visual C++. The image was be
enhance by applied image processing techniques include techniques for gray level image
processing and stroke analysis was used for character recognition.
2.2.4
This project was done by Tava Manggai A/P Muthusamy [5]. This project was
developed to recognize the characters that appear on a license plate using Pattern
Matching and Normalized Cross Correlation algorithm. Pattern matching is a
recognition technique which it represent each class by a prototype pattern vector.
Template matching is one of the simplest pattern classification approaches. A template
is defined as an ideal representation of the object to be identified within the image. This
process involves moving the template to every position in the image and evaluating a
degree of similarity at each position called the correlation. Meanwhile, the Normalized
Cross Correlation algorithm can be formulated directly in terms of images and is quite
intuitive. The result where are alphabets from A to Z will display in the interface
created using Microsoft Visual C++.
2.3
9
build-up of noise and signal distortion during processing [6]. Image enhancement is the
most interesting parts of digital image processing. Enhancement program will make
information more visible and few techniques such as smoothing; sharpening, threshold
and negation were used to achieve the target.
2.3.1
Image Smoothing
The filtering operation can be implemented by convolving the entire image with
a simple 3X3 window or mask. The output of this technique is simply the average of the
pixels contained in the neighborhood of the filter mask. The filter mask was used for
reduction of irrelevant detail in an image where the irrelevant detail means that pixel
regions that are small with respect to the size of the filter mask. Figure 2.1 shows a 3X3
kernel for performing a low pas filter operation and smoothed value for each pixel may
be defined as:
R=
1 9
zi
9 i =1
(2.1)
10
2.3.2
Image Sharpening
-1
-1
-1
-1
-1
-1
-1
-1
2.3.3
Threshold
Threshold technique must be done to converts the grey scaled image into binary
image so it can be segmented into foreground and background region. Binary images
are much simpler to analyze because the geometrical patterns and objects in the images
can be identified easily since they are not cluttered with shading information.
11
Selection of the threshold value, T is a crucial issue where this value will not be
suitable for all image. It is common to study the image histogram in order to determine
the value that used to partition the image into pixels with just two values:
If f ( x, y ) T then g (x, y ) = 1
(2.2)
If f ( x, y ) < T then g ( x, y ) = 0
(2.3)
2.3.4
Negation
2.4
Pattern Matching
Pattern matching technique was used as the characters identify where it is the act
of checking for the presence of the constituents of a given pattern. This technique is
used to test and find whether things have a desired or relevant structure, to retrieve the
aligning parts, and to substitute the matching part with something else [8]. Template
matching that also known as pattern matching can be applied whether on binary or grey
level image.
12
The best match will have the higher matching function value when using the
normalized cross correlation algorithm. If P( x, y ) is the image, T ( x, y ) is the template,
then the matching function S (P, T ) will return a value to indicate how much the image
matches with the template.
(2.4)
CHAPTER 3
3.1
System Requirement
In developing a well and good system, the selection of the right hardware and
software is very important to make sure that there is no wasted time and money. In
additional, this also to ensure that the system that will be built can will function
effectively up to the user and developers requirement.
3.1.1
Hardware Requirement
The system for this project was developed using a personal computer with the
specification as below:
A digital camera was used to take the sample image of vehicle registration plate.
Then, these images were stored manually in the hard disk of the computer.
14
3.1.2
Software Requirement
The Microsoft Visual C++ is one of the software that will be used in developing
this system. This software will be the focus of discussion since it played the bigger role
in this project. Besides, Paint application was also used for image resizing to ensure the
original image does not get damaged.
Microsoft Visual C++ is a high level programming language also graphical user
interface software that helps develop C++ codes on computers. This software was chose
because it is simple, secure, portable and user friendly. Compared to the other software,
all the coding required to produce an interface has been predefined already and make
writing programming become more easy and fast.
The AppWizard generate a basic framework for the windows program which
already complete and executable. The classes generated by AppWizard are extending as
part of the basic windows program by the Class Wizard. It is also helps to add new
classes based on classes in the MFC to make sure the functionality needed in the
program was support. Figure 3.1 shows the basic interface of a workspace in Microsoft
Visual C++.
15
3.2
The flow of the system used in identifying the vehicle registration plate is shown
in the figure 3.2. The flow chart shows the main flow of the vehicle registration plate
identifying system. All the vehicle images available for identifying are manually stored
in the hard disk. Therefore, the user of this system can choose an image from the
available pre stored images. Then, the image will be displayed on the interface of the
system after the selection.
16
process. The Pattern Matching will do the identifying and correlation value will be
calculated. If the value is above 0.7, identifying result will be display and if it is
opposite, error massage will be display.
Start
Negate
Image
Load Image
Smoothen
Pattern Matching
Image
Sharpen
Image
& Calculate
Correlation
No
Yes
Correlation
> 0.7
Threshold
Image
Display Error in
Identification
Display
Result
End
Figure 3.2: Flow chart of the system
17
3.3
System Design
3.3.1
The Dialog Based application that was provides by MFC Application Wizard
(exe) was select to develop system and create GUI for this project [9]. This application
generates three classes which are CAboutDlg, CvrpiApp and CVrpiDlg and the main
class that was used is CVrpiDlg. Functions such as icons, buttons and edit boxes were
simply taken from the control toolbar provided as the first step to create the GUI and
using the Class Wizard all these functions are defined and were given their own
variables.
The GUI for this project is shown in the figure 3.3. At the left space of interface,
using the picture function it was provided for displaying image of the vehicle after the
successful of loading image process. Then, three edit boxes was arrange below the
display image area. These edit boxes were name as Location to display the location of
the mouse cursor throughout the whole image interface, Character Location to display
the location of the first black pixel found in image and Plate No. to display the result of
this system.
At the right space of the interface, eight buttons was provided to do some process
in order to functional the system. First button is Load Image button to allow image
that are pre stored from the hard disk to be loaded into the system. This follow by
Smoothen Image and Sharpen Image buttons to enhance and remove the noise in the
image loaded. Next are Threshold Image and Negate Image buttons that will
transformed image into only black and white image and then negated by inverting those
two color vise versa. The Search Location button was used to search the location of
the first black pixel in the image and Recognize button does the recognition process for
this system. Finally, the Exit button will function to close window of the system after
the requesting for a confirmation.
18
3.3.2
A routine is created to read the position of the mouse where the location of the
mouse is pointed and will display in the edit box IDC_LOCATION. Figure 3.4 shows
the routine for this mouse control.
19
3.3.2.2 OnExit() Class
This class is used to enable the user to close the window of application. A single
function call within the OnExit function closes the window and exits the application
after get the confirmation from the user. The class for the OnExit function is shown in
figure 3.5.
void CVrpiDlg::OnExit()
{
int Exit=MessageBox("Are you sure you want to exit this program?","Exit
Program",MB_YESNO+MB_ICONQUESTION);
if(Exit==IDYES)
{
OnOK();
}
}
Figure 3.5: Program routine for exiting the application
This class allows the user to load bitmaps from files that are manually stored in
the hard disk. When the user clicked the Load Image button, a Load Image Dialog
window is pop up, allowing the user to select image of the registration plate where files
of bitmap format only are available to be displayed. The routine for the OnLoad() Class
is shown in figure 3.6.
20
void CVrpiDlg::OnLoad()
{
CClientDC dc(this);
CString m_sFileName, FileExt;
char szFilter []="Bitmap Files(*.bmp)|*.bmp||";
CFileDialog
m_ldFile(TRUE,/*DefFileExt*/NULL,NULL,OFN_HIDEREADONLY|OFN_OVERW
RITEPROMPT,szFilter,NULL);
if (m_ldFile.DoModal()==IDOK)
{
m_sFileName=m_ldFile.GetFileName();
UpdateData (FALSE);
FileExt=m_ldFile.GetFileExt();
FileExt.MakeUpper();
CDC dcMem;
BITMAP bm;
m_hBmpNew =
(HBITMAP)::LoadImage(AfxGetInstanceHandle(),m_sFileName,IMAGE_BITMAP,0,
0, LR_LOADFROMFILE|LR_CREATEDIBSECTION);
GetObject(m_hBmpNew,sizeof(BITMAP),&bm);
dcMem.CreateCompatibleDC(NULL);
::SelectObject(dcMem.m_hDC,m_hBmpNew);
dc.StretchBlt(30,35,350,220,&dcMem,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
}
m_cSmooth.EnableWindow(TRUE);
}
Figure 3.6: Program routine for load image
This class is created to eliminate and remove noise in the image by applying a
low pass kernel. The output of this process is the average of the pixels in the
neighborhood of the filter mask where the bitmap is scanned at the first place. Then, all
the neighborhood pixel values are added together and are divided by 9. This process
21
will continue until the whole image is scanned and the coding was written as shown in
figure 3.7
for(y=0;y<=Height;y++)
{
for(x=0;x<=Width;x++)
{
a[0]=sourceDC.GetPixel(x-1,y-1)&0x000000ff;
a[1]=sourceDC.GetPixel(x-1,y)&0x000000ff;
a[2]=sourceDC.GetPixel(x-1,y+1)&0x000000ff;
a[3]=sourceDC.GetPixel(x,y-1)&0x000000ff;
a[4]=sourceDC.GetPixel(x,y)&0x000000ff;
a[5]=sourceDC.GetPixel(x,y+1)&0x000000ff;
a[6]=sourceDC.GetPixel(x+1,y-1)&0x000000ff;
a[7]=sourceDC.GetPixel(x+1,y)&0x000000ff;
a[8]=sourceDC.GetPixel(x+1,y+1)&0x000000ff;
value=(float)1/9*(a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6] + a[7] + a[8]);
if(value>255)value=255;
if(value<0)value=0;
result=(int)value + ((int)value<<8) + ((int)value<<16);
smoothDC.SetPixel(x,y,result);
}
}
Figure 3.7: Subroutine for smoothing image process
The high pass filter 3X3 kernel was applied to perform the sharpening process as
shown in figure 3.8. In order to obtain image with edges and boundaries sharpened, the
kernel was applying each time the image was scanned start from the top left corner to
the right and from top to the bottom. The subroutine for the sharpening function is
shown in figure 3.9
22
1/7
-1
-2
-1
-2
19
-2
-1
-2
-1
The threshold image function is used to converts the grey scale image into a
black (0) and white (255) image or binary image to make further analysis be easier. The
threshold value T for this project is predefined as 185 as in figure 3.10. Every pixel in
the image will be scanned and all values that exceed the threshold value T, will be set to
white and if it not, it will be set to black.
23
for(y=0;y<=Height;y++)
{
for(x=0;x<=Width;x++)
{
r[x][y]=sourceDC.GetPixel(x,y)&0x000000ff;
if(r[x][y]<=180) r[x][y]=0;
if(r[x][y]>180) r[x][y]=255;
if(r[x][y]>255) r[x][y]=255;
if(r[x][y]<0) r[x][y]=0;
result=((int)r[x][y]) + ((int)r[x][y]<<8) + ((int)r[x][y]<<16);
binarizeDC.SetPixel(x,y,result);
}
}
Figure 3.10: Subroutine for threshold image process
This class is used to invert the pixel value in the threshold image that is to
change black pixel to white pixel and vise versa. The image is negated to make sure that
the characters of the vehicle registration plate are in black color so it easier for recognize
process. Figure 3.11 shows the subroutine for the negate process.
for(y=0;y<=Height;y++)
{
for(x=0;x<=Width;x++)
{
negateDC.SetPixel(x,y,0x00ffffff-(sourceDC.GetPixel(x,y)));
}
}
Figure 3.11: Subroutine for negate image process
24
3.3.2.8 OnSearch() Class
The OnSearch() Class scans the image to find the location of the first black pixel
in the image. The process is important for recognition process where this location state
the place that recognition process should be start and will be display in the character
location edit box.
Usually, the scanning image will start from the center of the Y- axis to make the
processing faster. This is because the registration plate is normally placed at the bottom
of the image and so that users have to make sure that registration plate have to be below
this position in order to be recognized. The program for this purpose is shown in figure
3.12.
do
{
for(x=0;x<Width;x++)
{
z=sourceDC.GetPixel(x,y)&0x000000ff;
if(z==0)
{
m=x;
locX=("%d",m);
n=y;
locY=("%d",n);
UpdateData(FALSE);
break;
}
}
y--;
}
while(z!=0);
Figure 3.12: Program for search image process
25
3.3.2.9 OnRecog() Class
The identification of the vehicle registration plate characters used the template
matching technique. At the first place, the arrays of templates for the characters A to Z
and 0 to 9 are created. The size of the templates are varies depending on the characters
and it have created in binary format. The example of the templates is shown in figure
3.13. For this example, 0 denotes the black color pixel and 1 denotes white color
pixel and the values of black and white pixels value are storing into arrays named
CHAR_K[20][16] and CHAR_S[20][14] respectively.
int CHAR_K[20][16]={0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,
0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,
0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,
0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
0,0,0,0,1,1,1,0,0,0,0,1,1,1,1,1,
0,0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,
0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,
0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
0,0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,
0,0,0,0,1,1,1,0,0,0,0,1,1,1,1,1,
0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,
0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,
0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,
0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,1,
0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0};
int CHAR_S[20][14]={1,1,1,0,0,0,0,0,0,0,0,1,1,1,
1,1,0,0,0,0,0,0,0,0,0,0,1,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,1,
0,0,0,0,0,1,1,1,1,0,0,0,0,0,
0,0,0,0,1,1,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,1,1,0,0,0,0,
0,0,0,0,0,1,1,1,1,1,1,1,1,1,
0,0,0,0,0,0,1,1,1,1,1,1,1,1,
1,0,0,0,0,0,0,1,1,1,1,1,1,1,
1,1,0,0,0,0,0,0,0,0,1,1,1,1,
1,1,1,1,1,0,0,0,0,0,0,0,1,1,
1,1,1,1,1,1,1,0,0,0,0,0,0,1,
1,1,1,1,1,1,1,1,1,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,1,1,0,0,0,0,
0,0,0,0,0,1,1,1,1,0,0,0,0,0,
1,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,1,0,0,0,0,0,0,0,0,0,0,1,1,
1,1,1,0,0,0,0,0,0,0,0,1,1,1};
26
The black and white pixel value of the character from the image is stored first in
an array. Then the array is matched with all the defined templates and the percentage of
matchness is stored in a variable. As the Cross Correlation technique is used, the largest
value for correlation is the most likely match. The high correlation indicates that the
template is similar to the bitmap character and that the array will be set as the recognized
alphabet. The cross correlation value is calculated as:
Cross Correlation = Total Match
Template size
(3.1)
If the correlation value is less than 0.7, an error message will be displayed as
shown in figure 3.14. Meanwhile for the successful recognized, the result will be
displayed in Plate No. edit box. The successful result must have correlation value not
less than 0.7. 0.7 was chose as the level value to determine whether the system is
success or not because this value can make a better comparison and also not so difficult
to achieve as user want to see many successfully recognition.
CHAPTER 4
4.1
Introduction
In this chapter, the result for all process in order to get the recognition of the
vehicle registration plate will be shown and displayed.
4.2
Results
4.2.1
Load Image
All the images captured using the digital camera was in 2048 x 1536 sizes.
Then, these images be resized to size of 350 x 220 to fit in the interface of the system
and were saved in bitmap format, *.bmp as the image of bitmap format only are allowed
to be loaded. Figure 4.1 shows the image displayed as a result of load image.
28
4.2.2
Smoothen Image
Smoothen image function will eliminate and remove noise in the image and give
a result of blurring process as shown in figure 4.2.
29
4.2.3
Sharpen Image
4.2.4
Threshold Image
The threshold image function converts the grey scale image into a black (0) and
white (255) image. From the figure 4.4, it can be observed that characters of the vehicle
registration plate are still in white color whereas other colors in the image turn to black.
30
4.2.5
Negate Image
Negate image function is a simple process of inverting colors of a threshold
image where black and white is inverted vise versa. The characters of the vehicle
registration plate now are in black color as shown in figure 4.5.
31
4.2.6
Search Location
The search location is function to find the location of the first black pixel in the
image. As shown in figure 4.6, when the location is found it will be displayed at the
character location box. This location can be verified by comparing it with the result at
the location box by moving the cursor to the spot where the characters begin.
4.2.7
Recognize
The identification does the pattern matching starting from the location shown in
search location result. When the characters of the vehicle registration plate were
successfully identify, the result will be displayed in plate number box as shown in figure
4.7. Figure 4.7 also shows the recognize result for the other vehicle registration plate
after loading image till search location give a good result.
32
(a)
(b)
33
(c)
(d)
Figure 4.7: Recognize Result
34
4.3
Analysis
The accuracy for this system on identifying characters is not high as the
expectation. Only one over seven characters was success to recognize where it will give
the accuracy of the system only at 14%. So, lots of improvements have to be done in the
future to get more accurate result.
CHAPTER 5
CONCLUSION
5.1
Conclusion
This project has demonstrated the capability of pattern matching in identify the
characters that appear on a registration plate in Malaysia. A functional and user friendly
system which is able to enhance the selective image and can be determining the
locations of the characters to be identifying on the registration plate have been designed
and developed.
Generally, this project has four main stages that have to be done to make this
project success. Capture and loading image are the first stage that has to be done before
image processing techniques take place. Overall, all the desire images are successfully
loaded and result of image processing has shown great result. Determining the character
location and the character identification are another two last stages that make this system
complete. Results of these two stages can be improved using a suggestion in the
recommended section as results for this project are not accurate as a wish.
36
5.2
Limitation
There are many limitations of this system where the obvious limitation it is not a
real time system. Besides, the image processing for this project take time to be done and
this make it is not suitable to apply for application that need immediate result.
Additionally, the result also cannot be saving automatically and once more have to do
manually and take a time to be done.
5.3
Problem Faced
The biggest problem that has to be faced during working on this project is to
determine the suitable threshold value T for all images. This is because not all images
can give a good result after threshold image process due to vary pixel value of the
image.
Capture the image using the standard digital camera instead using a high
resolution camera also give a problem due to the lots of noises to be removed. Lots of
information of image seems lost after the enhancement process and make the system not
too efficient in identify the characters.
5.4
Recommendations
Lots of improvement can be done on the system to make it more reliable and
efficient in the future. The system can be further improved to identify registration plates
that have bad quality of image for example the image that was taken in bad whether or in
the night. Since the image consists of varies pixel values, the system suppose can
generate a suitable threshold value for every different image to avoid the loss of
37
information. In this case, the adaptive thresholding technique is more suitable to apply
so that the threshold value based on the specified image information can be obtained.
Besides, the image of static vehicles can be replaced to the movement car for the real
time system and the best suitable analysis that can be use is image morphology where it
used to reconstruct the image blurring.
This system also can be build using a more powerful programming language like
a Matlab or Java for better reliability. It is also important to make sure this system can
function in a real time and can give instant results to make it more valuable.
38
REFERENCES
3. Lee Seow Sung. Vehicle License Plate Recognition System. Degree thesis.
Universiti Teknologi Malaysia; 2001
4. Anoop Sehgal A/L Paras Ram. Design of a Recognition System for Special
Malaysian Car Plate. Master thesis. Universiti Teknologi Malaysia; 2005
5. Tava Manggai A/P Muthusamy. Car License Plate Recognition System. Degree
thesis. Universiti Teknologi Malaysia; 2006
9. Nicolaisen, Nancy. The Visual Guide to Visual C++: The Pictorial Encyclopedia
of the Windows Programming Language. Chapel Hill, NC.: The Ventana Press
Visual GuideTM Series. 1994
39
APPENDIX A
40
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////
// CVrpiDlg dialog
CVrpiDlg::CVrpiDlg(CWnd* pParent /*=NULL*/)
: CDialog(CVrpiDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CVrpiDlg)
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon
in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CVrpiDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CVrpiDlg)
DDX_Control(pDX, IDC_NEGATE, m_cNegate);
DDX_Control(pDX, IDC_RECOG, m_cRecog);
DDX_Control(pDX, IDC_SEARCH, m_cSearch);
DDX_Control(pDX, IDC_SHARP, m_cSharp);
DDX_Control(pDX, IDC_THRES, m_cThres);
DDX_Control(pDX, IDC_SMOOTH, m_cSmooth);
DDX_Control(pDX, IDC_LOAD, m_ldFile);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CVrpiDlg, CDialog)
//{{AFX_MSG_MAP(CVrpiDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_WM_MOUSEMOVE()
ON_BN_CLICKED(IDC_EXIT, OnExit)
ON_BN_CLICKED(IDC_LOAD, OnLoad)
ON_BN_CLICKED(IDC_SMOOTH, OnSmooth)
ON_BN_CLICKED(IDC_SHARP, OnSharp)
ON_BN_CLICKED(IDC_THRES, OnThres)
ON_BN_CLICKED(IDC_NEGATE, OnNegate)
ON_BN_CLICKED(IDC_SEARCH, OnSearch)
ON_BN_CLICKED(IDC_RECOG, OnRecog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////
// CVrpiDlg message handlers
BOOL CVrpiDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
41
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX,strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE);
// Set big icon
SetIcon(m_hIcon, FALSE);
// Set small icon
// TODO: Add extra initialization here
m_cNegate.EnableWindow(FALSE);
m_cSmooth.EnableWindow(FALSE);
m_cSharp.EnableWindow(FALSE);
m_cRecog.EnableWindow(FALSE);
m_cThres.EnableWindow(FALSE);
m_cSearch.EnableWindow(FALSE);
return TRUE;
// return TRUE unless you set the focus to a control
}
void CVrpiDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
//If you add a minimize button to your dialog, you will need the code
below to draw the icon. For MFC applications using the document/view
model,this is automatically done for you by the framework.
void CVrpiDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
42
else
{
CDialog::OnPaint();
}
}
//The system calls this to obtain the cursor to display while the user
drags the minimized window.
HCURSOR CVrpiDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
//////////////////////////////////////////////////////////////////////
void CVrpiDlg::OnMouseMove(UINT nFlags, CPoint point)
{
CString str;
str.Format("(%d,%d)",point.x-30,point.y-35);
SetDlgItemText(IDC_LOCATION,str);
CDialog::OnMouseMove(nFlags, point);
}
//////////////////////////////////////////////////////////////////////
void CVrpiDlg::OnExit()
{
int Exit=MessageBox("Are you sure you want to exit this
program?","Exit Program",MB_YESNO+MB_ICONQUESTION);
if(Exit==IDYES)
{
OnOK();
}
}
//////////////////////////////////////////////////////////////////////
void CVrpiDlg::OnLoad()
{
CClientDC dc(this);
CString m_sFileName, FileExt;
char szFilter []="Bitmap Files(*.bmp)|*.bmp||";
CFileDialog
m_ldFile(TRUE,/*DefFileExt*/NULL,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPR
OMPT,szFilter,NULL);
if (m_ldFile.DoModal()==IDOK)
{
m_sFileName=m_ldFile.GetFileName();
UpdateData (FALSE);
FileExt=m_ldFile.GetFileExt();
FileExt.MakeUpper();
CDC dcMem;
BITMAP bm;
m_hBmpNew =
(HBITMAP)::LoadImage(AfxGetInstanceHandle(),m_sFileName,IMAGE_BITMAP,0
,0, LR_LOADFROMFILE|LR_CREATEDIBSECTION);
GetObject(m_hBmpNew,sizeof(BITMAP),&bm);
dcMem.CreateCompatibleDC(NULL);
::SelectObject(dcMem.m_hDC,m_hBmpNew);
dc.StretchBlt(30,35,350,220,&dcMem,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY)
;
}
m_cSmooth.EnableWindow(TRUE);
}
43
//////////////////////////////////////////////////////////////////////
void CVrpiDlg::OnSmooth()
{
CClientDC dc(this);
CDC sourceDC,smoothDC;
sourceDC.CreateCompatibleDC(NULL);
smoothDC.CreateCompatibleDC(NULL);
BITMAP bm;
GetObject(m_hBmpNew,sizeof(bm),&bm);
int Width=bm.bmWidth;
int Height=bm.bmHeight;
HBITMAP
hbmpresultsmooth=::CreateCompatibleBitmap(CClientDC(NULL),Width,Height
);
HBITMAP
hbmpOldsource=(HBITMAP)::SelectObject(sourceDC.m_hDC,m_hBmpNew);
HBITMAP
hbmpOldsmooth=(HBITMAP)::SelectObject(smoothDC.m_hDC,hbmpresultsmooth)
;
hbitmap1=hbmpresultsmooth;
int x,y,result,a[9];
float value;
for(y=0;y<=Height;y++)
{
for(x=0;x<=Width;x++)
{
a[0]=sourceDC.GetPixel(x-1,y-1)&0x000000ff;
a[1]=sourceDC.GetPixel(x-1,y)&0x000000ff;
a[2]=sourceDC.GetPixel(x-1,y+1)&0x000000ff;
a[3]=sourceDC.GetPixel(x,y-1)&0x000000ff;
a[4]=sourceDC.GetPixel(x,y)&0x000000ff;
a[5]=sourceDC.GetPixel(x,y+1)&0x000000ff;
a[6]=sourceDC.GetPixel(x+1,y-1)&0x000000ff;
a[7]=sourceDC.GetPixel(x+1,y)&0x000000ff;
a[8]=sourceDC.GetPixel(x+1,y+1)&0x000000ff;
value=(float)1/9*(a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]);
if(value>255)value=255;
if(value<0)value=0;
result=(int)value + ((int)value<<8) + ((int)value<<16);
smoothDC.SetPixel(x,y,result);
}
}
dc.StretchBlt(30,35,350,220,&smoothDC,0,0,Width,Height,SRCCOPY);
m_cSmooth.EnableWindow(FALSE);
m_cSharp.EnableWindow(TRUE);
}
//////////////////////////////////////////////////////////////////////
void CVrpiDlg::OnSharp()
{
CClientDC dc(this);
CDC sourceDC,sharpDC;
sourceDC.CreateCompatibleDC(NULL);
sharpDC.CreateCompatibleDC(NULL);
BITMAP bm;
GetObject(hbitmap1,sizeof(bm),&bm);
int Width=bm.bmWidth;
int Height=bm.bmHeight;
44
HBITMAP
hbmpresultsharp=::CreateCompatibleBitmap(CClientDC(NULL),Width,Height)
;
HBITMAP
hbmpOldsource=(HBITMAP)::SelectObject(sourceDC.m_hDC,hbitmap1);
HBITMAP
hbmpOldsharp=(HBITMAP)::SelectObject(sharpDC.m_hDC,hbmpresultsharp);
hbitmap2=hbmpresultsharp;
int x,y,result,a[9];
float value;
for(y=0;y<=Height;y++)
{
for(x=0;x<=Width;x++)
{
a[0]=sourceDC.GetPixel(x-1,y-1)&0x000000ff;
a[1]=sourceDC.GetPixel(x-1,y)&0x000000ff;
a[2]=sourceDC.GetPixel(x-1,y+1)&0x000000ff;
a[3]=sourceDC.GetPixel(x,y-1)&0x000000ff;
a[4]=sourceDC.GetPixel(x,y)&0x000000ff;
a[5]=sourceDC.GetPixel(x,y+1)&0x000000ff;
a[6]=sourceDC.GetPixel(x+1,y-1)&0x000000ff;
a[7]=sourceDC.GetPixel(x+1,y)&0x000000ff;
a[8]=sourceDC.GetPixel(x+1,y+1)&0x000000ff;
value=(float)1/7*(-a[0]-2*a[1]-a[2]-2*a[3]+19*a[4]-2*a[5]-a[6]-2*a[7]a[8]);
if(value>255)value=255;
if(value<0)value=0;
result=(int)value + ((int)value<<8) + ((int)value<<16);
sharpDC.SetPixel(x,y,result);
}
}
dc.StretchBlt(30,35,350,220,&sharpDC,0,0,Width,Height,SRCCOPY);
m_cSharp.EnableWindow(FALSE);
m_cThres.EnableWindow(TRUE);
}
//////////////////////////////////////////////////////////////////////
void CVrpiDlg::OnThres()
{
CClientDC dc(this);
CDC sourceDC;
CDC binarizeDC;
sourceDC.CreateCompatibleDC(NULL);
binarizeDC.CreateCompatibleDC(NULL);
BITMAP bm;
::GetObject(hbitmap2,sizeof(bm),&bm);
int Width=bm.bmWidth;
int Height=bm.bmHeight;
HBITMAP
hbmpresultbinarize=::CreateCompatibleBitmap(CClientDC(NULL),Width,Heig
ht);
HBITMAP
hbmpOldsource=(HBITMAP)::SelectObject(sourceDC.m_hDC,hbitmap2);
HBITMAP
hbmpOldbinarize=(HBITMAP)::SelectObject(binarizeDC.m_hDC,hbmpresultbin
arize);
hbitmap3=hbmpresultbinarize;
int r[550][259];
int x,y,result;
45
for(y=0;y<=Height;y++)
{
for(x=0;x<=Width;x++)
{
r[x][y]=sourceDC.GetPixel(x,y)&0x000000ff;
if(r[x][y]<=185) r[x][y]=0;
if(r[x][y]>185) r[x][y]=255;
if(r[x][y]>255) r[x][y]=255;
if(r[x][y]<0) r[x][y]=0;
result=((int)r[x][y]) + ((int)r[x][y]<<8) + ((int)r[x][y]<<16);
binarizeDC.SetPixel(x,y,result);
}
}
dc.StretchBlt(30,35,350,220,&binarizeDC,0,0,Width,Height,SRCCOPY);
m_cThres.EnableWindow(FALSE);
m_cNegate.EnableWindow(TRUE);
}
//////////////////////////////////////////////////////////////////////
void CVrpiDlg::OnNegate()
{
CClientDC dc(this);
CDC sourceDC;
CDC negateDC;
sourceDC.CreateCompatibleDC(NULL);
negateDC.CreateCompatibleDC(NULL);
BITMAP bm;
::GetObject(hbitmap3,sizeof(bm),&bm);
int Width=bm.bmWidth;
int Height=bm.bmHeight;
HBITMAP
hbmpresultnegate=::CreateCompatibleBitmap(CClientDC(NULL),Width,Height
);
HBITMAP
hbmpOldsource=(HBITMAP)::SelectObject(sourceDC.m_hDC,hbitmap3);
HBITMAP
hbmpOldnegate=(HBITMAP)::SelectObject(negateDC.m_hDC,hbmpresultnegate)
;
hbitmap4=hbmpresultnegate;
int x,y;
for(y=0;y<=Height;y++)
{
for(x=0;x<=Width;x++)
{
negateDC.SetPixel(x,y,0x00ffffff-(sourceDC.GetPixel(x,y)));
}
}
dc.StretchBlt(30,35,350,220,&negateDC,0,0,Width,Height,SRCCOPY);
m_cNegate.EnableWindow(FALSE);
m_cSearch.EnableWindow(TRUE);
}
//////////////////////////////////////////////////////////////////////
void CVrpiDlg::OnSearch()
{
CClientDC dc(this);
CDC sourceDC;
CDC searchDC;
sourceDC.CreateCompatibleDC(NULL);
searchDC.CreateCompatibleDC(NULL);
46
BITMAP bm;
::GetObject(hbitmap4,sizeof(bm),&bm);
int Width=bm.bmWidth;
int Height=bm.bmHeight;
HBITMAP
hbmpresultsearch=::CreateCompatibleBitmap(CClientDC(NULL),Width,Height
);
HBITMAP
hbmpOldsource=(HBITMAP)::SelectObject(sourceDC.m_hDC,hbitmap4);
HBITMAP
hbmpOldsearch=(HBITMAP)::SelectObject(searchDC.m_hDC,hbmpresultsearch)
;
CString str;
hbitmap5=hbmpresultsearch;
int x,y,m,n,z;
x=0;
y=Height/2;
do
{
for(x=0;x<Width;x++)
{
z=sourceDC.GetPixel(x,y)&0x000000ff;
if(z==0)
{
m=x;
locX=("%d",m);
n=y;
locY=("%d",n);
UpdateData(FALSE);
break;
}
}
y++;
}
while(z!=0);
str.Format("(%d,%d)",m,n);
SetDlgItemText(IDC_PIXEL,str);
m_cSearch.EnableWindow(FALSE);
m_cRecog.EnableWindow(TRUE);
}
//////////////////////////////////////////////////////////////////////
void CVrpiDlg::OnRecog()
{
CClientDC dc(this);
CDC sourceDC;
CDC recognizeDC;
sourceDC.CreateCompatibleDC(NULL);
recognizeDC.CreateCompatibleDC(NULL);
BITMAP bm;
::GetObject(hbitmap4,sizeof(bm),&bm);
int Width=bm.bmWidth;
int Height=bm.bmHeight;
HBITMAP
hbmpresultrecognize=::CreateCompatibleBitmap(CClientDC(NULL),Width,Hei
ght);
HBITMAP
hbmpOldsource=(HBITMAP)::SelectObject(sourceDC.m_hDC,hbitmap4);
47
HBITMAP
hbmpOldrecognize=(HBITMAP)::SelectObject(recognizeDC.m_hDC,hbmpresultr
ecognize);
int m,n,i,x,y,j,k,a,b,flag,test,match;
int temp[20][36];
CString str,str_temp,str_a[1000];
str=' ';
m=locX;
n=locY + 18;
int mc[20]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
float ratio,ratio_char;
int got_it=0;
int char_count=0;
int CHAR_A[20][16]={1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,
1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,
1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,
1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,
1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,
1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,
1,1,1,1,0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0,0,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,0,0,0,0,
1,1,0,0,0,0,0,0,0,0,1,1,
1,1,0,0,0,0,0,0,0,0,1,1};
for(test=0;test<1000000;test++)
{
flag=0;ratio=0;
for(i=0;i<20;i++)
{
for(j=0;j<36;j++)
{
temp[i][j]=sourceDC.GetPixel(m+j-8,n+i)&0x000000ff;
if(temp[i][j]==255)
temp[i][j]=1;
}
}
//checking for A
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<16;j++)
{
if(temp[i][j+2]==CHAR_A[i][j])
match++;
59
}
}
ratio_char=float(match)/(20*16);
if(ratio_char>ratio)
{
str_temp='A';
ratio=ratio_char;
}
}
//checking for B
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<16;j++)
{
if(temp[i][j+8]==CHAR_B[i][j])
match++;
}
}
ratio_char=float(match)/(20*16);
if(ratio_char>ratio)
{
str_temp='B';
ratio=ratio_char;
}
}
//checking for C
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<14;j++)
{
if(temp[i][j+4]==CHAR_C[i][j])
match++;
}
}
ratio_char=float(match)/(20*14);
if(ratio_char>ratio)
{
str_temp='C';
ratio=ratio_char;
}
}
//checking for D
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<16;j++)
{
if(temp[i][j+8]==CHAR_D[i][j])
match++;
}
}
ratio_char=float(match)/(20*16);
if(ratio_char>ratio)
{
60
str_temp='D';
ratio=ratio_char;
}
}
//checking for E
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<14;j++)
{
if(temp[i][j+8]==CHAR_E[i][j])
match++;
}
}
ratio_char=float(match)/(20*14);
if(ratio_char>ratio)
{
str_temp='E';
ratio=ratio_char;
}
}
//checking for F
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<14;j++)
{
if(temp[i][j+8]==CHAR_F[i][j])
match++;
}
}
ratio_char=float(match)/(20*14);
if(ratio_char>ratio)
{
str_temp='F';
ratio=ratio_char;
}
}
//checking for G
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<16;j++)
{
if(temp[i][j+4]==CHAR_G[i][j])
match++;
}
}
ratio_char=float(match)/(20*16);
if(ratio_char>ratio)
{
str_temp='G';
ratio=ratio_char;
}
}
61
//checking for H
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<16;j++)
{
if(temp[i][j+8]==CHAR_H[i][j])
match++;
}
}
ratio_char=float(match)/(20*16);
if(ratio_char>ratio)
{
str_temp='H';
ratio=ratio_char;
}
}
//checking for J
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<12;j++)
{
if(temp[i][j]==CHAR_J[i][j])
match++;
}
}
ratio_char=float(match)/(20*12);
if(ratio_char>ratio)
{
str_temp='J';
ratio=ratio_char;
}
}
//checking for K
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<16;j++)
{
if(temp[i][j+8]==CHAR_K[i][j])
match++;
}
}
ratio_char=float(match)/(20*16);
if(ratio_char>ratio)
{
str_temp='K';
ratio=ratio_char;
}
}
//checking for L
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
62
{
for(j=0;j<18;j++)
{
if(temp[i][j+8]==CHAR_L[i][j])
match++;
}
}
ratio_char=float(match)/(20*18);
if(ratio_char>ratio)
{
str_temp='L';
ratio=ratio_char;
}
}
//checking for M
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<20;j++)
{
if(temp[i][j+8]==CHAR_M[i][j])
match++;
}
}
ratio_char=float(match)/(20*20);
if(ratio_char>ratio)
{
str_temp='M';
ratio=ratio_char;
}
}
//checking for N
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<16;j++)
{
if(temp[i][j+8]==CHAR_N[i][j])
match++;
}
}
ratio_char=float(match)/(20*16);
if(ratio_char>ratio)
{
str_temp='N';
ratio=ratio_char;
}
}
//checking for P
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<16;j++)
{
if(temp[i][j+8]==CHAR_P[i][j])
match++;
63
}
}
ratio_char=float(match)/(20*16);
if(ratio_char>ratio)
{
str_temp='P';
ratio=ratio_char;
}
}
//checking for Q
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<18;j++)
{
if(temp[i][j+4]==CHAR_Q[i][j])
match++;
}
}
ratio_char=float(match)/(20*18);
if(ratio_char>ratio)
{
str_temp='Q';
ratio=ratio_char;
}
}
//checking for R
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<18;j++)
{
if(temp[i][j+8]==CHAR_R[i][j])
match++;
}
}
ratio_char=float(match)/(20*18);
if(ratio_char>ratio)
{
str_temp='R';
ratio=ratio_char;
}
}
//checking for S
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<14;j++)
{
if(temp[i][j+6]==CHAR_S[i][j])
match++;
}
}
ratio_char=float(match)/(20*14);
if(ratio_char>ratio)
{
64
str_temp='S';
ratio=ratio_char;
}
}
//checking for T
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<16;j++)
{
if(temp[i][j+8]==CHAR_T[i][j])
match++;
}
}
ratio_char=float(match)/(20*16);
if(ratio_char>ratio)
{
str_temp='T';
ratio=ratio_char;
}
}
//checking for U
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<16;j++)
{
if(temp[i][j+8]==CHAR_U[i][j])
match++;
}
}
ratio_char=float(match)/(20*16);
if(ratio_char>ratio)
{
str_temp='U';
ratio=ratio_char;
}
}
//checking for V
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<16;j++)
{
if(temp[i][j+8]==CHAR_V[i][j])
match++;
}
}
ratio_char=float(match)/(20*16);
if(ratio_char>ratio)
{
str_temp='V';
ratio=ratio_char;
}
}
65
//checking for W
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<28;j++)
{
if(temp[i][j+8]==CHAR_W[i][j])
match++;
}
}
ratio_char=float(match)/(20*28);
if(ratio_char>ratio)
{
str_temp='W';
ratio=ratio_char;
}
}
//checking for X
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<18;j++)
{
if(temp[i][j+8]==CHAR_X[i][j])
match++;
}
}
ratio_char=float(match)/(20*18);
if(ratio_char>ratio)
{
str_temp='X';
ratio=ratio_char;
}
}
//checking for Y
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<20;j++)
{
if(temp[i][j+8]==CHAR_Y[i][j])
match++;
}
}
ratio_char=float(match)/(20*20);
if(ratio_char>ratio)
{
str_temp='Y';
ratio=ratio_char;
}
}
//checking for Z
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
66
{
for(j=0;j<18;j++)
{
if(temp[i][j+8]==CHAR_Z[i][j])
match++;
}
}
ratio_char=float(match)/(20*18);
if(ratio_char>ratio)
{
str_temp='Z';
ratio=ratio_char;
}
}
//checking for 1
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<12;j++)
{
if(temp[i][j+2]==CHAR_1[i][j])
match++;
}
}
ratio_char=float(match)/(20*12);
if(ratio_char>ratio)
{
str_temp='1';
ratio=ratio_char;
}
}
//checking for 2
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<12;j++)
{
if(temp[i][j+6]==CHAR_2[i][j])
match++;
}
}
ratio_char=float(match)/(20*12);
if(ratio_char>ratio)
{
str_temp='2';
ratio=ratio_char;
}
}
//checking for 3
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<12;j++)
{
if(temp[i][j+6]==CHAR_3[i][j])
67
match++;
}
}
ratio_char=float(match)/(20*12);
if(ratio_char>ratio)
{
str_temp='3';
ratio=ratio_char;
}
}
//checking for 4
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<12;j++)
{
if(temp[i][j]==CHAR_4[i][j])
match++;
}
}
ratio_char=float(match)/(20*12);
if(ratio_char>ratio)
{
str_temp='4';
ratio=ratio_char;
}
}
//checking for 5
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<12;j++)
{
if(temp[i][j+8]==CHAR_5[i][j])
match++;
}
}
ratio_char=float(match)/(20*12);
if(ratio_char>ratio)
{
str_temp='5';
ratio=ratio_char;
}
}
//checking for 6
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<12;j++)
{
if(temp[i][j+6]==CHAR_6[i][j])
match++;
}
}
ratio_char=float(match)/(20*12);
if(ratio_char>ratio)
68
{
str_temp='6';
ratio=ratio_char;
}
}
//checking for 7
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<12;j++)
{
if(temp[i][j+8]==CHAR_7[i][j])
match++;
}
}
ratio_char=float(match)/(20*12);
if(ratio_char>ratio)
{
str_temp='7';
ratio=ratio_char;
}
}
//checking for 8
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<12;j++)
{
if(temp[i][j+6]==CHAR_8[i][j])
match++;
}
}
ratio_char=float(match)/(20*12);
if(ratio_char>ratio)
{
str_temp='8';
ratio=ratio_char;
}
}
//checking for 9
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<12;j++)
{
if(temp[i][j+6]==CHAR_9[i][j])
match++;
}
}
ratio_char=float(match)/(20*12);
if(ratio_char>ratio)
{
str_temp='9';
ratio=ratio_char;
}
}
69
//checking for 0
if(flag==0)
{
match=0;
for(i=0;i<20;i++)
{
for(j=0;j<12;j++)
{
if(temp[i][j+6]==CHAR_0[i][j])
match++;
}
}
ratio_char=float(match)/(20*12);
if(ratio_char>ratio)
{
str_temp='0';
ratio=ratio_char;
}
}
if(ratio>0.7)
{
int in_char=0;
for(i=0;i<20;i++)
{
if(m<(mc[i]+5)&&(m>(mc[i]-5)))
in_char=1;
}
if(in_char==0)
{
mc[char_count]=m;
char_count++;
got_it=1;
str_a[m]=str_temp;
if(str_temp=='H')m=m+12;
if(str_temp=='K')m=m+10;
if(str_temp=='M')m=m+16;
if(str_temp=='N')m=m+12;
if(str_temp=='U')m=m+12;
if(str_temp=='V')m=m+12;
if(str_temp=='W')m=m+24;
if(str_temp=='X')m=m+14;
if(str_temp=='Y')m=m+16;
}
}
if(ratio<0.7)
{
int iResults;
iResults=MessageBox("Sorry,could not recognize this
image!","Recognition Error",MB_OK|MB_ICONSTOP);
break;
}
y=n;
if(got_it==0)
{
if(y==Height)goto exit_loop;
for(x=m;x<Width;x++)
{
j=sourceDC.GetPixel(x,y)&0x000000ff;
if(j==255)
70
{
a=x;
b=y;
UpdateData(FALSE);
break;
}
}
scan_again:
for(x=a;x<Width;x++)
{
k=sourceDC.GetPixel(x,y)&0x000000ff;
if(k==0)
{
m=x;
n=y;
UpdateData(FALSE);
break;
}
}
if(x==Width)
{
y++;
a=0;
goto scan_again;
}
}
if(got_it==10)
{
if(y==Height)goto exit_loop;
for(x=m;x<Width;x++)
{
j=sourceDC.GetPixel(x,y)&0x000000ff;
if(j==255)
{
a=x;
b=y;
UpdateData(FALSE);
break;
}
}
for(x=a;x<Width;x++)
{
k=sourceDC.GetPixel(x,y)&0x000000ff;
if(k==0)
{
m=x;
n=y;
UpdateData(FALSE);
break;
}
if(x==Width)
{
y++;
a=0;
goto scan_again;
}
}
}
71
exit_loop:
int mc_temp;
for(i=0;i<19;i++)
{
for(j=0;j<19;j++)
{
if(mc[j]>mc[j+1])
{
mc_temp=mc[j];
mc[j]=mc[j+1];
mc[j+1]=mc_temp;
}
}
}
for(i=0;i<20;i++)
{
if(mc[i]!=0)
str=str + str_a[mc[i]];
}
SetDlgItemText(IDC_DISPLAY,str);
m_cRecog.EnableWindow(FALSE);
}
}