I have a web site that allows users to upload images of cars and I would like to put a privacy filter in place to detect registration plates on the vehicle and blur them.
The blurring is not a problem but is there a library or component (open source preferred) that will help with finding a licence within a photo?
Caveats;
- I know nothing is perfect and image recognition of this type will provide false positive and negatives.
- I appreciate that we could ask the user to select the area to blur and we will do this as well, but the question is specifically about finding that data programmatically; so answers such as 'get a person to check every image' is not helpful.
- This software method is called 'Automatic Number Plate Recognition' in the UK but I cannot see any implementations of it as libraries.
- Any language is great although .Net is preferred.
There is a new, open source library on GitHub that does ANPR for US and European plates. It looks pretty accurate and it should do exactly what you need (recognize the plate regions). Here is the GitHub project: https://github.com/openalpr/openalpr
Yes I use gocr at http://jocr.sourceforge.net/ its a commandline application which you could execute from your application. I use it in a couple of my applications.
The blurring is not a problem but is there a library or component (open source preferred) that will help with finding a licence within a photo?
Ans: The CARMEN FreeFlow ANPR Software engine (Commerical)
It maybe work looking at Character recoqnition software as there are many libraries out there that perform the same thing. I reading an image and storing it. Micrsoft office is able to read tiff files and return alphanumerics
EDIT: I wrote a Python script for this.
As your objective is blurring (for privacy protection), you basically need a high recall detector as a first step. Here's how to go about doing this. The included code hints use OpenCV with Python.
Apply Gaussian Blur.
Let the input image be the following.
Threshold the resultant image using strict threshold or OTSU's binarization.
Apply a Morphological Closing operation using suitable structuring element. (I used 16x4 as structuring element)
Resultant Image after Step 5.
Find external contours of this image.
For each contour, find the
minAreaRect()
bounding it.All
minAreaRect()
s are shown in orange and the one which satisfies our criteria is in green.You can apply other filters you deem suitable to increase recall and precision. The detection can also be trained using HOG+SVM to increase precision.
I came across this one that is written in java javaANPR, I am looking for a c# library as well.
I would like a system where I can point a video camera at some sailing boats, all of which have large, identifiable numbers on them, and have it identify the boats and send a tweet when they sail past a video camera.