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
557bcdb2
Commit
557bcdb2
authored
Dec 21, 2011
by
Richard Torenvliet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
worked on report
parent
67232a83
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
66 deletions
+66
-66
docs/report.tex
docs/report.tex
+66
-66
No files found.
docs/report.tex
View file @
557bcdb2
...
@@ -45,39 +45,38 @@ in classifying characters on a license plate.
...
@@ -45,39 +45,38 @@ in classifying characters on a license plate.
In short our program must be able to do the following:
In short our program must be able to do the following:
\begin{enumerate}
\begin{enumerate}
\item
Extract characters using the location points in the xml file.
\item
Extract
ing
characters using the location points in the xml file.
\item
Reduce noise where possible to ensure maximum readability.
\item
Reduce noise where possible to ensure maximum readability.
\item
Transform a character to a normal form.
\item
Transform
ing
a character to a normal form.
\item
Creat
e
a local binary pattern histogram vector.
\item
Creat
ing
a local binary pattern histogram vector.
\item
Recognize the character value of a vector using a classifier
.
\item
Matching the found vector with a learning set
.
\item
Determine the performance of the classifier with a given test
set.
\item
And finally it has to check results with a real data
set.
\end{enumerate}
\end{enumerate}
\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. Since the LBP algorithm is fairly simple to
license plate characters. We knew the LBP implementation would be pretty
implement, it should have a good performance in comparison to other license
simple. Thus an advantage had to be its speed compared with other license plate
plate recognition implementations if implemented in C. However, we decided to
recognition implementations, but the uncertainty of whether we could get some
focus on functionality rather than speed. Therefore, we picked Python. We felt
results made us pick Python. We felt Python would not restrict us as much in
Python would not restrict us as much in assigning tasks to each member of the
assigning tasks to each member of the group. In addition, when using the
group. In addition, when using the correct modules to handle images, Python can
correct modules to handle images, Python can be decent in speed.
be decent in speed.
\section
{
Theory
}
\section
{
Theory
}
Now we know what our program has to be capable of, we can start with the
Now we know what our program has to be capable of, we can start with the
defining
the problems we have and how we are planning
to solve these.
defining
what problems we have and how we want
to solve these.
\subsection
{
Extracting a letter and resizing it
}
\subsection
{
Extracting a letter and resizing it
}
% TODO:
Rewrite this section once we have implemented this properly.
Rewrite this section once we have implemented this properly.
\subsection
{
Transformation
}
\subsection
{
Transformation
}
A simple perspective transformation will be sufficient to transform and resize
A simple perspective transformation will be sufficient to transform and resize
the characters to a normalized format. The corner positions of characters in
the characters to a normalized format. The corner positions of characters in
the dataset are
provid
ed together with the dataset.
the dataset are
suppli
ed together with the dataset.
\subsection
{
Reducing noise
}
\subsection
{
Reducing noise
}
...
@@ -93,80 +92,76 @@ part of the license plate remains readable.
...
@@ -93,80 +92,76 @@ part of the license plate remains readable.
\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
or
Patterns (Ojala, Pietikäinen
\&
Harwood, 1994) to determine what character
digit we are dealing with. Local Binary Patterns are a way to classify a
or digit we are dealing with. Local Binary
texture based on the distribution of edge directions in the image. Sinc
e
Patterns are a way to classify a texture based on the distribution of edg
e
letters on a license plate consist mainly of straight lines and simple curves,
directions in the image. Since letters on a license plate consist mainly of
LBP should be suited to identify these.
straight lines and simple curves,
LBP should be suited to identify these.
\subsubsection
{
LBP Algorithm
}
\subsubsection
{
LBP Algorithm
}
The LBP algorithm that we implemented can use a variety of neighbourhoods,
The LBP algorithm that we implemented can use a variety of neighbourhoods,
including the same square pattern that is introduced by Ojala et al (1994), and
including the same square pattern that is introduced by Ojala et al (1994),
a circular form as presented by Wikipedia.
and a circular form as presented by Wikipedia.
\begin{itemize}
\begin{enumerate}
\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 as threshold. Every
\item
The grayscale value of the center pixel is used as threshold. Every value
value of the pixel around the middle pixel is evaluated. If it's value is
of the pixel around the center pixel is evaluated. If it's value is greater
greater than the threshold it will be become a one else a zero.
than the threshold it will be become a one, otherwise it will be a zero.
\begin{figure}
[H]
\begin{figure}
[H]
\center
\center
\includegraphics
[scale=0.5]
{
lbp.png
}
\includegraphics
[scale=0.5]
{
lbp.png
}
\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}
The pattern will be an 8-bit integer. This is accomplished by shifting the
Notice that the pattern will be come of the form 01001110. This is done when a
boolean value of each comparison one to seven places to the left.
the value of the evaluated pixel is greater than the threshold, shift the bit
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
$
) be a grayscale Image and
$
g
_
n
$
the value of the pixel
$
(
x
_
i,
Let I(
$
x
_
i, y
_
i
$
) an Image with grayscale values and
$
g
_
n
$
the grayscale value
y
_
i
)
$
. Also let
$
s
(
g
_
i, g
_
c
)
$
(see below) with
$
g
_
c
$
being the value of the
of the pixel
$
(
x
_
i, y
_
i
)
$
. Also let
$
s
(
g
_
i, g
_
c
)
$
(see below) with
$
g
_
c
$
=
center pixel and
$
g
_
i
$
the grayscale value of the pixel to be evaluated.
grayscale value of the center pixel and
$
g
_
i
$
the grayscale value of the pixel
to be evaluated.
$$
$$
s
(
g
_
i, g
_
c
)
=
\left
\{
s
(
g
_
i, g
_
c
)
=
\left
\{
\begin
{
array
}{
l l
}
\begin
{
array
}{
l l
}
1
&
\quad
\text
{
if $g
_
i$ $
\geq
$ $g
_
c$
}
\\
1
&
\quad
\text
{
if $g
_
i$ $
\geq
$ $g
_
c$
}
\\
0
&
\quad
\text
{
if $g
_
i$ $<$ $g
_
c$
}
\\
0
&
\quad
\text
{
if $g
_
i$ $<$ $g
_
c$
}
\\
\end
{
array
}
\right
.
\end
{
array
}
\right
.
$$
$$
$$
LBP
_{
n, g
_
c
=
(
x
_
c, y
_
c
)
}
=
\sum\limits
_{
i
=
0
}^{
n
-
1
}
s
(
g
_
i, g
_
c
)
\cdot
2
^
i
$$
$$
LBP
_{
n, g
_
c
=
(
x
_
c, y
_
c
)
}
=
\sum\limits
_{
i
=
0
}^{
n
-
1
}
s
(
g
_
i, g
_
c
)
^{
2
i
}
$$
The outcome of this operations will be a binary pattern. Note that the
The outcome of this operations will be a binary pattern.
mathematical expression has the same effect as the bit shifting operation that
we defined earlier.
\item
Given this pattern, the next step is to divide the pattern into cells.
\item
Given this pattern, the next step is to divide the pattern in cells. The
The amount of cells depends on the quality of the result, which we plan to
amount of cells depends on the quality of the result, so trial and error is in
determine by trial and error. We will start by dividing the pattern into cells
order. Starting with dividing the pattern in to cells of size 16.
of size 16, which is a common value according to Wikipedia.
\item
Compute a histogram for each cell.
\item
Compute a histogram for each cell.
\begin{figure}
[H]
\begin{figure}
[H]
\center
\center
\includegraphics
[scale=0.7]
{
cells.png
}
\includegraphics
[scale=0.7]
{
cells.png
}
\caption
{
Divide into 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
\item
Consider every histogram as a vector element and concatenate these. The
result is a feature vector of the image.
result is a feature vector of the image.
\item
Feed these vectors to a support vector machine. Th
e SVM will ``learn''
\item
Feed these vectors to a support vector machine. Th
is will ''learn'' which
which vectors to associate with a
character.
vector indicates what vector is which
character.
\end{
enumerat
e}
\end{
itemiz
e}
To our knowledge, LBP has yet not been used in this manner before. Therefore,
To our knowledge, LBP has yet not been used in this manner before. Therefore,
it will be the first thing to implement, to see if it lives up to the
it will be the first thing to implement, to see if it lives up to the
expectations. When the proof of concept is there, it can be used in a final
,
expectations. When the proof of concept is there, it can be used in a final
more efficient
program.
program.
Later we will show that taking a histogram over the entire image (basically
Later we will show that taking a histogram over the entire image (basically
working with just one cell) gives us the best results.
working with just one cell) gives us the best results.
...
@@ -174,19 +169,19 @@ working with just one cell) gives us the best results.
...
@@ -174,19 +169,19 @@ working with just one cell) gives us the best results.
\subsection
{
Matching the database
}
\subsection
{
Matching the database
}
Given the LBP of a character, a Support Vector Machine can be used to classify
Given the LBP of a character, a Support Vector Machine can be used to classify
the character to a character in a learning set. The SVM uses
the
concatenation
the character to a character in a learning set. The SVM uses
a
concatenation
of
the histograms of all cells in an image as a feature vector (in the case w
e
of
each cell in an image as a feature vector (in the case we check the entir
e
check the entire image no concatenation has to be done of course. The SVM can
image no concatenation has to be done of course. The SVM can be trained with a
be trained with a subset of the given dataset called the ``learning set''. Onc
e
subset of the given dataset called the ''Learning set''. Once trained, th
e
trained, the
entire classifier can be saved as a Pickle object
\footnote
{
See
entire classifier can be saved as a Pickle object
\footnote
{
See
\url
{
http://docs.python.org/library/pickle.html
}}
for later usage.
\url
{
http://docs.python.org/library/pickle.html
}}
for later usage.
In our case the support vector machine uses a radial gauss kernel function. The
In our case the support vector machine uses a radial gauss kernel function. The
SVM finds a seperating hyperplane with minimum margins.
SVM finds a seperating hyperplane with minimum margins.
\section
{
Implementation
}
\section
{
Implementation
}
In this section we will describe our implementation in more detail, explaining
In this section we will describe our implementation
s
in more detail, explaining
the choices we made in the process
.
choices we made
.
\subsection
{
Character retrieval
}
\subsection
{
Character retrieval
}
...
@@ -614,10 +609,15 @@ were instantaneous! A crew to remember.
...
@@ -614,10 +609,15 @@ were instantaneous! A crew to remember.
Timo Ahonen.
Timo Ahonen.
\emph
{
Computational Imaging and Vision
}
.
\emph
{
Computational Imaging and Vision
}
.
Springer-Verlag, London,
Springer-Verlag, London,
1
nd
Edition,
1
st
Edition,
2011.
2011.
\bibitem
{
wikiplate
}
\emph
{
Automatic number-plate recognition
}
. (2011, December 17).
\\
Wikipedia.
Retrieved from http://en.wikipedia.org/wiki/Automatic
\_
number
\_
plate
\_
recognition
\end{thebibliography}
\end{thebibliography}
\appendix
\appendix
\section
{
Faulty Classifications
}
\section
{
Faulty Classifications
}
\begin{figure}
[H]
\begin{figure}
[H]
...
...
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