1 minute read

영상 처리에서 특정한 패턴이나 모양을 탐지하기 위해 사용되는 모폴로지적 변환 기법


Morphology: Hit or Miss Transform

image

전체 이미지에서 미리 정의된 객체를 찾는 것.

전경 및 배경 픽셀의 특정 패턴을 찾는 데 사용하는 일반적인 이진 형태학적 연산이다.


Background

배경지식


Hit, Fit, Miss

image

  • Defined structuring element : 2 x 2 커널

  • Fit : Positions where the whole element fits inside the object
    • 구조 엘리먼트가 완벽하게 맞아 들어가는 경우
  • Hit : Positions where the element partly overlaps the object
    • 구조 엘리먼트 일부에 속하는 경우
  • Miss : Positions where the element does not overlap with the object.
    • 구조 엘리먼트 일부에도 속하지 않는 경우


Hit or Miss Transform

Hit or Miss Transform 에는 Hit 과 Miss 만 존재.

완벽히 커널과 겹칠 때에만 Hit. 그 외 모든 경우에는 Miss.

image

  • 목표: 집합 A 내에서 특정 형태 (target) D의 위치를 찾는 것이다.

  • D can fit inside many objects, so we need to look at the local background $W-D$.

    • D는 많은 위치에서 맞을 수 있다. 그렇기 때문에 $W-D$ 도 고려해야 한다.


Step:

Hit or Miss 변환 과정

image


Erosion of A by D

  • A 를 D 로 침식
  • $A \ominus D$
  • 이 침식과정은 D 가 A 내부에 들어맞을 수 있는 모든 픽셀 위치를 찾는다.

image


Fit the background

  • A의 보완 (complement of A), i.e., $A^C$를 계산한다.
  • 보완은 이미지의 픽셀값을 반전키는 것을 의미한다.
  • 이미지의 배경과 객체를 반전시켜, 배경에 초점

image


image


Erosion of $A^c$ by $W - D$

  • $A^C \ominus (W - D)$
  • 로컬배경 ($W-D$) : 특정 대상, 또는 객체 주변의 영역
  • $W-D$는 원래 구조요서 D의 배경에 해당하는 부분이다.
  • 구조요소가 보완된 이미지에 적합하는 모든 위치를 나타낸다.

image


Intersection

  • D 가 A 에 맞는 위치와 배경이 맞는 위치의 교차점을 찾는다.
  • 이 교차점은 D 가 A 에 정확히 맞는 위치를 나타낸다.
  • $A \ominus D \cap A^C \ominus (W - D)$

image


Finally,

  • It express $ A \odot D $
  • D 가 A 에 완벽하게 맞는 위치를 찾을 수 있다.


Advanced

모서리 탐지

Structuring element

image


Pivot for detecting corner

image


Input and Results

image


Reference:

  • https://youtu.be/zY-3psKZ6Yg?si=hviRjKCeBrY9SemM
  • https://homepages.inf.ed.ac.uk/rbf/HIPR2/hitmiss.htm
  • https://www.uio.no/studier/emner/matnat/ifi/INF4300/h16/undervisningsmateriale/inf4300-2016–morfologi.pdf

Leave a comment