private int getEstimatedLength(OCRImage image, int brightness, boolean spaces, int spaceDistance) {
		int count = 0;
		int lastX = 0;
		for(int x = 0; x < image.getWidth(); x++) {
			for(int y = 0; y < image.getHeight(); y++) {
				int color = image.getData()[(y * image.getWidth()) + x];
				if(getBrightness(color, brightness)) {
					if(lastX == 0)
						lastX = x;
					if(x - lastX > 1)
						count++;
					if(spaces && (x - lastX > spaceDistance))
						count += ((x - lastX) / spaceDistance);
					lastX = x;
				}
			}
		}
		return count + 1;
	}