You store the descriptor of one image in one Mat
variable. So, basically you have one Mat
for one descriptors. So, if you have 100 descriptors then, all of these decriptors should be present in a single Mat
. You can do it as following:
Step-1: Declare a vector
of Mat
type.
vector<Mat> allDescriptors;
Step-2: Then find descriptors for each image and store it in Mat
format
Mat newImageDescriptor;
Step-3: finally, push the descriptor calculated above into the vector.
allDescriptors.push_back(newImageDescriptor);
Repeat step-2 & 3 for all of your images
Now, you can access them as following:
You can access the data in vector
as you do it in case of arrays
so allDescriptors[0]
will give you the first descriptor in Mat
format
So, by using a for loop
, you can access all of your descriptors.
for(int i=0; i<allDescriptors.size(); i++)
{
Mat accessedDescriptor;
allDescriptors[i].copyTo(accessedDescriptor);
}