public static void main(String[] args) throws IOException {
		ArrayList<Img<Color>> els = new ArrayList<Img<Color>>();
		Random r = new Random(/*2413*/);
		String[] FONTS = { "Times", "Georgia", "Optima", "Times New Roman" };
		for (int i = 0; i < 200; i++) {
			TreePredict.Img<Color> timg = TreePredict.getImg("a", new Config.FontType(FONTS[i % FONTS.length], false), Color.RED, r);
			float[] fftdata = fft(timg.data, new float[timg.data.length], true);
			els.add(new Img<Color>(fftdata, Color.RED));
		}
		for (int i = 0; i < 200; i++) {
			TreePredict.Img<Color> timg = TreePredict.getImg("e", new Config.FontType(FONTS[i % FONTS.length], false), Color.BLUE, r);
			float[] fftdata = fft(timg.data, new float[timg.data.length], true);
			els.add(new Img<Color>(fftdata, Color.BLUE));
		}
		
		SVNode tree = createSVTree(els, els, 5, 2, null);
		int failures = 0;
		int tries = 0;
		for (File f : new File("/Users/zar/Desktop/DesktopContents/ltestdata3/a/").listFiles()) {
			if (!f.getName().endsWith(".png")) { continue; }
			float[] data = TreePredict.getImg(ImageIO.read(f), Color.RED).data;
			float[] fftdata = fft(data, new float[data.length], true);
			Color tag = tree.classify(new Img(fftdata, Color.RED));
			if (!tag.equals(Color.RED)) { failures++; }
			tries++;
		}
		
		for (File f : new File("/Users/zar/Desktop/DesktopContents/ltestdata3/e/").listFiles()) {
			if (!f.getName().endsWith(".png")) { continue; }
			float[] data = TreePredict.getImg(ImageIO.read(f), Color.BLUE).data;
			float[] fftdata = fft(data, new float[data.length], true);
			Color tag = tree.classify(new Img(fftdata, Color.BLUE));
			if (!tag.equals(Color.BLUE)) { failures++; }
			tries++;
		}
		
		System.out.println(failures + "/" + tries);
		System.out.println((tries - failures) * 100.0 / tries);
		
		/*// Find SV Tree
		for (int i = 1; i < 8; i += 2) {
			BufferedImage img = new BufferedImage(IMG_SZ, IMG_SZ, BufferedImage.TYPE_INT_RGB);
			Graphics2D g = img.createGraphics();
			g.setColor(Color.WHITE);
			g.fillRect(0, 0, IMG_SZ, IMG_SZ);
			SVNode tree = createSVTree(els, els, i, 2, null);

			// Draw support vector by checking each pixel of the display.
			drawVector(tree, g, 0);

			// Draw classes.
			int score = 0;
			for (Img<Color> e : els) {
				Color c = tree.classify(e);
				if (c == e.tag) { score++; }
				g.setColor(c);
				g.drawRect((int) (IMG_SZ / 2 * (e.data[0] + 1)) - 2, (int) (IMG_SZ / 2 * (e.data[1] + 1)) - 2, 5, 5);
			}

			// Draw points with correct classes.
			for (Img<Color> e : els) {
				g.setColor(e.tag);
				g.fillRect((int) (IMG_SZ / 2 * (e.data[0] + 1)) - 1, (int) (IMG_SZ / 2 * (e.data[1] + 1)) - 1, 4, 4);
			}

			g.setColor(Color.BLACK);
			g.drawString(score + "/" + els.size(), 10, 20);

			ImageIO.write(img, "png", new File("/Users/zar/Desktop/" + i + ".png"));
		}*/
	}