OpenCV 3.1: cvflann::anyimpl::bad_any_cast

asked 2016-06-03 14:39:50 -0600

Hi there,

I have an iOS project running OpenCV 3.1. I have this bit of code that crashes ONLY in debug mode. If I run this exact same code but change Xcode to run the project in release mode, the crash does not occur and it works as expected.

vector< vector< cv::DMatch >> matches;
cv::FlannBasedMatcher matcher(new cv::flann::LshIndexParams(10, 10, 2));
matcher.knnMatch(descriptors, movingImage.descriptors, matches, 2);

The error that prints is: "libc++abi.dylib: terminating with uncaught exception of type cvflann::anyimpl::bad_any_cast"

My problem is very similar to these other issues mentioned here: http://answers.opencv.org/question/10... http://answers.opencv.org/question/50...

But neither of those solve my issue. Also, these issues were brought up almost 3 years ago and it seems like they should be fixed by now.

Any ideas?

edit retag flag offensive close merge delete

Comments

I am moving from OpenCV 2.4 to OpenCV 3 and facing the same problem. I tried versions 3.1.0, 3.2.0, 3.3.0 with no luck. I tried ORB and AKAZE as features.

Does anyone know a solution?

mbeer gravatar imagembeer ( 2017-09-05 04:50:57 -0600 )edit

Did you find a solution for this?

rentziass gravatar imagerentziass ( 2017-11-15 03:17:51 -0600 )edit