python - 打开cv2读写视频错误1287

标签 python opencv

我在这里遇到错误,

dif = cv2.absdiff(frameAnterior, frameAtual)

该错误仅发生在视频的最后一帧。

错误:

cv2.error: ......\modules\core\src\arithm.cpp:1287: error: (-209) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function cv::arithm_op

最佳答案

该错误与视频结束的最后一帧有关。也许您应该尝试在最后一帧之前停止阅读?休息一下。

关于python - 打开cv2读写视频错误1287,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35304548/

相关文章:

python - cv2.matchTemplate 函数与模板和图像不匹配后,如何阻止程序执行?

c++ - 使用 OpenCV 触摸和选择对象

python - 更改 python mechanize 中的链接

python - 连接到 Django 查询中的新字段

python - 在 Python 中使用 Flashtext 计算关键字出现的次数

python gnupg.GPG 没有这样的文件或目录

python - 挑战:使用python提取弯曲文本

c++如何在给定一组点的情况下绘制区域?

c++ - 如何在 OpenCV 上创建一个 Mat 来制作直方图

python - 如何检查对象是列表还是元组(但不是字符串)?