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

2 views (last 30 days)
mustafa karatas
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;
b = imread('cameraman.tif');
figure
imshow(b)
title('ikinci görüntü')
sharpenb = imsharpen(b);
figure
imshow(sharpenb)
title('unsharp masking ikinci')

Answers (1)

yanqi liu
yanqi liu on 7 Jan 2022
clc
close all
clear all
I = imread('cameraman.tif');
% 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);
% determining the filtering mask
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');

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by