摘要:#imread #方法1 imread import cv2 img0 = cv2.imread('image0.jpg',0) img1 = cv2.imread('image0.jpg',1) print(img0.shape) print(img1.shape) cv2.imshow('src',img0) cv2.waitKey(0) #方法2 cvtColor import c...
阅读全文
摘要:import cv2 import numpy as np img = cv2.imread('image3.png',1) cv2.imshow('src',img) imgInfo = img.shape height = imgInfo[0] width = imgInfo[1] # 2*3 matRotate = cv2.getRotationMatrix2D((height*0.5...
阅读全文
摘要: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 (左上角 左下角 右上角)仿射变换的实质实际上就是把原图像的三个点映射到目...
阅读全文
摘要:# [[A1 A2 B1],[A3 A4 B2]] # [[A1 A2],[A3 A4]] [[B1],[B2]] # newX = A1*x + A2*y+B1 # newY = A3*x + A4*y+B2 # x->x*0.5 y->y*0.5 # newX = 0.5*x import cv2 import numpy as np img = cv2.imread('image0.j...
阅读全文
摘要:import cv2 import numpy as np img = cv2.imread('image3.png',1) cv2.imshow('src',img) imgInfo = img.shape height = imgInfo[0] width = imgInfo[1] deep = imgInfo[2] newImgInfo = (height*2,width,deep)...
阅读全文
摘要:import cv2 import numpy as np img = cv2.imread('image0.jpg',1) cv2.imshow('src',img) imgInfo = img.shape dst = np.zeros(img.shape,np.uint8) height = imgInfo[0] width = imgInfo[1] for i in range(0,he...
阅读全文
摘要:# [1,0,100],[0,1,200] 2*2 2*1 # [[1,0],[0,1]] 2*2 A # [[100],[200]] 2*1 B # xy C # A*C+B = [[1*x+0*y],[0*x+1*y]]+[[100],[200]] # = [[x+100],[y+200]] 沿着x轴右移了100个点,沿着y轴向下移动了200个点 #(10,20)->(110,120) ...
阅读全文
摘要:# 1 API 2 算法原理 3 源代码 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] ### 设置一个偏移矩阵 这个偏移矩阵用numpy来表示 matSh...
阅读全文
摘要:#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)
阅读全文
摘要:# 1 info 2 空白模板 3 xy import cv2 import numpy as np img = cv2.imread('image0.jpg',1) imgInfo = img.shape height = imgInfo[0] width = imgInfo[1] dstHeight = int(height/2) dstWidth = int(width/2) dstIm...
阅读全文
摘要:#最近临域插值 双线性插值 原理 # src 10*20 dst 5*10 # dst src x 2 newX # newX = x*(src 行/目标 行) newX = 1* (10/5) = 2 # newY = y*(src 列/目标 列) newY = 2* (20/10) = 4 # 12.3 = 12 # 双线性插值 # A1 = 20% 上+80%下 A2 # B1 = ...
阅读全文
摘要:图片的缩放顾名思义就是改变图片的宽度和高度。
阅读全文
摘要:import tensorflow as tf import numpy as np import matplotlib.pyplot as plt date = np.linspace(1,15,15) endPrice = np.array([2511.90,2538.26,2510.68,2591.66,2732.98,2701.69,2701.29,2678.67,2726.50,268...
阅读全文
摘要:import tensorflow as tf import numpy as np import matplotlib.pyplot as plt date = np.linspace(1,15,15) endPrice = np.array([2511.90,2538.26,2510.68,2591.66,2732.98,2701.69,2701.29,2678.67,2726.50,268...
阅读全文
摘要:w1是一个1行10列的权重矩阵。w1的维度是一个1行10列的。b1也是一个1行10列的偏移矩阵。w2是一个10行1列的权重矩阵。b2是一个15行1列的偏移矩阵。
阅读全文
摘要:import tensorflow as tf import numpy as np import matplotlib.pyplot as plt date = np.linspace(1,15,15) endPrice = np.array([2511.90,2538.26,2510.68,2591.66,2732.98,2701.69,2701.29,2678.67,2726.50,...
阅读全文
摘要:import numpy as np import matplotlib.pyplot as plt x = np.array([1,2,3,4,5,6,7,8]) y = np.array([3,5,7,6,2,6,10,15]) plt.plot(x,y,'r') # 折线 1 x 2 y 3 color import numpy as np import matplo...
阅读全文