AI-generated Key Takeaways
-
MLKSegmentationMaskrepresents the result of a segmentation operation, providing a mask to identify segmented regions within an image. -
The
bufferproperty offers aCVPixelBuffercontaining per-pixel region values ranging from 0.0 to 1.0, where 1.0 signifies inclusion within the segmented area. -
While the
MLKSegmentationMaskowns and manages the lifecycle of the buffer, external users can retain it usingCVPixelBufferRetain()for extended usage.
MLKSegmentationMask
@interface MLKSegmentationMask : NSObjectThe result from a segmenter operation.
-
The segmentation buffer for the mask.
The buffer will be of format type
kCVPixelFormatType_OneComponent32Float. Each pixel in the mask will have a value in range [0.0f, 1.0f] where 1 indicates that a pixel is inside the segmented region, and 0 indicates that a pixel is outside the segmented region. Callers may query the mask for per-pixel region-value estimates, but are responsible for defining their own threshold for intermediate values. The buffer is owned by theSegmentationMaskand will be released when the container is deallocated, unless callers explicitly maintain a reference to it viaCVPixelBufferRetain().Declaration
Objective-C
@property (nonatomic, readonly) CVPixelBufferRef _Nonnull buffer; -
Unavailable.
Declaration
Objective-C
- (nonnull instancetype)init;