-
public final class SemanticSegmentationResultsA class containing segmentation mask, overlay functions, and helper utilities to process segmentation results from model inference (run function).
-
-
Field Summary
Fields Modifier and Type Field Description private IntegeralphaValueprivate final List<ColoredLabel>fullColorLabelMapprivate final <ERROR CLASS>foundDetectionsprivate final BitmapsegmentationMaskprivate final <ERROR CLASS>segmentationLabelprivate final BitmapmaskOverlayOnOriginalprivate final BitmapinputImage
-
Constructor Summary
Constructors Constructor Description SemanticSegmentationResults(Segmentation segmentation, Bitmap inputImage)
-
Method Summary
Modifier and Type Method Description final IntegergetAlphaValue()Alpha channel value for overlaying mask on top on inputImage final UnitsetAlphaValue(Integer alphaValue)Alpha channel value for overlaying mask on top on inputImage final List<ColoredLabel>getFullColorLabelMap()map from label name to color final <ERROR CLASS>getFoundDetections()final BitmapgetSegmentationMask()final <ERROR CLASS>getSegmentationLabel()final BitmapgetMaskOverlayOnOriginal()final BitmapgetInputImage()final BitmapmaskOverlayOnOriginal(Integer overlayAlpha)same as maskOverlayOnOriginal but with optional alpha value parameter for the mask image final BitmapfilteredInputImage(String label)Extract the pixels of input image that correspond to the given label Rest of the image is transparent. final UnitdrawOnCanvas(Canvas canvas, Integer alpha)-
-
Constructor Detail
-
SemanticSegmentationResults
SemanticSegmentationResults(Segmentation segmentation, Bitmap inputImage)
- Parameters:
segmentation- TFLite task api segmentation mask (bound to change)inputImage- The image for which the segmentation mask was generated
-
-
Method Detail
-
getAlphaValue
final Integer getAlphaValue()
Alpha channel value for overlaying mask on top on inputImage
-
setAlphaValue
final Unit setAlphaValue(Integer alphaValue)
Alpha channel value for overlaying mask on top on inputImage
-
getFullColorLabelMap
final List<ColoredLabel> getFullColorLabelMap()
map from label name to color
-
getFoundDetections
final <ERROR CLASS> getFoundDetections()
-
getSegmentationMask
final Bitmap getSegmentationMask()
-
getSegmentationLabel
final <ERROR CLASS> getSegmentationLabel()
-
getMaskOverlayOnOriginal
final Bitmap getMaskOverlayOnOriginal()
-
getInputImage
final Bitmap getInputImage()
-
maskOverlayOnOriginal
final Bitmap maskOverlayOnOriginal(Integer overlayAlpha)
same as maskOverlayOnOriginal but with optional alpha value parameter for the mask image
-
filteredInputImage
final Bitmap filteredInputImage(String label)
Extract the pixels of input image that correspond to the given label Rest of the image is transparent.
- Parameters:
label- Label name (from fullColorLabelMap) of detections for which you want the image portion.
-
drawOnCanvas
final Unit drawOnCanvas(Canvas canvas, Integer alpha)
-
-
-
-