1#ifndef _CHRONOPTICS_TOF_CALIBRATION_HPP_ 
    2#define _CHRONOPTICS_TOF_CALIBRATION_HPP_ 
    4#include <chronoptics/tof/calibration.h> 
    6#include <chronoptics/tof/base.hpp> 
   13class Calibration : 
public detail::Base<tof_calibration, tof_calibration_delete> {
 
   24    this->ptr_ = tof_calibration_new_from_disk(file_location, TOF_ERROR_HANDLER{});
 
   30  void write(StringView file_location)
 const {
 
   31    return tof_calibration_write(this->ptr_, file_location, TOF_ERROR_HANDLER{});
 
   38    size_t size = tof_calibration_get_calibrated_frequencies(this->ptr_, 
nullptr, 0, TOF_ERROR_HANDLER{});
 
   39    std::vector<float> vec(size);
 
   40    size = tof_calibration_get_calibrated_frequencies(this->ptr_, vec.data(), vec.size(), TOF_ERROR_HANDLER{});
 
   48    return tof_calibration_get_focal_length_x(this->ptr_, TOF_ERROR_HANDLER{});
 
   55    return tof_calibration_get_focal_length_y(this->ptr_, TOF_ERROR_HANDLER{});
 
   62    return tof_calibration_get_principal_point_x(this->ptr_, TOF_ERROR_HANDLER{});
 
   69    return tof_calibration_get_principal_point_y(this->ptr_, TOF_ERROR_HANDLER{});
 
   76    std::array<double, 9> array;
 
   77    auto data = tof_calibration_get_depth_camera_matrix(this->ptr_, TOF_ERROR_HANDLER{});
 
   78    std::copy(data, data + array.size(), array.data());
 
   86    std::array<double, 5> array;
 
   87    auto data = tof_calibration_get_depth_distortion_coefficients(this->ptr_, TOF_ERROR_HANDLER{});
 
   88    std::copy(data, data + array.size(), array.data());
 
   96    std::array<double, 9> array;
 
   97    auto data = tof_calibration_get_rgb_camera_matrix(this->ptr_, TOF_ERROR_HANDLER{});
 
   98    std::copy(data, data + array.size(), array.data());
 
  106    std::array<double, 5> array;
 
  107    auto data = tof_calibration_get_rgb_distortion_coefficients(this->ptr_, TOF_ERROR_HANDLER{});
 
  108    std::copy(data, data + array.size(), array.data());
 
This class contains all the calibration information.
 
double get_principal_point_y() const
Get principal point y.
 
std::array< double, 9 > get_rgb_camera_matrix()
Get the camera matrix of the rgb sensor and lens.
 
std::array< double, 5 > get_depth_distortion_coefficients()
Get the distortion coefficients of the depth lens.
 
Calibration(tof_calibration_t ptr=nullptr)
Construct from pointer.
 
double get_focal_length_y() const
Get focal length y.
 
std::array< double, 5 > get_rgb_distortion_coefficients()
Get the distortion coefficients of the rgb lens.
 
double get_principal_point_x() const
Get principal point x.
 
double get_focal_length_x() const
Get focal length x.
 
void write(StringView file_location) const
Write calibration to disk.
 
std::array< double, 9 > get_depth_camera_matrix()
Get the camera matrix of the depth sensor and lens.
 
Calibration(StringView file_location)
Read calibration from disk.
 
std::vector< float > get_calibrated_frequencies() const
The the calibrated frequencies in the calibration file.