I have a binary vector generated for each keypoint as its description. I would like to create my own binary descriptor matrix. I understand that descriptors are just matrices. Binary descriptor is a matrix with depth CV_8U. Below is my code to create the matrix. But is there an easy way to populate it?
//I have 4096 bit data for descriptor. So 4096/8=512 will be my bytes
cv::Mat descriptors;
int bytes_ = 512;
descriptors.create((int)keypoints.size(), bytes_ , CV_8U);
I have the binary data in the form of four 32X32 binary images. How do I encode this data into the descriptor matrix? I would like to use opencv's DescriptorMatcher to match the descriptors later.