Compare images using sikuli in java

大城市里の小女人 提交于 2019-12-06 15:11:13

问题


im using sikuli-api 1.0.1 in java. The current problem is that I want to use the matching algo for a given image instead of a screen. The code which works is:

ScreenRegion s = new DesktopScreenRegion();
Target imageTarget = new ImageTarget(new File("someImage"));
ScreenRegion r = s.find(imageTarget);

Instead of using the ScreenRegion I would like to use a given image (File/BufferedImage). Any ideas how to do it? I dont want to click on the image etc. I just want to use sikulis algo to check if the target is inside the image.

Thanks in advance


回答1:


Your best bet is to create your own ScreenRegion implementation. Replace DesktopScreenRegion by an ImageScreenRegion which implements ScreenRegion.

ScreenRegion interface is pretty limited in terms of external classes implementations. It seems you'll just have to implement an ImageScreen and an ImageScreenLocation (easy as pie)

Look at the SreenRegion sources



来源:https://stackoverflow.com/questions/23384064/compare-images-using-sikuli-in-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!