Configuration

Settings

Global meshing settings, independent of device configuration.

struct Settings

Public Types

enum class RasterizationEngine : uint8_t

Rasterization engine selection between opengl (default), cuda and vulkan.

RasterizationEngine::cuda - Use for servers without display. It may have a negative impact on performance.

RasterizationEngine::vulkan - provides best performance but still in beta testing.

Warning

This is an Experimental setting and may be removed in near future.

Values:

enumerator opengl
enumerator cuda
enumerator vulkan

Public Members

uint8_t gpu_id = 0

Index of GPU that will be used for computation.

uint8_t max_gpu_memory_usage = 85

Maximum percentage of available GPU memory which can be used by the library in a standard scenario.

Note

If some other program that is also using GPU is running, the available GPU memory is smaller. This value can be exceeded in a few cases: 1.) Multiple devices with different resolutions are used. 2.) A device with a resolution higher than 1120 x 800 is used. 3.) If GetVirtualScan method is used.

float voxel_size = 1.0f

Size of one voxel (smallest unit of the internal volumetric structure). The smaller the value is, the more detailed will be the resulting mesh, but the worse performance and higher memory requirements will be.

float working_volume_edge_length = 33.0f

Edge length of the cubic working volume for 3D scan integration, in meters. The first scan always anchors at the center of this volume. When scanning objects that extend from one edge to the other, increase this value by approximately 2x the object length. Minimal allowed value is 4.0.

Note

CPU RAM usage scales cubically with this value, but is negligible up to 33 m.

uint8_t min_voxel_consensus = 3

Minimum number of scans required to report voxel data for inclusion in the output mesh. A value of 0 will result in no filtering.

bool streaming_enabled = true

Enables streaming data between CPU and GPU. This feature enables to scanning of much larger scenes by transferring data temporarily from GPU to CPU when they are not needed.

bool color_intensity_auto_minmax_enabled = true

Enable calculating the color intensities automatically from the first frame of the input dataset.

float tracking_lost_tolerance = 1.0f

The transformation from tracking is considered invalid if the translation or rotation is too great. This number can lower or increase the threshold of how big can the transformation be before the tracking is lost. The higher this parameter is, the bigger can be the transformation found by tracking, but it also increases the chance that a wrongly aligned scan will be added.

Public Static Functions

static inline RasterizationEngine RasterizationEngineFromString(const std::string &rendermode)

Converts string to Settings::RasterizationEngine. Supported strings are: “opengl”, “cuda” and “vulkan”.

Throws:

Throwsphoim::Exception if input value is other than supported strings.

static inline std::string RasterizationEngineToString(RasterizationEngine rendermode)

Convert RenderMode enum value to string.

static inline std::string SerializeSettings(const Settings &settings)

Serialize PhoXiInstantMeshing general Settings to JSON string.

Parameters:

settings – PhoXiInstantMeshing settings struct.

Returns:

String representation of settings in JSON format.

static inline void DeserializeSettings(const std::string &settings_json, Settings &settings)

Deserialize PhoIm Settings from JSON string and return struct.

Parameters:
  • settings_json – Input JSON string representation of settings.

  • settings – Output structure whose parameters will be set from json.

Device Parameters

Per-device configuration passed to the InstantMeshing constructor.

struct DeviceParameters : public phoim::DeviceParamsBase

PhoXi device parameters.

Public Members

pho::api::PhoXiVirtualCamera current_camera

Virtual camera params.

Public Static Functions

static std::string SerializeDeviceParams(const DeviceParameters &params)

Serialize Device Parameters to JSON string.

Parameters:

params – Device Parameters struct.

Returns:

String representation of Device Parameters in JSON format.

static inline void DeserializeDeviceParams(const std::string &json_params, DeviceParameters &params)

Deserialize Device Parameters from JSON string and update existing struct. This overwrites all members specified in the JSON.

Parameters:
  • json_params – String representation of Device Parameters in JSON form.

  • params – DeviceParams to update with values defined in JSON string.

struct DeviceParamsBase

PhoXi device parameters.

Subclassed by phoim::DeviceParameters, phoim::DeviceParams

Public Members

float min_depth = 200.0f

Only points with greater depth than min_depth will be rendered.

float max_depth = 2500.0f

Only points with lesser depth than max_depth will be rendered.

float sweet_spot_depth = 0.0f

Points near sweet spot are considered as most confident. Points with greater or smaller depth will have lower weight in integration to the final mesh. The value must lie between min_depth and max_depth. If the value equals zero, a mean value of min_depth and max_depth will be used instead.

float min_color_intensity = 0.0f

Minimal input intensity (for each channel in the case of RGB) will be mapped to 0.0f.

float max_color_intensity = 512.0f

Maximal input intensity (for each channel in the case of RGB) will be mapped to 1.0f.

bool tracking_enabled = true

Enable automatic tracking.

bool texture_tracking_enabled = true

Use information from Texture (RGB or intensity) to improve tracking.

bool movement_prediction_enabled = true

Enable prediction of camera movement based on camera positions and timestamps.

Note

If non-identity transformation is provided in AddScan, the predictor is ignored.

bool force_camera_space_enabled = false

If true, each added scan will be automatically transformed into camera space before further processing.

glm::mat4 calibration_matrix = glm::mat4(1.0f)

Deprecated parameter. The calibration matrix describes a transformation from this camera space to a mesh space. You can choose whether the mesh space is the “main” camera space, a marker space, or anything else.

Camera Parameters

Virtual camera definitions for GetVirtualScan and GetUnion.

struct CameraParams

Camera parameters for GetVirtualScan function with perspective projection.

Public Members

glm::vec3 position = glm::vec3(0.0f, 0.0f, 0.0f)

Camera position - default (camera space) is at the origin of the coordinate system.

glm::vec3 forward_vector = glm::vec3(0.0f, 0.0f, 1.0f)

Camera direction - default (camera space) is positive Z-axis.

glm::vec3 up_vector = glm::vec3(0.0f, -1.0f, 0.0f)

Up vector - default (camera space) is negative Y-axis.

pho::api::PhoXiSize resolution

Resolution.

float min_depth

Only points with greater depth than min_depth will be rendered.

float max_depth

Only points with lesser depth than max_depth will be rendered.

pho::api::CameraMatrix64f camera_matrix

Camera (intrinsic) matrix.

struct CameraParamsOrthogonal

Camera parameters for GetVirtualScan function with orthogonal projection.

Public Members

glm::vec3 position = glm::vec3(0.0f, 0.0f, 0.0f)

Camera position - default (camera space) is at the origin of the coordinate system.

glm::vec3 forward_vector = glm::vec3(0.0f, 0.0f, 1.0f)

Camera direction - default (camera space) is positive Z-axis.

glm::vec3 up_vector = glm::vec3(0.0f, -1.0f, 0.0f)

Up vector - default (camera space) is negative Y-axis.

pho::api::PhoXiSize resolution

Resolution.

float min_depth

Only points with greater depth than min_depth will be rendered.

float max_depth

Only points with lesser depth than max_depth will be rendered.

float width

Width of the view volume in millimeters.

float height

Height of the view volume in millimeters.