{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture - Bilateral filter

# Lecture - Bilateral filter - EE4780 Bilateral Filter...

This preview shows pages 1–6. Sign up to view the full content.

EE 4780 Bilateral Filter

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Bahadir K. Gunturk 2 Bilateral Filter ( 29 2 2 2 2 /2 ( ) ( ) /2 1 ˆ ( ) ( ) d r x N y x I y I x y x N I x e e I y K σ σ + - - - - = - = Intensity (range) proximity Spatial (domain) proximity N is a fixed value used to define the spatial neighborhood of the filter K is the normalization constant ( 29 2 2 2 2 / 2 ( ) ( ) / 2 d r x N y x I y I x y x N K e e σ σ + - - - - = - =
Bahadir K. Gunturk 3 Bilateral Filter  – Matlab implementation n=1:1:500; % Generate a vector from 1 to 500; the increment is 1. I0=zeros(size(n)); % Generate a vector of zeros; the size of the vector is equal to the size of n. I0(1:250)=15; I0(251:end)=10; % Set the first 250 values to 15, and the rest to 10. I = I0 + 0.5*randn(size(I0)); % 0.5 is the standard deviation of the noise figure; subplot(2,1,1); plot(n,I0); axis ([190 310 6 18]); title('Original signal'); subplot(2,1,2); plot(n,I); axis ([190 310 6 18]); title('Noisy signal');

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Bahadir K. Gunturk 4 Bilateral Filter  – Matlab implementation sigma_d=10; N=round(4*sigma_d); % N determines the spatial neighborhood sigma_r=1.3; d = -N:1:N; weights_d = exp(-d.*d/(2*sigma_d*sigma_d)); ( 29 2 2 2 2 / 2 ( ) ( ) / 2 1 ˆ ( ) ( ) d r x N y x I y I x y x N I x e e I y K σ σ + - - - - = - = The weights depend on the spatial distance (to the center pixel x) only; therefore, it is calculated once and saved.