I am new to OpenCV, and trying to capture an image, and then save it to a file. I am posting the code for your reference, below.
The jpg file is being saved, but it is black.
// Capture the Image from the webcam
CvCapture *pCapturedImage = cvCreateCameraCapture(0);
// Get the frame
IplImage *pSaveImg = cvQueryFrame(pCapturedImage);
// Save the frame into a file
cvSaveImage("test.jpg". ,pSaveImg); // A JPG FILE IS BEING SAVED
// OF 6KB , BUT IT IS BLACK
All of the functions are succesful. I have tried the above code in both XP and Vista - the result is a black image on both. Please let me know what I am missing out.