GARFrame(Semantics)

Category adding Semantics functionality to GARFrame.

Summary

Properties

semanticConfidenceImage
CVPixelBufferRef
The latest semantic confidence image for the GARFrame as a CVPixelBuffer .
semanticImage
CVPixelBufferRef
The latest semantic image for the GARFrame as a CVPixelBuffer .

Public methods

fractionForSemanticLabel:
float
Retrieves the fraction of the most recent semantics frame that are queryLabel.

Properties

semanticConfidenceImage

@property(nullable, readonly) CVPixelBufferRef semanticConfidenceImage CF_RETURNS_NOT_RETAINED;

The latest semantic confidence image for the GARFrame as a CVPixelBuffer .

Each pixel is an 8-bit integer representing the confidence of the semantic label, with 0 representing the lowest confidence and 255 representing the highest confidence.

GARFrame retains the semantic CVPixelBuffer. Holding references to GARFrames will eventually exhaust resources.

GARFrame.semanticConfidenceImage will be nil if GARSessionConfiguration does not have GARSemanticModeEnabled set. Use isSemanticModeSupported: (GARSession(Semantics)) to check for support for the Scene Semantics API.

GARFrame.semanticConfidenceImage may be nil for the first few frames after initializing semantics, or if memory is exhausted due to retaining old GARFrames.

Extends class GARFrame.

semanticImage

@property(nullable, readonly) CVPixelBufferRef semanticImage CF_RETURNS_NOT_RETAINED;

The latest semantic image for the GARFrame as a CVPixelBuffer .

Each pixel in the image is an 8-bit integer representing a semantic class label: see GARSemanticLabel for a list of pixel labels and the Scene Semantics Developer Guide for more information.

GARFrame retains the semantic CVPixelBuffer. Holding references to GARFrames will eventually exhaust resources.

GARFrame.semanticImage will be nil if GARSessionConfiguration does not have GARSemanticModeEnabled set. Use isSemanticModeSupported: (GARSession(Semantics)) to check for support for the Scene Semantics API.

GARFrame.semanticImage may be nil for the first few frames after initializing semantics, or if memory is exhausted due to retaining old GARFrames.

Extends class GARFrame.

Public methods

fractionForSemanticLabel:

- (float)fractionForSemanticLabel:
(GARSemanticLabel) queryLabel

Retrieves the fraction of the most recent semantics frame that are queryLabel.

Queries the semantic image provided by GARFrame.semanticImage for pixels labeled by queryLabel. This call is more efficient than retrieving the CVPixelBuffer and performing a pixel-wise search for the detected labels.

If GARFrame.semanticImage is nil, fractionForSemanticLabel: will return 0.0.

Details
Parameters
queryLabel
the label to search for in the semantic image. See GARSemanticLabel for options.
Returns
The fraction of the semantic image with the given queryLabel.
Extends class GARFrame.