去噪
程序员文章站
2022-03-14 15:53:14
...
denoise_color = cv2.fastNlMeansDenoisingColored(img,None,10,10,7,21)
cv2.imshow("denoise_color",denoise_color)
dst = cv2.fastNlMeansDenoising(gray_bin)
cv2.imshow("dst",dst)
blur = cv2.medianBlur(gray_bin,5)
cv2.imshow("blur",blur)
#OpenCV定义的结构元素
kernel = cv2.getStructuringElement(cv2.MORPH_RECT,(3, 3))
#腐蚀图像
eroded = cv2.erode(gray_bin,kernel)
#显示腐蚀后的图像
cv2.imshow("Eroded Image",eroded);
#膨胀图像
dilated = cv2.dilate(gray_bin,kernel)
#显示膨胀后的图像
cv2.imshow("Dilated Image",dilated);
#原图像
cv2.imshow("Origin", gray_bin)
#NumPy定义的结构元素
NpKernel = np.uint8(np.ones((3,3)))
Nperoded = cv2.erode(gray_bin,NpKernel)
#显示腐蚀后的图像
cv2.imshow("Eroded by NumPy kernel",Nperoded);
上一篇: Color argb()方法的参数
下一篇: SwipeRefreshLayout