Tanay
Tanay

Reputation: 187

Opencv image shape tuple unpacking

# Importing the libraries
import numpy as np
import cv2


# Load two images
img1 = cv2.imread(r'C:\Users\user1\Pictures\messi.jpg')
img2 = cv2.imread(r'C:\Users\user1\Pictures\opencvimp.jpg')
# I want to put logo on top-left corner, So I create a ROI
rows,cols,channels = img2.shape

this above code is giveing me the following error.

rows,cols,channels = img2.shape
AttributeError: 'NoneType' object has no attribute 'shape

What am I doing wrong with img2.shape ?

Upvotes: 0

Views: 1549

Answers (1)

Marat
Marat

Reputation: 15738

the img2 is None. It looks like the file is not a valid image

Upvotes: 1

Related Questions