I am developing an opensv application for the ios platform. I have opencv compiled by me for debugging and release schemes, but when I try to run the cv::meanStdDev function using the debugging scheme, the application crashes with an exception (with Release it works fine). The test function is very simple:
float list[] = {1.2,1.2,1.3,0.3,6.5,2.2,0.9,0.8,0.9}; cv::Mat test(1,9,CV_32F, list); cv::Scalar mean1, stddev1; cv::meanStdDev(test, mean1, stddev1); printf("[%f, %f]", mean1.val[0], stddev1.val[0]);
This function works correctly in the Release schema, but in Debug it throws an exception similar to this:
OpenCV Error: Assertion failed (dims == 2 && ((sizes[0] == sz.height && sizes[1] == sz.width) || (allowTransposed && sizes[0] == sz.width && sizes[1] == sz.height))) in create, file /Users/jgoenetxea/libraries/OpenCV-2.4.0/trunk/opencv/modules/core/src/matrix.cpp, line 1375 terminate called throwing an exception
This line is the "create" function of the matrix class. At this point, the kind() function gives different values ββin the debug and release circuits for the same matrix. When a debugging scheme is selected, due to the result of this kind() function, the execution checks some data with a call to the CV_Assert function, and then fails.
Any ideas? Does anyone know what I can check?