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

Detailed Description

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

Definition at line 124 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 127 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 134 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 169 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 176 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 186 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 163 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 301 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 389 of file camera_config.hpp.

◆ get_depth_fps()

float chronoptics::tof::CameraConfig::get_depth_fps ( )
inline

Get the maximum theoretical fps the camera can run.

Returns
The fps in Hz

Definition at line 620 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 266 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 317 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 512 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 348 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 532 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 555 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 573 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 215 of file camera_config.hpp.

◆ get_mipi_speed()

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

Get the mipi speed.

Returns
The mipi speed

Definition at line 421 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 333 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 406 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 436 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 452 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 250 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 474 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 195 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 492 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 599 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 592 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 282 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 234 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 363 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 606 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 148 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 379 of file camera_config.hpp.

◆ reset()

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

Reset camera config to default.

Definition at line 154 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 309 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 399 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 274 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 325 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 521 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 355 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 546 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 564 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 585 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 226 of file camera_config.hpp.

◆ set_mipi_speed()

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

Set the mipi speed.

Parameters
mipi_speedThe mipi speed

Definition at line 428 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 341 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 414 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 444 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 460 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 258 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 467 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 484 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 207 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 503 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 293 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 242 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 371 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 613 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 141 of file camera_config.hpp.