GithubHelp home page GithubHelp logo

trisha11r / bag_of_visual_words Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 15.68 MB

Implementation of basic ‘bag of visual words’ model using SIFT Algorithm and Shape Context Matching to identify and match logos on scanned documents.

MATLAB 100.00%
sift-algorithm sift sift-descriptors shape-context shape-matching bag-of-visual-words image-processing matlab-code feature-descriptors keypoint

bag_of_visual_words's Introduction

Logo Spotting using Bag of Visual Words Model

Implementation of basic ‘bag of visual words’ model using two different approaches for feature descriptor extraction(SIFT Algorithm and Shape Context Matching) to identify and match company logos on scanned documents.

Bag of Visual Words

  • Used in image classification

  • adopted from NLP's Bag of words concept, where we count the number of times each word appears in a document and use this frequency to know keywords of the document and make a frequency histogram from it. The document is treated as a bag of words.

  • For BoVW, instead of words we use the features of the image. Image features are unique patterns that we can find in an image.

  • Image -> set of features -> consists of keypoints and descriptors. Keypoints and descriptors are used to construct vocabularies and represent each image as a frequency histoogram of features that are in the image. Frequency hitograms are the bag of visual words (BoVW).

    Keypoints: standout points in an image, no matter whether the img rotated/shrunk/exapnded, keypoints will always be same
    Descriptors: description of the keypoints
    

SIFT (Scale Invariant Feature Transform)

  • Invariant to scale, rotation, illummination and viewpoint of image.

  • Steps

    • Constructing a scale space

      generate seven octaves of original image, each octave's image size is half the previous one
      within an octave images arew progressively blurred using Gaussian Blur
      
  • LoG approximation (Laplace of Gaussian): used to blur images using Gaussian Blur

  • Finding the keypoints

    maxima and minima of DoG image by comparing neighbourhood pixels in current scale, scale above and scale below
    
  • Get rid of bad keypoints

    edges and low contrast regions use technique similar to Harris Corner Detector
    
  • Assign orientation to the keypoints to achieve rotation invariance. Assign orientation to each keypoint and do all calculations relative to that.

  • Generate sift features to uniquely identify features

Shape Matching using Shape Context

  • Shape context is the feature descriptor used in object recognition

  • take points from contours of shape

  • translational invariance possible, complete rotational and scaling invariance also possible after modifications

  • Steps:

    • Solve for correspondences between points on the 2 shapes (using shape contexts)

      compute marching costs using Chi-squared distance, minimize total cost of matching such that matching is one to one
      
    • Use correspondences to estimate an aligning transform, using regularized thin plate splines

      thin plate spline: physical analogy involving bending sheet of metal
      thin plate spline interpolation: minimize bend energy
      
    • Compute distance between 2 shapes

bag_of_visual_words's People

Contributors

trisha11r avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

fanyanfu

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.