vl_dsift trying to get a feature vector at every pixel

前端 未结 1 571
旧巷少年郎
旧巷少年郎 2021-01-16 22:10

I am trying to use vl_dsift to get the 128*1 feature vectors at every pixel. Therefore I want the resulting matrix to have size

128*(#OfPixels)

However when

1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-16 22:40

    I am afraid you cannot extract the feature vectors for all the pixels in the image.

    As you can see from figure 'Dense SIFT descriptor geometry' in the following link ( http://www.vlfeat.org/api/dsift.html ) dense sift extracts the features from 4-by-4 window. Since this box cannot move outside the image, top left bin of the 4-by-4 window can be at first pixel namely (1,1). Thus in this situation ( assuming your bin size is 1), the center of the 4-by-4 window is at (2.5, 2.5) in other words between 2nd and 3rd pixels in both x and y direction. Please notice that in this situation the 4-by-4 window is covering 16 pixels which are [1,4] x [1,4] pixels.

    Now say your image of the size n-by-m. In the same manner when the bottom right bin of 4-by-4 window is at last pixel (pixel at n,m) the center of the 4-by-4 window will be at [n-1.5, m-1.5]. In your case your features will start from pixel at 2.5 x 2.5 and will end at 190.5 x 166.5

    So the bottom line is that the center of 4-by-4 window travels in X direction from 'XMIN + 3/2 * SIZE' to 'MAX - 3/2 * SIZE' with steps of size 'STEP'. Where XMIN and XMAX are the first and the last pixels in X direction respectively. Same for Y axis(See the bottom paragraph 'FURTHER DETAILS ON THE GEOMETRY' at the link http://www.vlfeat.org/matlab/vl_dsift.html). As a result the 4-by-4 window travels whole the image.

    0 讨论(0)
提交回复
热议问题