Error -215 trainDescCollection[iIdx] Python OpenCV

opencv, python, sift, surf

Solution

This is an open bug in opencv. https://github.com/Itseez/opencv/issues/5700

Try using smaller images (for example, take a subset and/or down-sample). It looks as though the implementation involves a tricky (in the pejorative sense) optimisation which assumed that the number of features (in one of the images) is less than some magic power-of-two.

Problem

I'm matching two images and in the 80% of the cases works but in some cases it crashes and show up this message: ... matches = matcher.match(d1, d2) error: ......\opencv-2.4.6\modules\features2d\src\matchers.cpp:365: error: (-215) trainDescCollection[iIdx].rows < IMGIDX_ONE where `d1` and `d2` are the descriptors of the two images. I searh in Google but didn't found an answer. Maybe its a stupid error but I'm a noob in this field. Furthermore I read in this website the following declaration :'it works perfectly just with SIFT and SURF descriptors(which are non free)'. Do you know if SIFT and SURF are protected by copyright? Thanks all!

Original source