webcam capture returns a orange frame

asked 2017-11-15 08:41:39 -0500

TheHives gravatar image

Hi everyone, I want to get the camera feed but the usual code just gives me an orange frame. I use that :

VideoCapture capture(0);
    Mat frame;
    capture >> frame;
    cv::imshow("frame", frame);

and the test capture.isOpened() is true.

So the camera seems to be open but returns just orange... The webcam works on other things such as Unity. Thank you for you help, Cheers, Nathan

edit retag flag offensive close merge delete


did you try reading more frames from it ?

(e.g. using v4l, there's an internal fifo, and you might just get unitialized memory in the 1st few frames)

berak gravatar imageberak ( 2017-11-15 09:23:40 -0500 )edit

Yes, even if I do it in a loop it is the same. I am using my phone trough Droid Cam, it might cause the issue ?

TheHives gravatar imageTheHives ( 2017-11-15 09:57:59 -0500 )edit

@TheHives. Your problem is you can't do on your phone with android. It is slightly different colour

supra56 gravatar imagesupra56 ( 2017-11-15 20:46:36 -0500 )edit