The choice of 8 and 32 bits pattern is due to storage and efficiency issues.
The bit order in BRIEF, ORB and BRISK is not relevant (unlike FREAK).
Thus, all bits of these descriptors are of equal significance, and you can't just compare the first part of the bitstream, etc.
On the other had, FREAK was designed with such a matching process (called a cascade in FREAK's paper) in mind.
Well, computers don't store individual bits. Thus, you won't see anybody storing BRIEF and the like in bit arrays.
The smallest component that can be read from memory is a byte (corresponding usually to 8 bits, although some DSPs cannot read chunks that are smaller than 16 bits, but that's another story).
Thus, you could see people storing their descriptors in byte arrays (type unsigned char
in C/C++, which is the underlying OpenCV implementation language).
Plus, memory accesses are usually better (faster) when the variables are aligned on CPU word boundaries.
Most CPU's nowadays have words of 32 or 64 bits, 32 bits words being the better choice because 64 bits architectures were designed with the legacy 32-bits processors in mind.
Hamming distance is computed via an XOR operation.
It happens that many processors have dedicated instruction sets that can compute XOR efficiently with 32 bits words (the common size of an integer before 64 bits CPUs became more common).
Even more, they may also support computing several XOR values on multiple 32 bits words in parallel, which is a parallelism technique called SIMD (Single Input Multiple Data). For example, SSE extensions can be leveraged to further accelerate the Hamming distance computation of BRIEF/ORB/... descriptors whose size is a multiple of 32 bits.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…