Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Python module for use with David Lowe's SIFT code available at:
- http://www.cs.ubc.ca/~lowe/keypoints/
- adapted from the matlab code examples.
- import os
- from numpy import *
- import pylab
- def process_image(imagename, resultname):
- """ process an image and save the results in a .key ascii file"""
- #check if linux or windows
- if os.name == "posix":
- cmmd = "./sift <"+imagename+">"+resultname
- else:
- cmmd = "siftWin32 <"+imagename+">"+resultname
- os.system(cmmd)
- print 'processed', imagename
- import sift
- imname = ’empire.jpg’
- im1 = array(Image.open(imname).convert(’L’))
- sift.process_image(imname,’empire.sift’)
- l1,d1 = sift.read_features_from_file(’empire.sift’)
- figure()
- gray()
- sift.plot_features(im1,l1,circle=True)
- show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement