[Book] Summary of Digital Image Processing Chapter 03

Chapter 3: Intensity Transformations and Spatial Filtering

Rafael C.Gonzalez and Richard E.Woods. Digital Image Processing. PEARSON 을 다시 한번 읽어보며, 개인적으로 정리한 글입니다.

3.1 Background

3.1.1 The Basics of Intensity Transformations and Spatial Filtering

  • 모든 spatial domain process 에서 operator 와 input image f(x,y), output image g(x, y) 로 표현된다.

$$g(x, y) = T[f(x, y)]$$

3.2 Some Basic Intensity Transformation Functions

3.2.1 Image Negatives

  • Negative transformation
  • 이미지 반전 효과

$$s = L-1-r$$

3.2.2 Log Transormations

$$s=c*log(1+r)$$

  • c : constant, assumed r ≥ 0
  • low intensity value of input → wider range of output levels

3.2.3 Power-Law(Gamma) Transformations

$$s = cr^\gamma=c(r+\epsilon)^\gamma$$

c, gamma: positive constants

  • gamma 의 값에 따라서, intensity의 어떤 부분이 강조되는지가 다르다.
  • Original Image 와 monitor 에 비추는 이미지간의 차이를 중요하게 다룰 때, gamma correction 을 사용하게 된다.
  • 일반적인 contrast를 다룰 때 중요하게 사용되기도 한다. MRI 사진 sample 예

3.2.4 Piecewise-Linear Transformation Functions

1. Contrast stretching

  • Low-contrast image 은 sensing 면에서 떨어질 수 있으므로, intensity range를 연장하여, 큰 범위의 intensity 를 사용할 수 있도록 하는 방법
  • (input_intensity, output_intensity)→ (r1, s1) 과 (r2, s2)의 관계를 조절하여 contrast transform 형태를 조절한다. 극단적으로 r1=r2, s1=0, s2=L-1 이면, binary image 를 생성한다.(thresholding function)

2. Intensity-level slicing

  • 관심있는 영역의 Intensity-level 외에는 모두 0으로 처리하거나, 관심있는 영역은 특정 intensity level 로 두고, 나머지 level 은 그대로 두는 형태등이 있을 수 있다.

3. Bit-plane slicing

  • 8bit 의 이미지 슬라이드 중, significant order의 bit slide 중 특정 부분을 slicing

3.3 Histogram Processing

3.3.1 Histogram Equalization

  • Assume monotonic transformation: one-to-one mapping or many-to-one mapping
  • output pdf ps, input pdf pr

$$p_s(s) = p_r(r)|\frac{dr}{ds}|$$

  • 이 식은?

$$s=T(r)=(L-1)\int_{0}^{r}{p_r(w)dw}$$

  • histogram equalization, histogram linearization

$$s_k=T(r_k)=(L-1)\sum_{j=0}^{k}p_r(r_j) = \frac{L-1}{MN}\sum_{j=0}^{k}{n_j}$$

  • output image 의 p_s, distribution 이 uniform 되게 하는 형태
  • 결과적으로, 같은 이미지 형태이지만, 밝기와 contrast 가 모두 다르더라도 일정한 historgram 이 되도록 transform 해준다.

3.3.2 Histogram Matching(Specifiaction)

  • Uniform historgram이 항상 좋은 것은 아니다.
  • histogram matching, histogram specification : The method used to generate a processed image that has specified histogram

(1) histogram p_r(r) 을 계산, s_k 를 구하기 위해 histogram equalization transformation 식을 계산

(2) 원하는 p_z(z) 를 이용하여, function G 를 계산

(3)(2)에서 계산한 G를 이용해 z_k (k=0, 1, 2, …L-1) 까지 계산

(4) inverse of G 계산

(5) r → z trasnformation 계산

3.3.3 Local Histogram Processing

  • 이 전 두가지 histogram processing model 은 global 한 영역에서 진행, 즉 전체 이미지에 대해 intensity distribution 을 확인하고, 이를 이용해 transformation 을 진행 하였다.
  • 이러한 modeling 스킬을 Local enhancement 에 사용가능
  • Local enhancement 는 neighborhood 를 정하고, 중심을 이동해가며, neighborhood 안에서의 histogram equalization 이나 histogram specification transformation 등을 이용할 수 있다.
  • 계산을 줄이기 위해, nonoverlapping region 을 사용하여 위 방법을 동일하게 사용할 수 있으나, blocky effect 를 발생시킬 수 있음
  • blocky effect (p.161)

3.3.4 Using Histogram Statistics for Image Enhancement

3.4 Fundamentals of Spatial Filtering

3.4.1 The mechanics of Spatial FIltering

  1. Neighborhood (typically a small rectangle) 2. predefined operation

3.4.2 Spatial Correlation and Convolution

  • correlation, convolution: 180 degree 반전

3.4.3 Vector Representation of Linear Filttering

$$R=\sum_{k=1}^{9}w_kz_k=\boldsymbol{w}^T\boldsymbol{z}$$

3.4.4 Generating Spatial Filter Masks

  • mn mask
  • Average value of masked values → image smoothing
  • 위치에 따른 gaussian filter 예 (standard deviation?(p.173))

3.5 Smoothing Spatial Filters

  • smoothing for blurring, noise reduction
  • blurring : removal of small details from an image prior to object extraction, bridging of small gaps in lines or curves
  • noise reduction: blurring by linear or non-linear filtering

3.5.1 Smoothing Linear Filters

  • averaging filters == lowpass filters
  • Replace the value of every pixel in an image by the average of the intensity levels in neighborhood defined by the filter mask → reduced “sharp” transitions in intensity
  • box filter : all coefficient are euqal in filter

3.5.2 Order-Statistic(Nonlinear) Filters

  • median filter (popular): effective in impulse noise-reduction (salt-pepper noise)
  • implement
    1. sort values of neighborhood
    2. determine their median
    3. assign the value to filtered image

3.6 Sharpening Spatial Filters

  • highlight transitions

3.6.1 Foundation

3.6.2 Using the Second Derivative for Image Sharpeing—The Laplacian

  • capture intensity discontinuities in an image and deemphasize

$$g(x, y)=f(x, y) + c[\triangledown^2f(x,y)]$$

3.6.3 Unsharp Masking and Highboost Filtering

  • unsharp masking
    1. Blur the original image
    2. Subtract the blurred image from the original (the resulting difference is called the mask)
    3. Add the mask to the original

$$g_{mask}(x,y)=f(x,y)-\bar{f}(x,y)$$

$$g(x,y) = f(x, y) + k*g_{mask}(x, y), \quad k>=0$$

  • k>1 , highboost filtering
  • k<1, de-emphasizes unsharp mask

3.6.4 Using First-Order Derivatives for (Nonlinear) Image Sharpening—The gradient

  • Using the magnitude of the gradient, magnitude M(x, y)

$$M(x, y)=mag(\triangledown f)=\sqrt{g_x^2+g_y^2}=|g_x|+|g_y|$$

[Book] Summary of Digital Image Processing Chapter 03

https://emjayahn.github.io/2019/08/26/DIP-chapter3/

Author

Emjay Ahn

Posted on

2019-08-26

Updated on

2019-08-26

Licensed under

Comments