OpenCV 3 License Plate Recognition Python full source code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello again everybody and welcome back this is the fifth video in our six-part video series covering character recognition and license-plate recognition in OpenCV 3 and in this video we're going to implement license-plate recognition in Python so let's go ahead and dive right into it so G ith UV microcontrollers and more and we'll go ahead and take out the spaces and then we're going to go here and then to repositories and there are two prerequisites to this video today the first is if we go to open CV 3 Windows 10 installation tutorial and then you click on this playlist up here I will definitely suggest viewing this video open CV 3 Windows 10 installation tutorial part 2 Python if you have not already and that covers of course open CV installation configuration when using Python and then the other prerequisite is let's see here open CV 3 KNN character recognition Python which was part 2 of this six-part series where we generated classifications text and flattened images text and we're going to be reusing those files today to perform character recognition once we have our license plates picked out and there is one other thing I should mention in the video for this repository here open CV 3 license plate recognition CPP which was the previous video the fourth part in the series and I'm going to add a link to that up here when I've had a chance to process all these videos but in that video we took a look at dachshund presentation and then this document here which explained the steps that we followed to actually pick the license plate out and to save some time in this video I don't really think it's necessary to repeat that information so I'll refer you to the previous video as far as an explanation of the algorithmic steps were going to perform to recognize the license plate today and we'll just stick to the implementation in this video so if we go finally to our repository for this video here open CV 3 license plate recognition Python and then in Docs and presentation we have the same steps with images document which is this is of course using the Python version of the program so this is PyCharm at the end we're looking at here but it's the same results of each of the images and then steps top PNG this is a sort of a flowchart of some of the data structures and function calls involved in the program and in the C++ version of course we use vectors whereas in Python we use lists so I did update this document so the names are consistent with the Python version of the program so please refer to this document if you're interested in following the program flow along so then we can go ahead and make our directory for our project today so I'll just copy this name up here and then you can go to wherever you like to store your Python programs so I'll go to documents Python probes and go ahead and make a new folder take out the space and to save some time today let's go to download zip and then we'll go to open and it's going to take just a mint to open the zip for us and what we're going to do is we're going to copy in the Python files and also the license-plate images when that's done okay so here's our zip so then we're going to go to yes we know we have that open so then we're going to go to all of these files except for the readme we don't need that so classifications flatten images and the Python files and there we go we can go ahead and copy those into our project directory and then we're going to go to license plate images and we can copy those into our project directory as well and then we can go ahead and open any of these in Pride charm actually let's start with Maine's open with pie charm and PyCharm will take just a moment to load and there are two spots we're going to want to refer to in Maine the first is this here show steps we currently have that set to a default of false we can show that to true to show the steps and then on this line here this is where we choose which image to open so let's go ahead and fire the program up so if we go to shift + alt + f10 and then main we can go ahead and run it and there we go there's our first image picked out McLaren f1 and if we click on the image and press any key and then that will close the program out for us and let's next do show steps here so go ahead and change that to true and run the program again and similar to the previous program we can take a look at our steps here so again see the previous video for more of a detailed explanation but here's the original image threshold grayscale image threshold image and then here we have all our contours here we have the contours that are possible characters here we have everything regrouped in terms of matching characters and then I'm trying to get the text on the bottom to show as well as I can down here it's a little bit tight on the screen but that's okay so in any case if we choose any of these images and then we press a key we can step through each of the 13 license plates and then now we're into the second part of the program we where we essentially perform sort of similar set of steps in each of the 13 potential license plates and we'll find that we get the longest list of characters when we apply character recognition to the set that actually ends up being the final plate McLaren f1 and that's how we perform our plate detection so we'll just test on a few of the other images here so we can turn show steps back off and then maybe we'll just try some different images here so we'll try image 9 and PNY exp s so that's working for us and then we can show image 10 so we go ahead and run that so this is almost too easy but we'll take it 0m n65 and then we're going to show let's do 11 and then maybe just 12 so here we have this is a little disappointing hor 5 sh1t is misread hu so our character recognition isn't perfect is we get a very good threshold abut it's still misread as au I'm not sure the reasons for that and then of course the one is well actually that is supposed to be a 1 it's just sort of a play on words with the way the vanity plate is but anyhow we can go to 12 and FA ll Y and then the always read as a 9 and then you that's a little disappointing because we can see we get a very good threshold on that so our character recognition isn't but it's still pretty good so let's just do one more flight then and there's a five and easy ey this is a particularly good read because the play takes up a pretty small portion of the image and it's not especially well lit with this bright lighting in the background here so that's that's a very good read so I'd say that was successful in this programs working pretty well for us so that's going to conclude this video and in the next video we're going to take a look at the final program in this series which is going to be implementing license-plate recognition in Visual Basic so I'll see everybody in the next one
Info
Channel: Chris Dahms
Views: 213,537
Rating: undefined out of 5
Keywords: OpenCV, Python, Software, Tutorial
Id: fJcl6Gw1D8k
Channel Id: undefined
Length: 7min 7sec (427 seconds)
Published: Sat Jan 09 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.