I. Lab questions
See for high-frequency enhancement of images.
High-frequency enhancement: A> = 0, B> =HHfe(U, v) = a + bHHP(U, v)Where a = 0.5, B = 2.0
Ii. Experiment Analysis
This experiment mainly involves filtering in the frequency domain.AlgorithmThe process is as follows:
① Use (-1) x + y multiplied by the input image for center Transformation
② Calculate DFT f (u, v) in ① ③ multiply f (u, v) by f (u, v) using the filter function H (u, v)
④ Calculate the inverse DFT of the result in ③ to obtain the real part of the result in ④.
⑥ Use (-1) x + y multiplied by the result in ⑤ to cancel the multiplier of the input image
We can implement corresponding operations through fft2, fftshift, ifftshift, iftt2, and
The filtering function can be used together to complete the experiment.
Iii. ExperimentProgram
Clear; clc; figure; I = imread ('images \ fig4.30(a).jpg '); subplot (, 1); imshow (I); Title ('a graph origin '); F = double (I); [R, C] = size (f); F = fft2 (f); G = fftshift (f); D0 = 15; % Radius Range n = 2; % butworth order a = 0.5; B = 2.0; % high frequency emphasis on filter transfer function coefficient mu = floor (R/2 ); MV = floor (C/2); for u = 1: R for V = 1: c d = SQRT (u-mu) ^ 2 + (V-mV) ^ 2); hlpbtw = 1/(1 + 0.414 * (D/D0) ^ (2 * n); hhpbtw = 1-hlpbtw; ghpbtw (u, v) = hhpbtw * g (u, v); hhfebtw = a + B * hhpbtw; ghfebtw (u, v) = hhfebtw * g (u, v ); endendghpbtw = ifftshift (ghpbtw); fhpbtw = uint8 (real (ifft2 (ghpbtw); subplot (2, 2); imshow (fhpbtw ); title ('B tu butworth Qualcomm'); ghfebtw = ifftshift (ghfebtw); fhfebtw = uint8 (real (ifft2 (ghfebtw); subplot (, 3 ); imshow (fhfebtw); Title ('C-map butworth high frequency emphasis filter'); histeq_fhfebtw = histeq (fhfebtw, 256); subplot (, 4); imshow (histeq_fhfebtw ); title ('C image equalization result ');
Program description:
1. BTW Butterworth, barworth Filter
2. F, G is the spatial domain, g, h is the frequency domain