How does SikuliX use OpenCV matchTemplate()?

Asked by Alexc on 2017-08-03

For sikuli, I hear it uses opencv under the hood. With that assumption, which of the method matching is used on the page:
http://docs.opencv.org/master/df/dfb/group__imgproc__object.html#ga586ebfb0a7fb604b35a23d85391329be

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Alexc
Solved:
2017-08-26
Last query:
2017-08-26
Last reply:
2017-08-04
Alexc (alexnospam123) said : #1

Also, for multiple matches, how does sikuli loop through the results array that is set when matchTemplate()
 is called? Is it pure brute force of lopping through each pixel in the result Mat and seeing if the values are at a certain threshold and extracting the pixel if it is a match?

Alexc (alexnospam123) said : #3

I am looking for the specific strategy used. Is it TM_CCORR or squared differences or something else? I am currently experimenting with the mask functionality of opencv 3.3 (since alpha mask transparency is not supported in sikuli) and it only supports TM_SQDIFF or TM_CCORR_NORMED and i get hundreds of false positives using a mask and converting both template and image into grayscale.

Alexc (alexnospam123) said : #4

I think I found my answer. This can be closed.