I have a project where I need to identify the license plate of a car using OpenCV.
I want to load an image of a number or a letter and let OpenCV identify it and print i
if you are looking to learn more about OpenCV generally, you a good place to start is with this book: Learning OpenCV by Bradksi et al.
dunno what implementations are available in opencv, but a couple other libraries are:
JavaANPR
DTK ANPR
I have recently been working on a simple implementation of ANPR in OpenCV python. You can check it out here
It is written with the help of Shogun Machine Learning toolbox with the Image processing part in OpenCV. Do play with the variables as they need some tweaking for cars from different regions.
You can use the color of the ROI to create the filter. This will work until the plate region and the vehicle has the same color.
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while(1):
_, frame = cap.read()
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_red = np.array([30,150,50])
upper_red = np.array([255,255,180])
mask = cv2.inRange(hsv, lower_red, upper_red)
res = cv2.bitwise_and(frame,frame, mask= mask)
cv2.imshow('frame',frame)
cv2.imshow('mask',mask)
cv2.imshow('res',res)
k = cv2.waitKey(5) & 0xFF
if k == 27:
break
cv2.destroyAllWindows()
cap.release()