Monday, February 28, 2011

[Py] SURF tests with mahotas.surf

I installed mahotas in my Python for the purpose of trying the SURF. There is a simple example on the mahotas document page, but some minor modifications are needed. Here is the modified example code:



import numpy as np
import pylab
import mahotas.surf

f = mahotas.imread('lena.png')
spoints = mahotas.surf.surf(f)

f2 = mahotas.surf.show_surf(f, spoints[:20])
pylab.imshow(f2)
pylab.show()


Note that only grayscale images can be directly used as the input. Here only the first 20 interesting points have been plotted.

No comments:

Post a Comment