摘要: #选取周围几个像素点,并对其进行排序,选取中间那个值import cv2import numpy as npimg = cv2.imread('D:/pythonob/imageinpaint/img/noise.jpg',1)imgInfo = img.shapeheight = imgInfo[0]width = imgInfo[1]gray = cv2.cvtColor(img,cv2.CO 阅读全文
posted @ 2019-09-07 16:36 Bambo0 阅读(254) 评论(0) 推荐(0)
摘要: import cv2import numpy as npimg = cv2.imread('D:/pythonob/imageinpaint/img/noise.jpg',1)gauss = cv2.GaussianBlur(img,(5,5),1.5)#高斯滤波#均值滤波:将每个像素取周围像素的平均值imgInfo = img.shapeheight = imgInfo[0]width = im 阅读全文
posted @ 2019-09-07 16:34 Bambo0 阅读(337) 评论(0) 推荐(0)
摘要: #双边滤波函数:bilateralFilter(src,d,sigmaColor,sigmaSpace)# src:输入图像# d:过滤时周围每个像素领域的直径# sigmaColor:在color space中过滤sigma。参数越大,临近像素将会在越远的地方mix。# sigmaSpace:在coordinate space中过滤sigma。参数越大,那些颜色足够相近的的颜色的影响越大。imp 阅读全文
posted @ 2019-09-07 16:33 Bambo0 阅读(779) 评论(0) 推荐(0)
摘要: 原理:将所有像素点的值加上一个常数 阅读全文
posted @ 2019-09-07 16:29 Bambo0 阅读(354) 评论(0) 推荐(0)
摘要: 原理:计算每个通道像素级别(0-255)的累加概率,然后用累加概率乘以255代替原来的像素 阅读全文
posted @ 2019-09-07 15:10 Bambo0 阅读(707) 评论(0) 推荐(0)
摘要: #计算灰度级别的累加概率,然后:当前像素值 = 当前像素的累加概率 * 255import cv2import numpy as npimg = cv2.imread('D:/pythonob/imageinpaint/img/flower.jpg',1)imgInfo = img.shapeheight = imgInfo[0]width = imgInfo[1]gray = cv2.cvtCo... 阅读全文
posted @ 2019-09-07 14:34 Bambo0 阅读(364) 评论(0) 推荐(0)
摘要: 原理:和灰度直方图一样,只是将一个灰度通道换成了三个的RGB通道import cv2import numpy as npimport matplotlib.pyplot as pltimg = cv2.imread('D:/pythonob/imageinpaint/img/flower.jpg',1)imgInfo = img.shapeheight = imgInfo[0]width = im... 阅读全文
posted @ 2019-09-07 14:27 Bambo0 阅读(440) 评论(0) 推荐(0)
摘要: 原理:统计每个像素灰度出现的概率import cv2import numpy as npimport matplotlib.pyplot as pltimg = cv2.imread('D:/pythonob/imageinpaint/img/flower.jpg',1)imgInfo = img.shapeheight = imgInfo[0]width = imgInfo[1]gray = c 阅读全文
posted @ 2019-09-07 12:58 Bambo0 阅读(880) 评论(0) 推荐(0)