Git Product home page Git Product logo

pysift's Introduction

PySIFT

This project contains an implementation of the SIFT keypoint extraction algorithm in Python. For a detailed explanation, visit the following blog post: https://medium.com/@lerner98/implementing-sift-in-python-36c619df7945.

Usage

Pass in a filename for the --input argument and a prefix for the --output parameter. In addition to plotting the keypoints, main.py will save results/<prefix>_kp_pyr.pkl and results/<prefix>_feats_pyr.pkl files containing the computed features.

Warning

I do not maintain this repository. The code is provided as-is, so if you encounter an issue (which is likely) I would advise you to try and fix it yourself.

Also, if anyone wants to maintain this repository, leave an issue and I will gladly add you as a collaborator or transfer ownership.

Limitations

The code is unoptimized. This means that I took time to implement each step of SIFT as described in the paper as faithfully as I could but I did not do a second pass over the implementation for optimization. Therefore, on any reasonably-sized image, it should be fairly slow.

In addition, there is currently a mistake in the keypoint scaling. When scaled up from the higher levels of the pyramid, they get off center. This can be seen in the following example:

example

pysift's People

Contributors

saml98 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

Watchers

 avatar  avatar  avatar  avatar

pysift's Issues

issue about keypoint localization

Hi, @SamL98

I got a little confused about the Line 43 in keypoints.py, it wrote offset = -LA.inv(HD).dot(J). You defined the HD as a 3 by 3 array, and the shape of J is 1 by 3. How that possible to use a dot operation between them?

Negative sigma values return an error

With the picture that I'm working, sigma = kp[2]*1.5 on line 50 in orientation.py returns a negative sigma value. This obviously results in an error when passed to gaussian_filter. Any idea why kp[2] might be negative?

Array out of Bounds issue

When I feed in different images to the SIFT class to extract the SIFT features sometimes for some images I keep getting this error:
weight = kernel[oy+w, ox+w] * m
IndexError: index 9 is out of bounds for axis 1 with size 9

I would truly appreciate if you could fix this as I cannot find the root to the problem. In the case you I have a paypal link. I would gladly donate for all the amazing work you did. This SIFT implementation is a very good one :)

hello,SamL98

File PySIFT/orientation.py", line 65, in assign_orientation
weight = kernel[oy+w, ox+w] * m
IndexError: index 5 is out of bounds for axis 1 with size 5

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.