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 2-D image or batch 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. c can have the value 3, such as for color images, but c can have other values as well. For example, if the image data has red, green, blue, and infrafred channels, c has the value 4.
A batch of equally-sized 2-D images. In this case,
A has size
where b is the batch size.