holypipette.vision.templatematching module

Search a template image in an other image Not scale nor rotation invariant

Uses OpenCV. Alternatively, one might use skimage.feature.match_template

exception holypipette.vision.templatematching.MatchingError(value)[source]

Bases: Exception

holypipette.vision.templatematching.templatematching(img, template, threshold=0)[source]

Search a template image in an other image Not scale nor rotation invariant.

Parameters:
  • img (image to look in)

  • template (image to look for)

  • threshold (throw an error if match value is below threshold)

Returns:

  • x (x coordinate of the template in the image)

  • y (y coordinate)

  • maxval (maximum value corresponding to the best matching ratio)