移除噪声OpenCV

时间:2019-03-07 03:54:19

标签: python opencv image-processing noise-reduction

我正在尝试消除二进制反转后的噪声,但是当我应用某种去噪技术时,肾小球的轮廓也会褪色,任何人都建议使用什么去噪技术。

Original Image Binary Invert

import cv2 as cv
import numpy as np

#Read Image
img = cv.imread('kidney5.jpg')

#Matrix of size 5 as the kernel
kernel = np.ones((5,5), np.uint8)

#Denoising
dst = cv.fastNlMeansDenoisingColored(img,None,10,10,7,21)
cv.imshow('Denoising',dst)

#Green Channel Part
img1 = cv.cvtColor(dst, cv.COLOR_BGR2RGB)

r, g, b = cv.split(img1)
images = [cv.merge((r,g,b)),r,g,b]
img2 = images[1] 
cv.imshow('Green Channel', images[1])

#Histogram Equalization
equal = cv.equalizeHist(img2)
cv.imshow('Equalize',equal)

#Thresholding
ret, th1 = cv.threshold(equal,180,255,cv.THRESH_BINARY_INV)
cv.imshow('Binary Inv',th1)

cv.waitKey(0)
cv.destroyAllWindows() 

0 个答案:

没有答案