Similarity / Score

Asked by Rideg

What is the similarity or the getScore() computation based on? Is it a pixel by pixel comparison?
I tried comparing two very similar images (basically the same screen but one of them has additional text in a textfield while the other has the textfield empty, and i got a score of ~0.48.
Comparing 2 completely different screens is returning a score of ~0.53.
I am trying to understand why these 2 scores are close while i would have expected a score close to 1 in the first case, and close to 0 in the second case.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

not really clear what you did?

Comparing 2 screens? Used the Finder class?

Paste your test snippet.

Revision history for this message
Rideg (rimadeghaili) said :
#2

Just doing something simple like the below to try Sikuli and see if I could adopt it for my project to compare images.
But i want to understand how the getScore() works. What does this score really represents and how is it computed?

Finder f = new Finder("D:\\sikuli_screens\\figure1.png");

         f.find("D:\\sikuli_screens\\figure2.png",0.6);
        if (f.hasNext()) {
            System.out.println("same");
            System.out.println(f.next().getScore());
        } else {
            System.out.println("different");

        }

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3
Revision history for this message
Rideg (rimadeghaili) said :
#4

Thanks RaiMan, that solved my question.