how to apply mask on image of a size
I have apply noise to an image, now I would like to add mask on the image of size 3×3.
This is the code I am using to add noise but not able to add mask in it.
I = imread(‘sample2.jpg’);
I = rgb2gray(I);
noise_type = ‘salt & pepper’; % ‘gaussian’ or ‘poisson’ are also valid
noises = imnoise(im, noise_type, 0.09);
nim = im;
nim(noises == 0) = 0;
%# plot
figure; subplot(1,2,1);
imagesc(nim);
colormap(gray);
title(‘the noisy image’);I have apply noise to an image, now I would like to add mask on the image of size 3×3.
This is the code I am using to add noise but not able to add mask in it.
I = imread(‘sample2.jpg’);
I = rgb2gray(I);
noise_type = ‘salt & pepper’; % ‘gaussian’ or ‘poisson’ are also valid
noises = imnoise(im, noise_type, 0.09);
nim = im;
nim(noises == 0) = 0;
%# plot
figure; subplot(1,2,1);
imagesc(nim);
colormap(gray);
title(‘the noisy image’); I have apply noise to an image, now I would like to add mask on the image of size 3×3.
This is the code I am using to add noise but not able to add mask in it.
I = imread(‘sample2.jpg’);
I = rgb2gray(I);
noise_type = ‘salt & pepper’; % ‘gaussian’ or ‘poisson’ are also valid
noises = imnoise(im, noise_type, 0.09);
nim = im;
nim(noises == 0) = 0;
%# plot
figure; subplot(1,2,1);
imagesc(nim);
colormap(gray);
title(‘the noisy image’); mask on image MATLAB Answers — New Questions