opencvcomputer-visionfeature-descriptorfreak

Freak Descriptor Row type


I have the following code:

//newImg is a mat of an image and orderedKeyPoint is the result from Fast
cv::FREAK extractor;
cv::Mat queryDescriptors;
extractor.compute(newImg, orderedKeyPoint, queryDescriptors);

I am trying to access individual freak descriptors using queryDescriptors.at< ???>(r,0) where r is an arbitrary valid row value but I am not sure of the type. All documentation states that it is just a descriptor, but is that of type Mat or double or something else? Is this the best way of doing it?

cv::Mat descriptor2 = queryDescriptors.at<cv::Mat>(2,0);

I would like to be able to reconstruct queryDescriptors (Mat of descriptors) from individual descriptors by taking them and putting them in the row values of a cv::Mat, ex:

queryDescriptors.at<cv::Mat>(2,0) = descriptor2;

Any help or insight would be greatly appreciated,

Isaac


Solution

  • the FREAK descriptor is a uchar Mat with 64 cols and numkeypoints rows.

    so, to get to an element of it:

    uchar elm = descriptor.at<uchar>(row,col);
    

    where row is the keypoint id, and col is the element id.