我只是想开始学习 OpenCV。我的理解是 ExtractSURF 应该返回 0 到 360 之间的角度。出于某种原因,关键点总是为我返回 90 的方向。任何想法为什么?
这段代码:
import cv
image = cv.LoadImageM('lena.bmp', cv.CV_LOAD_IMAGE_GRAYSCALE)
(keypoints, descriptors) = cv.ExtractSURF(image, None, cv.CreateMemStorage(), (0, 6000, 1, 3))
for keypoint in keypoints:
((x, y), laplacian, size, dir, hessian) = keypoint
print "x=%d y=%d laplacian=%d size=%f dir=%f hessian=%f" % (x, y, laplacian, size, dir, hessian)
返回
x=345 y=201 laplacian=1 size=22.000000 dir=90.000000 hessian=6674.604492
x=82 y=270 laplacian=-1 size=18.000000 dir=90.000000 hessian=7615.113770
x=90 y=278 laplacian=-1 size=15.000000 dir=90.000000 hessian=12525.487305
x=112 y=254 laplacian=1 size=22.000000 dir=90.000000 hessian=8894.154297
x=273 y=274 laplacian=-1 size=24.000000 dir=90.000000 hessian=16313.005859
x=154 y=319 laplacian=-1 size=15.000000 dir=90.000000 hessian=9818.360352
x=172 y=333 laplacian=-1 size=26.000000 dir=90.000000 hessian=8314.745117
x=137 y=386 laplacian=-1 size=15.000000 dir=90.000000 hessian=9148.833984
x=140 y=363 laplacian=-1 size=22.000000 dir=90.000000 hessian=7735.985840