Python 我想找到一个类似于org.sikuli.API.DesktopScreenRegion的API,以验证一个图像是否存在于另一个图像中

Python 我想找到一个类似于org.sikuli.API.DesktopScreenRegion的API,以验证一个图像是否存在于另一个图像中,python,webdriver,sikuli,appium,Python,Webdriver,Sikuli,Appium,我正在使用Appium为IOS自动化编写Python代码,但遇到了这个问题: 检查点是检查tableView中的一些单元格,当更改设备位置设置时(单元格将不同,数字和文本),如果文本和图像正确显示在单元格中,并且图像与文本匹配,就像足球图标与“足球”匹配一样,我尝试查找webdriver api以仅捕获单元格的快照,但是我发现的所有方法都是针对驱动程序的,它只能捕获整个屏幕 so we found a way to check this: first we capture the correct

我正在使用Appium为IOS自动化编写Python代码,但遇到了这个问题: 检查点是检查tableView中的一些单元格,当更改设备位置设置时(单元格将不同,数字和文本),如果文本和图像正确显示在单元格中,并且图像与文本匹配,就像足球图标与“足球”匹配一样,我尝试查找webdriver api以仅捕获单元格的快照,但是我发现的所有方法都是针对驱动程序的,它只能捕获整个屏幕

so we found a way to check this: first we capture the correct screenshot for the cells manually, then running the automation script, use the correct cell_screenshot to check if it appears in the screen
现在,我的同事有了这方面的java代码:
此代码可以使用imageExists来判断是否可以在另一个文件中找到该图像 我搜索了python的sikuli api,但找不到任何东西,看起来只有java api
现在我被困在这里了,有人能帮忙吗?非常感谢

Sikuli也支持Jython。事实上,这是Sikuli的默认脚本语言。因此,您可以在Jython中编写类似的逻辑,然后从Python中调用该脚本(如果可以的话)。我见过用户使用Java调用sikuli脚本。请参阅Sikuli的详细信息。

非常感谢!我会调查的。
import org.sikuli.api.DesktopScreenRegion;
import org.sikuli.api.ImageTarget;
import org.sikuli.api.ScreenRegion;
import org.sikuli.api.Target;

public class SnapShot {
    static DesktopScreenRegion sr = new DesktopScreenRegion();
    static Target image;
    static ScreenRegion result;
    static String fileURL;

    private static String getImageURL(String fileURL){
        return "screenshots/" + fileURL; 
    }`enter code here`
    public static boolean imageExists(String fileURL, Double similar, int timeout){
    timeout = timeout * 1000;
    image = new ImageTarget(new File(getImageURL(fileURL)));
    image.setMinScore(similar);
    result = sr.wait(image, timeout);
    if (result == null){
            System.out.println("Can not find image");
            return false;
    }
    return true;
    }
}