Denoise image using deep neural network
B = denoiseImage(A,net)
Retrieve the pretrained denoising convolutional neural network,
net = denoisingNetwork('DnCNN');
Load a grayscale image into the workspace, then create a noisy version of the image. Display the two images.
I = imread('cameraman.tif'); noisyI = imnoise(I,'gaussian',0,0.01); figure imshowpair(I,noisyI,'montage'); title('Original Image (left) and Noisy Image (right)')
Remove noise from the noisy image, and display the result.
denoisedI = denoiseImage(noisyI, net); figure imshow(denoisedI) title('Denoised Image')
A— Noisy image
Noisy image, specified as a single 2-D image or a stack of 2-D images.
A can be:
A 2-D grayscale image with size m-by-n.
A 2-D multichannel image with size m-by-n-by-c, where c is the number of image channels. For example, c is 3 for RGB images, and 4 for four-channel images such as RGB images with an infrared channel.
A stack of equally-sized 2-D images. In this case,
A has size
where p is the number of images in the