I - Ground-truth pixel typeJ - Predicted pixel typepublic class ConfusionMatrix<I extends net.imglib2.type.numeric.IntegerType<I>,J extends net.imglib2.type.numeric.IntegerType<J>> extends Object
Additionally, a ConfusionMatrix gives access to the total number of pixels labeled by ground-truth label i or predicted label j.
Pixel of value 0 are considered background and ignored in confusion matrix. Therefore, if ground-truth image has M labels, including background, and the prediction image has N, then the confusion matrix is of size (M-1)x(N-1).
| Constructor and Description |
|---|
ConfusionMatrix(net.imglib2.RandomAccessibleInterval<I> groundTruth,
net.imglib2.RandomAccessibleInterval<J> prediction)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getGroundTruthLabelSize(int labelIndex)
Return the number of pixels corresponding to the ground-truth
label indexed by
labelIndex. |
int |
getIntersection(int gtLabelIndex,
int predLabelIndex)
Return the number of pixels shared by the ground-truth label
indexed by
gtIndex and the prediction label indexed
by predIndex. |
int |
getNumberGroundTruthLabels()
Return the number of ground-truth labels.
|
int |
getNumberPredictionLabels()
Return the number of prediction labels.
|
int |
getPredictionLabelSize(int labelIndex)
Return the number of pixels corresponding to the prediction
label indexed by
labelIndex. |
public ConfusionMatrix(net.imglib2.RandomAccessibleInterval<I> groundTruth, net.imglib2.RandomAccessibleInterval<J> prediction)
groundTruth - Ground-truth imageprediction - Prediction imagepublic int getGroundTruthLabelSize(int labelIndex)
labelIndex.labelIndex - Index of the labelpublic int getPredictionLabelSize(int labelIndex)
labelIndex.labelIndex - Index of the labelpublic int getIntersection(int gtLabelIndex,
int predLabelIndex)
gtIndex and the prediction label indexed
by predIndex.gtLabelIndex - Index of the ground-truth labelpredLabelIndex - Index of the prediction labelpublic int getNumberGroundTruthLabels()
public int getNumberPredictionLabels()
Copyright © 2009–2026 ImgLib2. All rights reserved.