[CV] Linear and Nonlinear Image Filtering, 이미지 필터링

전서윤·2023년 3월 27일

1. Linear Filtering

1-1. Convolution

1-2. Linear Filtering

  • Output은 Input의 weighted sum
  • Shift Invariant : Output은 이미지 내에서 neighborhood의 position이 아닌 pattern에 의해 결정된다
    g(i,j)=f(i+k,j+l)g(i,j) = f(i+k,j+l)(hg)(i,j)=(hf)(i+k,j+l)(h*g)(i,j) = (h*f)(i+k,j+l)
  • Image Filtering 과정에서 boundary effect를 없애기 위해 padding을 한다. ex) Zero, Wrap, Clamp, Mirror etc.

1-3. Examples

  1. Smoothing
  • h(u,v)=exp(u2+v22σ2)h(u,v) = exp(\frac{u^2+v^2}{2\sigma^2}) Gaussian Filter로 Noise Reduction도 가능하다
  1. Sharpening
  • Original Image에서 smoothed/unsharp image를 빼는 방법으로 Sharpening 가능
    g=f+γ(fhbf)=(1+γ)fγ(hbf)=(hahb)fg=f+\gamma(f-h_b*f)=(1+\gamma)f-\gamma(h_b*f)=(h_a-h_b')*f
  • hahbh_a-h_b' 라는 new Sharpening filter
  1. Gradient

1-4. Separablity

  • 2D filter를 2개의 1D filter (horizontal & vertical)로 separate한다면 time complexity가 O(k2)O(k^2)에서 O(k)O(k)로 줄어든다
  • K=vhK=vh^{\top}KK is a rank-1 matrix인 경우에 separable

2. Non-Linear Filtering

f(I1+I2)f(I1)+f(I2)f(I_1+I_2) \neq f(I_1)+f(I_2)

2-1. Median Filter

  • 각 pixel의 neighborhood 중에 median 값을 select
  • Pros : Effective to remove shot noise & Edge Preserving
  • Cons : Slow & 하나의 Pixel 값만 반영
  • Wighted median filter
  • α\alpha trimmed mean filter : outlier 제거

2-2. Bilateral Filtering

  • Neighboring pixel 값의 weighted combination

  • Domain kernel : smoothiing (using distances)

  • Range kernel : edge-preserving (using signal difference)

2-3. Morphology

  • 주로 픽셀의 값이 0 또는 1로 표현되는 binary image에 적용되며 postprocessing에 이용된다.
  • Structuring Elements : diamond, disk, octagon, rectangle etc.
  • θ(c,t)\theta(c,t) : window 내의 1의 개수인 c가 특정 t보다 클 경우 살리고 작을 경우 없앤다.

2-4. Distance Transfom

  • 어떤 픽셀 (i,j)로부터 0인 픽셀(background)까지의 최소한의 거리 (k,l)을 의미
  • Distance metrics : Manhattan(city block) or Euclidean, 주로 전자
  • 4 neighbor system이면 forward & backward 두번의 scan으로 계산, 8 neighbor일경우 4번 scan

2-5. Connected Component

  • 같은 label을 가지는 인접한 pixel을 연결하여 하나의 region/component를 만든다.
  • coloring : forward scan하면서 같은 값을 가지는 인접한 pixel을 같은 color로 한다.
    merging : 같은 label을 가지는데 서로 다른 color를 가지는 region을 merge한다.

요약

1. Linear Filtering

  • Convolution
  • Smoothing, Sharpening, Gradient filtering
  • Separability

2. Non-Linear Filtering

  • Median Filter
  • Bilateral Filter
  • Morphology
  • Distance Transform
  • Connected Component

0개의 댓글