How to make an array element (class mat), where the elements are bitstrings

asked 2014-01-24 07:37:54 -0600

updated 2014-01-24 08:05:13 -0600

Hello,

acutally i work with this code:

Mat image = imread("img1.ppm",CV_LOAD_IMAGE_GRAYSCALE);
ORB orb;
vector<key_points>;
Mat descriptors;
orb.detect(image,key_points,Mat());
orb.compute(image,key_points,descriptors);

so the elements from Mat descriptors is uchar (usigned char). So i get for example:

descriptors(1,1)=184

is there any way to get a bitstring for every element like this example

descriptors(1,1)=100111010101

and so on? I need this, because i use ORB and ORB uses BRIEF descriptor

my first try was: Mat descriptors(rows,cols,CV_32FC2); and it fail

please help me

edit retag flag offensive close merge delete

Comments

what do you need the bits for ? visualization ?

uchar b = descriptors.at<uchar>(1,1); for(int i=0;i<8;i++) cerr << ((b&(1<<i))?1:0); cerr << endl;

berak gravatar imageberak ( 2014-01-24 07:53:11 -0600 )edit