0

I have one source picture and 5 other samples and I want to find the sample that matches the source image best. I concluded that should use template matching since histogram comparison didn't fit the problem well. I use cv::minMaxLoc to determine min and max values of the result matrix but I misunderstand how to compare this values to properly find the "best-matching" picture.
Thank you!

PS: I have read OpenCV documentation.

Angie Quijano
  • 4,167
  • 3
  • 25
  • 30
user3577807
  • 31
  • 1
  • 5

1 Answers1

2

Here's a tutorial explaining the use of cv::matchTemplate(). In addition to the min and max, cv::MinMaxLoc() returns the top-left corner of the template position for the best match.

Note that if you expect more than one max/min then cv::MinMaxLoc() is not sufficient since it returns only a single point.

Adi Shavit
  • 16,743
  • 5
  • 67
  • 137