Diogo Sampaio, Tomás Pacheco - May 27, 2024
Last time we discussed our python code, there were many imperfections and errors that made it hard to correctly read any license plates. However, after a lot of trial and error through big revisions and small corrections, we managed to make our code better at processing license plates correctly.
How the Image Processing is Handled
Firstly, we changed the code in order to turn any black and blue sections of the license plate black:
Right after this change, we repeatedly, through a double for clause, turn the image into many shades of gray to facilitate processing for any machine, while also raising the contrast between lighter and darker shades to ensure correct reading regardless of luminosity conditions, using the Canny Edge function in opencv:
Next, using the FindCountours function, we try to find any contours in the following image:
As we can see by the placement of the green lines, the processing hasn't been successful in the first iteration. Since there was no text detected by the program, it jumps into the next iteration of the aforementioned double for.
The second iteration is, in this case, more successful, yielding these results for step #1, #2 and #3, respectively:
As we can see, the license plate has been successfully identified and text was, indeed, detected.
Before reading the content of the license plate, the program first crops the image to the point only it is visible:
Finally, the program is ready to read the license plate (expand to see):
After reading 6 characters, the reading loop ends, producing the following result:
Which is, as we can see, correct.
Errors, Difficulties and Moving Forward
Even with these changes and enhancement of the code, it still has its' shortcomings:
The program cannot differenciate a "0" from an "O";
Sometimes reads "4"'s as "L"'s;
We still cannot use images taken from many different angles.
These following weeks, we mainly hope to make our program recognize the difference between these specific characters, since it is a big necessity if we hope to correctly read any license plate.
And this is how our program works!
Thank you for your attention and interest in understanding how we make our project come to life! For more articles regarding the engineering our team does everyday, check this very same blog for more posts.
Σχόλια