GithubHelp home page GithubHelp logo

pyanpd's Introduction

pyANPD

pyANPD is a high recall automatic number plate detector based on this Stack Overflow answer. For details of the algorithm, check the answer on Stack Overflow. The detector is robust to orientation. The precision decreases and recall increases if the edge_density threshold is decreased.

Dependencies

  1. OpenCV
  2. Numpy

Usage

python pyANPR.py <image_file_path>

This outputs an image with the same name with -detected appended.

How to tweak it for your dataset?

Change aspect_ratio_range (Range of Aspect Ratio for Accepted Rectangles), area_range (Range of Area for Accepted Rectangles), and se_shape (Shape of Structuring Element for Morphological Closing) to the taste of your own dataset.

Results

1 2 3

pyanpd's People

Contributors

abdulfatir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyanpd's Issues

Failure with OpenCV 4

Using opencv-python-4.1.0.25, the following error is generated:

$ python pyANPD.py image.jpg 
Traceback (most recent call last):
  File "pyANPD.py", line 152, in <module>
    o1 = process_image(path, 0, type='rect')
  File "pyANPD.py", line 79, in process_image
    _,contours,_=cv2.findContours(gray, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
ValueError: need more than 2 values to unpack

This does not happen with OpenCV 3.4.5.20, i.e. use
pip install opencv-python==3.4.5.20

TypeError: Expected cv::UMat for argument 'src'

Traceback (most recent call last):
File "D:\Computer Vision\pyANPD-master\pyANPD.py", line 152, in
o1 = process_image(path, 0, type='rect')
File "D:\Computer Vision\pyANPD-master\pyANPD.py", line 73, in process_image
gray = cv2.cvtColor(input_image, cv2.COLOR_BGR2GRAY)
TypeError: Expected cv::UMat for argument 'src'

Add -blur option

Would be great if the library had a direct -blur option, i.e. rather than just highlight the selected regions (which works well), it blurred them instead.

src data type = 17 is not supported

TypeError Traceback (most recent call last)
in ()
1 t1 = time.time()
----> 2 o1 = process_image(path, 0, type='rect')
3 #cv2.imwrite('%s-detected.png' % path[:path.rfind('.')], o1)
4
5 print ('Time taken: %d ms'%((time.time()-t1)*1000))

in process_image(name, debug, **options)
7 raw_image = cv2.imread(name,1)
8 input_image = np.copy(raw_image)
----> 9 gray = cv2.cvtColor(input_image, cv2.COLOR_BGR2GRAY)
10 gray = enhance(gray)
11 gray = cv2.GaussianBlur(gray, (5,5), 0)

I am working to extract name plate using this code using 1-detection.png image but getting this error .
please verify and send the results

problem

HI!
How can I deal with this problem?
I use the report picture to run the code
but it have the problem!
default

Display All contours

Hello!

How to display all possible contours?
i.e minAreaRect()s are shown in orange and the one which satisfies our criteria is in green.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.