devskim blog
Search
📏

템플릿 매칭

sections
Tags
C++
OpenCV
Created
Apr 28, 2023 04:10 AM
Last Updated
Jul 30, 2023 09:49 AM
 
 
 

템플릿 매칭

  • 입력 영상에서 템플릿 영상 위치를 찾는 기법
  • 템플릿 찾을 대상이 되는 작은 영상
  • matchTemplate
    • TM_SQDIFF
    • TM_CCORR
    • TM_CCOEFF
  • 영상의 변형
    • 잡음 → 가우시안 필터
    • 밝기/명암 → 정규화
    • 크기/회전 변환 → 취약
  • 예시
 
notion image
 
notion image
notion image
 
 

여러 개의 템플릿 매칭

  • 예시 이미지
    • 템플릿 영상
      • notion image
    • 입력 영상
      • notion image
  • 구현 방법
      1. 정규화된 상관 계수 행렬 구하기
        1. notion image
      1. 정규화된 상관 계수 값이 충분히 큰 영역 검출
        1. notion image
      1. 각각의 영역에서 국지적 최대 지점 검출
        1. notion image
      1. 검출 영상 확인
        1. notion image
 
 
 

템플릿 매칭을 이용한 숫자 인식

  • 인식 여러 개의 클래스 중에서 가장 유사항 클래스 선택
  • Consolas 폰트 예시
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
 
PREV특징점 검출
NEXT이진화, 객체 단위 분석