Code Monkey home page Code Monkey logo

label_inspection's Introduction

Read this before running the code:

  • Make sure the paths to images and database are put correctly in inspection.py, inspect_folder.py, and main.py.
  • Run main.py if you are interested in continuously monitoring and image directory and inspecting new uploads (e.g. in production setting).
  • Run inspect_folder.py if you are interested in inspecting all images in the directory.
  • Run insection.py if you are interested in inspecting single image. Background
  • This is a pet project, not an official project.
  • The code can inspect text and symbols on the labels.
  • The code is not intended to read barcodes.

Structure of the code

main.py Constantly monitor image directory and when there is a new image, call the inspection module to inspect the image. Free up space periodically by deleting old images.

Inspection.py The inspect function accepts the image and returns the inspection results (pass/fail) along with cause(s) of the fail. The function inspects text and symbols. Inspection is done in three parts: text inspection, symbol inspection, and reporting the output.

Part 1: Text inspection Step 1: Open, binarize and filter image, using OpenCV library. Step 2: Extract text from the image using Tesseract library. Step 3: Compare this text to the information in product database, and check the validity of

  • Catalog #
  • Manufacturing date
  • Expiry date
  • Product description
  • Product code Part 2: Symbol inspection Template matching was performed to identify symbols. Step 1: Open, binarize and filter image and template, using OpenCV library. Step 2: Perform template matching. The output is a ndarray of r values. Step 3: Pass the symbol inspection if maximum r value > threshold.

Part 3 Print the summary of inspection results and write it to a csv file.

label_inspection's People

Contributors

amohajerani avatar

Watchers

James Cloos avatar

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.