Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
licenseplates
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
licenseplates
Commits
ecbc5afa
Commit
ecbc5afa
authored
Dec 19, 2011
by
Jayke Meijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added section on difficulties to report.
parent
c1d76618
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
57 deletions
+93
-57
docs/verslag.tex
docs/verslag.tex
+93
-57
No files found.
docs/verslag.tex
View file @
ecbc5afa
...
@@ -57,12 +57,12 @@ In short our program must be able to do the following:
...
@@ -57,12 +57,12 @@ In short our program must be able to do the following:
\section
{
Language of choice
}
\section
{
Language of choice
}
The actual purpose of this project is to check if LBP is capable of recognizing
The actual purpose of this project is to check if LBP is capable of recognizing
license plate characters. We knew the LBP implementation would be pretty
simple.
license plate characters. We knew the LBP implementation would be pretty
Thus an advantage had to be its speed compared with other license plate
simple.
Thus an advantage had to be its speed compared with other license plate
recognition implementations, but the uncertainity of whether we could get some
recognition implementations, but the uncertainity of whether we could get some
results made us pick Python. We felt Python would not restrict us as much in
results made us pick Python. We felt Python would not restrict us as much in
assigning tasks to each member of the group. In addition, when using the
correct
assigning tasks to each member of the group. In addition, when using the
modules to handle images, Python can be decent in speed.
correct
modules to handle images, Python can be decent in speed.
\section
{
Implementation
}
\section
{
Implementation
}
...
@@ -76,22 +76,9 @@ A simple perspective transformation will be sufficient to transform and resize
...
@@ -76,22 +76,9 @@ A simple perspective transformation will be sufficient to transform and resize
the plate to a normalized format. The corner positions of license plates in the
the plate to a normalized format. The corner positions of license plates in the
dataset are supplied together with the dataset.
dataset are supplied together with the dataset.
\subsection
{
Reducing noise
}
Small amounts of noise will probably be suppressed by usage of a Gaussian
filter. A real problem occurs in very dirty license plates, where branches and
dirt over a letter could radically change the local binary pattern. A question
we can ask ourselves here, is whether we want to concentrate ourselves on these
exceptional cases. By law, license plates have to be readable. Therefore, we
will first direct our attention at getting a higher score in the 'regular' test
set before addressing these cases. Considered the fact that the LBP algorithm
divides a letter into a lot of cells, there is a good change that a great
number of cells will still match the learning set, and thus still return the
correct character as a best match. Therefore, we expect the algorithm to be
very robust when dealing with noisy images.
\subsection
{
Extracting a letter
}
\subsection
{
Extracting a letter
}
NO LONGER VALID!
Because we are already given the locations of the characters, we only need to
Because we are already given the locations of the characters, we only need to
transform those locations using the same perspective transformation used to
transform those locations using the same perspective transformation used to
create a front facing license plate. The next step is to transform the
create a front facing license plate. The next step is to transform the
...
@@ -111,6 +98,20 @@ The resulting image will always have the same size, the character contained
...
@@ -111,6 +98,20 @@ The resulting image will always have the same size, the character contained
will always be of the same height, and the character will alway be positioned
will always be of the same height, and the character will alway be positioned
at either the left of right side of the image.
at either the left of right side of the image.
\subsection
{
Reducing noise
}
Small amounts of noise will probably be suppressed by usage of a Gaussian
filter. A real problem occurs in very dirty license plates, where branches and
dirt over a letter could radically change the local binary pattern. A question
we can ask ourselves here, is whether we want to concentrate ourselves on these
exceptional cases. By law, license plates have to be readable. Therefore, we
will first direct our attention at getting a higher score in the 'regular' test
set before addressing these cases. Considered the fact that the LBP algorithm
divides a letter into a lot of cells, there is a good change that a great
number of cells will still match the learning set, and thus still return the
correct character as a best match. Therefore, we expect the algorithm to be
very robust when dealing with noisy images.
\subsection
{
Local binary patterns
}
\subsection
{
Local binary patterns
}
Once we have separate digits and characters, we intent to use Local Binary
Once we have separate digits and characters, we intent to use Local Binary
Patterns (Ojala, Pietikäinen
\&
Harwood, 1994) to determine what character
Patterns (Ojala, Pietikäinen
\&
Harwood, 1994) to determine what character
...
@@ -126,9 +127,9 @@ form where the pattern is circular.
...
@@ -126,9 +127,9 @@ form where the pattern is circular.
\begin{itemize}
\begin{itemize}
\item
Determine the size of the square where the local patterns are being
\item
Determine the size of the square where the local patterns are being
registered. For explanation purposes let the square be 3 x 3.
\\
registered. For explanation purposes let the square be 3 x 3.
\\
\item
The grayscale value of the middle pixel is used a threshold. Every value
of the pixel
\item
The grayscale value of the middle pixel is used a threshold. Every value
around the middle pixel is evaluated. If it's value is greater than the threshold
of the pixel around the middle pixel is evaluated. If it's value is greater
it will be become a one else a zero.
than the threshold
it will be become a one else a zero.
\begin{figure}
[h!]
\begin{figure}
[h!]
\center
\center
...
@@ -136,13 +137,14 @@ it will be become a one else a zero.
...
@@ -136,13 +137,14 @@ it will be become a one else a zero.
\caption
{
LBP 3 x 3 (Pietik
\"
ainen, Hadid, Zhao
\&
Ahonen (2011))
}
\caption
{
LBP 3 x 3 (Pietik
\"
ainen, Hadid, Zhao
\&
Ahonen (2011))
}
\end{figure}
\end{figure}
Notice that the pattern will be come of the form 01001110. This is done when a
the value
Notice that the pattern will be come of the form 01001110. This is done when a
of the evaluated pixel is greater than the threshold, shift the bit by the n(with i=i
$_{
th
}$
pixel
the value of the evaluated pixel is greater than the threshold, shift the bit
evaluated, starting with
$
i
=
0
$
).
by the n(with i=i
$_{
th
}$
pixel
evaluated, starting with
$
i
=
0
$
).
This results in a mathematical expression:
This results in a mathematical expression:
Let I(
$
x
_
i, y
_
i
$
) an Image with grayscale values and
$
g
_
n
$
the grayscale value of the pixel
$
(
x
_
i, y
_
i
)
$
.
Let I(
$
x
_
i, y
_
i
$
) an Image with grayscale values and
$
g
_
n
$
the grayscale value
Also let
$
s
(
g
_
i
-
g
_
c
)
$
with
$
g
_
c
$
= grayscale value of the center pixel.
of the pixel
$
(
x
_
i, y
_
i
)
$
. Also let
$
s
(
g
_
i
-
g
_
c
)
$
with
$
g
_
c
$
= grayscale value
of the center pixel.
$$
$$
s
(
v, g
_
c
)
=
\left\{
s
(
v, g
_
c
)
=
\left\{
...
@@ -157,8 +159,8 @@ $$LBP_{n, g_c = (x_c, y_c)} = \sum\limits_{i=0}^{n-1} s(g_i, g_c)^{2i} $$
...
@@ -157,8 +159,8 @@ $$LBP_{n, g_c = (x_c, y_c)} = \sum\limits_{i=0}^{n-1} s(g_i, g_c)^{2i} $$
The outcome of this operations will be a binary pattern.
The outcome of this operations will be a binary pattern.
\item
Given this pattern, the next step is to divide the pattern in cells. The
\item
Given this pattern, the next step is to divide the pattern in cells. The
amount of cells depends on the quality of the result, so trial and error is in
order.
amount of cells depends on the quality of the result, so trial and error is in
Starting with dividing the pattern in to 16 cells
.
order. Starting with dividing the pattern in to cells of size 16
.
\item
Compute a histogram for each cell.
\item
Compute a histogram for each cell.
...
@@ -168,11 +170,11 @@ Starting with dividing the pattern in to 16 cells.
...
@@ -168,11 +170,11 @@ Starting with dividing the pattern in to 16 cells.
\caption
{
Divide in cells(Pietik
\"
ainen et all (2011))
}
\caption
{
Divide in cells(Pietik
\"
ainen et all (2011))
}
\end{figure}
\end{figure}
\item
Consider every histogram as a vector element and concatenate these. The
result is a
\item
Consider every histogram as a vector element and concatenate these. The
feature vector of the image.
result is a
feature vector of the image.
\item
Feed these vectors to a support vector machine. This will ''learn'' which
vector
\item
Feed these vectors to a support vector machine. This will ''learn'' which
are
.
vector indicate what letter
.
\end{itemize}
\end{itemize}
...
@@ -211,33 +213,36 @@ stored in XML files. So, the first step is to read these XML files.
...
@@ -211,33 +213,36 @@ stored in XML files. So, the first step is to read these XML files.
\paragraph*
{
XML reader
}
\paragraph*
{
XML reader
}
The XML reader will return a 'license plate' object when given an XML file. The
The XML reader will return a 'license plate' object when given an XML file. The
licence plate holds a list of, up to six, NormalizedImage characters and from which country the
licence plate holds a list of, up to six, NormalizedImage characters and from
plate is from. The reader is currently assuming the XML file and image name are corresponding. Since this was the case
which country the plate is from. The reader is currently assuming the XML file
for the given dataset. This can easily be adjusted if required.
and image name are corresponding. Since this was the case for the given
dataset. This can easily be adjusted if required.
To parse the XML file, the minidom module is used. So the XML file can be
To parse the XML file, the minidom module is used. So the XML file can be
treated as a tree, where one can search for certain nodes. In each XML
treated as a tree, where one can search for certain nodes. In each XML
file it is possible that multiple versions exist, so the first thing the reader
will do is
file it is possible that multiple versions exist, so the first thing the reader
retrieve the current and most up-to-date version of the plate. The reader will only get results from this
will do is retrieve the current and most up-to-date version of the plate. The
version.
reader will only get results from this
version.
Now we are only interested in the individual characters so we can skip the
location
Now we are only interested in the individual characters so we can skip the
of the entire license plate. Each character has
location
of the entire license plate. Each character has
a single character value, indicating what someone thought what the letter or
digit was and four coordinates to create
a single character value, indicating what someone thought what the letter or
a bounding box. To make things not to complicated a
digit was and four coordinates to create a bounding box. To make things not to
Character class and Point class are used. They
complicated a
Character class and Point class are used. They
act pretty much as associative lists, but it gives extra freedom on using the
act pretty much as associative lists, but it gives extra freedom on using the
data. If less then four points have been set the character will not be saved.
data. If less then four points have been set the character will not be saved.
When four points have been gathered the data from the actual image is being requested.
When four points have been gathered the data from the actual image is being
For each corner a small margin is added (around 3 pixels) so that no features will be lost and minimum
requested. For each corner a small margin is added (around 3 pixels) so that no
amounts of new features will be introduced by noise in the margin.
features will be lost and minimum amounts of new features will be introduced by
noise in the margin.
In the next section you can read more about the perspective transformation that is being done. After the transformation the
In the next section you can read more about the perspective transformation that
character can be saved: Converted to grayscale, but nothing further. This was used
is being done. After the transformation the character can be saved: Converted
to create a learning set. If it doesn't need to be saved as an actual image it will be converted
to grayscale, but nothing further. This was used to create a learning set. If
to a NormalizedImage. When these actions have been completed for each character the license
it doesn't need to be saved as an actual image it will be converted to a
plate is usable in the rest of the code.
NormalizedImage. When these actions have been completed for each character the
license plate is usable in the rest of the code.
\paragraph*
{
Perspective transformation
}
\paragraph*
{
Perspective transformation
}
Once we retrieved the cornerpoints of the license plate, we feed those to a
Once we retrieved the cornerpoints of the license plate, we feed those to a
...
@@ -378,6 +383,37 @@ commercial license plate recognition software score about $90\%$ to $94\%$,
...
@@ -378,6 +383,37 @@ commercial license plate recognition software score about $90\%$ to $94\%$,
under optimal conditions and with modern equipment. Our program scores an
under optimal conditions and with modern equipment. Our program scores an
average of blablabla.
average of blablabla.
\section
{
Difficulties
}
During the implementation and testing of the program, we did encounter a
number of difficulties. In this section we will state what these difficulties
were and whether we were able to find a proper solution for them.
\subsection*
{
Dataset
}
We did experience a number of problems with the provided dataset. A number of
these are problems to be expected in a real world problem, but which make
development harder. Others are more elemental problems.
\\
The first problem was that the dataset contains a lot of license plates which
are problematic to read, due to excessive amounts of dirt on them. Of course,
this is something you would encounter in the real situation, but it made it
hard for us to see whether there was a coding error or just a bad example.
\\
Another problem was that there were license plates of several countries in
the dataset. Each of these countries has it own font, which also makes it
hard to identify these plates, unless there are a lot of these plates in the
learning set.
\\
A problem that is more elemental is that some of the characters in the dataset
are not properly classified. This is of course very problematic, both for
training the SVM as for checking the performance. This meant we had to check
each character whether its description was correct.
\subsection*
{
SVM
}
We also had trouble with the SVM for Python. The standard Python SVM, libsvm,
had a poor documentation. There was no explanation what so ever on which
parameter had to be what. This made it a lot harder for us to see what went
wrong in the program.
\section
{
Workload distribution
}
\section
{
Workload distribution
}
The first two weeks were team based. Basically the LBP algorithm could be
The first two weeks were team based. Basically the LBP algorithm could be
...
@@ -390,13 +426,13 @@ implementation was most suited to be done by one individually or in a pair.
...
@@ -390,13 +426,13 @@ implementation was most suited to be done by one individually or in a pair.
Gijs created the basic classes we could use and helped the rest everyone by
Gijs created the basic classes we could use and helped the rest everyone by
keeping track of what required to be finished and whom was working on what.
keeping track of what required to be finished and whom was working on what.
Tadde
\"
us and Jayke were mostly working on the SVM and all kinds of tests
Tadde
\"
us and Jayke were mostly working on the SVM and all kinds of tests
whether the histograms were mathing and alike. Fabi
\"
en created the functions
whether the histograms were mat
c
hing and alike. Fabi
\"
en created the functions
to read and parse the given xml files with information about the license
plates.
to read and parse the given xml files with information about the license
Upon completion all kinds of learning and data sets could be created.
plates.
Upon completion all kinds of learning and data sets could be created.
%Richard je moet even toevoegen wat je hebt gedaan :P:P
%Richard je moet even toevoegen wat je hebt gedaan :P:P
%maar miss is dit hele ding wel overbodig. Ik dacht dat Rein het zei tijdens
gesprek van ik wil weten
%maar miss is dit hele ding wel overbodig. Ik dacht dat Rein het zei tijdens
%hoe het ging enzo
%
gesprek van ik wil weten
hoe het ging enzo
\subsection
{
How it went
}
\subsection
{
How it went
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment