gpt4 book ai didi

python-3.x - OpenCV图像形状元组解压缩

转载 作者:行者123 更新时间:2023-12-02 17:37:44 29 4
gpt4 key购买 nike

# 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

上面的代码给我以下错误。
rows,cols,channels = img2.shape
AttributeError: 'NoneType' object has no attribute 'shape

img2.shape我在做什么错?

最佳答案

img2None。文件似乎无效

关于python-3.x - OpenCV图像形状元组解压缩,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48602076/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com