Why there is a hardcoded maximum numbers of descriptors that can be matched with BFmatcher?

asked 2016-01-22 10:17:35 -0500

nyd gravatar image

In BFMatcher::knnMatchImpl in matchers.cpp there is the following code:


const int IMGIDX_SHIFT = 18;
const int IMGIDX_ONE = (1 << IMGIDX_SHIFT);


CV_Assert( trainDescCollection[iIdx].rows < IMGIDX_ONE );

What is the point of this assertion that only makes sure that the number of training descriptors cannot be larger than precisely 262144, independently of the computer used?

edit retag flag offensive close merge delete