I am using OpenCV 2.3.1 with Windows 8. When I call function cvShowImage the program crashes. I am using codeblocks and I don’t know why this happens.
If I comment the line the program runs well.
The code looks as follows:
IplImage *img1=NULL;
img1=cvLoadImage("LenaComFormas.pgm",CV_LOAD_IMAGE_GRAYSCALE);
cvShowImage("Original", img1);
cvWaitKey(0);
your code is working fine with Qt and opencv 2.4.3 on Windows7…possible checks you can do…
IplImage *img1 = cvLoadImage("",0);if(img1==NULL)return -1;3 . check the support of *.pgm images…or else get the latest opencv and try…
EDIT..
4 . just for check try the following..