添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
谦和的鸡蛋面  ·  UnsatisfiedLinkError: ...·  1 月前    · 
成熟的火柴  ·  Using opencv in linux ...·  1 周前    · 
坚韧的绿茶  ·  OpenCV with Java: ...·  1 周前    · 
痴情的眼镜  ·  AssumeRole - AWS ...·  7 月前    · 
叛逆的消防车  ·  Veusz – a scientific ...·  7 月前    · 
爽快的充电器  ·  java stream ...·  8 月前    · 

First time here? Check out the FAQ!

-1

problem with cv2.imshow() method

asked 2020-09-21 15:54:41 -0600

delcencen gravatar image

Hello,

i try on many script,on linux and windows,but i still ave a bug on " cv2.imshow()".

the code with my image adress:

import cv2

path = r'C:\Users\me\Pictures\dell latitude\DSCF1513'

image = cv2.imread(path) window_name = 'image'

cv2.imshow(window_name, image)

cv2.waitKey(0)

cv2.destroyAllWindows()

and now the bug:

================= RESTART: C:\Users\me\Documents\opencvTest.py ================= Traceback (most recent call last): File "C:\Users\me\Documents\opencvTest.py", line 18, in <module> cv2.imshow(window_name, image) cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-k8sx3e60\opencv\modules\highgui\src\window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

thanks for your help.

edit retag flag offensive close merge delete
0

answered 2020-09-22 01:28:13 -0600

berak gravatar image

problem is not with imshow(), -- your image was not loaded correctly, and is invalid. you have to check the output of imread() before going on.

edit flag offensive delete

Stats

Asked: 2020-09-21 15:54:41 -0600 Seen: 44,575 times

Last updated: Sep 22 '20