MATLAB CODE - Adding Noise to the Image

clc
close all

% Read the test Image
mygrayimg = imread('grayleaf.jpg');
mygrayimg = imresize(mygrayimg,[256 256],'bilinear');
subplot(2,3,1);
imshow(mygrayimg);
title('Original Image');

% Add Salt and pepper noise with noise density 0.02
salt = imnoise(mygrayimg,'salt & pepper',0.02);
subplot(2,3,2);
imshow(salt);
title('Salt & Pepper Image');

% Add Gaussian noise with mean 0 and variance 0.01
gau = imnoise(mygrayimg, 'gaussian', 0, 0.01);
subplot(2,3,3);
imshow(gau);
title('Gaussian Image- mean 0 and variance 0.01');

% Generate Gaussian noise with mean 6 and variance 225
mynoise = 6 + sqrt(225) * randn(256,256);
subplot(2,3,4);
imshow(mynoise,[]);
title('Generated gaussian noise');

% Original Image and generated Gaussian  

subplot(2,3,5);
mynoiseimg = double(mygrayimg) + mynoise;
imshow(mynoiseimg,[]);
title('Gaussian image(mean 6 & Var 225');

% Original Image plus sinusoidal noise  

subplot(2,3,6);
[x y] = meshgrid(1:256,1:256);
mysinusoidalnoise = 15 * sin(2*pi/14*x+2*pi/14*y);
mynoiseimg1 = double(mygrayimg) + mysinusoidalnoise;
imshow(mynoiseimg1,[]);
title('Generated Sinusoidal noise');

MATLAB CODE - Adding Noise to the Image MATLAB CODE - Adding Noise to the Image Reviewed by Suresh Bojja on 10/20/2015 07:06:00 PM Rating: 5

Subjects & Labs

AC (6) ADS (2) ATMEL (6) AWP (5) C- Language (3) CAO (5) CDAC (1) Cloud Computing (1) CMC (6) CN (10) CONSERVATION & MANAGEMENT Complete Notes (1) Control Sys (2) CVSM (2) Data Analytics (1) DC (5) Digital System Design (3) DIP (17) DLD (10) DLD Lab Manual (1) DS (4) DSD&DICA (9) DSP (6) EDC (45) Electonic Components (2) Embedded (7) EMWTL (6) ENERGY AUDIT (1) Engg. Mechanics (2) Engg.Chemistry (11) Faculty Files (6) Faculty Labs (1) Fuzzy (3) II MID (1) Job Exam Papers (4) LICA (1) Linux OS (1) Materials (1) MATLAB (27) MCU IDE 8051 (1) MEMS (4) MPMC (57) MPMC LAB Manual (3) MTECH (6) MWE (2) OC (1) PDC (9) Projects (8) RADAR (1) Research (9) RVSP (3) SC (1) Softwares (1) SS (1) STLD (18) TCSS (1) TSSN (1) TV Engg (1) VHDL (4) VLSI (8) VLSI Lab manual (1) WCN (1) Wireless Commu. (1) WSN (2)

Contact Form :

Name

Email *

Message *

Theme images by enjoynz. Powered by Blogger.