Hi
if anyone can help me to fix this OpenCV bug it would be great.
I started learning OpenCV few weeks before and I found some difficulties in installation process and using the following code I test me first sample.
But it gives an error like this
1>------ Build started: Project: hello, Configuration: Debug Win32 ------
1>Compiling...
1>img.c
1>c:\manoj\cprogram\hello\hello\img.c(4) : fatal error C1083: Cannot open include file: 'cv.h': No such file or directory
1>Build log was saved at "file://c:\manoj\cprogram\hello\hello\Debug\BuildLog.htm"
1>hello - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I have add all the necessary lib as fallows, but still I get this error , do I have to add any header file in my project apart this ? to run my program ? please let me know if there is any thing I have to add to make my program run.
Additional Include Directories: "C:\Program Files\OpenCV\cxcore\include";
"C:\Program Files\OpenCV\cv\include";
"C:\Program Files\OpenCV\cvaux\include";
"C:\Program Files\OpenCV\otherlibs\highgui";
"C:\Program Files\OpenCV\otherlibs\cvcam\include"
Additional Library Directories: "C:\Program Files\OpenCV\lib"
Additional Dependencies (libraries): cv.lib cxcore.lib highgui.lib
Test Program I used
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <cv.h>
#include <highgui.h>
int main(int argc, char *argv[])
{
IplImage* img = 0;
int height,width,step,channels;
uchar *data;
int i,j,k;
if(argc<2){
printf("Usage: main <image-file-name>\n\7");
exit(0);
}
// load an image
img=cvLoadImage(argv[1]);
if(!img){
printf("Could not load image file: %s\n",argv[1]);
exit(0);
}
// get the image data
height = img->height;
width = img->width;
step = img->widthStep;
channels = img->nChannels;
data = (uchar *)img->imageData;
printf("Processing a %dx%d image with %d channels\n",height,width,channels);
// create a window
cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE);
cvMoveWindow("mainWin", 100, 100);
// invert the image
for(i=0;i<height;i++) for(j=0;j<width;j++) for(k=0;k<channels;k++)
data[i*step+j*channels+k]=255-data[i*step+j*channels+k];
// show the image
cvShowImage("mainWin", img );
// wait for a key
cvWaitKey(0);
// release the image
cvReleaseImage(&img );
return 0;
}