GithubHelp home page GithubHelp logo

krshrimali / dimensionality-calculation-using-homography-matrix-and-qr-code-detection Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 2.0 2.18 MB

(My internship selection task at LearnOpenCV | Big Vision LLC) OpenCV based dimensional measurement of a book cover using Homography and Ratio comparison.

License: Apache License 2.0

Python 100.00%
opencv homography detection measurements learning-opencv dimensions zbar snap plane-tracker

dimensionality-calculation-using-homography-matrix-and-qr-code-detection's Introduction

Measurement-of-Book-Cover

OpenCV based dimensional measurement of a book cover using Homography and Ratio comparison.

Files Description

  1. book_dimensions.py : Simpler, easy and gives lengths of all edges.
  2. book_dimension_detection.py : Complex and gives only width and height of the book.
  3. book_dimension_top_bottom_edge.py : Complex, gives length of top and bottom edge of the book (only width)

Folder: images/ : All output and input images are in this folder. Use book_final.jpg as sample image.

Documentation of each file is in the code itself.

What it does?

Approximation of the dimensions of a cover page of a book using techniques: Homography Algorithms, [QR Code Detection using Zbar]

How it does?

  1. QR Code generation using any online web service. [Example: https://www.qr-code-generator.com/]

  2. Detection of the QR Code and Text generation [encoded in the QR code - assuming text or any hyperlink etc.] using zbar module in Python. Credits: learnopencv.com

  3. Printing out the QR Code on a page, assuming it to be on a book - take the snap of it, and determine the approximate dimensions of the book cover, using the measured (manually) dimensions of the QR code.

Note: The QR Code detection has been shown in qr_code_detection.py file, although in the book dimension code - a text has been assumed instead of QR code because of some unavailability of the printing facilities. The version for QR code will be out soon.

  1. Homography technique is used, feature detection, choosing the image of the QR code as the selected area.

Challenges

  1. What if a stack of several books is there and then the snap is clicked? [Challenge credits: Vishwesh Ravi Shrimali].

  2. Which angle should the snap be taken? Sideways? Which one is the better?

  3. Can we measure the number of books in the stack based on the photo angle?

Debugging

In case of errors, import exceptions for following libraries:

  1. video : No module named "video"

Copy and paste video.py from Video Module: OpenCV to the current directory.

  1. plane_tracker: No module named 'plane_tracker'

Copy and paste plane_tracker.py from Plane Tracker: OpenCV to the current directory.

  1. common : No module named 'common'

Copy and paste common.py from Common Module: OpenCV to the current directory.

  1. numpy : No module named 'numpy'

Install numpy either using pip or build from source. pip install numpy [or pip3 based on the pip and python versions] should do, if not, please follow the searches on google.

  1. cv2 : No module named 'cv2'

You need to install OpenCV2 then. pip install opencv-python should do, or follow searches from google for more information.

Note: No function ORB_create() [most probably when you are using python3.5(+) version], if this error comes, then replace ORB_create(nfeatures = 1000) with ORB(nfeatures = 1000) in plane_tracker.py file.


Inspiration Credits: learnopencv.com latest blog post on QR Code Detection.

dimensionality-calculation-using-homography-matrix-and-qr-code-detection's People

Contributors

krshrimali avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

sethips datomi79

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.