OpenCV webcam capture problem

前端 未结 8 661
逝去的感伤
逝去的感伤 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: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);
    

提交回复
热议问题