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

后端 未结 5 1457
渐次进展
渐次进展 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:20

    For me it worked when i just changed jpeg to jpg

    Try this, may be it will work

    import numpy as np
    import cv2
    img=cv2.imread('C:\Users\Pravin\Desktop\a.jpg',1)    #changed image format to jpg
    cv2.namedWindow('img',cv2.WINDOW_NORMAL)
    cv2.Waitkey(10000)
    cv2.imshow('cv2.WINDOW_NORMAL',img)
    cv2.destoryAllWindows()
    

提交回复
热议问题