Package com.github.axet.starjeweled.core

Examples of com.github.axet.starjeweled.core.Recognition


        frame.noise.setImage(i2);
        rectangle = lookup.getBounds(i2);
        BufferedImage i3 = lookup.crop(i2, rectangle);
        frame.bounds.setImage(i3);

        Recognition rr = new Recognition(desktopImage, rectangle);
        colorTable = new BoardColorsTable(rr.matrix);

        frame.analyse.init(rr.getCX(), rr.getCY());
    }
View Full Code Here


        // desktopRegion =
        // capture.load("/Users/axet/Desktop//Screen Shot 2011-08-19 at 18.55.22.png",
        // rectangle);
        desktopRegion = capture.capture(rectangle);
        frame.board.setImage(desktopRegion);
        Recognition rr = new Recognition(desktopRegion);
        RecognitionTable rtable = new RecognitionTable(rr, colorTable);

        Matrix m = new Matrix(rtable);

        frame.analyse.draw(colorTable, m);

        SimpleAI a = new SimpleAI(m);
        ArrayList<MoveMatrix> ppp = a.getMove();

        int missClick = 10;

        try {
            for (MoveMatrix p : ppp) {
                frame.analyse.move(p.p1, p.p2);

                Rectangle mr = rr.getRect(p.p1.x, p.p1.y);
                Point pp = rr.getMiddle(mr);
                pp.x += rectangle.x;
                pp.y += rectangle.y;
                user.click(user.random(pp, missClick));

                mr = rr.getRect(p.p2.x, p.p2.y);
                pp = rr.getMiddle(mr);
                pp.x += rectangle.x;
                pp.y += rectangle.y;
                user.click(user.random(pp, missClick));
            }
        } finally {
View Full Code Here

TOP

Related Classes of com.github.axet.starjeweled.core.Recognition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.