Python/OpenCV视频入门

2024-05-19 06:22:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我试着运行这个页面上的第一个代码,“从摄像机捕捉vídeo”:

http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html

在cv2.videoCapture(0)中,我用vídeo名称替换了0—它保存在.ipynb文件的同一目录中。它返回以下错误:

error                                     Traceback (most recent call last)
<ipython-input-1-ce45564bb1af> in <module>()
  9 
 10     # Our operations on the frame come here
 ---> 11     gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
 12 
 13     # Display the resulting frame

 error: C:\conda\conda-bld\work\opencv-3.1.0\modules\imgproc\src\color.cpp:7456: error: (-215) scn == 3 || scn == 4 in function cv::ipp_cvtColor

我怎么能修好它?我在windows10上工作。在


Tags: the代码inpyvideodisplayerror页面

热门问题