OpenCV webcam capture problem

前端 未结 8 600
逝去的感伤
逝去的感伤 2020-12-30 10:47

I\'ve installed OpenCV 2.2 and now I can\'t get webcam capture to work. It worked ok in 2.1. OpenCV detects a webcam, doesn\'t report any errors or warnings, but each frame

相关标签:
8条回答
  • 2020-12-30 11:11

    I had the same problem. I figured that it might be the settings on my camera, because I was supposed to have an input of 640x480px (which I could not adjust) and I could not adjust the permissions for the feed. So I installed a virtual webcam, which pretty much resolved both issues. I got an input dialogue, chose the virtual camera and it worked. I managed to set it to 640x480 in the app too.

    My virtual camera was called ManyCam, but it looks like it is made for teenage girls, wanted me to install 3 other apps and I'm still not sure weather it doesn't come with 'complementary' trojans.

    However, it lets you adjust colors, hue, contrast etc. and other stuff you might need for testing.

    0 讨论(0)
  • 2020-12-30 11:14

    I really don't know anything about OpenCV, but Isn't the problem on the following line ?

    cvtColor(frame, edges, CV_BGR2GRAY);
    

    Seems like you are intentionally converting a B-G-R color space into a Grayscale space.

    Shouldn't it be something like:

    cvtColor(frame, edges, CV_BGR2RGB);
    
    0 讨论(0)
提交回复
热议问题