How to get a binary representation of a binary descriptor

asked 2016-02-26 03:19:30 -0500

501 - not implemented gravatar image

updated 2016-02-26 03:22:23 -0500

Hello, I'm working with binary descriptors like ORB and AKAZE in opencv and want to store each descriptor (a col of the descriptor mat) as binary string. To perform the query, I want to save these representation as a array of integers (int = 32 bits and I have a 32 bit machine), so I can easy compare binary string with hamming distance.

My problem is to extract the bit representation from the mat because the at has byte representation. Is there something that I must conside if want to extract the bits?

thank you! :)

edit retag flag offensive close merge delete



i don't think, you have to convert the descriptors at all.

why not use a simple norm(a,b,NORM_HAMMING); ?

berak gravatar imageberak ( 2016-02-26 03:28:54 -0500 )edit

no I doesn't normalize the descriptor. Is this important? And after the normaliztion, I can easy extract each row and concatendate the byte to a integer?

501 - not implemented gravatar image501 - not implemented ( 2016-02-26 04:28:54 -0500 )edit

it's not about normalization, the norm() function calculates a distance (hamming in this case)

berak gravatar imageberak ( 2016-02-26 04:37:59 -0500 )edit

ah...of course...but no, I want not use intern functions of opencv for this. I want only extract the string representation

501 - not implemented gravatar image501 - not implemented ( 2016-02-26 04:41:03 -0500 )edit

An integer is sort of already a binary array. Store them as integers and operate on bit-level. Also, you can always do something like this:

thierrypin gravatar imagethierrypin ( 2016-02-26 07:42:33 -0500 )edit