[check] find and findAll don't return the same score

Bug #1198108 reported by obiwan-92
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Medium
RaiMan

Bug Description

My point is that the score return by these function are not the same.
This means that the function "find" and "exists" are able to find an image that the function "findAll" will not find.

---------------------------------------------------------------------------------------------------------------------
For example, the code :

cs = "img.png"

e = exists(cs)
print "exists:", e

f = find(cs)
print "find:", f

lfa = findAll(cs)
for fa in lfa:
    print "findAll:", fa

return the following log:
exists: M[834,767 65x10]@S(0)[0,0 1920x1200] S:0,79 Center:866,772
find: M[834,767 65x10]@S(0)[0,0 1920x1200] S:0,79 Center:866,772
[error] script [ test_Skl ] stopped with error in line 9
[error] FindFailed ( can not find img.png on the screen. )
---------------------------------------------------------------------------------------------------------------------
To explain the above example :
I search three times the same image in the same background.
The functions exists are all found the same result with a score of 0.79.
But the "findAll" function has found no images with a similarity score higher than 0.7.

I use the release 1.0.0 of Sikuli on Windows XP (32).

Tags: fkt-find
RaiMan (raimund-hocke)
summary: - find and findAll don't return the same score
+ [1.0] find and findAll don't return the same score
description: updated
Changed in sikuli:
status: New → In Progress
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
tags: added: fkt-find
description: updated
Revision history for this message
obiwan-92 (obiwan-92) wrote : Re: [1.0] find and findAll don't return the same score

Hi

I think that the bug is in the TemplateFinder::find_all(Mat target, double min_similarity) function
I 'm not sure where the problem is, but take a look at all the lines with "data.useGray" and more specifically at the line with "data.useGray(false);"

In the equivalent function for find (TemplateFinder::find), the variable is set at False only if you are looking for the exact match (similarity > 0.99).
But in the TemplateFinder::find_all function, you set the variable to false at the end of the method.
If I understand correctly, you don't use the thresholding method, so the colors would be considered by openCV.

Am I correct ?

Regards.

Revision history for this message
RaiMan (raimund-hocke) wrote :

Thanks for digging into and find a possible cause.

I will check it the next days and report back.

RaiMan (raimund-hocke)
Changed in sikuli:
milestone: 1.1.0 → 1.2.0
RaiMan (raimund-hocke)
Changed in sikuli:
importance: High → Medium
milestone: 2.0.0 → 2.1.0
summary: - [1.0] find and findAll don't return the same score
+ [check] find and findAll don't return the same score
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.