I'm using opencv in VC2010 and I'm quite familiar with it.
I installed OPENCV 2.4.5 today and tried to display an image for testing if my opencv works or not.
it was amazing that this code displays the image in release mode but when I change the compiler mode to debug, opencv cannot find the image and returns null for image data !!!
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
int main()
{
cv::RNG rng;
cv::Mat image = cv::imread("1.jpg",-1);
cv::imshow("Image",image);
cv::waitKey(0);
return 0;
}
the error is shown as :
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupport
ed array type) in unknown function, file ..\..\..\src\opencv\modules\core\src\ar
ray.cpp, line 2482
I'm sure that in release Mode the code works fine , So the path, the image name and everything is fine but I don't know why it's not working in debug mode.
I also gave absolute path as input and it did not work either !! but again the absolute path worked on release mode !
it worth saying that I also tested my project both on 32bit and 64bit libraries of opencv and the problem did not change !!