Webcam show a grey screen in OpenCV !
Hi
I'm using opencv to grab images from webcam .but all images are grey !
I tested opencv 2.2 & 2.3 with my A4tech webcam and Microsoft Lifecam but the screen is still grey !
I'm using VIsual Studio 2010 Express
My code is very simple :
int main(int argc, _TCHAR* argv[])
{
VideoCapture cap;
Mat frame,image,hsv;
cap.open(0);
if (! cap.isOpened())
{
cout << "Not Open" << endl;
waitKey(10000);
return 1;
}
namedWindow("Camera");
for (;;)
{
cap >> frame;
waitKey(1000);
cout << "r";
imshow("Camera",frame);
waitKey(1000);
}
return 0;
}
Re: Webcam show a grey screen in OpenCV !
So a few questions...
Are you trying to get a grayscale image? or color?
I did some research, http://stackoverflow.com/questions/4...apture-problem, should help you out. They also got a grey screen/image, and some steps indicated how to get color or greyscale.
Let me know if it helps.
Re: Webcam show a grey screen in OpenCV !
Quote:
Originally Posted by
QuinnJohns
So a few questions...
Are you trying to get a grayscale image? or color?
I did some research,
http://stackoverflow.com/questions/4...apture-problem, should help you out. They also got a grey screen/image, and some steps indicated how to get color or greyscale.
Let me know if it helps.
Thanks ...
I saw it but it did not help :(
I want a color image but the output is solid gray ! .I added the delay as you saw but it's still gray
Re: Webcam show a grey screen in OpenCV !
So you added the matrix, and did the SvColor?
Re: Webcam show a grey screen in OpenCV !
I'm currently using the C# wrapper, EmguCV, that encapsulates OpenCV. If I weren't, I'd be able to jump right in and help, as I'm playing with facial recognition right now. However, not using the straight OpenCV. My applications are currently interfacing with a ip-camera, getting greyscale output. If you are still having problems in a couple days of playing with this, I'll try and install the base OpenCV and give it a try -- and help you.