I dont understand this error while using template.shape?

asked 2018-12-26 04:38:42 -0500

updated 2018-12-26 08:10:44 -0500

berak gravatar image

img = cv.imread('C:\Users\user\Desktop\download.jpg',0) img2 = img.copy() template = cv.imread('C:\Users\user\Desktop\download1.jpg',0) w, h = template.shape[::-1]

error is : w, h = template.shape[::-1]

edit retag flag offensive close merge delete



Please try to improve your message. Use icon 101010 to indent your code and insert an error message as text in your post and use this code to read an image :

#Read an image
img = cv.imread("C:/Users/user/Desktop/download.jpg",cv.IMREAD_GRAYSCALE)
#Check if image is empty
if img is None:
    print ( "Image is empty.Check image file path\n")
LBerger gravatar imageLBerger ( 2018-12-26 05:19:06 -0500 )edit