1 | initial version |
To convert to bit stream:
descriptors.type()
For example, for ORB descriptor, the desciptor type is CV_8U
, the descriptor size is 256 so there are 256/8=32 columns in the matrix.
The corresponding code prints the descriptor values with binary string:
for(int i = 0; i < descriptors.rows; i++) {
std::string binary_string = "";
for(int j = 0; j < descriptors.cols; j++) {
binary_string += std::bitset< 8 >( descriptors.at<uchar>(i,j) ).to_string();
}
std::cout << i << ") " << binary_string << std::endl;
}