summaryrefslogtreecommitdiff
path: root/125/CH6/EX6.7
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /125/CH6/EX6.7
downloadScilab-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.7')
-rwxr-xr-x125/CH6/EX6.7/Fig6_5_DegradedImage_Restoration.JPGbin0 -> 30761 bytes
-rwxr-xr-x125/CH6/EX6.7/Fig6_7.sce38
-rwxr-xr-x125/CH6/EX6.7/Fig6_7_Degraded_NoiseImage_Restoration.JPGbin0 -> 47700 bytes
3 files changed, 38 insertions, 0 deletions
diff --git a/125/CH6/EX6.7/Fig6_5_DegradedImage_Restoration.JPG b/125/CH6/EX6.7/Fig6_5_DegradedImage_Restoration.JPG
new file mode 100755
index 000000000..220368740
--- /dev/null
+++ b/125/CH6/EX6.7/Fig6_5_DegradedImage_Restoration.JPG
Binary files differ
diff --git a/125/CH6/EX6.7/Fig6_7.sce b/125/CH6/EX6.7/Fig6_7.sce
new file mode 100755
index 000000000..cc531f3e9
--- /dev/null
+++ b/125/CH6/EX6.7/Fig6_7.sce
@@ -0,0 +1,38 @@
+//Caption:Scilab code performs inverse filtering
+//Degrade the image by means of a known blur and white noise
+//The image is degraded as well as corrupted by noise
+//Apply inverse filter to restore the image
+//Fig6.7
+//page 332
+clc;
+close;
+x =imread('E:\DIP_JAYARAMAN\Chapter6\flower2.jpg');
+x=double(rgb2gray(x));
+[M N]=size(x);
+h = zeros(M,N);
+for i = 1:11
+ for j = 1:11
+ h(i,j) = 1/121;
+ end
+end
+sigma = sqrt(4*10^(-7));
+freqx = fft2d(x); //Fourier transform of input image
+freqh = fft2d(h);//Fourier transform of degradation
+y = real(ifft2d(freqh.*freqx))+10*rand(M,N,'normal');
+freqy = fft2d(y);
+powfreqx = freqx.^2/(M*N);
+alpha = 0.5; //Indicates inverse filter
+freqg = ((freqh.')').*abs(powfreqx)./(abs(freqh.^2).*abs(powfreqx)+alpha*sigma^2);
+Resfreqx = freqg.*freqy;
+Resa = real(ifft2d(Resfreqx));
+x = uint8(x);
+y = uint8(y);
+Resa = uint8(Resa)
+ShowImage(x,'Original Image')
+title('Original Image')
+figure
+ShowImage(y,'Degraded+noise Image')
+title('Degraded+noise Image')
+figure
+ShowImage(Resa,'Restored Image')
+title('Restored Image') \ No newline at end of file
diff --git a/125/CH6/EX6.7/Fig6_7_Degraded_NoiseImage_Restoration.JPG b/125/CH6/EX6.7/Fig6_7_Degraded_NoiseImage_Restoration.JPG
new file mode 100755
index 000000000..8b8ff8a19
--- /dev/null
+++ b/125/CH6/EX6.7/Fig6_7_Degraded_NoiseImage_Restoration.JPG
Binary files differ