Denoising of an image refers to the process of reconstruction of a signal from noisy images. Denoising is done to remove unwanted noise from images to analyze it in better form. It refers to one of the major pre-processing steps. There are four functions in OpenCV which is used for denoising of different images.
Syntax: cv2.fastNlMeansDenoisingColored( P1, P2, float P3, float P4, int P5, int P6)
# importing libraries
import numpy as np
import cv2
from matplotlib import pyplot as plt
# Reading image from folder where it is stored
img = cv2.imread('abc.jpg')
# denoising of image saving it into dst image
dst = cv2.fastNlMeansDenoisingColored(img, None, 10, 10, 7, 15)
# Plotting of source and destination image
plt.subplot(121), plt.imshow(img)
plt.subplot(122), plt.imshow(dst)
plt.show()
cv2.waitKey(0)
cv2.destroyAllWindows()