Giter Site home page Giter Site logo

document-scanner's People

Contributors

vipul-sharma20 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  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  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

document-scanner's Issues

cv2 has not member imread and resize

I just tried to debug the scanner.py file and it tells me in line 8, cv2 has no 'imread' member:
Has anyone had the same problem yet? Am I missing a module or package that needs to be installed?
I already installed opencv-python succesfully...
Thanks

blog post

I noticed someone in the HN thread posted about how a blog post from 2014 had the same code as found in this repository.

We should give that pyimagesearch blog post credit in the README

Modify perspective rectification to match paper aspect ratio

Currently, when the code performs the perspective rectification/correction, the code maps the original image to an [800 x 800] image (800 is hardcoded).

As a result, the resulting image looks "squashed" in the x direction.

To improve the output, one could map the image to an image size whose aspect ratio matches the paper size aspect ratio.
For instance, let's assume that the form will come in the A4 paper size:
http://www.papersizes.org/a-paper-sizes.htm
The A4 ratio of height-to-width is 11.7 / 8.3 ~= 1.41.

So, to maintain an A4 aspect ratio when doing the perspective correction, you can map the original image to an image of size [800 x 1128](800 * 1.41 = 1128).

Since your test image is landscape, the dimensions should be:
Height: 800 pixels
Width: 1128 pixels
It'd be neat to also autodetect paper orientation, ie portrait vs landscape.

[Blog] "OpenCV's methods may not perform accurately for very large dimensions"

In your blog post:
http://vipulsharma20.blogspot.in/2016/01/document-scanner-using-python-opencv.html

You write that:
"The original image is resized and scaled down as OpenCV's methods may not perform accurately for very large dimensions. (Above image is the scaled down/resized version)"

I think you should consider rewording this sentence. Instead of "accuracy", do you mean performance/efficiency?

For instance, doing contour detection on a 18000 x 18000 image is likely to be extremely slow. Instead, one can downscale the image to a more manageable size -- say, 1800 x 1800 -- and still get comparable results.

Your original phrasing seems to suggest that certain operations will have bad results on very large images, but will somehow get better simply by downsizing the image. This seems odd -- and wrong -- to me.

Otherwise, I liked the writeup!

[Sorry, this issue doesn't deal with your code at all, but I thought I'd put it here to keep things localized. Thanks!]

contours error

Hello,

I get the following error with valid arguments and (to the best of my knowledge) satisfied dependencies. Any ideas?

Traceback (most recent call last):
File "/path/to/scanner.py", line 28, in
(contours, _) = cv2.findContours(edged, cv2.RETR_LIST, cv2.CHAIN_APPROX_NONE)
ValueError: too many values to unpack

Thank you!
zelon88

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.