-
September 26th, 2011, 10:46 PM
#1
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;
}
-
September 30th, 2011, 03:45 AM
#2
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.
-
September 30th, 2011, 04:26 AM
#3
Re: Webcam show a grey screen in OpenCV !
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
-
September 30th, 2011, 05:38 PM
#4
Re: Webcam show a grey screen in OpenCV !
So you added the matrix, and did the SvColor?
-
September 30th, 2011, 05:41 PM
#5
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|