No success trying to grab images from my built-in MacBook Pro Cam
Hi,
I am desperately looking for a solution to make my builtin cam working. No matter which settings I try, it does not put on the green light.
This is my main method for testing purposes:
VideoCapture capture_;
capture_.open(0);
Mat img;
if (capture_.isOpened()) {
printf("Is open!\n");
sleep(2); // I read somewhere that open takes some time
Mat frame;
printf("Codec: %f\n", capture_.get(CV_CAP_PROP_FOURCC)); // this one is 0.0000
capture_.set(CV_CAP_PROP_FOURCC, CV_FOURCC('M','J','P','G'));
printf("Codec: %f\n", capture_.get(CV_CAP_PROP_FOURCC)); // it is still 0.0000
capture_ >> frame;
// capture_.read(img); // they both fail
imshow("Test", frame);
waitKey(0);
} else {
printf("Is not open!\n");
}
The cam seems to open correctly (but no green light indicating that). When I try to read from the cam I get an empty image. I found some sources on the web that claimed that I need QuickTime support for the cam to work. But I did not succeed in compiling with QuickTime on OSX 10.8.
Does anyone have further ideas?
Thanks and best regards,
Sebastian
Which OpenCV version are you using? There were many errors that got fixed. Make sure you are trying to build openCV 2.4.6.1
Just two small hints: If opening takes some time, it's not useful to put the sleep() after the if-clause, because it already passed the relevant point. Second, make sure you have properly initialised opencv ( OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_5, ...))
I have the same problem. Running OpenCV 2.4.6.1, it won't open the isight camera. Anyone found a solution?