How to read video files using python & Opencv

后端 未结 4 1251
甜味超标
甜味超标 2020-12-31 19:50

I am reading an avi file usinh python 2.7 and opencv2.4.I am using windows 10.My sample code is

import numpy as np
import cv2
cap = cv2.VideoCapture(\'videos         


        
4条回答
  •  无人及你
    2020-12-31 20:43

    You took the tutorial from here: Playing Video from file

    This question adresses your error: open cv error: (-215) scn == 3 || scn == 4 in function cvtColor

    Two things may work:

    • Make sure the video is found!
    • And try to use cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

提交回复
热议问题