Anuradha
Anuradha

Reputation: 53

OpenCV Code to compare descriptors stored in a list with new image descriptors

I'm currently doing a research on Automatic traffic sign detection using SIFT algorithm for final year University project. I am using OpenCV and at the moment I have reached until find Descriptors of an image. I am storing this SIFT features in a list using following code,

vector<Descriptor> m_keyDescs;

m_keyDescs.push_back(Descriptor(descxi, descyi, fv));

Now I want to use this features to compare with a new image and I want to recognize whether the new image is same as the previous image. But I have no idea how to use this features that stored in a list to identify new image. How can I retrieve this stored list and compare with newly created Descriptors of an image??

I am so glad if you can help me as I'm new to OpenCV. :)

I have defined Descriptor class as,

 class Descriptor
 {
 public:
 float xi, yi;      
 vector<double> fv; // Feature vector

Descriptor()
{
}

Descriptor(float x, float y, vector<double> const& f)
{
    xi = x;
    yi = y;
    fv = f;
}
};

Thanks for your kind consideration...

Upvotes: 1

Views: 2082

Answers (1)

user7610
user7610

Reputation: 28751

To match Descriptors you need a DescriptorMatcher (like BruteForceMatcher in this example). More documentation on those can be found on OpenCV site here

Upvotes: 1

Related Questions