Long range license plate recognition

5 Comments

IMG_9936_3Automatic license/number plate recognition (ALPR / ANPR) is a specialized kind of optical character (OCR). Target applications might include automatic car parking control, electronic toll collection, neighborhood watch, vehicle tracking and such.

Concerns about these systems have centered on privacy fears of government tracking citizens’ movements. Critics have described it as a form of mass surveillance. Nice let’s try!

As I have few telephoto lenses, selected one with has highest MTF. In this case sharpness won over focal length. My trusty Kurokesu C1 USB camera has pixel size of 2×2µm so sharpness will help achieving better results.

Gear

  • Kurokesu C1 USB web camera
  • Sigma 70-300 telephoto lens
  • EOS to C-mount adapter
  • 5mm adapter ring C-mount to CS-mount
  • Tripod
  • Computer

Packed all items and headed to nearest bridge to hunt for traffic. View at angle at 300mm is in a range of degree. It was windy outside, so had to lower tripod to most stable position but shakiness was not eliminated completely.

map1

Distance to target vehicles is about 460m, width of the road is ~7m.

IMG_9929_r

Field “workstation” setup.

Process data

I was using openALPR – open for community users, but if needed it has commercial support and cloud based processing plans.

License plate recognition is time consuming process. To process single frame it takes about 300ms with default settings. So this is was not realtime process (unless video is recorded at 3 or less frames per second). Therefore I will process recorded data with native alpr utility offline.

alpr.exe -c eu samples\1.avi -n 2 -j > results.json

Overlay results on original video

Generated results.json file contains useful information like license place number with confidence level, region of detected plate, time stamp. I made quick and dirty python script (which is even not worth publishing) to overlay this information on top of original video file.

Video shows all you need to know. Additional local plate training and filtering would help increase confidence level and recognition reliability.

out2

Is this a tool for you to use? It depends on your application. If your application is to screen traffic realtime like I just did – this tool is not quite suitable due to high cpu load. If you would like to make automated entry into your house or parking it should work pretty well. Just consider implementing extra light sources for night time operation. Computer vision works much better when it has good light source.

On the other hand camera with lens like this can be used as a decent surveillance or spy tool by itself.

Comments ( 5 )

  1. Johnathan Hill
    Very very interesting, Thanks for sharing this. (Johnathan Hill from Reddit)
    • saulius
      Thank you Johnathan!
  2. Big Brother and Others Are Watching Your Car | Hackaday
    […] We are all (hopefully) aware that we can be watched while we’re online. Our clicks are all trackable to some extent, whether it’s our country’s government or an advertiser. What isn’t as obvious, though, is that it’s just as easy to track our movements in real life. [Saulius] was able to prove this concept by using optical character recognition to track the license plate numbers of passing cars half a kilometer away. […]
  3. bigdaddyjsb@gmail.com
    This is really cool. Do you still have the code for this? I would love to test out a similar system.
    • saulius
      Basically one command did all black magic (it's in the blog post). Just OpenALPR changed a lot since, there is a great chance command structure will not be the same.

Leave a reply

Your email address will not be published.