5

I have working OpenCV template matching code made with python. Now I am searching for a way to tell OpenCV to search only in a supplied area (x, y, w, h), is that possible?

Regards, Philip

plaetzchen
  • 757
  • 6
  • 22

1 Answers1

5
roi = image[y:y+h , x:x+w]

cv2.matchTemplate(roi, templ, ...
berak
  • 39,159
  • 9
  • 91
  • 89