



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Image: 2-D function x(i, j) where 0 ≤ i, j ≤ M − 1 (for an M × M image). System: Continuousspace (t,s) x˜(t, s) → |A/D| ︸ ︷︷ ︸ SAMPLER
→ |h(i, j)| ︸ ︷︷ ︸ FILTER
INTERP OLATOR−
→ y˜(t, s).
D/A: y˜(t, s) = 4
i=−∞
j=−∞ y(i, j)^
S
)2 sin B(t−iT ) B(t−iT )
sin B(s−jT ) B(s−jT ) (2D sinc). Sample: t = iT, s = jT, S = (^2) Tπ , S > 2 B where 2B=image bandwidth. Assume: X(ω 1 , ω 2 )) = FF{x(t, s)} = 0 for |ω 1 | > B and |ω 2 | > B. LTI: If xn(i, j) → |LT I| → yn(i, j), then
cnxn(i, j) → |LT I| →
cnyn(i, j).
h(i,j): If x(i, j) → |h(i, j)| → y(i, j), then y(i, j) =
h(i−m, j−n)x(m, n). h(i, j)=impulse response=point-spread function. Stable: BIBO stable ⇔
i=−∞
j=−∞ |h(i, j)|^ <^ ∞. 2-D Z: Z{h(i, j)} =
h(i, j)z 1 − iz 2 − j= H(z 1 , z 2 )=transfer function. y(i, j) = h(i, j) ∗ ∗x(i, j) → Y (z 1 , z 2 ) = H(z 1 , z 2 )X(z 1 , z 2 ). DSFT: H(ejω^1 , ejω^2 ) =
h(m, n)e−j(ω^1 m+ω^2 n)^ = H(z 1 , z 2 )|z 1 =ejω (^1) ,z 2 =ejω 2. Inverse: h(m, n) = (^4) π^12
∫ (^) π −π
∫ (^) π −π H(e
jω (^1) , ejω (^2) )ej(ω 1 m+ω 2 n)dω 1 dω 2.
Note: H(ejω^1 , ejω^2 ) is periodic in ω 1 and ω 2 with periods 2π. Odd+ xe(i, j) = 12 (x(i, j) + x(−i, −j)) = DSF T −^1 {RE[X(ejω^1 , ejω^2 )]}. Even xo(i, j) = 12 (x(i, j) − x(−i, −j)) = DSF T −^1 {jIM [X(ejω^1 , ejω^2 )]}. Any x(i, j) = xe(i, j) + xo(i, j). DSFT[real and even] is real and even. Freq. cos(ω 1 i+ω 2 j) → |h(i, j)| → |H(ejω^1 , ejω^2 )| cos(ω 1 i+ω 2 j+ARG[H(ejω^1 , ejω^2 )]). Resp. |H(ejω^1 , ejω^2 )|=Gain; ARG[H(ejω^1 , ejω^2 )]=Phase (shift).
2-D DFT: Xk 1 ,k 2 =
n 1 =
n 2 =0 x(n^1 , n^2 )e
−j 2 π( n N^1 k 11 + n N^2 k 22 ), 0 ≤k 1 ≤N 1 − 1 0 ≤k 2 ≤N 2 − 1.
Inverse: x(n 1 , n 2 ) = (^) N 11 N 2
k 1 =
k 2 =0 Xk^1 ,k^2 e
j 2 π( n N^1 k 11 + n N^2 k 22 ), 0 ≤n 1 ≤N 1 − 1 0 ≤n 2 ≤N 2 − 1. Cyclic: y(i, j) = h(i, j) c© ©cx(i, j) ⇔ Yk 1 ,k 2 = Hk 1 ,k 2 Xk 1 ,k 2. 0-pad: 2-D cyclic convolution can be 0-padded to 2-D linear convolution. 2-D FFT: N 1 [N 2 -point 1-D FFTs] to compute ˆx(n 1 , k 2 ) from x(n 1 , n 2 ). AND N 2 [N 1 -point 1-D FFTs] to compute Xk 1 ,k 2 from ˆx(n 1 , k 2 ). → N 1 N 22 log N 2 + N 2 N 21 log N 1 = N^12 N 2 log(N 1 N 2 ) mults. (like 1-D).
Example: h(i, j) =
(^) → H(ejω^1 , ejω^2 ) =
sin(1. 5 ω 1 ) sin(0. 5 ω 1 )
sin(1. 5 ω 2 ) sin(0. 5 ω 2 )
(1 + 2 cos(ω 1 ))(1 + 2 cos(ω 2 ))
Note: Separable: h(i, j) = h 1 (i)h 2 (j) → H(ejω^1 , ejω^2 ) = H 1 (ejω^1 )H 2 (ejω^2 ). Point: Separable system/image→2-D problem decouples to 1-D problems. So? 2-D lowpass: h(i, j) = hL(i)hL(j) where hL(i) is 1-D lowpass filter.
Radial: H(ejω^1 , ejω^2 ) =
1 for
ω 12 + ω^22 < B 0 for
ω 12 + ω^22 > B 0 ≤ |ω 1 |, |ω 2 | ≤ π Note: H(ejω^1 , ejω^2 ) is circularly symmetric ”pill-box function.” Recall: H(ejω^1 , ejω^2 ) is periodic in ω 1 and ω 2 with periods 2π.
Then: h(i, j) = 2 BπJ^1 ( RBR ) where R =
i^2 + j^2. (Derivation: Lim p.57). Where: J 1 (·)=Bessel function of 1st^ kind of order 1. J^1 x(x ) ∼ sinc function.
Note: H(ejω^1 , ejω^2 ) = H(
ω 12 + ω^22 ) for
ω 12 + ω^22 < π → h(i, j) = h(
i^2 + j^2 ) If: H(ejω^1 , ejω^2 )=constant in rest of the region 0 ≤ |ω 1 |, |ω 2 | ≤ π. But: h(i, j) = h(
i^2 + j^2 ) does NOT → H(ejω^1 , ejω^2 ) = H(
ω^21 + ω 22 ). MEDIAN FILTERING For: Impulsive=“salt-and-pepper”=shot noise (arises from bit errors). while: Preserving image edges. NOTE: Example of nonlinear filtering. 1-D: y(n) = MEDIAN[x(n + 2), x(n + 1), x(n), x(n − 1), x(n − 2)]. Why? Preserves edges: Note this has no effect on step function u(n). 2-D: Apply 1-D median filter to each row, then to each column. EDGE DETECTION For: Enhancing edges. Why? Image segmentation, image understanding.
∑i+ i− 2
∑j+ j− 2 [x(m, n)^ −^ x¯(m, n)]
(^2) > η, declare ∃“edge.”
OR: Use gradients for directional edge detection:
load lena.mat;X=xx;N=2*randn(300,300);2D IMPULSE
50 100 150 200 250
50 100 150 200 250
H=.8.^abs(-22:22);H=H*H; POINT-SPREAD
10 20 30 40
10 20 30 40
Y=conv2(X,H);Y1=Y+N;BLURRED IMAGE
50 100 150 200 250 300
100
200
300
real(ifft2(fft2(Y)./fft2(H,300,300)));RECONSTRUCTION
50 100 150 200 250
50 100 150 200 250
real(ifft2(fft2(Y1)./fft2(H,300,300)));RECONSTRUCTION
50 100 150 200 250 300
100
200
300
FX(76:225,76:225)=0;real(ifft2(FX));RECONSTRUCTION
50 100 150 200 250 300
100
200
300