Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SIFT descriptors ARE float, come rain or come shine:

>>> sift = cv2.xfeatures2d.SIFT_create()
>>> im = cv2.imread("img/crack.jpg",0)
>>> im.shape
(379, 500)
>>> kp,des = sift.detectAndCompute(im,None)
>>> des
array([[ 47.,   9.,   6., ...,   0.,   0.,   2.],
       [  8.,   3.,   5., ...,   0.,   7.,  15.],
       [ 28.,  14.,   2., ...,   4.,   2.,   1.],
       ...,
       [ 88.,   6.,   1., ...,  21.,  17.,   5.],
       [ 66.,   5.,   1., ...,  23.,  22.,   7.],
       [  2.,   0.,   0., ...,   2.,   1.,   1.]], dtype=float32)

SIFT descriptors ARE float, come rain or come shine:

>>> sift = cv2.xfeatures2d.SIFT_create()
>>> im = cv2.imread("img/crack.jpg",0)
>>> im.shape
(379, 500)
>>> kp,des = sift.detectAndCompute(im,None)
>>> des
array([[ 47.,   9.,   6., ...,   0.,   0.,   2.],
       [  8.,   3.,   5., ...,   0.,   7.,  15.],
       [ 28.,  14.,   2., ...,   4.,   2.,   1.],
       ...,
       [ 88.,   6.,   1., ...,  21.,  17.,   5.],
       [ 66.,   5.,   1., ...,  23.,  22.,   7.],
       [  2.,   0.,   0., ...,   2.,   1.,   1.]], dtype=float32)

(those are actually histogram bins, counters, they are integer numbers (in a float array), not truncated at all)