I am using Opencv 2.3.1 with visual studio 2008 on my windows 7 32 bit machine.I have just installed/extracted opencv 2.3.1 and it works fine with visual studio 2008 as I am not getting any errors while compiling a opencv code .My problem is that,the program is unable to read any image.
My code is
#include "stdafx.h"
#include <cv.h>
#include <highgui.h>
int main()
{
IplImage* img = cvLoadImage("C:\Users\Anks\Documents\Visual Studio 2008\Projects\examp_aishack\aishack.jpg");
cvNamedWindow("myfirstwindow");
cvShowImage("myfirstwindow", img);
cvWaitKey(0);
cvReleaseImage(&img);
return 0;
}
By compiling this I get zero error and but when I run it the console window appears and a blank(gray) window appear.It doesnot show the image. I have throughly searched internet ,but unable to solve my problem.Please help me. PS:I am a novice in opencv.