Note that there are some explanatory texts on larger screens.

plurals
  1. POSIFT implementation Python error
    primarykey
    data
    text
    <p>I am using the SIFT implementation from vlfeat.org in Python, vlfeat.py. </p> <p>I keep getting an error stating <strong>too many indices</strong> and the line number indicates that the error occurs when <code>read_features_from_file()</code> is executed. </p> <p>I also noticed that the file <em>features1.sift</em> is empty, meaning something goes wrong when <code>executing process_image()</code>. </p> <p><strong>Code Snippet</strong> :</p> <pre><code>from PIL import Image from pylab import * import vlfeat as vlf vlf.process_image('semper1.jpg','features1.sift', params="--edge-thresh 10 --peak-thresh 5") l1,d1 = vlf.read_features_from_file('features1.sift') image = array(Image.open('semper1.jpg')) vlf.process_image('semper2.jpg','features2.sift', params="--edge-thresh 10 --peak-thresh 5") l2,d2 = vlf.read_features_from_file('feautures2.sift') image2 = array(Image.open('semper2.jpg')) matches = vlf.match(d1,d2) imshow(image) for k in xrange(len(matches)): if matches[k] &gt; 0: plot(l1[k, 0], l1[k, 1], 'r.') plot([l1[k,0], l2[matches[k,0],0]], [l1[k,1], l2[matches[k,0],1]], 'b-') show() </code></pre> <p>Here's what process_image looks like: </p> <pre><code>def process_image(imagename,resultname,params="--edge-thresh 10 --peak-thresh 5"): """ process an image and save the results in a file""" if imagename[-3:] != 'pgm': #create a pgm file im = Image.open(imagename).convert('L') im.save('tmp.pgm') imagename = 'tmp.pgm' cmmd = str("sift "+imagename+" --output="+resultname+ " "+params) os.system(cmmd) print 'processed', imagename, 'to', resultname </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload