Webcam show a grey screen in OpenCV !
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Webcam show a grey screen in OpenCV !

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Posts
    8

    Question 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;
    }

  2. #2
    Join Date
    Jul 2005
    Location
    Louisville, KY
    Posts
    201

    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.

  3. #3
    Join Date
    Sep 2009
    Posts
    8

    Question Re: Webcam show a grey screen in OpenCV !

    Quote Originally Posted by QuinnJohns View Post
    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

  4. #4
    Join Date
    Jul 2005
    Location
    Louisville, KY
    Posts
    201

    Re: Webcam show a grey screen in OpenCV !

    So you added the matrix, and did the SvColor?

  5. #5
    Join Date
    Jul 2005
    Location
    Louisville, KY
    Posts
    201

    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center