1

I am currently trying to program a template matcher from the openCV tutorial using these images: enter image description here image

I successfully get the match, however I don't need the visualization of drawing a rectangle like

 Imgproc.rectangle(img, matchLoc, new Point(matchLoc.x + templ.cols(),
            matchLoc.y + templ.rows()), new Scalar(0, 255, 0));

More importantly I wan't to get the coordinates of the matching template.

        System.out.println(String.format("X: %s \nY: %s" , matchLoc.x, matchLoc.y)); 
       -> X: 259.0  Y: 349.0

How can I retrieve the coordinates of every Point creating the resulting rectangle or maybe there is already a method for that?

0x45
  • 779
  • 3
  • 7
  • 26

0 Answers0