public CandidateBand getCandidateBand(Line line){
		Set<Character> shortestCharacterChoices = recognize(line.shortest,trainingMap.keySet());
		int minHeight = histogram.getTrainingCharactersByHeight().lastKey();
		for (Character choice:shortestCharacterChoices){
			if (minHeight > trainingMap.get(choice).height()){
				minHeight = trainingMap.get(choice).height();
			}
		}
		Set<Character> widestCharacterChoices = recognize(line.widest, trainingMap.keySet());
		int maxWidth = histogram.getTrainingCharactersByWidth().firstKey(); 
		for (Character choice:widestCharacterChoices){
			if (maxWidth < trainingMap.get(choice).width()){
				maxWidth = trainingMap.get(choice).width();
			}
		}
		
		double hscale = ((1.0 *minHeight)/line.shortest.height() + (1.0 * maxWidth)/line.widest.width())/2.0;
		
		int maxHeightCandidate = minHeight ;
		if (line.tallest.height() > line.shortest.height()){
			SortedMap<Integer,List<Character>> tailMap = histogram.getTrainingCharactersByHeight().tailMap((int)(hscale * line.tallest.height()));
			if (!tailMap.isEmpty()){
				maxHeightCandidate = tailMap.firstKey() ;
			}
		}
		Set<Character> tallestCharacterChoices = recognize(line.tallest, histogram.getCharactersTallerThan(maxHeightCandidate-1,2));
		int maxHeight = histogram.getTrainingCharactersByHeight().firstKey();
		for (Character choice: tallestCharacterChoices){
			if(maxHeight < trainingMap.get(choice).height()){
				maxHeight = trainingMap.get(choice).height();
			}
		}
			
		CandidateBand band = new CandidateBand();
		band.minHeight = minHeight; 
		band.maxHeight = maxHeight;
		band.maxWidth = maxWidth;
		//System.out.println(band);
		return band;
	}