GARFrame

ARCore frame class.

Each GARFrame corresponds to an ARFrame that was passed into a GARSession with a call to update:error: (GARSession). GARFrames are immutable, since new ARFrames can be generated by ARKit at any time. For Augmented Faces, see GARAugmentedFaceFrame.

Summary

Inheritance

Inherits from: NSObject

Properties

anchors
NSArray< GARAnchor * > *
All anchors in the GARSession at the timestamp of this frame, plus any anchors removed by the GARSession since the last frame was generated.
earth
Snapshot of the GAREarth state for this frame.
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 .
streetscapeGeometries
NSArray< GARStreetscapeGeometry * > *
List of snapshots of GARStreetscapeGeometry for this frame.
timestamp
NSTimeInterval
The frame timestamp.
updatedAnchors
NSArray< GARAnchor * > *
The subset of the anchors array consisting of those anchors that have changed since the last frame was generated.

Public methods

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

Properties

anchors

@property(nonatomic, readonly) NSArray *anchors;

All anchors in the GARSession at the timestamp of this frame, plus any anchors removed by the GARSession since the last frame was generated.

Each anchor in this array is an immutable snapshot of an underlying anchor, which can be uniquely identified by the anchor's identifier property.

earth

@property(nonatomic, readonly, nullable) GAREarth *earth;

Snapshot of the GAREarth state for this frame.

This will be nil if GARSessionConfiguration.geospatialMode is disabled.

Provided by category GARFrame(Geospatial).

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.

Provided by category GARFrame(Semantics).

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.

Provided by category GARFrame(Semantics).

streetscapeGeometries

@property(nonatomic, readonly, nullable) NSArray *streetscapeGeometries;

List of snapshots of GARStreetscapeGeometry for this frame.

See the Streetscape Geometry Developer Guide for additional information.

This will be nil if GARSessionConfiguration.streetscapeGeometryMode is disabled.

Provided by category GARFrame(Geospatial).

timestamp

@property(nonatomic, readonly) NSTimeInterval timestamp;

The frame timestamp.

This is equal to the timestamp on the corresponding ARFrame, and represents time since boot in seconds.

updatedAnchors

@property(nonatomic, readonly) NSArray *updatedAnchors;

The subset of the anchors array consisting of those anchors that have changed since the last frame was generated.

This should only be used if the immediately previous frame was processed.

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: (GARFrame(Semantics)) 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.
Provided by category GARFrame(Semantics).