Package net.hearthstats.game.imageanalysis

Examples of net.hearthstats.game.imageanalysis.ScreenAnalyser


    new RelativePixelAnalyserMain().testFindRelativePixel();
  }

    public void testFindRelativePixel() throws Exception {

        ScreenAnalyser analyser = new ScreenAnalyser();
        RelativePixelAnalyser relativePixelAnalyser = new RelativePixelAnalyser();

        File imageFolder = new File(IMAGE_PATH);
        File[] imageArray = imageFolder.listFiles();

        Assert.assertNotNull("No files found in " + IMAGE_PATH + ". Please make sure you've set the path to a folder that contains screenshots from Hearthstone", imageArray);

        List<File> images = new ArrayList<>(imageArray.length);
        for (File image : imageArray) {
            if (image.getName().endsWith(".png")) {
                // Determine if this is a match end image
                BufferedImage bufferedImage = ImageIO.read(image);

                Screen screen = analyser.identifyScreen(bufferedImage, null);

                if (screen == Screen.MATCH_NAXXRAMAS_END || screen == Screen.MATCH_ORGRIMMAR_END || screen == Screen.MATCH_PANDARIA_END
                        || screen == Screen.MATCH_STORMWIND_END || screen == Screen.MATCH_STRANGLETHORN_END) {
                    // This is a match end screen, so it is suitable for testing with the RelativePixelAnalyser
                    images.add(image);
View Full Code Here

TOP

Related Classes of net.hearthstats.game.imageanalysis.ScreenAnalyser

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.