Re: [Sikuli-driver] [Question #663991]: get count of similar images

2018-02-02 Thread Maniraj
Question #663991 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/663991

Status: Needs information => Open

Maniraj gave more information on the question:
Hai,


public static boolean findInWholePage(WebDriver driver,String 
imageName,ExtentTest etest) throws IOException, FindFailed, InterruptedException
  {
String expectedimg = "imagepath" // path of image. 
URL file_url = new URL(expectedimg);
String uniqueID = UUID.randomUUID().toString();
String actualimage = uniqueID+imageName;
BufferedImage regionsetimage = screenCapture(driver,actualimage); // using 
selenium I am taking whole page screenshot and storing as buffered image.
Finder window = new Finder(regionsetimage);
Pattern testImage = new Pattern(file_url); 
window.find(testImage.similar((float) 0.99));  //.exact()
Match found = null;
if (window.hasNext())
{
  found = window.next();
  //System.out.println(imageName + " Image found");
  etest.log(LogStatus.PASS,"Expected: "+ expected + "Actual" + actual);
  return true;
}
else
{
  System.out.println(imageName + " Image Not found");
  etest.log(LogStatus.FAIL,"Expected: "+ expected + "Actual" + actual);
  return false;
}
  }


In this inside my region (that means whole page Screenshot taken in runtime), I 
have more than 1 similar images. In this scenario can I get count of all that 
similar images ?

... would be easier to understand if you post some snippet of code.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #663991]: get count of similar images

2018-02-02 Thread Maniraj
Question #663991 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/663991

Status: Answered => Solved

Maniraj confirmed that the question is solved:
Thanks raiman. i will check.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #663991]: get count of similar images

2018-02-02 Thread RaiMan
Question #663991 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/663991

Status: Open => Answered

RaiMan proposed the following answer:
supposing it is SikuliX 1.1.1 or even 1.1.2, then this should do what
you want:

window.findAll(testImage.similar((float) 0.99)); //.exact()
while (window.hasNext()) {
nextMatch = window.next();


the matches are delivered with decreasing score.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #663991]: get count of similar images

2018-02-02 Thread RaiMan
Question #663991 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/663991

Status: Open => Needs information

RaiMan requested more information:
what you say is not consistent:
---  finding image inside region, in that region more that 1 similar images are 
there
--- i am taking screenshot and inside that screenshot comparing the image

... would be easier to understand if you post some snippet of code.

In any case use
findAll()

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp