上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 56 下一页
摘要: from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf # 载入MNIST数据集 mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) sess = tf.InteractiveSession() # 先定义好初... 阅读全文
posted @ 2019-07-20 16:54 青衫客36 阅读(167) 评论(0) 推荐(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] matScale = np.float32([[0.5, 0, 0], [0, 0.5, 0]]) ds... 阅读全文
posted @ 2019-07-19 21:07 青衫客36 阅读(211) 评论(0) 推荐(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] # src 3 -> dst 3(左上角, 左下角, 右上角) matSrc = np.float32(... 阅读全文
posted @ 2019-07-19 21:05 青衫客36 阅读(298) 评论(0) 推荐(0) 编辑
摘要: # 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) 阅读全文
posted @ 2019-07-19 21:04 青衫客36 阅读(85) 评论(0) 推荐(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... 阅读全文
posted @ 2019-07-19 21:02 青衫客36 阅读(118) 评论(0) 推荐(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] deep = imgInfo[2] newImgInfo = (height*2, width, dee... 阅读全文
posted @ 2019-07-19 21:01 青衫客36 阅读(214) 评论(0) 推荐(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] matShift = np.float32([[1, 0, 100], [0, 1, 20... 阅读全文
posted @ 2019-07-19 20:59 青衫客36 阅读(185) 评论(0) 推荐(0) 编辑
摘要: # 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... 阅读全文
posted @ 2019-07-19 20:56 青衫客36 阅读(168) 评论(0) 推荐(0) 编辑
摘要: attributeError: 'NoneType' object has no attribute 'shape' 报错 可能是因为没有设置路径,所以返回的类型是None。 改正的方法是,读取图片时把路径也写上 阅读全文
posted @ 2019-07-19 18:45 青衫客36 阅读(17271) 评论(0) 推荐(0) 编辑
摘要: OpenCV安装前需要依赖包numpy,所以需要安装numpy pip install numpy 然后就可以利用下面的代码安装OpenCV了。 pip3 install opencv-python 阅读全文
posted @ 2019-07-18 21:27 青衫客36 阅读(3050) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 56 下一页