convert sequentially camera image to gray scale image
hi all,
i am new in programming in OpenCv.
i am not able to do cvCvtcolor command for the sequential images which is captured by cameraCapture command. please do needful.
Thank you in advanced..
my code is here...(I don't get compilation error.. but not get output images..)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int c=1;
IplImage* img=0;
char buffer[2000];
CvCapture* cv_cap=cvCaptureFromCAM(1);
cvNamedWindow("Video",CV_WINDOW_AUTOSIZE);
while(1) {
img=cvQueryFrame(cv_cap);
cvShowImage("Video",img);
cvCvtColor(img,img,CV_RGB2GRAY);
sprintf(buffer,"D:/1/ImageName%u.jpg",c);
cvSaveImage(buffer,img);
c++;
if (cvWaitKey(100)== 27) break;
}
cvDestroyWindow("Video");
return 0;
}
does your "D:/1" folder exist ?
yes, i have created that folder...but cant execute the program.