摘要:
import cv2 import numpy as np img = cv2.imread('image0.jpg', 1) cv2.imshow('src', img) imgInfo = img.shape height = imgInfo[0] width = imgInfo[1] matScale = np.float32([[0.5, 0, 0], [0, 0.5, 0]]) ds... 阅读全文
摘要:
import cv2 import numpy as np img = cv2.imread('image0.jpg', 1) cv2.imshow('src', img) imgInfo = img.shape height = imgInfo[0] width = imgInfo[1] # src 3 -> dst 3(左上角, 左下角, 右上角) matSrc = np.float32(... 阅读全文
摘要:
# 100 -> 200 x # 100 -> 300 y import cv2 img = cv2.imread('image0.jpg', 1) imgInfo = img.shape dst = img[100:200, 100:300] cv2.imshow('image', dst) cv2.waitKey(0) 阅读全文
摘要:
import cv2 import numpy as np img = cv2.imread('image0.jpg', 1) cv2.imshow('src', img) imgInfo = img.shape height = imgInfo[0] width = imgInfo[1] # 获取旋转矩阵(旋转的中心点, 旋转的角度, 缩放的系数) matRotate = cv2.getRo... 阅读全文
摘要:
import cv2 import numpy as np img = cv2.imread("image0.jpg", 1) cv2.imshow('src', img) imgInfo = img.shape height = imgInfo[0] width = imgInfo[1] deep = imgInfo[2] newImgInfo = (height*2, width, dee... 阅读全文
摘要:
import cv2 import numpy as np img = cv2.imread('image0.jpg', 1) cv2.imshow('src', img) imgInfo = img.shape height = imgInfo[0] width = imgInfo[1] matShift = np.float32([[1, 0, 100], [0, 1, 20... 阅读全文
摘要:
# 1 load 2 info 3 resize 4 check import cv2 img = cv2.imread(r"D:\PythonCode\neuron\image0.jpg", 1) imgInfo = img.shape # shape (行[height], 列[width]) print(imgInfo) height = imgInfo[0] width = i... 阅读全文
摘要:
attributeError: 'NoneType' object has no attribute 'shape' 报错 可能是因为没有设置路径,所以返回的类型是None。 改正的方法是,读取图片时把路径也写上 阅读全文