Python-OpenCV cv2 OpenCV Error: Assertion failed (scn == 3 || scn == 4) in unknown function, file ..\..\..\modules\imgproc\src\color.cpp

前端 未结 4 1257
半阙折子戏
半阙折子戏 2020-12-09 02:32

I am trying to learn contours in python using cv2.

I tried the following code given in a tutorial guide:

import cv2
import numpy as np
from matplotli         


        
4条回答
  •  余生分开走
    2020-12-09 02:50

    1st print ret. If it is showing false then your image is not taken properly. If it is showing True Try this command - sudo modprobe bcm2835-v4l2 Or in your /etc/modules file add bcm2835-v4l2 at the bottom.

提交回复
热议问题