Time-of-Flight Library(ToF) 3.4.0
chronoptics::tof::CameraConfig Class Reference

This class allows you to view/edit the camera settings. More...

#include <camera_config.hpp>

+ Inheritance diagram for chronoptics::tof::CameraConfig:

Public Member Functions

 CameraConfig (tof_camera_config_t ptr=nullptr)
 Construct from pointer. More...
 
 CameraConfig (StringView file_location)
 Read camera config from disk. More...
 
void write (StringView file_location) const
 Write camera config to disk. More...
 
CameraType get_type () const
 Get the camera type. More...
 
void reset ()
 Reset camera config to default. More...
 
size_t frame_size () const
 Get the amount of frames in the config. More...
 
void add_frame ()
 Add a default frame to the camera config. More...
 
ProcessingConfig default_processing () const
 Generate default processing config from camera configuration. More...
 
void erase_frame (size_t frame)
 Erase specified frame. More...
 
std::vector< float > get_phase_shifts (size_t frame) const
 Get the phase shifts. More...
 
void set_phase_shifts (size_t frame, const std::vector< float > &phase_shifts)
 Set the phase shifts. More...
 
std::vector< uint32_t > get_integration_time (size_t frame) const
 Get the integration time. More...
 
void set_integration_time (size_t frame, const std::vector< uint32_t > &integration_time)
 Set the integration time. More...
 
SensorMode get_sensor_mode (size_t frame) const
 Get the mode to set the camera's depth sensor to. More...
 
void set_sensor_mode (size_t frame, SensorMode sensor_mode)
 Set the mode to set the camera's depth sensor to. More...
 
float get_modulation_frequency (size_t frame) const
 Get the modulation frequency. More...
 
void set_modulation_frequency (size_t frame, float modulation_frequency)
 Set the modulation frequency. More...
 
float get_duty_cycle (size_t frame) const
 Get the duty cycle. More...
 
void set_duty_cycle (size_t frame, float duty_cycle)
 Set the duty cycle. More...
 
Roi get_roi (size_t frame) const
 Get the region of interest. More...
 
void set_roi (size_t frame, Roi &roi)
 Set the region of interest. More...
 
uint8_t get_binning (size_t frame) const
 Get the amount of binning. More...
 
void set_binning (size_t frame, uint8_t binning)
 Set the amount of binning. More...
 
bool get_flip (size_t frame) const
 Get is the image flipped. More...
 
void set_flip (size_t frame, bool flip)
 Set is the image flipped. More...
 
bool get_mirror (size_t frame) const
 Get is the image mirrored. More...
 
void set_mirror (size_t frame, bool mirror)
 Set is the image mirrored. More...
 
float get_gain () const
 Get the image sensor gain. More...
 
void set_gain (float gain)
 Set the image sensor gain. More...
 
int32_t get_sync_mode () const
 Get the kind of camera synchronization. More...
 
void set_sync_mode (int32_t sync_mode)
 Set the kind of camera synchronization. More...
 
std::vector< uint32_t > maximum_integration_time (size_t frame)
 Get the maximum integration time possible. More...
 
std::vector< uint16_t > get_dac () const
 Get the DAC gain. More...
 
void set_dac (const std::vector< uint16_t > &dac)
 Set the DAC gain. More...
 
int32_t get_mlx_mipi_speed () const
 Get the mipi speed for the MLX75027. More...
 
void set_mlx_mipi_speed (int32_t mipi_speed)
 Set the mipi speed for the MLX75027. More...
 
uint32_t get_mlx_preheat (size_t frame) const
 Get the preheat time. More...
 
void set_mlx_preheat (size_t frame, uint32_t preheat)
 Set the preheat time. More...
 
bool get_mlx_preheat_enable (size_t frame) const
 Get enable preheat. More...
 
void set_mlx_preheat_enable (size_t frame, bool enable)
 Set enable preheat. More...
 
void set_opt_kea_nios_hex (StringView file_location)
 Set the Nios hex for the keaB cameras. More...
 
std::array< int32_t, 2 > get_opt_kea_sub_quad () const
 Get the opt8241 number of sub and quad frames. More...
 
void set_opt_kea_sub_quad (const std::array< int32_t, 2 > &subs_quads)
 Set the opt8241 number of sub and quad frames. More...
 
ProcessingConfig get_processing () const
 Get the processing configuration for when the depth is calculated on camera. More...
 
void set_processing (ProcessingConfig &processing)
 Set the processing configuration for when the depth is calculated on camera. More...
 
uint32_t get_frame_time (size_t frame) const
 Get the time this depth frame will take. More...
 
void set_frame_time (size_t frame, uint32_t frame_time)
 Set the time this depth frame will take. More...
 
std::array< float, 2 > get_global_phase_offset (size_t frame) const
 Get phase offset for illumination and sensor. More...
 
void set_global_phase_offset (size_t frame, const std::array< float, 2 > &phase_offset)
 Set phase offset for illumination and sensor. More...
 
uint8_t get_illumination_mode (size_t frame) const
 Get the illumination mode. More...
 
void set_illumination_mode (size_t frame, uint8_t illumination_mode)
 Set the illumination mode. More...
 
std::vector< float > get_image_offsets (size_t frame) const
 Get the image offsets. More...
 
void set_image_offsets (size_t frame, const std::vector< float > &image_offsets)
 Set the image offsets. More...
 
size_t get_rgb_width ()
 Get the width of the rgb sensor. More...
 
size_t get_rgb_height ()
 Get the height of the rgb sensor. More...
 
TriggerMode get_trigger_mode () const
 Get the trigger mode. More...
 
void set_trigger_mode (TriggerMode trigger_mode)
 Set the trigger mode. More...
 

Detailed Description

This class allows you to view/edit the camera settings.

Definition at line 122 of file camera_config.hpp.

Constructor & Destructor Documentation

◆ CameraConfig() [1/2]

chronoptics::tof::CameraConfig::CameraConfig ( tof_camera_config_t  ptr = nullptr)
inline

Construct from pointer.

Definition at line 125 of file camera_config.hpp.

◆ CameraConfig() [2/2]

chronoptics::tof::CameraConfig::CameraConfig ( StringView  file_location)
inline

Read camera config from disk.

Parameters
file_locationLocation of camera config on disk

Definition at line 132 of file camera_config.hpp.

Member Function Documentation

◆ add_frame()

void chronoptics::tof::CameraConfig::add_frame ( )
inline

Add a default frame to the camera config.

Definition at line 167 of file camera_config.hpp.

◆ default_processing()

ProcessingConfig chronoptics::tof::CameraConfig::default_processing ( ) const
inline

Generate default processing config from camera configuration.

Returns
The default processing config

Definition at line 174 of file camera_config.hpp.

◆ erase_frame()

void chronoptics::tof::CameraConfig::erase_frame ( size_t  frame)
inline

Erase specified frame.

Parameters
frameFrame number

Definition at line 184 of file camera_config.hpp.

◆ frame_size()

size_t chronoptics::tof::CameraConfig::frame_size ( ) const
inline

Get the amount of frames in the config.

Having multiple frames allows you to configure different modulation frequencies or integration times per frame.

Returns
Frame size

Definition at line 161 of file camera_config.hpp.

◆ get_binning()

uint8_t chronoptics::tof::CameraConfig::get_binning ( size_t  frame) const
inline

Get the amount of binning.

Parameters
frameFrame number
Returns
Amount of binning 0=none, 1=x2, 2=x4, 3=x8

Definition at line 299 of file camera_config.hpp.

◆ get_dac()

std::vector< uint16_t > chronoptics::tof::CameraConfig::get_dac ( ) const
inline

Get the DAC gain.

Returns
The DAC gain

Definition at line 387 of file camera_config.hpp.

◆ get_duty_cycle()

float chronoptics::tof::CameraConfig::get_duty_cycle ( size_t  frame) const
inline

Get the duty cycle.

Parameters
frameFrame number
Returns
Duty cycle 0.0 to 1.0

Definition at line 264 of file camera_config.hpp.

◆ get_flip()

bool chronoptics::tof::CameraConfig::get_flip ( size_t  frame) const
inline

Get is the image flipped.

Parameters
frameFrame number
Returns
Image is flipped

Definition at line 315 of file camera_config.hpp.

◆ get_frame_time()

uint32_t chronoptics::tof::CameraConfig::get_frame_time ( size_t  frame) const
inline

Get the time this depth frame will take.

This is useful when you want a steady but lower framerate.

Parameters
frameFrame number
Returns
Frame time in micro seconds

Definition at line 496 of file camera_config.hpp.

◆ get_gain()

float chronoptics::tof::CameraConfig::get_gain ( ) const
inline

Get the image sensor gain.

Returns
Image sensor gain

Definition at line 346 of file camera_config.hpp.

◆ get_global_phase_offset()

std::array< float, 2 > chronoptics::tof::CameraConfig::get_global_phase_offset ( size_t  frame) const
inline

Get phase offset for illumination and sensor.

The phase offsets are two floating point values corresponding to the phase delay for the illumination and sensor respectively. The values should be between 0.0 and 1.0 where 0.0 is no phase offset and 1.0 is 360 degree phase offset

Parameters
frameFrame number
Returns
Image is mirrored

Definition at line 516 of file camera_config.hpp.

◆ get_illumination_mode()

uint8_t chronoptics::tof::CameraConfig::get_illumination_mode ( size_t  frame) const
inline

Get the illumination mode.

Parameters
frameFrame number
Returns
Illumination mode. 0 is actively modulating, 2 is active low (illumination disabled) and 3 is active high

Definition at line 539 of file camera_config.hpp.

◆ get_image_offsets()

std::vector< float > chronoptics::tof::CameraConfig::get_image_offsets ( size_t  frame) const
inline

Get the image offsets.

This configuration is only for sensors with column phase offsets.

Parameters
frameFrame number
Returns
The image offset per column in 0.0 to 1.0

Definition at line 557 of file camera_config.hpp.

◆ get_integration_time()

std::vector< uint32_t > chronoptics::tof::CameraConfig::get_integration_time ( size_t  frame) const
inline

Get the integration time.

Parameters
frameFrame number
Returns
Integration time in micro seconds

Definition at line 213 of file camera_config.hpp.

◆ get_mirror()

bool chronoptics::tof::CameraConfig::get_mirror ( size_t  frame) const
inline

Get is the image mirrored.

Parameters
frameFrame number
Returns
Image is mirrored

Definition at line 331 of file camera_config.hpp.

◆ get_mlx_mipi_speed()

int32_t chronoptics::tof::CameraConfig::get_mlx_mipi_speed ( ) const
inline

Get the mipi speed for the MLX75027.

Returns
The mipi speed. Can only be the values 300, 600, 704, 800 and 960

Definition at line 404 of file camera_config.hpp.

◆ get_mlx_preheat()

uint32_t chronoptics::tof::CameraConfig::get_mlx_preheat ( size_t  frame) const
inline

Get the preheat time.

Parameters
frameFrame number
Returns
The preheat time

Definition at line 420 of file camera_config.hpp.

◆ get_mlx_preheat_enable()

bool chronoptics::tof::CameraConfig::get_mlx_preheat_enable ( size_t  frame) const
inline

Get enable preheat.

Parameters
frameFrame number
Returns
Enable preheating

Definition at line 436 of file camera_config.hpp.

◆ get_modulation_frequency()

float chronoptics::tof::CameraConfig::get_modulation_frequency ( size_t  frame) const
inline

Get the modulation frequency.

Parameters
frameFrame number
Returns
Modulation frequency in MHz

Definition at line 248 of file camera_config.hpp.

◆ get_opt_kea_sub_quad()

std::array< int32_t, 2 > chronoptics::tof::CameraConfig::get_opt_kea_sub_quad ( ) const
inline

Get the opt8241 number of sub and quad frames.

Returns
Number of subs and quads respectively

Definition at line 458 of file camera_config.hpp.

◆ get_phase_shifts()

std::vector< float > chronoptics::tof::CameraConfig::get_phase_shifts ( size_t  frame) const
inline

Get the phase shifts.

Value ranges from 0.0 to 1.0 which translates to 0-2 pi

Parameters
frameFrame number
Returns
Phase shifts

Definition at line 193 of file camera_config.hpp.

◆ get_processing()

ProcessingConfig chronoptics::tof::CameraConfig::get_processing ( ) const
inline

Get the processing configuration for when the depth is calculated on camera.

Returns
The pipeline processing to be done on camera

Definition at line 476 of file camera_config.hpp.

◆ get_rgb_height()

size_t chronoptics::tof::CameraConfig::get_rgb_height ( )
inline

Get the height of the rgb sensor.

Returns
Height in pixels

Definition at line 583 of file camera_config.hpp.

◆ get_rgb_width()

size_t chronoptics::tof::CameraConfig::get_rgb_width ( )
inline

Get the width of the rgb sensor.

Returns
Width in pixels

Definition at line 576 of file camera_config.hpp.

◆ get_roi()

Roi chronoptics::tof::CameraConfig::get_roi ( size_t  frame) const
inline

Get the region of interest.

Parameters
frameFrame number
Returns
Region of interest

Definition at line 280 of file camera_config.hpp.

◆ get_sensor_mode()

SensorMode chronoptics::tof::CameraConfig::get_sensor_mode ( size_t  frame) const
inline

Get the mode to set the camera's depth sensor to.

Parameters
frameFrame number
Returns
Sensor mode

Definition at line 232 of file camera_config.hpp.

◆ get_sync_mode()

int32_t chronoptics::tof::CameraConfig::get_sync_mode ( ) const
inline

Get the kind of camera synchronization.

Returns
The kind of sync mode. 0 waits for the vsync pulse before starting the next frame. 1 optional vsync 2 is no frame syncing

Definition at line 361 of file camera_config.hpp.

◆ get_trigger_mode()

TriggerMode chronoptics::tof::CameraConfig::get_trigger_mode ( ) const
inline

Get the trigger mode.

Returns
The trigger mode of the camera

Definition at line 590 of file camera_config.hpp.

◆ get_type()

CameraType chronoptics::tof::CameraConfig::get_type ( ) const
inline

Get the camera type.

Returns
Camera type

Definition at line 146 of file camera_config.hpp.

◆ maximum_integration_time()

std::vector< uint32_t > chronoptics::tof::CameraConfig::maximum_integration_time ( size_t  frame)
inline

Get the maximum integration time possible.

Parameters
frameFrame number
Returns
Maximum integration time in micro seconds

Definition at line 377 of file camera_config.hpp.

◆ reset()

void chronoptics::tof::CameraConfig::reset ( )
inline

Reset camera config to default.

Definition at line 152 of file camera_config.hpp.

◆ set_binning()

void chronoptics::tof::CameraConfig::set_binning ( size_t  frame,
uint8_t  binning 
)
inline

Set the amount of binning.

Parameters
frameFrame number
binningAmount of binning 0=none, 1=x2, 2=x4, 3=x8

Definition at line 307 of file camera_config.hpp.

◆ set_dac()

void chronoptics::tof::CameraConfig::set_dac ( const std::vector< uint16_t > &  dac)
inline

Set the DAC gain.

Parameters
dacThe DAC gain

Definition at line 397 of file camera_config.hpp.

◆ set_duty_cycle()

void chronoptics::tof::CameraConfig::set_duty_cycle ( size_t  frame,
float  duty_cycle 
)
inline

Set the duty cycle.

Parameters
frameFrame number
duty_cycleDuty cycle 0.0 to 1.0

Definition at line 272 of file camera_config.hpp.

◆ set_flip()

void chronoptics::tof::CameraConfig::set_flip ( size_t  frame,
bool  flip 
)
inline

Set is the image flipped.

Parameters
frameFrame number
flipImage is flipped

Definition at line 323 of file camera_config.hpp.

◆ set_frame_time()

void chronoptics::tof::CameraConfig::set_frame_time ( size_t  frame,
uint32_t  frame_time 
)
inline

Set the time this depth frame will take.

This is useful when you want a steady but lower framerate.

Parameters
frameFrame number
frame_timeFrame time in micro seconds

Definition at line 505 of file camera_config.hpp.

◆ set_gain()

void chronoptics::tof::CameraConfig::set_gain ( float  gain)
inline

Set the image sensor gain.

Parameters
gainImage sensor gain

Definition at line 353 of file camera_config.hpp.

◆ set_global_phase_offset()

void chronoptics::tof::CameraConfig::set_global_phase_offset ( size_t  frame,
const std::array< float, 2 > &  phase_offset 
)
inline

Set phase offset for illumination and sensor.

The phase offsets are two floating point values corresponding to the phase delay for the illumination and sensor respectively. The values should be between 0.0 and 1.0 where 0.0 is no phase offset and 1.0 is 360 degree phase offset

Parameters
frameFrame number
phase_offsetImage is mirrored

Definition at line 530 of file camera_config.hpp.

◆ set_illumination_mode()

void chronoptics::tof::CameraConfig::set_illumination_mode ( size_t  frame,
uint8_t  illumination_mode 
)
inline

Set the illumination mode.

Parameters
frameFrame number
illumination_modeIllumination mode. 0 is actively modulating, 2 is active low (illumination disabled) and 3 is active high

Definition at line 548 of file camera_config.hpp.

◆ set_image_offsets()

void chronoptics::tof::CameraConfig::set_image_offsets ( size_t  frame,
const std::vector< float > &  image_offsets 
)
inline

Set the image offsets.

This configuration is only for sensors with column phase offsets.

Parameters
frameFrame number
image_offsetsThe image offset per column in 0.0 to 1.0

Definition at line 569 of file camera_config.hpp.

◆ set_integration_time()

void chronoptics::tof::CameraConfig::set_integration_time ( size_t  frame,
const std::vector< uint32_t > &  integration_time 
)
inline

Set the integration time.

Parameters
frameFrame number
integration_timeIntegration time in micro seconds

Definition at line 224 of file camera_config.hpp.

◆ set_mirror()

void chronoptics::tof::CameraConfig::set_mirror ( size_t  frame,
bool  mirror 
)
inline

Set is the image mirrored.

Parameters
frameFrame number
mirrorImage is mirrored

Definition at line 339 of file camera_config.hpp.

◆ set_mlx_mipi_speed()

void chronoptics::tof::CameraConfig::set_mlx_mipi_speed ( int32_t  mipi_speed)
inline

Set the mipi speed for the MLX75027.

Parameters
mipi_speedThe mipi speed. Can only be the values 300, 600, 704, 800 and 960

Definition at line 412 of file camera_config.hpp.

◆ set_mlx_preheat()

void chronoptics::tof::CameraConfig::set_mlx_preheat ( size_t  frame,
uint32_t  preheat 
)
inline

Set the preheat time.

Parameters
frameFrame number
preheatThe preheat time

Definition at line 428 of file camera_config.hpp.

◆ set_mlx_preheat_enable()

void chronoptics::tof::CameraConfig::set_mlx_preheat_enable ( size_t  frame,
bool  enable 
)
inline

Set enable preheat.

Parameters
frameFrame number
enableEnable preheating

Definition at line 444 of file camera_config.hpp.

◆ set_modulation_frequency()

void chronoptics::tof::CameraConfig::set_modulation_frequency ( size_t  frame,
float  modulation_frequency 
)
inline

Set the modulation frequency.

Parameters
frameFrame number
modulation_frequencyModulation frequency in MHz

Definition at line 256 of file camera_config.hpp.

◆ set_opt_kea_nios_hex()

void chronoptics::tof::CameraConfig::set_opt_kea_nios_hex ( StringView  file_location)
inline

Set the Nios hex for the keaB cameras.

Parameters
file_locationFile location of the nios hex file

Definition at line 451 of file camera_config.hpp.

◆ set_opt_kea_sub_quad()

void chronoptics::tof::CameraConfig::set_opt_kea_sub_quad ( const std::array< int32_t, 2 > &  subs_quads)
inline

Set the opt8241 number of sub and quad frames.

Parameters
subs_quadsNumber of subs and quads respectively

Definition at line 468 of file camera_config.hpp.

◆ set_phase_shifts()

void chronoptics::tof::CameraConfig::set_phase_shifts ( size_t  frame,
const std::vector< float > &  phase_shifts 
)
inline

Set the phase shifts.

Value ranges from 0.0 to 1.0 which translates to 0-2 pi

Parameters
frameFrame number
phase_shiftsPhase shifts

Definition at line 205 of file camera_config.hpp.

◆ set_processing()

void chronoptics::tof::CameraConfig::set_processing ( ProcessingConfig processing)
inline

Set the processing configuration for when the depth is calculated on camera.

Parameters
processingThe pipeline processing to be done on camera

Definition at line 487 of file camera_config.hpp.

◆ set_roi()

void chronoptics::tof::CameraConfig::set_roi ( size_t  frame,
Roi roi 
)
inline

Set the region of interest.

Parameters
frameFrame number
roiRegion of interest

Definition at line 291 of file camera_config.hpp.

◆ set_sensor_mode()

void chronoptics::tof::CameraConfig::set_sensor_mode ( size_t  frame,
SensorMode  sensor_mode 
)
inline

Set the mode to set the camera's depth sensor to.

Parameters
frameFrame number
sensor_modeSensor mode

Definition at line 240 of file camera_config.hpp.

◆ set_sync_mode()

void chronoptics::tof::CameraConfig::set_sync_mode ( int32_t  sync_mode)
inline

Set the kind of camera synchronization.

Parameters
sync_modeThe kind of sync mode. 0 waits for the vsync pulse before starting the next frame. 1 optional vsync 2 is no frame syncing

Definition at line 369 of file camera_config.hpp.

◆ set_trigger_mode()

void chronoptics::tof::CameraConfig::set_trigger_mode ( TriggerMode  trigger_mode)
inline

Set the trigger mode.

Parameters
trigger_modeThe trigger mode of the camera

Definition at line 597 of file camera_config.hpp.

◆ write()

void chronoptics::tof::CameraConfig::write ( StringView  file_location) const
inline

Write camera config to disk.

Parameters
file_locationLocation to save camera config to

Definition at line 139 of file camera_config.hpp.