Assertion failure : size.width>0 && size.height>0 in function imshow

前端 未结 10 1249
失恋的感觉
失恋的感觉 2020-11-30 12:19

i am using opencv2 and python on raspberry pi. and i am new with python and opencv. i tried to read a jpeg image and display image it shows the following error:

<         


        
10条回答
  •  北海茫月
    2020-11-30 12:54

    While reading the image file, specifying the color option should solve this, for example:

    image=cv2.imread('img.jpg',cv2.IMREAD_COLOR)
    

    adding the cv2.IMREAD_COLOR should solve this

提交回复
热议问题