code: private List<HistogramScene> computeHistograms(FeatureToWordHistogram_F64 featuresToHistogram ) {
  
  		List<String> scenes = getScenes();
  
  		List<HistogramScene> memory;// Processed results which will be passed into the k-NN algorithm
  		memory = new ArrayList<>();
  
  		for( int sceneIndex = 0; sceneIndex < scenes.size(); sceneIndex++ ) {
  			String scene = scenes.get(sceneIndex);
  			System.out.println("   " + scene);
  			List<String> imagePaths = train.get(scene);
  
  			for (String path : imagePaths) {
  				GrayU8 image = UtilImageIO.loadImage(path, GrayU8.class);
  
  				// reset before processing a new image
  				featuresToHistogram.reset();
  				describeImage.process(image);
  				for ( TupleDesc_F64 d : describeImage.getDescriptions() ) {
  					featuresToHistogram.addFeature(d);
  				}
  				featuresToHistogram.process();
  
  				// The histogram is already normalized so that it sums up to 1.  This provides invariance
  				// against the overall number of features changing.
  				double[] histogram = featuresToHistogram.getHistogram();
  
  				// Create the data structure used by the KNN classifier
  				HistogramScene imageHist = new HistogramScene(NUMBER_OF_WORDS);
  				imageHist.setHistogram(histogram);
  				imageHist.type = sceneIndex;
  
  				memory.add(imageHist);
  			}
  		}
  		return memory;
  	}
docs: For all the images in the training data set it computes a {@link HistogramScene}.  That data structure
  contains the word histogram and the scene that the histogram belongs to.