I wish to create a new RGB image in OpenCV using Python. Face and eyes detection in OpenCV The goal of object detection is to find an object of a. Automatic Number Plate Recognition (ANPR) in Python. Published: Tue 21 February 2017. Show me the code. Somwhere in the middle of 2015. After having worked through Learn Python the Hard Way. With a histogram of a verified license plate the histogram would ideally have a bin count distribution of: (3, 2, 0) or (3, 0, 2).
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. EDIT: I wrote a for this.
As your objective is blurring (for privacy protection), you basically need a high detector as a first step. Here's how to go about doing this. The included code hints use OpenCV with Python. Convert to Grayscale.
Apply Gaussian Blur. Img = cv2.imread('input.jpg',1) imggray = cv2.cvtColor(img, cv2.COLORBGR2GRAY) imggray = cv2.GaussianBlur(imggray, (5,5), 0) Let the input image be the following. Apply Sobel Filter to detect vertical edges.
![]()
Threshold the resultant image using strict threshold or OTSU's binarization. Cv2.Sobel(image, -1, 1, 0) cv2.threshold. Apply a Morphological Closing operation using suitable structuring element.
(I used 16x4 as structuring element) se = cv2.getStructuringElement(cv2.MORPHRECT,(16,4)) cv2.morphologyEx(image, cv2.MORPHCLOSE, se) Resultant Image after Step 5. Find external contours of this image. Cv2.findContours(image, cv2.RETREXTERNAL, cv2.CHAINAPPROXNONE). For each contour, find the minAreaRect bounding it. Select rectangles based on aspect ratio, minimum and maximum area, and angle with the horizontal.
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |