Question

2) One application of Low-pass filter is noise reduction. However, it has adverse effect on the image edges and may cause Rin

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#ideal Low Pass Filter

# Reading input image : input_image
input_image = imread('[name of input image].[file format]');
% R: no of rows (height of the image)
% C : no of columns (width of the image)
[R, C] = size(input_image);

# Getting Fourier Transform of the input_image
# using MATLAB library function fft2 (2D fast fourier transform)
FT_img = fft2(double(input_image));

#Assign Cut-off Frequency you find comfartable

#change this value accordingly

D0 = 20;

# Designing filter
u = 0:(R-1);
idx = find(u>R/2);
u(idx) = u(idx)-R;
v = 0:(C-1);
idy = find(v>C/2);
v(idy) = v(idy)-N;

# MATLAB library function meshgrid(v, u) returns
# 2D grid which contains the coordinates of vectors
# v and u. Matrix V with each row is a copy
# of v, and matrix U with each column is a copy of u
[V, U] = meshgrid(v, u);

#Calculating Euclidean Distance
D = sqrt(U.^2+V.^2);

#Comparing with the cut-off frequency and
# determining the filtering mask
H = double(D <= D0);

# Convolution between the Fourier Transformed
# image and the mask
G = H.*FT_img;

# Getting the resultant image by Inverse Fourier Transform
# of the convoluted image using MATLAB library function
# ifft2 (2D inverse fast fourier transform)
output_image = real(ifft2(double(G)));

# Displaying Input Image and Output Image
subplot(2, 1, 1), imshow(input_image),
subplot(2, 1, 2), imshow(output_image, [ ]);

Explaination:-

first input and read image file with correct image file format. Then Give small dimension value for image if it is bigger to reduce computation time.Image pixel values will be in matrix of given dimension.Then apply 2D fast fourier transform it will generate a complex array of value which is visualized . The white speckles will indicate high energy in low frequencies.Then set a favorable CUT-off frequency at 20 to50.Then design and apply low pass filter.Apply mesh grid technique and euclidean distance in image pixel matrix is calculate to optimise and reduce the noise on the image. Then converting the resultant information from spectrum back to gray scale image. It could be done by applying inverse shifting and inverse FFT operation.

Image will have low features and details but there will be reduction in image noise.

# Butter worth low pass filter

Similarly to above program we will apply order value

n= 2;

# assigning Cut-off frequency

D0 =20;

%designing filter

u = 0:(R-1);

v = 0:(R-1);

idx = find(u > R/2);

u(idx) = u(idx) - R;

idy = find(v > C/2);

v(idy) = v(idy) - C;

MATLAB library function meshgrid(v, u) returns

# 2D grid which contains the coordinates of vectors

# v and u. Matrix V with each row is a copy of v

# and matrix U with each column is a copy of u

[V, U] = meshgrid(v, u);

# Calculating Euclidean Distance

D = sqrt(U.^2 + V.^2);

#determine filtering mask

H = 1./(1 + (D./D0).^(2*n));

#Inverse Fourieer transform

output_image = real(ifft2(double(G)));

#Displaying Input Image and Output Image

subplot(2, 1, 1), imshow(input_image),

subplot(2, 1, 2), imshow(output_image, [ ]);

##Explaination

It removes high-frequency noise from a digital image and preserves low-frequency components. The transfer function of Butterworth low pass filter of order n is defined to 2

first input and read image file with correct image file format. Then Give small dimension value for image if it is bigger to reduce computation time.Image pixel values will be in matrix of given dimension.Then apply 2D fast fourier transform it will generate a complex array of value which is visualized . The white speckles will indicate high energy in low frequencies.We have to set order of Butterworth filter order to (n=2)Then set a favorable CUT-off frequency at 20 to50.Then design and apply a low pass filter.Apply mesh grid technique and euclidean distance in image pixel matrix.The Filtering mask is applied to reduce noise pixel value  calculate to optimise and reduce the noise on the image. Then converting the resultant information from spectrum back to gray scale image. It could be done by applying inverse shifting and inverse FFT operation.

#Comparsion between Ideal LP filter and LP Butterworth

The image will be more blurry and have less details compared to Ideal low pass filter.The butterworth filter is   It removes high-frequency noise from a digital image more aggressively and preserves low-frequency components.

Add a comment
Know the answer?
Add Answer to:
2) One application of Low-pass filter is noise reduction. However, it has adverse effect on the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MUST BE IN MATLAB Design a low pass filter for this signal. Set the pass band...

    MUST BE IN MATLAB Design a low pass filter for this signal. Set the pass band frequency to 4.9 GHz and the stop band frequency to 5.6 GHz. Allow for 1 dB of attenuation in the pass band and require at least 20 dB of attenuation in the stop band. a. First design a Butterworth filter. Use the command buttord() to determine the order and the normalizing frequency for the filter. Use [Num,Den]=butter() to determine the numerator and denominator coefficients...

  • Activity-Based Costing, Distorted Product Costs Sharp Paper Inc. has three paper mills, one of which is...

    Activity-Based Costing, Distorted Product Costs Sharp Paper Inc. has three paper mills, one of which is located in Memphis, Tennessee. The Memphis mill produces 300 different types of coated and uncoated specialty printing papers. Management was convinced that the value of the large variety of products more than offset the extra costs of the increased complexity. During 20X1, the Memphis mill produced 120,000 tons of coated paper and 80,000 tons of uncoated paper. Of the 200,000 tons produced, 180,000 were...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT