private static double getBlackPercent(BufferedImage capture) {

		int blackcount = 0;
		for(int i = 0; i < capture.getWidth(); i++){
			for(int j = 0; j < capture.getHeight(); j++){
				int rgb = capture.getRGB(i, j);
				float[] hsb = Color.RGBtoHSB((rgb >> 16 & 0xFF), (rgb >> 8 & 0xFF), (rgb & 0xFF), null);
				if(hsb[2] < .05) blackcount++;
			}
		}
		
		return  (double) blackcount / (double) (capture.getWidth() * capture.getHeight());
		
		
	}