python3.6使用opencv的resize方法不定时报错
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python3.6使用opencv的resize方法不定时报错相关的知识,希望对你有一定的参考价值。
ret, frame = video_capture.read()small_frame = cv2.resize(frame, None, fx=0.15, fy=0.15)rgb_small_frame = small_frame[:, :, ::-1]small_frame = cv2.resize(frame, None, fx=0.15, fy=0.15)这一行报错报错代码:OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in cv::resize, file C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp, line 4044Traceback (most recent call last): File "E:/python/cam/My_face_recognition.py", line 35, in <module> small_frame = cv2.resize(frame, None, fx=0.15, fy=0.15)cv2.error: C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4044: error: (-215) ssize.width > 0 && ssize.height > 0 in function cv::resize
OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in cv::resize, file C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp, line 4044
Traceback (most recent call last):
File "E:/python/cam/My_face_recognition.py", line 35, in <module>
small_frame = cv2.resize(frame, None, fx=0.15, fy=0.15)
cv2.error: C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4044: error: (-215) ssize.width > 0 && ssize.height > 0 in function cv::resize
以上是关于python3.6使用opencv的resize方法不定时报错的主要内容,如果未能解决你的问题,请参考以下文章
Anaconda默认Python3.8版本创建Python3.6版本环境并安装opencv3.4.1.15,使用pycharm作为IDE