diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /125/CH6/EX6.18 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '125/CH6/EX6.18')
-rwxr-xr-x | 125/CH6/EX6.18/Fig6_18.sce | 31 | ||||
-rwxr-xr-x | 125/CH6/EX6.18/Fig6_18_Average_Filtering.JPG | bin | 0 -> 20161 bytes |
2 files changed, 31 insertions, 0 deletions
diff --git a/125/CH6/EX6.18/Fig6_18.sce b/125/CH6/EX6.18/Fig6_18.sce new file mode 100755 index 000000000..695254b9f --- /dev/null +++ b/125/CH6/EX6.18/Fig6_18.sce @@ -0,0 +1,31 @@ +//Caption:Scilab code to Perform Average Filtering operation
+//Fig6.18
+//page 349
+clc;
+close;
+a= imread('E:\DIP_JAYARAMAN\Chapter6\lenna.jpg');//SIVP toolbox
+a=imnoise(a,'salt & pepper', 0.2); //Add salt&pepper noise tothe image
+a=double(a);
+[m n]=size(a);
+N=input('enter the window size='); //The window size can be 3x3,5x5etc
+Start=(N+1)/2;
+Out_Imag=a;
+for i=Start:(m-Start+1)
+for j=Start:(n-Start+1)
+ limit=(N-1)/2;
+ Sum=0;
+ for k=-limit:limit,
+ for l=-limit:limit,
+ Sum=Sum+a(i+k,j+l);
+ end
+ end
+ Out_Imag(i,j)=Sum/(N*N);
+end
+end
+a = uint8(a);
+Out_Imag = uint8(Out_Imag);
+ShowImage(a,'original Image')
+title('Noisy Image')
+figure
+ShowImage(Out_Imag,'average filtered Image')
+title('5x5 average filtered Image');
\ No newline at end of file diff --git a/125/CH6/EX6.18/Fig6_18_Average_Filtering.JPG b/125/CH6/EX6.18/Fig6_18_Average_Filtering.JPG Binary files differnew file mode 100755 index 000000000..70688f20a --- /dev/null +++ b/125/CH6/EX6.18/Fig6_18_Average_Filtering.JPG |