In BFMatcher::knnMatchImpl in matchers.cpp there is the following code:
https://github.com/Itseez/opencv/blob/master/modules/features2d/src/matchers.cpp#L728
const int IMGIDX_SHIFT = 18;
const int IMGIDX_ONE = (1 << IMGIDX_SHIFT);
https://github.com/Itseez/opencv/blob/master/modules/features2d/src/matchers.cpp#L825
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?