GithubHelp home page GithubHelp logo

anaghaajith / pythonsift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rmislam/pythonsift

0.0 1.0 0.0 177 KB

A Python implementation of SIFT (for educational purposes only)

Python 100.00%

pythonsift's Introduction

PythonSIFT

This is an implementation of SIFT done entirely in Python with the help of NumPy. A wrapper function, match_template(), matches a template to an image and displays the result as a demonstration of the SIFT algorithm.

Note: this code relies on OpenCV version 2.4.11.

Match a template to an image

The wrapper function match_template() is used to call detect_keypoints().

Running from python in terminal:

from siftmatch import match_template
match_template(imagename, templatename, threshold, cutoff)

where imagename and templatename are filename strings (e.g., "image.jpg"), threshold is the contrast threshold for the sift detector, and cutoff is the maximum distance between a keypoint descriptor in the image and a keypoint descriptor in the template for the two keypoints to be considered a match. A good value for threshold is 5.

Note that if there are too many keypoints, flann.knnSearch() on line 16 of siftmatch.py may fail if you don't have enough RAM. Increasing threshold will reduce the number of keypoints found by SIFT.

Use the SIFT detector/descriptor function directly

Running from python in terminal:

from siftdetector import detect_keypoints
[keypoints, descriptors] = detect_keypoints(imagename, threshold)

where imagename and threshold are defined as above, keypoints is an n by 4 numpy array that holds the n keypoints (the first column is the image row coordinate, the second column is the image column coordinate, the third column is the scale, and the fourth column is the orientation as a bin index), and descriptors is an n by 128 numpy array where each row is the SIFT descriptor for the respective keypoint.

pythonsift's People

Contributors

rmislam avatar

Watchers

 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.