TemplateMatching

less than 1 minute read

Template Matching



1. Template Matching


  • The method finds the matching part with template image in input image.
  • Template : Small image to find the object. Patch


image


  • Template matching code


cv2.matchTemplate(image, temp1, method, result=None, mask=None) -> result


  • image : Input image. 8bit or 32 bit
  • templ : template image
  • method : comparision method
  • result : comparision result matirx


  • Template matching method


image

image


  • Templat matching example


image

image


2, Number recognition of typeface

  • Recognition
    • Classifying a detected object into different categories
    • Selecting similar class in the several class


image


  • Generating number template image
    • Saving the number image written by ‘Consolas’ font to digit0.bmp ~ digit9.bmp
    • Nomalization to 100 x 150 size of each number image


image


  • Number recognition process


image


  • Number recognition example


image


Leave a comment