tradt / sikuli-api

Automatically exported from code.google.com/p/sikuli-api
0 stars 0 forks source link

Exact matches have a score less than 1.0 #85

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to search an image, which is a pixel by pixel exact match of an area 
of the actual screen.
Only an exact match should be accepted, even at the smallest difference, the 
find method should fail. Therefore I set the minScore value of the Target 
object to 1.0.
But even if the image is exactly the same as a part of the screen, the find 
fails.
When debugging I found that the score value of the match is very close to 1.0, 
but doesn't reach it (e.g. 0.9999999523...).

This means that 1.0 cannot be used as the minScore. As a workaround I set it to 
0.9998, but couldn't find in any docs, what is the minScore that guarantees 
that the match found was exact.

What steps will reproduce the problem?
1. Create an image from a part of the screen.
2. Set the minScore of the Target object to 1.0
3. Invoke the find method on the ScreenRegion instance

What is the expected output? What do you see instead?
The find(Target) of the ScreenRegion object returns with null, instead of 
returning with the region containing the given target image.

What version of the product are you using? On what operating system?
- sikuli-api-1.0.2-standalone.jar
- Windows Server 2008 R2 Standard - Service Pack 1

Please provide any additional information below.

Original issue reported on code.google.com by mzoty...@gmail.com on 26 Mar 2014 at 12:27