skm
skm

Reputation: 5649

Concept behind SIFT descriptor

I have read some literature about SIFT and watched some videos also. I understood most of the concepts behind SIFT but one thing which confuses me is about SIFT descriptors.

In SIFT:

image

My confusion:

Upvotes: 3

Views: 1569

Answers (1)

marol
marol

Reputation: 4074

The opencv's 2.4.8 source says you should get n by 128 descriptor matrix, where n is the number of keypoints. You can see calcDescriptors() creates descriptor for every keypoint by refrencing descriptors rows.

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));
    }
}

Upvotes: 2

Related Questions