Problem: VS2013community+opencv2.4.13.x86 cannot open local images in debug mode, prompting error:
But you can run the generated exe file directly by entering the debugging directory
code:
#include "stdafx.h"
#include "opencv2\highgui\highgui.hpp"
int main(int argc, char ** argv)
{
IplImage* img = cvLoadImage("template.bmp");
printf("%d", img->imageSize);
cvNamedWindow("Example1", CV_WINDOW_AUTOSIZE);
cvShowImage("ExampleImage1", img);
cvWaitKey(0);
cvRelease((void **)(&img));
cvDestroyWindow("Example1");
return 0;
}
The default running directory is not the compilation directory, but the root directory by default