I'm working on a piece of code that performs feature matching with 128 dimensional descriptors.
All descriptors for an image are stored in a std::vector, where InterestPoint contains a member *double desc, which is the descriptorvector.
Now I want to use this structure in a Flann Matrix to later do Approximate Nearest Neighbor feature matching, which I initialize as such:
std::vector<InterestPoint> ip1;
//processing for building vector containing interest points
flann::Matrix<double> input(new double[ip1.size()*128], ip1.size(), 128);
How can I now fill this flann::Matrix with the *double desc members from every element of the ip1 vector? This is what I tried:
for(size_t i = 0; i < ip1.size(); i++)
{
for(size_t j = 0; j < 128; j++)
{
input[i][j] = ip1[i].ivec[j];
}
}
Compiled but didn't work out. flann offers a way to access every row of the flann::Matrix, using the operator [], the Matrix class is thus row major.
Thanks in advance,