Edges

HyungSeop Lee·2023년 10월 16일
0

Edge Detection

  • edge detection이란? :
    • image 상에서 존재하는 급격한 변화(discontinuities)를 탐지하는 것.
    • 2차원 image를 curve의 set으로 convert하는 것.
  • note :
    • salient(중요한) feature를 뽑아낼 수 있다
    • more compact than pixels

Origin of edges

  • edge가 발생하는 요인은 다양하다.
    1. 노면이 불연속적인 경우
    2. depth discontinuity (원근에 대한 불연속)
    3. surface color discontinuity (색상에 대한 불연속)
    4. illumination discontinuity (조명에 대한 불연속)

Image Gradient

Discrete derivatives in 1D

  • type of discrete derivative in 1D :

Discrete derivatives in 2D

3x3 image gradient filters

Characterizing edges


A simple Edge Detector

Effects of noise

  • Effects of noise :
    만약 noise가 있다면,
    위에서 봤던 gradient filter들로는 계산할 수 없다.

Smoothing with different fiilters

  • smoothing :
    noise를 제거하는 방법. (data preprocessing)
    1. mean smoothing : [1 1 1]^T, [1 1 1]
      window를 이동시키며 window 내 data들의 평균값을 취해 제거.
      noise는 줄지만 blur해짐.
    2. Gaussian filter smoothing : [1 2 1]^T, [1 2 1]
      가운데 부분 강조되며 smoothing됨

Derivative of Gaussian (DoG)

  • 아니면, gaussian kernel(=h)를 미분해서 f와 convolution해도 동일한 결과.

2D edge detection filters

  • trade-off between smoothing, at different scales

  • N(μ,σ)N(\mu, \sigma)
    σ\sigma가 커질수록 blur해진다.


Sobel Edge Detector

  • Sobel operator = DoG를 근사하기 위한 filter.

  • Sobel filter는 Gaussian filter(DoG)와 미분 filter를 모두 사용하기 때문에
    Gaussian이 noise를 없애주는 역할을 해주고, 미분 filter가 edge를 찾아주는 역할을 해주기 때문에
    noise 사진의 edge를 잘 찾음.
    하지만 여전히 blur함.

  • 단점 : blur하기 때문에 명확한 edge를 찾기 힘듦. = ramp 구간에서 edge를 정하기 힘듦.
    ➡️ threshold 설정, Canny edge detector


Canny Edge Detector

  • Canny edge detector steps :
    1. smooth image with Gaussian filter
    2. compute derivative of filtered image
    3. find magnitude and orientation of gradient
    4. apply non-maximum suppression
    5. apply hysteresis threshold

1, 2 : DoG

3. find magnitude and orientation of gradient

4. non-maximum suppression (NMS)

  • edge가 아닌데 edge라고 판단되는 edge들이 있다.
    이러한 edge들을 억제시켜줌.
    주변 8개 pixel값들과 gradient 비교하여, 본인보다 큰 게 있으면 0으로 만듦. 그렇지 않으면 유지.

5. hysteresis thresholding

  • with two thresholds(T, t)

  • strong edge : R > T
    weak edge : R > t and R < T
    no edge : R < t ➡️ remove

Canny Edge Detector도 마찬가지로 DoG를 쓰기 때문에
Gaussian Distribution의 σ\sigma가 크다면, 큰 edge들을 detect(weak egde들은 제거됨).

profile
efficient computer vision

0개의 댓글