Documentation on Native APIs for sikuli script

Asked by Yadish Khan

Is there an available documentation on the sikuli scripts APIs ?
If yes, can anyone please point me to it?
If no, can anyone help me out a little bit on the pyramid-template-matcher and other Native API files and the way it uses the cv::matchTemplate() ?
A little bit of description to understand how the pyramid algorithm is implemented would be very helpful!

Thanks in advance!

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
j (j-the-k) said :
#1

There is no documentation of the internal Sikuli APIs as far as I know.
If you want to understand how Sikuli uses opencv, take a look at the code: https://github.com/sikuli/sikuli/tree/develop/sikuli-script/src/main/native
It is unfortunately not documented very well either.
Do you have any specific questions?

Revision history for this message
Yadish Khan (yadish-khan) said :
#2

Thanks for the prompt reply!

I was actually looking at the code to figure out how the pyramid matching algorithm is implemented in sikuli.
It would be really great if, by any chance, I can get the algorithm for the 3 stage image pyramid used by sikuli.
If not the whole set, even small description of the call-stack between sikuli and OpenCV would be a great help!

Thanks!

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Just looking into the native modules with an editor might make you crazy, it is a hell.

So at least use a capable C++ IDE (I am using NetBeans 7.3), to have a chance to find the definitions of structures and functions, which are scattered over 4 to 5 modules. Mixing in the text finder feature did not make it better.

-- Sikuli's current matching (very rough description):

- at the base matchTemplate() is used with CV_TM_CCOEFF_NORMED
- there is some special handling for one-color-targets
- minMaxLoc() is used to get the top left of the best match

1. search step:
- target and shot are resized, so the target size is near but greater than 12x12 pixel
(this can be set using Vision.setParameter("MinTargetSize", n) )
(this is currently the one level pyramid - CV's pyrDown() is not used)
- if the score is minimum greater 0.9: return match

otherwise 2. search step: (if minSimilarity < 0.99)
- search target in shot grayscale
- if the score is minimum greater 0.9: return match

otherwise 3. search step:
- search target in shot (both the original RGB color images)
- return the match information

findAll() works somewhat different - but similar ;-)

Can you help with this problem?

Provide an answer of your own, or ask Yadish Khan for more information if necessary.

To post a message you must log in.