opencv学习——保存至github

opencv学习代码地址 (https://github.com/ei1994/opencv_practices/tree/master)

2017-10-30 22:31:31

阅读数:127

评论数:0

opencv学习——常见滤波器形状

import cv2 import numpy as np from matplotlib import pyplot as plt # simple averaging filter without scaling parameter mean_filter = np.ones((3,3)) #...

2017-10-30 22:16:28

阅读数:158

评论数:0

opencv学习——fft用numpy和cv2

import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('images/33.jpg',0) f = np.fft.fft2(img) #傅里叶变换得到频谱,一般来说,低频分量模值最大...

2017-10-30 22:02:16

阅读数:739

评论数:0

opencv学习——直方图反向投影分割

import numpy as np ''' 反向投影,根据颜色直方图和模板检测图像中像素值, 实现图像分割、背景与图像分离 ''' roi = cv2.imread('images/roi.jpg') hsv = cv2.cvtColor(roi,cv2.COLOR_BGR2HSV) targe...

2017-10-30 21:00:25

阅读数:229

评论数:0

opencv学习——直方图均衡化

import cv2 import numpy as np import matplotlib.pyplot as pltimg = cv2.imread('images/33.jpg') grey = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) #直方图均衡化 eq...

2017-10-30 20:58:57

阅读数:196

评论数:0

opencv学习——直方图及掩模直方图

import cv2 import numpy as np import matplotlib.pyplot as plt''' cv2.calcHist(images, channels, mask, histSize, ranges[, hist[, accumulate]]) 1. imag...

2017-10-30 20:58:10

阅读数:173

评论数:0

opencv学习——计算掩模及目标远点

import cv2 import numpy as npimg = cv2.imread('images/th.jpg') imgray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) ret,thresh = cv2.threshold(imgray,127,25...

2017-10-30 20:57:01

阅读数:236

评论数:0

opencv学习——利用轮廓画矩阵、外接圆、拟合曲线

import cv2 import numpy as npimg = cv2.imread('images/th.jpg')ret,thresh = cv2.threshold(cv2.cvtColor(img,cv2.COLOR_BGR2GRAY),127,255,0) _,contours,h...

2017-10-30 20:55:26

阅读数:589

评论数:0

opencv学习——计算轮廓中心点、周长、面积及近似

import cv2 import numpy as np import matplotlib.pylab as plt import scipy.misc as misc'''''' img = cv2.imread('images/11.jpg') ret,thresh = cv2.thres...

2017-10-30 18:42:34

阅读数:1882

评论数:0

opencv学习——画轮廓

import cv2 import numpy as np import matplotlib.pylab as plt import scipy.misc as misc''' 函数 cv2.findContours() 有三个参数,第一个是输入图像,第二个是 轮廓检索模式,第三个是轮廓近似方法...

2017-10-27 12:10:23

阅读数:233

评论数:0

opencv学习——图像金字塔

import cv2 import numpy as np import matplotlib.pylab as plt import scipy.misc as misc''' 实现上述效果的步骤如下: 1. 读入两幅图像,苹果和句子 2. 构建苹果和橘子的高斯金字塔(6 层) 3. 根据高斯金...

2017-10-27 11:46:34

阅读数:201

评论数:0

opencv学习——canny边缘检测

import cv2 import numpy as np import matplotlib.pylab as plt import scipy.misc as misc''' 这个函数的第一个参数是输入图像。第二和第三 个分别是 minVal 和 maxVal。第三个参数设置用来计算图像梯度的...

2017-10-26 20:35:22

阅读数:74

评论数:0

opencv学习——形态学运算

import cv2 import numpy as np import matplotlib.pylab as plt import scipy.misc as misc''' 腐蚀:根据卷积核的大小靠近前景的所有像素都会被腐蚀 掉(变为 0),所以前景物体会变小,整幅图像的白色区域会减少。这对...

2017-10-26 20:10:06

阅读数:132

评论数:0

opencv学习——Otsu's二值化

简单来说就是对一幅双峰图像自动根据其直方图计算出一个阈值。(对于非双峰图像,这种方法得到的结果可能会不理想)。 这里用到到的函数还是 cv2.threshold(),但是需要多传入一个参数(flag):cv2.THRESH_OTSU。这时要把阈值设为 0。然后算法会找到最优阈值,这个最优阈值就是...

2017-10-26 17:52:11

阅读数:475

评论数:0

opencv学习——自适应阈值二值化

import cv2 import numpy as np import matplotlib.pylab as plt import scipy.misc as misc''' Adaptive Method - It decides how thresholding value is calc...

2017-10-26 17:11:12

阅读数:1195

评论数:0

opencv学习——简单阈值二值化

import cv2 import numpy as np import matplotlib.pylab as plt import scipy.misc as miscimg = cv2.imread('images/32.jpg',0) ret,thresh1 = cv2.threshold...

2017-10-26 16:49:53

阅读数:179

评论数:0

opencv学习——仿射变换

import cv2 import numpy as np import matplotlib.pylab as plt import scipy.misc as miscimg = cv2.imread('images/33.jpg') rows, cols = img.shape[:2]def...

2017-10-26 16:43:28

阅读数:110

评论数:0

opencv学习——padding扩充边界

import cv2 import numpy as np import matplotlib.pylab as plt import scipy.misc as misc ''' src - input image top, bottom, left, right - border width ...

2017-10-26 10:57:32

阅读数:1315

评论数:0

opencv学习——滑动条做调色板

import cv2 import numpy as npdef nothing(x): pass# creat a black image img = np.zeros((300,512,3), np.uint8) cv2.namedWindow('image')# creat trac...

2017-10-26 10:02:56

阅读数:126

评论数:0

opencv学习——画线、圆、文字

import cv2 import numpy as np# creat a black image img = np.zeros((512,512,3), np.uint8)# draw a diagonal blue line with thickness of 5 px cv2.line(i...

2017-10-26 10:01:57

阅读数:137

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭