SIFT Descriptor Concept

I read some literature about SIFT and watched some videos. I understood most SIFT concepts, but one thing that bothers me is about SIFT descriptors.

In SIFT:

  • we find a key point
  • we take 16 x 16pixels around a key point.
  • Divide the blocks 16 x 16by 16 the number of blocks4 x 4
  • Calculate a histogram 8 binfor each block4 x 4
  • Therefore, we get the SIFT descriptor for this key point. 4 x 4 x 8 = 128

image

My confusion:

  • Let's say my image has 50 key points.
  • The SIFT descriptor that I get for this image ( that is, the Mat descriptor ) has 128 columnsand 1 row..... why ???
  • I have received 128 columnsand 1 rowfor one key point, and then, if I get 50 points, then it should not be a matrix 50 rows, and 128 colmuns?
+4
source share
1 answer

The opencv 2.4.8 source says that you should get n on a 128 descriptor matrix, where n is the number of key points. You can see that calcDescriptors () creates a descriptor for each cue point by overriding the descriptor strings.

static void calcDescriptors(const vector<Mat>& gpyr, const vector<KeyPoint>& keypoints,
                            Mat& descriptors, int nOctaveLayers, int firstOctave )
{
    int d = SIFT_DESCR_WIDTH, n = SIFT_DESCR_HIST_BINS;

    for( size_t i = 0; i < keypoints.size(); i++ )
    {
        // [...]
        // some unrelevant code 

        calcSIFTDescriptor(img, ptf, angle, size*0.5f, d, n, descriptors.ptr<float>((int)i));
    }
}
+2
source

Source: https://habr.com/ru/post/1536612/


All Articles