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);