English 中文(简体)
License plate recognition using OpenCV
原标题:

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 it to the console.

Is there a function do this? If not, how can I do it?

Note: I am working on gray level

Please help, I have to make it a week from now


thank you for your fast answer

I am working with Microsoft Visual C++ 2008 Express Edition

and about library the following libraries are whwat i used:

"C:Program FilesOpenCVlib"
"C:Program FilesOpenCVcvinclude"
"C:Program FilesOpenCVcxcoreinclude"
"C:Program FilesOpenCVotherlibshighgui"
"C:Program FilesOpenCVcvauxinclude"
"C:Program FilesOpenCVotherlibs\_graphicsinclude"
"C:Program FilesOpenCVcvsrc"
"C:Program FilesOpenCVcxcoresrc"
"C:Program FilesOpenCVcvauxsrc"
"C:Program FilesOpenCVotherlibshighgui"
"C:Program FilesOpenCVotherlibs\_graphicssrc"
问题回答

dunno what implementations are available in opencv, but a couple other libraries are:

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.

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()




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签