How to auto crop a car image to get the license plate
18 views (last 30 days)
Show older comments
I want this code to be able to crop a number plate within the bounding box. It has to be done manually atm.
0 Comments
Accepted Answer
Image Analyst
on 19 Jan 2016
Perhaps this demo will help:
If you get the letters like it shows, then you can use bwconvhull() and regionprops() to get the bounding box of all the letters it found. Then use imcrop() to crop it out.
2 Comments
Image Analyst
on 20 Jan 2016
Be sure to use bwconvhull() first (after individual letter segmentation) otherwise you'll have a whole bunch of bounding boxes - one for each letter - instead of just one for the whole plate.
More Answers (1)
Walter Roberson
on 19 Jan 2016
That is not possible as phrased. See http://uk.mathworks.com/matlabcentral/answers/232793-how-to-extract-license-plate and read all of the comments.
7 Comments
Thorsten
on 20 Jan 2016
Edited: Thorsten
on 20 Jan 2016
@Walter: You forgot to add: ... and in absolute darkness... Honestly, license plates are meant to be read. I don't think that there is any legal license plate around in the whole wide world with black letters on a black plate, but you may prove me wrong.
Image Analyst
on 20 Jan 2016
I'm not exactly sure how it works but the automatic plate readers attached to the front of police cars might rely on the police car's headlights to illuminate it. Or maybe they have their own light source to shine out in a particular direction (towards parked cars or straight ahead).
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!