why cv2.imshow() results in error in my python compiler?

后端 未结 5 1438
渐次进展
渐次进展 2020-12-11 21:04

Hi friends i just now installed opencv and checking the basic code but it results in error. The code is

import numpy as np
import cv2
img=cv2.imread(\'C:\\U         


        
5条回答
  •  既然无缘
    2020-12-11 21:19

    The error says that the image you opened doesn't satisfy the condition height > 0 and width > 0. This may have several reasons.

    Most of the times, it is due to an inexistent image address given in imread.

    Sometimes it may be also because the complier failed to load the image. For example, if you write some random strings in notepad and save the file as a.jpg, the compiler may not be able to load it.

提交回复
热议问题