Im working with openCV, and my output window does not show anything (black screen) when I run the code. I am using my default webcam.
#include "cv.h"
#include "highgui.h"
int main() {
//simple camera capture program.
IplImage* newImg;
CvCapture* capture = cvCaptureFromCAM(0);
while(1) {
newImg = cvQueryFrame(capture);
cvShowImage( "src", newImg );
if (cvWaitKey(15) == 27) {
break;
}
}
return 0;
}
Your code works fine.
The problem is most likely specific to your machine, since OpenCV supports only a few cameras. You might want to use some other library to grab frames from the camera – (V4L, for example?).