SubjectSegmentationResult
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
public Bitmap
getForegroundBitmap ()
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eSubjectSegmentationResult\u003c/code\u003e provides the output of a subject segmentation operation.\u003c/p\u003e\n"],["\u003cp\u003eIt offers access to a masked bitmap of the foreground, highlighting the segmented subject.\u003c/p\u003e\n"],["\u003cp\u003eA foreground confidence mask provides pixel-level probabilities of belonging to the foreground.\u003c/p\u003e\n"],["\u003cp\u003eIt can return a list of segmented subjects if enabled through \u003ccode\u003eSubjectSegmenterOptions\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# SubjectSegmentationResult\n\npublic class **SubjectSegmentationResult** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nResult of [SubjectSegmentation](/android/reference/com/google/mlkit/vision/segmentation/subject/SubjectSegmentation). \n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Bitmap](//developer.android.com/reference/android/graphics/Bitmap.html) | [getForegroundBitmap](/android/reference/com/google/mlkit/vision/segmentation/subject/SubjectSegmentationResult#getForegroundBitmap())() Returns the masked bitmap for the input image. |\n| [FloatBuffer](//developer.android.com/reference/java/nio/FloatBuffer.html) | [getForegroundConfidenceMask](/android/reference/com/google/mlkit/vision/segmentation/subject/SubjectSegmentationResult#getForegroundConfidenceMask())() Returns the foreground confidence mask for the input image. |\n| [List](//developer.android.com/reference/java/util/List.html)\\\u003c[Subject](/android/reference/com/google/mlkit/vision/segmentation/subject/Subject)\\\u003e | [getSubjects](/android/reference/com/google/mlkit/vision/segmentation/subject/SubjectSegmentationResult#getSubjects())() Returns all segmented [Subject](/android/reference/com/google/mlkit/vision/segmentation/subject/Subject)s from the input image. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public [Bitmap](//developer.android.com/reference/android/graphics/Bitmap.html)\n**getForegroundBitmap** ()\n\nReturns the masked bitmap for the input image.\n\nReturns null if it is not enabled by [SubjectSegmenterOptions.Builder.enableForegroundConfidenceMask()](/android/reference/com/google/mlkit/vision/segmentation/subject/SubjectSegmenterOptions.Builder#enableForegroundConfidenceMask()) \n\n#### public [FloatBuffer](//developer.android.com/reference/java/nio/FloatBuffer.html)\n**getForegroundConfidenceMask** ()\n\nReturns the foreground confidence mask for the input image.\n\nReturns null if it is not enabled by [SubjectSegmenterOptions.Builder.enableForegroundConfidenceMask()](/android/reference/com/google/mlkit/vision/segmentation/subject/SubjectSegmenterOptions.Builder#enableForegroundConfidenceMask()) \n\n#### public [List](//developer.android.com/reference/java/util/List.html)\\\u003c[Subject](/android/reference/com/google/mlkit/vision/segmentation/subject/Subject)\\\u003e\n**getSubjects** ()\n\nReturns all segmented [Subject](/android/reference/com/google/mlkit/vision/segmentation/subject/Subject)s\nfrom the input image.\n\nReturns an empty list if multiple subjects are not enabled by [SubjectSegmenterOptions.Builder.enableMultipleSubjects(SubjectSegmenterOptions.SubjectResultOptions)](/android/reference/com/google/mlkit/vision/segmentation/subject/SubjectSegmenterOptions.Builder#enableMultipleSubjects(com.google.mlkit.vision.segmentation.subject.SubjectSegmenterOptions.SubjectResultOptions))."]]