The configuration parameters for a photogrammetry session.
A ``PhotogrammetrySession/Configuration-swift.struct`` instance may be
passed in to any of the ``PhotogrammetrySession`` initializers to override
its default values.
Use the default values in most instances. In some cases, you may improve the quality
of the generated 3D object by specifying different values. If, for example, your
source images have few landmarks or poor contrast, you might set ``PhotogrammetrySession/Configuration-swift.struct/featureSensitivity-swift.property``
to ``PhotogrammetrySession/Configuration-swift.struct/FeatureSensitivity-swift.enum/high``
to compensate for it.
Members (12)
get · iOS 17.0+
sampleOrdering
TypeScript
get sampleOrdering(): PhotogrammetrySession_Configuration_SampleOrdering
Swift declaration
var sampleOrdering: PhotogrammetrySession.Configuration.SampleOrdering
The order of the image samples.
By default, RealityKit assumes that image samples aren’t in any particular order. If you’re
providing the images in order, with adjacent images next to each other, specifying
``PhotogrammetrySession/Configuration-swift.struct/SampleOrdering-swift.enum/sequential``
for this value may result in better performance.
This setting has no impact on the quality of the produced object.
set · iOS 17.0+
sampleOrdering
TypeScript
set sampleOrdering(value: PhotogrammetrySession_Configuration_SampleOrdering)
Swift declaration
var sampleOrdering: PhotogrammetrySession.Configuration.SampleOrdering
The order of the image samples.
By default, RealityKit assumes that image samples aren’t in any particular order. If you’re
providing the images in order, with adjacent images next to each other, specifying
``PhotogrammetrySession/Configuration-swift.struct/SampleOrdering-swift.enum/sequential``
for this value may result in better performance.
This setting has no impact on the quality of the produced object.
get · iOS 18.0+
ignoreBoundingBox
TypeScript
get ignoreBoundingBox(): boolean
Swift declaration
var ignoreBoundingBox: Bool
Ignores any bounding box information embedded in the input images and instead returns all possible geometry that can
be automatically estimated using the image set. The resulting mesh will likely need post-processing.
Note: to recover the entire scene geometry as well as ignore the box, `isObjectMaskingEnabled` should also be set to false.
set · iOS 18.0+
ignoreBoundingBox
TypeScript
set ignoreBoundingBox(value: boolean)
Swift declaration
var ignoreBoundingBox: Bool
Ignores any bounding box information embedded in the input images and instead returns all possible geometry that can
be automatically estimated using the image set. The resulting mesh will likely need post-processing.
Note: to recover the entire scene geometry as well as ignore the box, `isObjectMaskingEnabled` should also be set to false.
get · iOS 17.0+
featureSensitivity
TypeScript
get featureSensitivity(): PhotogrammetrySession_Configuration_FeatureSensitivity
Swift declaration
var featureSensitivity: PhotogrammetrySession.Configuration.FeatureSensitivity
The precision of landmark detection.
The photogrammetry process relies on finding identifiable landmarks in the overlap
between images. Landmarks can be hard to identify if the images don’t have enough
contrast, aren’t in focus, or if the object is all one color and lacks surface detail.
When ``PhotogrammetrySession/Configuration-swift.struct/featureSensitivity-swift.property``
is set to ``PhotogrammetrySession/Configuration-swift.struct/FeatureSensitivity-swift.enum/high``,
it instructs RealityKit to search an image for landmarks using an algorithm that
analyzes an image closely and in detail. This slower, more sensitive process can
produce an accurate 3D object even when landmarks are difficult to discern.
set · iOS 17.0+
featureSensitivity
TypeScript
set featureSensitivity(value: PhotogrammetrySession_Configuration_FeatureSensitivity)
Swift declaration
var featureSensitivity: PhotogrammetrySession.Configuration.FeatureSensitivity
The precision of landmark detection.
The photogrammetry process relies on finding identifiable landmarks in the overlap
between images. Landmarks can be hard to identify if the images don’t have enough
contrast, aren’t in focus, or if the object is all one color and lacks surface detail.
When ``PhotogrammetrySession/Configuration-swift.struct/featureSensitivity-swift.property``
is set to ``PhotogrammetrySession/Configuration-swift.struct/FeatureSensitivity-swift.enum/high``,
it instructs RealityKit to search an image for landmarks using an algorithm that
analyzes an image closely and in detail. This slower, more sensitive process can
produce an accurate 3D object even when landmarks are difficult to discern.
get · iOS 17.0+
checkpointDirectory
TypeScript
get checkpointDirectory(): (string) | null
Swift declaration
var checkpointDirectory: URL?
The directory that a the photogrammetry session uses for
checkpoints during reconstruction.
For macOS reconstruction, the `checkpointDirectory` serves
as a temporary reconstruction space if it is not `nil`.
Reconstruction starts from scratch, and does not resume
from previous checkpoints.
For iOS reconstruction, if you pass the same `checkpointDirectory`
used by an ``ObjectCaptureSession`` or an earlier interrupted
``PhotogrammetrySession``, the ``PhotogrammetrySession``
tries to use the saved checkpoint instead of starting from scratch.
Ensure that each `checkpointDirectory` is unique for each
images folder.
If set to an empty folder, the `checkpointDirectory` saves
checkpoints during processing for reuse in a subsequent restart.
If it is `nil`, the session does not use or save checkpoints, and
every reconstruction starts from scratch.
If a `checkpointDirectory` is has a non-nil value, but
the latest checkpoint is not compatible with the images folder
or other configuration settings, the session starts from scratch
and writes new checkpoints to this folder.
set · iOS 17.0+
checkpointDirectory
TypeScript
set checkpointDirectory(value: (string) | null)
Swift declaration
var checkpointDirectory: URL?
The directory that a the photogrammetry session uses for
checkpoints during reconstruction.
For macOS reconstruction, the `checkpointDirectory` serves
as a temporary reconstruction space if it is not `nil`.
Reconstruction starts from scratch, and does not resume
from previous checkpoints.
For iOS reconstruction, if you pass the same `checkpointDirectory`
used by an ``ObjectCaptureSession`` or an earlier interrupted
``PhotogrammetrySession``, the ``PhotogrammetrySession``
tries to use the saved checkpoint instead of starting from scratch.
Ensure that each `checkpointDirectory` is unique for each
images folder.
If set to an empty folder, the `checkpointDirectory` saves
checkpoints during processing for reuse in a subsequent restart.
If it is `nil`, the session does not use or save checkpoints, and
every reconstruction starts from scratch.
If a `checkpointDirectory` is has a non-nil value, but
the latest checkpoint is not compatible with the images folder
or other configuration settings, the session starts from scratch
and writes new checkpoints to this folder.
A Boolean value that indicates whether the session uses object masks.
If this value is true, but the samples don’t contain object masks, RealityKit attempts to
automatically create a mask algorithmically. If it’s unable to create a mask, RealityKit reverts to
reconstructing the object using the entire image.
If this value is true and the request’s samples do include object masks, RealityKit uses the
provided masks to separate the foreground object from the background.
If this value is false, RealityKit doesn’t attempt to separate the sample foreground from the
background, even if the samples have object masks.
set · iOS 17.0+
isObjectMaskingEnabled
TypeScript
set isObjectMaskingEnabled(value: boolean)
Swift declaration
var isObjectMaskingEnabled: Bool
A Boolean value that indicates whether the session uses object masks.
If this value is true, but the samples don’t contain object masks, RealityKit attempts to
automatically create a mask algorithmically. If it’s unable to create a mask, RealityKit reverts to
reconstructing the object using the entire image.
If this value is true and the request’s samples do include object masks, RealityKit uses the
provided masks to separate the foreground object from the background.
If this value is false, RealityKit doesn’t attempt to separate the sample foreground from the
background, even if the samples have object masks.