libfreenect2 0.4
Open source driver for the Kinect for Windows v2 (K4W2) sensor
Loading...
Searching...
No Matches

Opt-in linear correction for decoded depth measurements in millimeters. More...

#include <libfreenect2/depth_calibration.h>

Public Types

enum  Model { OffsetOnly , Linear }

Public Member Functions

 DepthCorrectionProfile ()
bool isValid () const
 A profile is usable only when its coefficients are finite and scale is positive.
float correct (float measured_mm) const
 Return scale * measured_mm + offset_mm, preserving invalid measurements.
bool apply (Frame &depth) const
 Apply this profile to a decoded float depth frame.
bool save (const std::string &path, std::string *error=0) const
 Atomically save a versioned JSON profile.

Static Public Member Functions

static bool load (const std::string &path, DepthCorrectionProfile &profile, std::string *error=0)
 Load and validate a versioned JSON profile.

Public Attributes

uint32_t version
std::string serial
std::string firmware
Model model
double scale
double offset_mm
double rmse_mm
DepthCalibrationRoi roi
std::vector< DepthCalibrationSamplesamples
std::vector< double > residuals_mm

Detailed Description

Opt-in linear correction for decoded depth measurements in millimeters.

Member Enumeration Documentation

◆ Model

enum Model
Enumerator
OffsetOnly 
Linear 

Constructor & Destructor Documentation

◆ DepthCorrectionProfile()

DepthCorrectionProfile ( )

Referenced by load().

Member Function Documentation

◆ isValid()

bool isValid ( ) const

A profile is usable only when its coefficients are finite and scale is positive.

◆ correct()

float correct ( float measured_mm) const

Return scale * measured_mm + offset_mm, preserving invalid measurements.

◆ apply()

bool apply ( Frame & depth) const

Apply this profile to a decoded float depth frame.

Invalid pixels are unchanged.

◆ save()

bool save ( const std::string & path,
std::string * error = 0 ) const

Atomically save a versioned JSON profile.

◆ load()

bool load ( const std::string & path,
DepthCorrectionProfile & profile,
std::string * error = 0 )
static

Load and validate a versioned JSON profile.

References DepthCorrectionProfile().

Member Data Documentation

◆ version

uint32_t version

◆ serial

std::string serial

◆ firmware

std::string firmware

◆ model

Model model

◆ scale

double scale

◆ offset_mm

double offset_mm

◆ rmse_mm

double rmse_mm

◆ roi

◆ samples

std::vector<DepthCalibrationSample> samples

◆ residuals_mm

std::vector<double> residuals_mm