stereodisc
Class Analyzer

java.lang.Object
  extended by stereodisc.Analyzer
Direct Known Subclasses:
ANNAccuracy, IxConverter, StereoAnalyzer

public class Analyzer
extends java.lang.Object

Stereo disk photograph analysis. Uses a directory that has a separate stack (multi TIFF file) for each future for all stereo pairs (starting with fts-) and the ground truth, starting with gt. Copyright (c) 1999-2004, Michael Abramoff. All rights reserved.


Constructor Summary
Analyzer()
           
 
Method Summary
static float[][] analyzeProbabilities(float[][] ft, float[][] truths, int width, java.util.Vector featureNames)
          Determine the probabilities that a pixelfeature can differentiate between two classes for all classes and all features.
static float[] createPixelSet(float[][] sampleGroundTruthPixels, int[][] coords)
           
static float[][] loadFeatures(java.lang.String[] names, int[][] coords, boolean train)
           
static float[][] pixelsToDataset(float[][][] samplePixels)
          samplePixels contains the pixel values for each sampled image for each feature (N).
static void showAccuracies(Features dataset, float[] featureTruth, Features m, float[] mTruth, int n, int k)
          Print the accuracies for each feature used in knn search.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Analyzer

public Analyzer()
Method Detail

loadFeatures

public static float[][] loadFeatures(java.lang.String[] names,
                                     int[][] coords,
                                     boolean train)
                              throws java.lang.Exception
Throws:
java.lang.Exception

pixelsToDataset

public static float[][] pixelsToDataset(float[][][] samplePixels)
samplePixels contains the pixel values for each sampled image for each feature (N). Sort of combined transpose and flatten. Convert into a feature vector for each pixel.

Returns:
float [j][i] the appropriately dimensioned dataset (MxN), where j is the sample index and i is the feature index.

createPixelSet

public static float[] createPixelSet(float[][] sampleGroundTruthPixels,
                                     int[][] coords)

analyzeProbabilities

public static float[][] analyzeProbabilities(float[][] ft,
                                             float[][] truths,
                                             int width,
                                             java.util.Vector featureNames)
Determine the probabilities that a pixelfeature can differentiate between two classes for all classes and all features. The truths, images in which only the pixel that have that true value are != 0, are used as masks.

Parameters:
ft - a float [][] matrix with images (row vectors).
truths - a float[][] matrix of column vector images for each class. A pixel is that class if the corresponding truth element is !0
Returns:
a float[][], with a p value for each feature and between all classes.

showAccuracies

public static void showAccuracies(Features dataset,
                                  float[] featureTruth,
                                  Features m,
                                  float[] mTruth,
                                  int n,
                                  int k)
Print the accuracies for each feature used in knn search. Features contains a data space for knn, and m contains the features that need to be classified. The average accuracy of the resulting classification vector is determined and shown. The features and m need to be organized in the same way, i.e. features[x][j] and m[y][j] refer to a feature of the same type, j.

Parameters:
features - the MxN matrix of N-dimensional features
featureTruth - a 1xM vector of the true classification for each element in data, 0 <= truth[i] <= n.
m - a PxQ matrix of Q-dimensional features that need to be classified, with Q <= N.
mTruth - a 1xP vector of the true classification for each element in m, 0 <= truth[i] <= n.
featureNames - the name of each j'th feature in features (and m).
n - the number of different classes in truth.
k - the number of neighbors to use for classification