Giter Club home page Giter Club logo

qrcodereader's Introduction

QR Code Detector

QR code Detector was developed for fun and to learn opencv and image processing and computer vision. Everyone is welcome to have a look into the code and use it for their purpose.The code is distributed under MIT License.

Requirements

  • Python 2.7 +
  • OpenCV 3.2.0 +
  • Flask 0.10.1 +

I recommend to install Python Anaconda so that all useful libraries are available at one go.

Working

  • All input images are placed under the Input folder
  • while the generated output images are placed in the Output folder
  • The input and output folder are fully configured using config.yml file

How To Use

Just run the call.py to get the output of the images placed in the Input Folder. If you want to change the Input folder, just write it in the config.yml file in the input section. You can change the location of the ouput folder by configuring it the ouput part. Run python simple_gui.py to read an image via a GUI having a QRCode or more, in the terminal and you will be automatically redirected to browser. In browser, upload the input image.

Contributing

We welcome your contributions. Please feel free to fork the code, play with it, make some patches and send us pull requests . MAIL me for any discussion on the project or contribution

ScreenShot

  • Input1 Input1
  • Output1 Ouput1
  • Input2 Input1
  • Output2 Ouput1

Results in Browser

  • Input1 Input3
  • Output1 Output3
  • Output2 Output4
  • Output3 Output5

Support

Please open an issue on GitHub if you'd like to report a bug or request a feature.

Donate

License

The code is released under MIT license and free to use.

Status

The project is not actively maintained. I am happy to accept PRs on the project.

qrcodereader's People

Contributors

debugduck avatar griffintaur avatar hemaolle avatar ujjaldas1997 avatar xiangshaocheng 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

Watchers

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

qrcodereader's Issues

update README with the new UI

The project has a new UI while the readme still shows the windows pop up, which needs to be updated with the new look and feel

Possible HCC2D add-on

Is it possible to have QRcode with multiple data channels to store 3x data?
Possible data splitter: def splitting(data): [return b"0"+data[0::3], b"1"+data[1::3], b"2"+data[2::3]]
And then run those through a QRcode generator, and use red, green, blue channels to pack them?

Improve handling on images without QR code

This spins off issue #19
After testing with several images without QR code, I've seen 3 different outcomes (there might be more I have not discovered). I'm new to this repo and may not able to tackle these immediately.
Further divide-and-conquer might be useful.

  1. program finished with QR code output by mistake
    ea_logo ea_logo_outpt
  2. program seemed to get stucked until keyboard interruption
    amazon_logo amazon_logo_output
  3. program exited with error
    california_yosemite national park yosemite_output

Make codebase Flake8-compliant

The codebase should use a common styling convention in order to make it easier for new developers to understand the code. We can use Flake8 to achieve this.

If a path is not valid, an exception should be raised.

If a path is not valid, an exception should be raised instead of just printing "file not found". This will prevent the confusion caused by the error message when the program continues to execute without a file found.

Line to change: https://github.com/Griffintaur/QRCodeReader/blob/master/Imagehandler.py#L18

Current output when a path is invalid:

suzil@vladimir ~/Documents/random/QRCodeReader $ python call.py 
file not found
Traceback (most recent call last):
  File "call.py", line 36, in <module>
    App()
  File "call.py", line 28, in App
    TransformImage=obj.QRCodeInImage()
  File "/home/suzil/Documents/random/QRCodeReader/Imagehandler.py", line 66, in QRCodeInImage
    patternFindingObj=PatternFinding(self.GetImageContour(),self.imageOriginal)
  File "/home/suzil/Documents/random/QRCodeReader/Imagehandler.py", line 43, in GetImageContour
    thresholdImage= self.__convertImagetoBlackWhite()
  File "/home/suzil/Documents/random/QRCodeReader/Imagehandler.py", line 21, in __convertImagetoBlackWhite
    self.Image=cv.imread(self.ImagePath,cv.IMREAD_COLOR)
AttributeError: 'Imagehandler' object has no attribute 'ImagePath'

Return the boolean expression directly

Statements like this one in PatternFinding.py

if parent == -1:
            return False
        else:
            return True

Should be rewritten to the equivalent, but simpler

return not (parent == -1)

Handling error in bad input and affine_transform of contours

  1. The program call.py shows an error for an input containing no QR, which need to be handled.
  2. When an input image contains a rotated image(rotated by some angle), the output of the image shows the identified contours of the input image format, whereas the output image is transformed according to right, top and bottom of contours. For example --
    Input -
    imageedit_2_5244152259
    and Output -
    output0

Repository needs a `.gitignore` file so that I don't have to worry about committing irrelevant files.

git should not recognize *.pyc files.

suzil@vladimir ~/Documents/random/QRCodeReader $ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   call.py
	modified:   config.yml

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	AffineTransformation.pyc
	FindingOrientationOfContours.pyc
	Imagehandler.pyc
	PatternFinding.pyc

Algorithm Improvement

Don't know if you are still maintaining this project. But I found something that might improve this program.
In Imagehandler.py line 56, it seems you convert the raw image to threshold image, and then apply Canny operator on it.
However, Canny operator can directly be applied on grayscale image, and thus reduce infomation loss in such progress.
By changing the parameter cv.Canny (Imagehandler.py line 57) from threshold_image to grayscale_image, will greatly improve the accuracy of the result.

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.