|
|
@ -13,9 +13,9 @@ import java.util.Iterator;
|
|
|
|
public class 屏幕找图 {
|
|
|
|
public class 屏幕找图 {
|
|
|
|
public static void main(String[] args) throws FindFailed {
|
|
|
|
public static void main(String[] args) throws FindFailed {
|
|
|
|
Screen screen = new Screen();
|
|
|
|
Screen screen = new Screen();
|
|
|
|
Pattern button = new Pattern(new File("legend/文件夹.png")
|
|
|
|
Pattern button = new Pattern(new File("legend/我的电脑.png")
|
|
|
|
.getAbsolutePath())
|
|
|
|
.getAbsolutePath())
|
|
|
|
.similar(0.7f);
|
|
|
|
.similar(0.8f);
|
|
|
|
// 相似度阈值 0.8
|
|
|
|
// 相似度阈值 0.8
|
|
|
|
Iterator<Match> all = screen.findAll(button);// 找到按钮位置
|
|
|
|
Iterator<Match> all = screen.findAll(button);// 找到按钮位置
|
|
|
|
|
|
|
|
|
|
|
|