Compte rendu
Elaboré par : Brini Houssem
Eddine
Classe : 3éme électromécanique
Exemple : Wiener Filter sur
Matlab
Read Pristine Image
Read and display a pristine image that does not have blur or noise.
Ioriginal = imread ('cameraman.tif') ;
Imshow (Ioriginal)
Title ('Original Image')
Simulate and Restore Motion Blur Without Noise
Simulate a blurred image that might result from camera motion. First, create a
point-spread function, PSF, by using the fspecial function and specifying linear
motion across 21 pixels at an angle of 11 degrees. Then, convolve the point-
spread function with the image by using imfilter.
The original image has data type uint8. If you pass a uint8 image to imfilter,
then the function will quantize the output in order to return another uint8 image.
To reduce quantization errors, convert the image to double before
calling imfilter.
PSF = fspecial ('motion',21,11) ;
Idouble = im2double (Ioriginal) ;
blurred = imfilter (Idouble,PSF,'conv','circular');
imshow (blurred)
title ('Blurred Image')
Restore the blurred image by using the deconvwnr function. The blurred image
does not have noise so you can omit the noise-to-signal (NSR) input argument.
wnr1 = deconvwnr(blurred,PSF);
imshow (wnr1)
title ('Restored Blurred Image')