report.tex 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. \documentclass[a4paper]{article}
  2. \usepackage{amsmath}
  3. \usepackage{hyperref}
  4. \usepackage{graphicx}
  5. \usepackage{float}
  6. \title{Using local binary patterns to read license plates in photographs}
  7. % Paragraph indentation
  8. \setlength{\parindent}{0pt}
  9. \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
  10. \begin{document}
  11. \maketitle
  12. \section*{Project members}
  13. Gijs van der Voort \\
  14. Richard Torenvliet \\
  15. Jayke Meijer \\
  16. Tadde\"us Kroes\\
  17. Fabi\"en Tesselaar
  18. \tableofcontents
  19. \pagebreak
  20. \setcounter{secnumdepth}{1}
  21. \section{Problem description}
  22. License plates are used for uniquely identifying motorized vehicles and are
  23. made to be read by humans from great distances and in all kinds of weather
  24. conditions.
  25. Reading license plates with a computer is much more difficult. Our dataset
  26. contains photographs of license plates from various angles and distances. This
  27. means that not only do we have to implement a method to read the actual
  28. characters, but given the location of the license plate and each individual
  29. character, we must make sure we transform each character to a standard form.
  30. Determining what character we are looking at will be done by using Local Binary
  31. Patterns. The main goal of our research is finding out how effective LBP's are
  32. in classifying characters on a license plate.
  33. In short our program must be able to do the following:
  34. \begin{enumerate}
  35. \item Extract characters using the location points in the xml file.
  36. \item Reduce noise where possible to ensure maximum readability.
  37. \item Transform a character to a normal form.
  38. \item Create a local binary pattern histogram vector.
  39. \item Recognize the character value of a vector using a classifier.
  40. \item Determine the performance of the classifier with a given test set.
  41. \end{enumerate}
  42. \section{Language of choice}
  43. The actual purpose of this project is to check if LBP is capable of recognizing
  44. license plate characters. Since the LBP algorithm is fairly simple to
  45. implement, it should have a good performance in comparison to other license
  46. plate recognition implementations if implemented in C. However, we decided to
  47. focus on functionality rather than speed. Therefore, we picked Python. We felt
  48. Python would not restrict us as much in assigning tasks to each member of the
  49. group. In addition, when using the correct modules to handle images, Python can
  50. be decent in speed.
  51. \section{Theory}
  52. Now we know what our program has to be capable of, we can start with the
  53. defining the problems we have and how we are planning to solve these.
  54. \subsection{Extracting a letter and resizing it}
  55. % TODO: Rewrite this section once we have implemented this properly.
  56. \subsection{Transformation}
  57. A simple perspective transformation will be sufficient to transform and resize
  58. the characters to a normalized format. The corner positions of characters in
  59. the dataset are provided together with the dataset.
  60. \subsection{Reducing noise}
  61. Small amounts of noise will probably be suppressed by usage of a Gaussian
  62. filter. A real problem occurs in very dirty license plates, where branches and
  63. dirt over a letter could radically change the local binary pattern. A question
  64. we can ask ourselves here, is whether we want to concentrate ourselves on these
  65. exceptional cases. By law, license plates have to be readable. However, the
  66. provided dataset showed that this does not mean they always are. We will have
  67. to see how the algorithm performs on these plates, however we have good hopes
  68. that our method will get a good score on dirty plates, as long as a big enough
  69. part of the license plate remains readable.
  70. \subsection{Local binary patterns}
  71. Once we have separate digits and characters, we intent to use Local Binary
  72. Patterns (Ojala, Pietikäinen \& Harwood, 1994) to determine what character or
  73. digit we are dealing with. Local Binary Patterns are a way to classify a
  74. texture based on the distribution of edge directions in the image. Since
  75. letters on a license plate consist mainly of straight lines and simple curves,
  76. LBP should be suited to identify these.
  77. \subsubsection{LBP Algorithm}
  78. The LBP algorithm that we implemented can use a variety of neighbourhoods,
  79. including the same square pattern that is introduced by Ojala et al (1994), and
  80. a circular form as presented by Wikipedia.
  81. \begin{enumerate}
  82. \item Determine the size of the square where the local patterns are being
  83. registered. For explanation purposes let the square be 3 x 3. \\
  84. \item The grayscale value of the center pixel is used as threshold. Every value
  85. of the pixel around the center pixel is evaluated. If it's value is greater
  86. than the threshold it will be become a one, otherwise it will be a zero.
  87. \begin{figure}[H]
  88. \center
  89. \includegraphics[scale=0.5]{lbp.png}
  90. \caption{LBP 3 x 3 (Pietik\"ainen, Hadid, Zhao \& Ahonen (2011))}
  91. \end{figure}
  92. The pattern will be an 8-bit integer. This is accomplished by shifting the
  93. boolean value of each comparison one to seven places to the left.
  94. This results in the following mathematical expression:
  95. Let I($x_i, y_i$) be a grayscale Image and $g_n$ the value of the pixel $(x_i,
  96. y_i)$. Also let $s(g_i, g_c)$ (see below) with $g_c$ being the value of the
  97. center pixel and $g_i$ the grayscale value of the pixel to be evaluated.
  98. $$
  99. s(g_i, g_c) = \left \{
  100. \begin{array}{l l}
  101. 1 & \quad \text{if $g_i$ $\geq$ $g_c$}\\
  102. 0 & \quad \text{if $g_i$ $<$ $g_c$}\\
  103. \end{array} \right.
  104. $$
  105. $$LBP_{n, g_c = (x_c, y_c)} = \sum\limits_{i=0}^{n-1} s(g_i, g_c) \cdot 2^i$$
  106. The outcome of this operations will be a binary pattern. Note that the
  107. mathematical expression has the same effect as the bit shifting operation that
  108. we defined earlier.
  109. \item Given this pattern for each pixel, the next step is to divide the image
  110. into cells.
  111. \item Compute a histogram for each cell.
  112. \begin{figure}[H]
  113. \center
  114. \includegraphics[scale=0.7]{cells.png}
  115. \caption{Divide into cells (Pietik\"ainen et all (2011))}
  116. \end{figure}
  117. \item Consider every histogram a vector element and concatenate all histograms.
  118. The concatenation is the feature vector of the image.
  119. \item Feed these vectors to a support vector machine. The SVM will ``learn''
  120. which vectors to associate with a character.
  121. \end{enumerate}
  122. To our knowledge, LBP has yet not been used in this manner before. Therefore,
  123. it will be the first thing to implement, to see if it lives up to the
  124. expectations. When the proof of concept is there, it can be used in a final,
  125. more efficient program.
  126. Later we will show that taking a histogram over the entire image (basically
  127. working with just one cell) gives us the best results.
  128. \subsection{Matching the database}
  129. Given the LBP of a character, a Support Vector Machine can be used to classify
  130. the character to a character in a learning set. The SVM uses the concatenation
  131. of the histograms of all cells in an image as a feature vector (in the case we
  132. check the entire image no concatenation has to be done of course. The SVM can
  133. be trained with a subset of the given dataset called the ``learning set''. Once
  134. trained, the entire classifier can be saved as a Pickle object\footnote{See
  135. \url{http://docs.python.org/library/pickle.html}} for later usage.
  136. In our case the support vector machine uses a radial gauss kernel function. The
  137. SVM finds a seperating hyperplane with minimum margins.
  138. \section{Implementation}
  139. In this section we will describe our implementation in more detail, explaining
  140. the choices we made in the process.
  141. \subsection{Character retrieval}
  142. In order to retrieve the characters from the entire image, we need to
  143. perform a perspective transformation. However, to do this, we need to know the
  144. coordinates of the four corners of each character. For our dataset, this is
  145. stored in XML files. So, the first step is to read these XML files.
  146. \paragraph*{XML reader}
  147. The XML reader will return a `license plate' object when given an XML file. The
  148. licence plate holds a list of, up to six, NormalizedImage characters and from
  149. which country the plate is from. The reader is currently assuming the XML file
  150. and image name are corresponding, since this was the case for the given
  151. dataset. This can easily be adjusted if required.
  152. To parse the XML file, the minidom module is used. So the XML file can be
  153. treated as a tree, where one can search for certain nodes. In each XML
  154. file it is possible that multiple versions exist, so the first thing the reader
  155. will do is retrieve the current and most up-to-date version of the plate. The
  156. reader will only get results from this version.
  157. Now we are only interested in the individual characters so we can skip the
  158. location of the entire license plate. Each character has
  159. a single character value, indicating what someone thought what the letter or
  160. digit was and four coordinates to create a bounding box. If less then four
  161. points have been set the character will not be saved. Else, to make things not
  162. to complicated, a Character class is used. It acts as an associative list, but
  163. it gives some extra freedom when using the data.
  164. When four points have been gathered the data from the actual image is being
  165. requested. For each corner a small margin is added (around 3 pixels) so that no
  166. features will be lost and minimum amounts of new features will be introduced by
  167. noise in the margin.
  168. In the next section you can read more about the perspective transformation that
  169. is being done. After the transformation the character can be saved: Converted
  170. to grayscale, but nothing further. This was used to create a learning set. If
  171. it does not need to be saved as an actual image it will be converted to a
  172. NormalizedImage. When these actions have been completed for each character the
  173. license plate is usable in the rest of the code.
  174. \paragraph*{Perspective transformation}
  175. Once we retrieved the corner points of the character, we feed those to a
  176. module that extracts the (warped) character from the original image, and
  177. creates a new image where the character is cut out, and is transformed to a
  178. rectangle.
  179. \subsection{Noise reduction}
  180. The image contains a lot of noise, both from camera errors due to dark noise
  181. etc., as from dirt on the license plate. In this case, noise therefore means
  182. any unwanted difference in color from the surrounding pixels.
  183. \paragraph*{Camera noise and small amounts of dirt}
  184. The dirt on the license plate can be of different sizes. We can reduce the
  185. smaller amounts of dirt in the same way as we reduce normal noise, by applying
  186. a Gaussian blur to the image. This is the next step in our program.
  187. The Gaussian filter we use comes from the \texttt{scipy.ndimage} module. We use
  188. this function instead of our own function, because the standard functions are
  189. most likely more optimized then our own implementation, and speed is an
  190. important factor in this application.
  191. \paragraph*{Larger amounts of dirt}
  192. Larger amounts of dirt are not going to be resolved by using a Gaussian filter.
  193. We rely on one of the characteristics of the Local Binary Pattern, only looking
  194. at the difference between two pixels, to take care of these problems. \\
  195. Because there will probably always be a difference between the characters and
  196. the dirt, and the fact that the characters are very black, the shape of the
  197. characters will still be conserved in the LBP, even if there is dirt
  198. surrounding the character.
  199. \subsection{Creating Local Binary Patterns and feature vector}
  200. Every pixel is a center pixel and it is also a value to evaluate but not at the
  201. same time. Every pixel is evaluated as shown in the explanation
  202. of the LBP algorithm. There are several neighbourhoods we can evaluate. We have
  203. tried the following neighbourhoods:
  204. \begin{figure}[H]
  205. \center
  206. \includegraphics[scale=0.5]{neighbourhoods.png}
  207. \caption{Tested neighbourhoods}
  208. \end{figure}
  209. We name these neighbourhoods respectively (8,3)-, (8,5)- and
  210. (12,5)-neighbourhoods, after the number of points we use and the diameter
  211. of the `circle´ on which these points lay.
  212. We chose these neighbourhoods to prevent having to use interpolation, which
  213. would add a computational step, thus making the code execute slower. In the
  214. next section we will describe what the best neighbourhood was.
  215. Take an example where the full square can be evaluated, so none of the
  216. neighbours are out of bounds. The first to be checked is the pixel in the left
  217. bottom corner in the square 3 x 3, with coordinate $(x - 1, y - 1)$ with $g_c$
  218. as center pixel that has coordinates $(x, y)$. If the grayscale value of the
  219. neighbour in the left corner is greater than the grayscale
  220. value of the center pixel than return true. Bit-shift the first bit with 7. The
  221. outcome is now 1000000. The second neighbour will be bit-shifted with 6, and so
  222. on. Until we are at 0. The result is a binary pattern of the local point just
  223. evaluated.
  224. Now only the edge pixels are a problem, but a simple check if the location of
  225. the neighbour is still in the image can resolve this. We simply state that the
  226. pixel has a lower value then the center pixel if it is outside the image
  227. bounds.
  228. \paragraph*{Histogram and Feature Vector}
  229. After all the Local Binary Patterns are created for every pixel, this pattern
  230. is divided into cells. The feature vector is the vector of concatenated
  231. histograms. These histograms are created for cells. These cells are created by
  232. dividing the \textbf{pattern} in to cells and create a histogram of that. So
  233. multiple cells are related to one histogram. All the histograms are
  234. concatenated and fed to the SVM that will be discussed in the next section,
  235. Classification. We did however find out that the use of several cells was not
  236. increasing our performance, so we only have one histogram to feed to the SVM.
  237. \subsection{Classification}
  238. For the classification, we use a standard Python Support Vector Machine,
  239. \texttt{libsvm}. This is an often used SVM, and should allow us to simply feed
  240. data from the LBP and Feature Vector steps into the SVM and receive results.
  241. Usage a SVM can be divided in two steps. First, the SVM has to be trained
  242. before it can be used to classify data. The training step takes a lot of time,
  243. but luckily \texttt{libsvm} offers us an opportunity to save a trained SVM.
  244. This means that the SVM only has to be created once, and can be saved for later
  245. usage.
  246. We have decided only to include a character in the system if the SVM can be
  247. trained with 70 examples. This is done automatically, by splitting the data set
  248. in a learning set and a test set, where the first 70 occurrences of a character
  249. are added to the learning set, and all the following are added to the test set.
  250. Therefore, if there are not enough examples, all available occurrences end up
  251. in the learning set, and non of these characters end up in the test set. Thus,
  252. they do not decrease our score. If such a character would be offered to the
  253. system (which it will not be in out own test program), the SVM will recognize
  254. it as good as possible because all occurrences are in the learning set.
  255. \subsection{Supporting Scripts}
  256. To be able to use the code efficiently, we wrote a number of scripts. This
  257. section describes the purpose and usage of each script.
  258. \subsection*{\texttt{create\_characters.py}}
  259. \subsection*{\texttt{create\_classifier.py}}
  260. \subsection*{\texttt{find\_svm\_params.py}}
  261. \subsection*{\texttt{generate\_learning\_set.py}}
  262. \subsection*{\texttt{load\_learning\_set.py}}
  263. \subsection*{\texttt{run\_classifier.py}}
  264. \section{Finding parameters}
  265. Now that we have a functioning system, we need to tune it to work properly for
  266. license plates. This means we need to find the parameters. Throughout the
  267. program we have a number of parameters for which no standard choice is
  268. available. These parameters are:
  269. \begin{tabular}{l|l}
  270. Parameter & Description \\
  271. \hline
  272. $\sigma$ & The size of the Gaussian blur. \\
  273. \emph{cell size} & The size of a cell for which a histogram of LBP's
  274. will be generated. \\
  275. \emph{Neighbourhood}& The neighbourhood to use for creating the LBP. \\
  276. $\gamma$ & Parameter for the Radial kernel used in the SVM. \\
  277. $c$ & The soft margin of the SVM. Allows how much training
  278. errors are accepted. \\
  279. \end{tabular}
  280. For each of these parameters, we will describe how we searched for a good
  281. value, and what value we decided on.
  282. \subsection{Parameter $\sigma$}
  283. The first parameter to decide on, is the $\sigma$ used in the Gaussian blur. To
  284. find this parameter, we tested a few values, by trying them and checking the
  285. results. It turned out that the best value was $\sigma = 1.4$.
  286. Theoretically, this can be explained as follows. The filter has width of
  287. $6 * \sigma = 6 * 1.4 = 8.4$ pixels. The width of a `stroke' in a character is,
  288. after our resize operations, around 8 pixels. This means, our filter `matches'
  289. the smallest detail size we want to be able to see, so everything that is
  290. smaller is properly suppressed, yet it retains the details we do want to keep,
  291. being everything that is part of the character.
  292. \subsection{Parameter \emph{cell size}}
  293. The cell size of the Local Binary Patterns determines over what region a
  294. histogram is made. The trade-off here is that a bigger cell size makes the
  295. classification less affected by relative movement of a character compared to
  296. those in the learning set, since the important structure will be more likely to
  297. remain in the same cell. However, if the cell size is too big, there will not
  298. be enough cells to properly describe the different areas of the character, and
  299. the feature vectors will not have enough elements.
  300. In order to find this parameter, we used a trial-and-error technique on a few
  301. cell sizes. During this testing, we discovered that a lot better score was
  302. reached when we take the histogram over the entire image, so with a single
  303. cell. Therefore, we decided to work without cells.
  304. A reason we can think of why using one cell works best is that the size of a
  305. single character on a license plate in the provided dataset is very small.
  306. That means that when dividing it into cells, these cells become simply too
  307. small to have a really representative histogram. Therefore, the
  308. concatenated histograms are then a list of only very small numbers, which
  309. are not significant enough to allow for reliable classification.
  310. \subsection{Parameter \emph{Neighbourhood}}
  311. The neighbourhood to use can only be determined through testing. We did a test
  312. with each of these neighbourhoods, and we found that the best results were
  313. reached with the following neighbourhood, which we will call the
  314. (12,5)-neighbourhood, since it has 12 points in a area with a diameter of 5.
  315. \begin{figure}[H]
  316. \center
  317. \includegraphics[scale=0.5]{12-5neighbourhood.png}
  318. \caption{(12,5)-neighbourhood}
  319. \end{figure}
  320. \subsection{Parameters $\gamma$ \& $c$}
  321. The parameters $\gamma$ and $c$ are used for the SVM. $c$ is a standard
  322. parameter for each type of SVM, called the `soft margin'. This indicates how
  323. exact each element in the learning set should be taken. A large soft margin
  324. means that an element in the learning set that accidentally has a completely
  325. different feature vector than expected, due to noise for example, is not taken
  326. into account. If the soft margin is very small, then almost all vectors will be
  327. taken into account, unless they differ extreme amounts. \\
  328. $\gamma$ is a variable that determines the size of the radial kernel, and as
  329. such determines how steep the difference between two classes can be.
  330. Since these parameters both influence the SVM, we need to find the best
  331. combination of values. To do this, we perform a so-called grid-search. A
  332. grid-search takes exponentially growing sequences for each parameter, and
  333. checks for each combination of values what the score is. The combination with
  334. the highest score is then used as our parameters, and the entire SVM will be
  335. trained using those parameters.
  336. The results of this grid-search are shown in the following table. The values
  337. in the table are rounded percentages, for better readability.
  338. \begin{tabular}{|r|r r r r r r r r r r|}
  339. \hline
  340. c $\gamma$ & $2^{-15}$ & $2^{-13}$ & $2^{-11}$ & $2^{-9}$ & $2^{-7}$ &
  341. $2^{-5}$ & $2^{-3}$ & $2^{-1}$ & $2^{1}$ & $2^{3}$\\
  342. \hline
  343. $2^{-5}$ & 61 & 61 & 61 & 61 & 62 &
  344. 63 & 67 & 74 & 59 & 24\\
  345. $2^{-3}$ & 61 & 61 & 61 & 61 & 62 &
  346. 63 & 70 & 78 & 60 & 24\\
  347. $2^{-1}$ & 61 & 61 & 61 & 61 & 62 &
  348. 70 & 83 & 88 & 78 & 27\\
  349. $2^{1}$ & 61 & 61 & 61 & 61 & 70 &
  350. 84 & 90 & 92 & 86 & 45\\
  351. $2^{3}$ & 61 & 61 & 61 & 70 & 84 &
  352. 90 & 93 & 93 & 86 & 45\\
  353. $2^{5}$ & 61 & 61 & 70 & 84 & 90 &
  354. 92 & 93 & 93 & 86 & 45\\
  355. $2^{7}$ & 61 & 70 & 84 & 90 & 92 &
  356. 93 & 93 & 93 & 86 & 45\\
  357. $2^{9}$ & 70 & 84 & 90 & 92 & 92 &
  358. 93 & 93 & 93 & 86 & 45\\
  359. $2^{11}$ & 84 & 90 & 92 & 92 & 92 &
  360. 92 & 93 & 93 & 86 & 45\\
  361. $2^{13}$ & 90 & 92 & 92 & 92 & 92 &
  362. 92 & 93 & 93 & 86 & 45\\
  363. $2^{15}$ & 92 & 92 & 92 & 92 & 92 &
  364. 92 & 93 & 93 & 86 & 45\\
  365. \hline
  366. \end{tabular} \\
  367. The grid-search shows that the best values for these parameters are $c = 2^5 =
  368. 32$ and $\gamma = 2^{-3} = 0.125$.
  369. \section{Results}
  370. The goal was to find out two things with this research: The speed of the
  371. classification and the accuracy. In this section we will show our findings.
  372. \subsection{Accuracy}
  373. Of course, it is vital that the recognition of a license plate is correct,
  374. almost correct is not good enough here. Therefore, we have to get the highest
  375. accuracy score we possibly can.
  376. According to Wikipedia\footnote{
  377. \url{http://en.wikipedia.org/wiki/Automatic_number_plate_recognition}},
  378. commercial license plate recognition software score about $90\%$ to $94\%$,
  379. under optimal conditions and with modern equipment.
  380. Our program scores an average of $93\%$. However, this is for a single
  381. character. That means that a full license plate should theoretically
  382. get a score of $0.93^6 = 0.647$, so $64.7\%$. That is not particularly
  383. good compared to the commercial ones. However, our focus was on getting
  384. good scores per character, and $93\%$ seems to be a fairly good result.
  385. Possibilities for improvement of this score would be more extensive
  386. grid-searches, finding more exact values for $c$ and $\gamma$, more tests
  387. for finding $\sigma$ and more experiments on the size and shape of the
  388. neighbourhoods.
  389. \subsection{Speed}
  390. Recognizing license plates is something that has to be done fast, since there
  391. can be a lot of cars passing a camera in a short time, especially on a highway.
  392. Therefore, we measured how well our program performed in terms of speed. We
  393. measure the time used to classify a license plate, not the training of the
  394. dataset, since that can be done offline, and speed is not a primary necessity
  395. there.
  396. The speed of a classification turned out to be reasonably good. We time between
  397. the moment a character has been 'cut out' of the image, so we have a exact
  398. image of a character, to the moment where the SVM tells us what character it
  399. is. This time is on average $65ms$. That means that this technique (tested on
  400. an AMD Phenom II X4 955 CPU running at 3.2 GHz) can identify 15 characters per
  401. second.
  402. This is not spectacular considering the amount of calculating power this CPU
  403. can offer, but it is still fairly reasonable. Of course, this program is
  404. written in Python, and is therefore not nearly as optimized as would be
  405. possible when written in a low-level language.
  406. Another performance gain is by using one of the other two neighbourhoods.
  407. Since these have 8 points instead of 12 points, this increases performance
  408. drastically, but at the cost of accuracy. With the (8,5)-neighbourhood
  409. we only need 1.6 ms seconds to identify a character. However, the accuracy
  410. drops to $89\%$. When using the (8,3)-neighbourhood, the speedwise performance
  411. remains the same, but accuracy drops even further, so that neighbourhood
  412. is not advisable to use.
  413. \section{Conclusion}
  414. In the end it turns out that using Local Binary Patterns is a promising
  415. technique for License Plate Recognition. It seems to be relatively indifferent
  416. for the amount of dirt on license plates and different fonts on these plates.
  417. The performance speed wise is fairly good, when using a fast machine. However,
  418. this is written in Python, which means it is not as efficient as it could be
  419. when using a low-level languages.
  420. We believe that with further experimentation and development, LBP's can
  421. absolutely be used as a good license plate recognition method.
  422. \section{Reflection}
  423. \subsection{Difficulties}
  424. During the implementation and testing of the program, we did encounter a
  425. number of difficulties. In this section we will state what these difficulties
  426. were and whether we were able to find a proper solution for them.
  427. \subsubsection*{Dataset}
  428. We did experience a number of problems with the provided dataset. A number of
  429. these are problems to be expected in a real world problem, but which make
  430. development harder. Others are more elemental problems.
  431. The first problem was that the dataset contains a lot of license plates which
  432. are problematic to read, due to excessive amounts of dirt on them. Of course,
  433. this is something you would encounter in the real situation, but it made it
  434. hard for us to see whether there was a coding error or just a bad example.
  435. Another problem was that there were license plates of several countries in
  436. the dataset. Each of these countries has it own font, which also makes it
  437. hard to identify these plates, unless there are a lot of these plates in the
  438. learning set.
  439. A problem that is more elemental is that some of the characters in the dataset
  440. are not properly classified. This is of course very problematic, both for
  441. training the SVM as for checking the performance. This meant we had to check
  442. each character whether its description was correct.
  443. \subsubsection*{SVM}
  444. We also had trouble with the SVM for Python. The standard Python SVM, libsvm,
  445. had a poor documentation. There was no explanation what so ever on which
  446. parameter had to be what. This made it a lot harder for us to see what went
  447. wrong in the program.
  448. \subsection{Workload distribution}
  449. The first two weeks were team based. Basically the LBP algorithm could be
  450. implemented in the first hour, while some talked and someone did the typing.
  451. Some additional 'basics' where created in similar fashion. This ensured that
  452. every team member was up-to-date and could start figuring out which part of the
  453. implementation was most suited to be done by one individually or in a pair.
  454. \subsubsection*{Who did what}
  455. Gijs created the basic classes we could use and helped everyone by keeping
  456. track of what was required to be finished and whom was working on what.
  457. Tadde\"us and Jayke were mostly working on the SVM and all kinds of tests
  458. whether the histograms were matching, and what parameters had to be used.
  459. Fabi\"en created the functions to read and parse the given xml files with
  460. information about the license plates. Upon completion all kinds of learning
  461. and data sets could be created. Richard helped out wherever anyone needed a
  462. helping hand, and was always available when someone had doubts about what they
  463. where doing or needed to ask something. He also wrote an image cropper that
  464. automatically exactly cuts out a character, which eventually turned out to be
  465. obsolete.
  466. \subsubsection*{How it went}
  467. Sometimes one cannot hear the alarm bell and wake up properly. This however was
  468. not a big problem as no one was afraid of staying at Science Park a bit longer
  469. to help out. Further communication usually went through e-mails and replies
  470. were instantaneous! A crew to remember.
  471. \section{Discussion}
  472. \begin{thebibliography}{9}
  473. \bibitem{lbp1}
  474. Matti Pietik\"ainen, Guoyin Zhao, Abdenour hadid,
  475. Timo Ahonen.
  476. \emph{Computational Imaging and Vision}.
  477. Springer-Verlag, London,
  478. 1st Edition,
  479. 2011.
  480. \bibitem{wikiplate}
  481. \emph{Automatic number-plate recognition}. (2011, December 17).\\
  482. Wikipedia.
  483. Retrieved from http://en.wikipedia.org/wiki/Automatic\_number\_plate\_recognition
  484. \end{thebibliography}
  485. \appendix
  486. \section{Faulty Classifications}
  487. \begin{figure}[H]
  488. \center
  489. \includegraphics[scale=0.5]{faulty.png}
  490. \caption{Faulty classifications of characters}
  491. \end{figure}
  492. \end{document}