# applying high-emphasis Butterworth filtering and the Butterworth highpass filtering into image

2 views (last 30 days)
mustafa karatas on 5 Jan 2022
Answered: yanqi liu on 7 Jan 2022
hi everyone,
how can apply high-emphasis Butterworth filtering into image? and how can the Butterworth highpass filtering into image? whats difference between them
thanks for now helping me this issue
here is my code;
figure
imshow(b)
title('ikinci görüntü')
sharpenb = imsharpen(b);
figure
imshow(sharpenb)

yanqi liu on 7 Jan 2022
clc
close all
clear all
% n: Value of Exponent
n = 4 ;
% D0: the cutoff calue
D0 = 20;
%R for Rows & C for Columns
[R, C] = size(I);
FT_img = fft2(double(I));
%Butterworth Filter
u = 0:(R-1);
v = 0:(R-1);
idx = find(u > R/2);
u(idx) = u(idx) - R;
idy = find(v > R/2);
v(idy) = v(idy) - R;
[V, U] = meshgrid(v, u);
% Calculating Euclidean Distance
D = sqrt(U.^2 + V.^2);
H = 1./(1 + (D./D0).^(2*n));
% H = 1 - H;
G = H.*FT_img;
output_img = real(ifft2(double(G)));
G2 = (1-H).*FT_img;
output_img2 = real(ifft2(double(G2)));
subplot(1, 3, 1)
imshow(mat2gray(I)),
title('Original Image');
subplot(1, 3, 2)
imshow(mat2gray(output_img), [ ]);
title('low');
subplot(1, 3, 3)
imshow(mat2gray(output_img2), [ ]);
title('high'); 