Package qupath.opencv.ml
Class FeaturePreprocessor
java.lang.Object
qupath.opencv.ml.FeaturePreprocessor
Create a preprocessor for an image or training matrix.
This can include simple normalization (rescaling) and PCA projection.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply preprocessing in-place.void
Apply preprocessing in-place.static FeaturePreprocessor.Builder
builder()
Create aFeaturePreprocessor.Builder
to build a customFeaturePreprocessor
.boolean
Returns true if this preprocessor transforms the features beyond a simple normalization.boolean
Returns true if this preprocessor has any effect.int
Get the number of features required of the input.int
Get the number of features expected in the output.toString()
-
Constructor Details
-
FeaturePreprocessor
public FeaturePreprocessor()
-
-
Method Details
-
apply
Apply preprocessing in-place.- Parameters:
mat
-channelFeatures
- treat each channel as a feature; otherwise, treat each column as a feature
-
apply
Apply preprocessing in-place. If theMat
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
Create aFeaturePreprocessor.Builder
to build a customFeaturePreprocessor
.- Returns:
-
toString
-