← Back to team overview

sikuli-driver team mailing list archive

[Question #661532]: region with finder

 

New question #661532 on Sikuli:
https://answers.launchpad.net/sikuli/+question/661532

Hi i am having one screenshot with specific region and i am trying to find one image inside that region it is possible

IMP.. Specific region will take screenshot in runtime and in that image we need to find expected image.


		WebElement elmt = driver2.findElement(By.xpath("//*[@id='window']"));
                Screenshot regionset = new AShot().takeScreenshot(driver, elmt);
		BufferedImage regionsetimage = regionset.getImage();
		ImageIO.write(regionset.getImage(), "PNG", new File("/Users/aathi/Desktop/testimage2.png"));
		Pattern Capimage = new Pattern(regionsetimage);
		Region reg1 = screen.find(Capimage);
		String a = reg1.toString();
		Finder f = new Finder("/Users/aathi/Desktop/testimage2.png");  
             //Finder f = new Finder(a);
		Pattern image = new Pattern("/Users/aathi/Desktop/Sikuli/"+imageName);
		f.find(image);
		System.out.println("find");

This is always running even the image is not present in that region also can u give any better solution for this

My Aim is  -- I need to find image in that bufferedimage which is set as region. i don't want to search for that image in web screen. i need to find or search for image in side that captured image which is captured as region in my localpath.


Kindly excepting your reply 

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