Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

so, there are several ORB descriptors in your vector, each of them has 32 uint32_t items, and descriptors.size() / 32 is the correct count ?

so, since there are will be several ORB descriptors in your vector, and each of them has 32 4 uint32_t items, and descriptors.size() / 324 is should be the correct count ?count.

you could try:

std::vector<uint32_t> descriptors = ....
assert(descriptors.size()%4==0); // must be multiple of 4!
int count = descriptors.size() / 4;

Mat ocv_desc(count, 32, CV_8U, (uchar*)descriptors.data());

so, since there will be several ORB descriptors in your vector, and each of them has 4 8 uint32_t items, descriptors.size() / 48 should be the correct count.

you could try:

std::vector<uint32_t> descriptors = ....
assert(descriptors.size()%4==0); assert(descriptors.size()%8==0); // must be multiple of 4!
8!
int count = descriptors.size() / 4;
8;

Mat ocv_desc(count, 32, CV_8U, (uchar*)descriptors.data());