1 '''
2 Created on Feb 2, 2011
3
4 @author: bolme
5 '''
6
7
8 import cv
9
10 -def surf(im,mask=None,extended=False,hessianThreshold=500, nOctaves=3, nOctaveLayers=4):
11 '''
12 Keypoints contain a
13 0: center point
14 1 sign of laplacian (-1,0,+1)
15 2 scale - diameter or radius
16 3 angle
17 4 response value
18
19 Descriptors contain 64 floating point numbers
20
21 @param im: image to extract features from.
22 @type im: pv.Image
23 @param mask: a mask that controls where features are extracted from.
24 @type mask: OpenCV 8bit image
25 @return: (keypoints,descriptors)
26 '''
27 cvim = im.asOpenCVBW()
28 keypoints,descriptors = cv.ExtractSURF(cvim,mask,cv.CreateMemStorage(),(int(extended),hessianThreshold,nOctaves,nOctaveLayers))
29 return keypoints,descriptors
30