Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cv异常 #1

Open
leeformoney opened this issue May 16, 2022 · 0 comments
Open

cv异常 #1

leeformoney opened this issue May 16, 2022 · 0 comments

Comments

@leeformoney
Copy link

您好:
我发现在用自己的视频,在对倒数第几张进行处理的时候,OpenCV会报错cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4052: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'
于是,将81行代码改为
if alpha<frame<video_length-alpha:
ret, cur_frame = cap.read()
try:
if height != out_height or width != out_width:
cur_frame = cv2.resize(cur_frame,(out_width,out_height),interpolation=cv2.INTER_LANCZOS4)
if not ret or cur_frame is None:
break
except :
continue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant