Configuration
Configuration structure for the scanning session.
Declaration
struct ConfigurationConstructors
init(framerate: Int = 0, enableRaycastVisualization: Bool = false, enableVoxelVisualization: Bool = false, raycastWidth: Int = 0, raycastHeight: Int = 0, nearDepth: Float = 0.02, farDepth: Float = 0.0, voxelSize: Float = 0.0, path: String? = nil, scanTargetId: String? = nil, generateDepthsIfLidarUnavailable: Bool = false, enableFullResolution: Bool = false, fullResolutionFramerate: Int = 0)
Summary
Properties
| Name | Type | Summary |
|---|---|---|
| var enableFullResolution | Bool | Controls whether full-resolution camera images are recorded. When true, the scanning feature will record a JPEG image that is the same resolutionas the raw camera image passed to the NSDK session with the sendFrame function.When false, the scanning feature records a 720x540 resolution JPEG imagegenerated by cropping and/or scaling and compressing the raw camera image. - Note: Compressing the camera image to JPEG format is relatively expensive, so enable this option with that in mind. - Note: The quality of voxel and raycast visualizations is not affected by this value. |
| var enableRaycastVisualization | Bool | Controls whether raycast visualization images are generated. When true, images for the raycast visualization will be generated each time a new inputframe is available. The scanning feature provides buffers that can be used to generate a 2D image that visualizes what parts of the scene have been thoroughly scanned. See the RaycastBuffer class for more information. |
| var enableVoxelVisualization | Bool | Controls whether voxel visualization is enabled. When true, voxels can be computed, and computed voxels will be updated each time anew input frame is available. Use computeVoxels to update the voxel grid andvoxelBuffer to read the data. |
| var farDepth | Float | Far depth plane for scan depth range, in meters. This parameter controls the farthest distance at which depth data will be integrated. Objects farther than this distance will not be visible in visualization or reconstruction. This does not affect the range of the recorded depth frames. If set to 0.0, this isconfigured to 5.0 m in the default configuration. Values greater than 5.0 m are not recommended. Must be greater than nearDepth, or set to 0 to use the default range. |
| var framerate | Int32 | Target FPS for recording and visualization processes. The target framerate is the cap for how often the feature will process new input frames. The actual framerate may differ. If set to 0, this defaults to 30 FPS. The recordingFPS cannot exceed the rate at which frames are delivered to the scanning session. - Note: Recording NSDK depth with generateDepthsIfLidarUnavailable can result in alower recording FPS than the target framerate. |
| var fullResolutionFramerate | Int32 | Target FPS for full resolution frame recording. The target framerate for recording full resolution frames when enableFullResolutionis true. The actual framerate for full-resolution frames may differ from the targetframerate. If set to 0, this is configured to 2 FPS in the default configuration.- Note: Recording NSDK depth with generateDepthsIfLidarUnavailable can result in alower recording FPS than the target framerate. |
| var generateDepthsIfLidarUnavailable | Bool | Whether to use and record NSDK's estimated depths, if platform depths are unavailable. Depths are recorded as part of the scan data, and are also required to generate voxels or raycast visualization images. If NSDK was configured to use platform depths, this value is ignored, and depths are expected to come through the scanning session. Otherwise: - When true, NSDK will generate estimated depths for use by the scanning feature- When false, the scanning feature will not be able to generate voxels or raycastvisualization images, but will still be able to record other scan data. - Attention: If NSDK depth is being recorded because generateDepthsIfLidarUnavailableis true and lidar is unavailable, the recording FPS will be limited to theupdate rate of the depth feature, which defaults to 10 FPS. To change the update rate of the depth feature, set NsdkDepthSession.Configuration.framerate to matchScanningConfiguration.framerate. |
| var nearDepth | Float | Near depth plane for scan depth range, in meters. This parameter controls the closest distance at which depth data will be integrated. Objects closer than this distance will not be visible in visualization or reconstruction. This does not affect the range of the recorded depth frames. If set to -1.0, this isconfigured to 0.02 m in the default configuration. Must be greater than or equal to 0 and less than farDepth, or set to -1.0 to use the default range. |
| var path | String? | Optional field to set a base path for writing scan data. If an absolute path (starting with '/', '', or a drive name) is provided, the directory must be writeable by the application. All other paths will be interpreted as relative to the public application path configured when the NSDK object was created. If left nil,NSDK uses the public application path which was configured when creating the NSDK object. |
| var raycastHeight | Int32 | Height of the raycast visualization's output image in pixel units. The output quality is bound by both the configured resolution and the quality of the underlying 3D reconstruction data. On devices without native depth support, the data is unlikely to be sufficient to support resolutions above 256x144. If set to 0, this isconfigured to 144 pixels. |
| var raycastWidth | Int32 | Width of the raycast visualization's output image in pixel units. The output quality is bound by both the configured resolution and the quality of the underlying 3D reconstruction data. On devices without native depth support, the data is unlikely to be sufficient to support resolutions above 256x144. If set to 0, this isconfigured to 256 pixels. |
| var scanTargetId | String? | Optional field to set a scan target identifier for use with Niantic Spatial's mapping services. |
| var voxelSize | Float | Minimum size of voxels for the voxel visualization, in meters. This parameter controls the resolution of the voxel grid used for voxel visualization. Smaller values result in higher resolution but require more memory and computation. Larger values result in lower resolution but are more efficient. The actual voxel size may become larger due to memory constraints, so this is only a minimum value. If set to 0.0, this is configured to 0.01 m in the default configuration. |
Initializes a new scanning session configuration with provided settings.