OpenCV CreateVideoWriter()问题

2024-10-04 11:26:35 发布

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

所以我想为我的raspberry pi写一些运动检测代码 我用python2.7运行debian和opencv2.3.1 我得到以下错误

cv2.error:数组应该是CvMat或IplImage

def initRecorder(self): #Create the recorder
    codec = cv.CV_FOURCC('M', 'J', 'P', 'G') #('W', 'M', 'V', '2')
    self.writer=cv.CreateVideoWriter(datetime.now().strftime("%b-%d_%H:%M:%S")+".wmv", codec, 5, cv.GetSize(self.frame), 1)
    self.font = cv.InitFont(cv.CV_FONT_HERSHEY_SIMPLEX, 1, 1, 0, 2, 8) #Creates a font

Tags: 代码self错误pierror数组debiancv2