code: public static void equalize( int histogram[] , int transform[] ) {
  
  		int sum = 0;
  		for( int i = 0; i < histogram.length; i++ ) {
  			transform[i] = sum += histogram[i];
  		}
  
  		int maxValue = histogram.length-1;
  
  		for( int i = 0; i < histogram.length; i++ ) {
  			transform[i] = (transform[i]*maxValue)/sum;
  		}
  	}
docs: Computes a transformation table which will equalize the provided histogram.  An equalized histogram spreads
  the 'weight' across the whole spectrum of values.  Often used to make dim images easier for people to see.
  
  @param histogram Input image histogram.
  @param transform Output transformation table.