Class FeaturePreprocessor

java.lang.Object
qupath.opencv.ml.FeaturePreprocessor

public class FeaturePreprocessor extends Object
Create a preprocessor for an image or training matrix. This can include simple normalization (rescaling) and PCA projection.
  • Constructor Details

    • FeaturePreprocessor

      public FeaturePreprocessor()
  • Method Details

    • apply

      public void apply(Mat mat, boolean channelFeatures)
      Apply preprocessing in-place.
      Parameters:
      mat -
      channelFeatures - treat each channel as a feature; otherwise, treat each column as a feature
    • apply

      public void apply(Mat mat)
      Apply preprocessing in-place. If the Mat has multiple channels, each channel is treated as a feature. Otherwise, each row is treated as a feature.
      Parameters:
      mat -
    • doesFeatureTransform

      public boolean doesFeatureTransform()
      Returns true if this preprocessor transforms the features beyond a simple normalization. In practice, for the current implementation this means PCA.
      Returns:
    • doesSomething

      public boolean doesSomething()
      Returns true if this preprocessor has any effect.
      Returns:
    • getInputLength

      public int getInputLength()
      Get the number of features required of the input.
      Returns:
    • getOutputLength

      public int getOutputLength()
      Get the number of features expected in the output.
      Returns:
    • builder

      public static FeaturePreprocessor.Builder builder()
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object