chrono::sensor::ChPhysCameraSensor Class Reference

Description

Camera class.

#include <ChPhysCameraSensor.h>

Inheritance diagram for chrono::sensor::ChPhysCameraSensor:
Collaboration diagram for chrono::sensor::ChPhysCameraSensor:

Public Member Functions

 ChPhysCameraSensor (std::shared_ptr< chrono::ChBody > parent, float updateRate, chrono::ChFrame< double > offsetPose, unsigned int w, unsigned int h, CameraLensModelType lens_model=CameraLensModelType::PINHOLE, unsigned int supersample_factor=1, bool use_diffuse_reflect=false, bool use_denoiser=false, bool use_defocus_blur=false, bool use_vignetting=false, bool use_aggregator=false, bool use_noise=false, bool use_expsr_to_dv=false, Integrator integrator=Integrator::LEGACY, float gamma=1.0f, bool use_fog=false, bool use_motion_blur=false)
 Constructor for the phys camera class that defaults to a pinhole lens model. More...
 
 ~ChPhysCameraSensor ()
 phys-camera class destructor
 
void SetRadialLensParameters (ChVector3f params)
 Sets the parameters for a radial lens distortion model Parameters should be given for the forward model The backward distortion model will then be used and calculated from the forward parameters given. More...
 
void SetCtrlParameters (float aperture_num, float expsr_time, float ISO, float focal_length, float focus_dist)
 Set camera control parameters. More...
 
void SetModelParameters (float sensor_width, float pixel_size, float max_scene_light_amount, ChVector3f rgb_QE_vec, PhysCameraGainParams gain_params, PhysCameraNoiseParams noise_params)
 Set camera intrinsic model parameters. More...
 
float GetHFOV () const
 returns the camera's horizontal field of view. More...
 
CameraLensModelType GetLensModelType () const
 returns the lens model type used for rendering More...
 
LensParams GetLensParameters () const
 returns the lens model parameters More...
 
bool GetUseGI ()
 returns if the cemera considers diffuse reflection More...
 
bool GetUseDenoiser ()
 returns if the cemera should use a denoiser More...
 
Integrator GetIntegrator ()
 Get the integrator algorithm type used for rendering. More...
 
float GetGamma ()
 returns the gamma correction value of this camera. More...
 
unsigned int GetSampleFactor ()
 Gets the number of samples per pixels in each direction used for super sampling. More...
 
bool GetUseFog ()
 returns if the cemera should use fog as dictated by the scene More...
 
ChMatrix33< float > GetCameraIntrinsicMatrix ()
 Get 3x3 Intrinsic Matrix.
 
ChVector3f GetCameraDistortionCoefficients ()
 Get the camera distortion coefficients.
 
float GetApertureNum ()
 Get the aperture number. More...
 
float GetExpsrTime ()
 Get the exposure time. More...
 
float GetISO ()
 Get the ISO gain. More...
 
float GetFocalLength ()
 Get the focal length. More...
 
float GetFocusDistance ()
 Get the focus distance. More...
 
float GetSensorWidth ()
 Get the sensor width. More...
 
float GetPixelSize ()
 Get the pixel size. More...
 
float GetMaxSceneLightAmount ()
 Get the maximum light amount in the scene. More...
 
PhysCameraGainParams GetGainParams ()
 Get all gain-related parameters in camera model. More...
 
PhysCameraNoiseParams GetNoiseParams ()
 Get noise model parameters in camera model. More...
 
void UpdateFilterParameters ()
 update filter parameters in ChOptixEngine.cpp
 
- Public Member Functions inherited from chrono::sensor::ChOptixSensor
 ChOptixSensor (std::shared_ptr< ChBody > parent, float updateRate, ChFrame< double > offsetPose, unsigned int w, unsigned int h)
 Constructor for the base camera class that defaults to a pinhole lens model. More...
 
PipelineType GetPipelineType ()
 
unsigned int GetWidth ()
 
unsigned int GetHeight ()
 
CUstream GetCudaStream ()
 
- Public Member Functions inherited from chrono::sensor::ChSensor
 ChSensor (std::shared_ptr< ChBody > parent, float updateRate, ChFrame< double > offsetPose)
 Constructor for the base sensor class. More...
 
void SetOffsetPose (ChFrame< double > pose)
 Set the sensor's relative position and orientation. More...
 
ChFrame< double > GetOffsetPose ()
 Get the sensor's relative position and orientation. More...
 
std::shared_ptr< ChBodyGetParent () const
 Get the object to which the sensor is attached. More...
 
void SetName (std::string name)
 Set the sensor's name. More...
 
std::string GetName () const
 Get the name of the sensor. More...
 
float GetUpdateRate () const
 Get the sensor update rate (Hz). More...
 
void SetLag (float t)
 Set the lag parameter. More...
 
float GetLag () const
 Get the sensor lag (seconds). More...
 
void SetCollectionWindow (float t)
 Set the collection window. More...
 
float GetCollectionWindow () const
 Get the sensor data collection window (seconds). More...
 
void SetUpdateRate (float updateRate)
 Set the sensor update rate (Hz). More...
 
unsigned int GetNumLaunches ()
 Get the number of times the sensor has been updated. More...
 
void IncrementNumLaunches ()
 Increments the count of number of updates.
 
std::list< std::shared_ptr< ChFilter > > GetFilterList () const
 Get the sensor's list of filters. More...
 
void PushFilter (std::shared_ptr< ChFilter > filter)
 Add a filter to the sensor. More...
 
void PushFilterFront (std::shared_ptr< ChFilter > filter)
 Add a filter to the front of the list on a sensor. More...
 
void LockFilterList ()
 Gives ability to lock the filter list to prevent race conditions. More...
 
template<class UserBufferType >
UserBufferType GetMostRecentBuffer ()
 Get the last filter in the list that matches the template type. More...
 
template<>
CH_SENSOR_API UserAccelBufferPtr GetMostRecentBuffer ()
 

Additional Inherited Members

- Protected Attributes inherited from chrono::sensor::ChOptixSensor
PipelineType m_pipeline_type
 the type of pipeline for rendering
 
- Protected Attributes inherited from chrono::sensor::ChSensor
float m_updateRate
 sensor update rate
 
float m_lag
 sensor lag from the time all scene information is available (sensor processing time)
 
float m_collection_window
 time over which data is collected. More...
 
float m_timeLastUpdated
 time since previous update
 
std::shared_ptr< ChBodym_parent
 object to which the sensor is attached
 
ChFrame< double > m_offsetPose
 position and orientation of the sensor relative to its parent
 
std::string m_name
 name of the sensor
 
unsigned int m_num_launches
 number of times the sensor has been updated
 
std::list< std::shared_ptr< ChFilter > > m_filters
 filter list for post-processing sensor data
 
bool m_filter_list_locked = false
 gives ability to lock the filter list to prevent race conditions
 

Constructor & Destructor Documentation

◆ ChPhysCameraSensor()

CH_SENSOR_API chrono::sensor::ChPhysCameraSensor::ChPhysCameraSensor ( std::shared_ptr< chrono::ChBody parent,
float  updateRate,
chrono::ChFrame< double >  offsetPose,
unsigned int  w,
unsigned int  h,
CameraLensModelType  lens_model = CameraLensModelType::PINHOLE,
unsigned int  supersample_factor = 1,
bool  use_diffuse_reflect = false,
bool  use_denoiser = false,
bool  use_defocus_blur = false,
bool  use_vignetting = false,
bool  use_aggregator = false,
bool  use_noise = false,
bool  use_expsr_to_dv = false,
Integrator  integrator = Integrator::LEGACY,
float  gamma = 1.0f,
bool  use_fog = false,
bool  use_motion_blur = false 
)

Constructor for the phys camera class that defaults to a pinhole lens model.

Parameters
parentA shared pointer to a body on which the sensor should be attached.
updateRateThe desired update rate of the sensor in Hz.
offsetPoseThe desired relative position and orientation of the sensor on the body.
wThe width of the image the camera should generate.
hThe height of the image the camera should generate.
lens_modelA enum specifying the desired lens model.
sensor_widthequivalent width of the image sensor to calculate hHOV, [mm]
pixel_sizelength of a pixel to calculate depth of field, [mm]
supersample_factorThe number of rays that should be sampled per pixel for antialiasing.
use_diffuse_reflectwhether to consider diffuse reflection in rendering. If false, only consider specular reflection.
use_denoiserwhether to use OptiX denoiser for diffuse reflection or area light.
use_defocus_blurwhether to use defocus blur effect
use_vignettingwhether to use vignetting effect
use_aggregatorwhether to aggregate illumination irradiance over exposure time and pixel area
use_expsr_to_dvwhether to convert exposure domain to digital value domain
integratorThe type of integrator algorithm to use for rendering.
gammacorrection of the image, 1 for linear color space, 2.2 for sRGB
use_fogwhether to use fog on this camera
use_motion_blurwhether to use motion blur effect

Member Function Documentation

◆ GetApertureNum()

float chrono::sensor::ChPhysCameraSensor::GetApertureNum ( )
inline

Get the aperture number.

Returns
the aperture number, [1/1]

◆ GetExpsrTime()

float chrono::sensor::ChPhysCameraSensor::GetExpsrTime ( )
inline

Get the exposure time.

Returns
the exposure time, [sec]

◆ GetFocalLength()

float chrono::sensor::ChPhysCameraSensor::GetFocalLength ( )
inline

Get the focal length.

Returns
the focal length, [m]

◆ GetFocusDistance()

float chrono::sensor::ChPhysCameraSensor::GetFocusDistance ( )
inline

Get the focus distance.

Returns
the focus distance, [m]

◆ GetGainParams()

PhysCameraGainParams chrono::sensor::ChPhysCameraSensor::GetGainParams ( )
inline

Get all gain-related parameters in camera model.

Returns
all gain-related parameters in camera model, [1/1]

◆ GetGamma()

float chrono::sensor::ChPhysCameraSensor::GetGamma ( )
inline

returns the gamma correction value of this camera.

1 means no correction and the image is in linear color space. Useful for other ML applications 2.2 means the image is in sRGB color space. Useful for display

Returns
Gamma value of the image

◆ GetHFOV()

float chrono::sensor::ChPhysCameraSensor::GetHFOV ( ) const
inline

returns the camera's horizontal field of view.

Vertical field of view is determined by the image aspect ratio and the lens model

Returns
The horizontal field of view of the camera lens, [rad]

◆ GetIntegrator()

Integrator chrono::sensor::ChPhysCameraSensor::GetIntegrator ( )
inline

Get the integrator algorithm type used for rendering.

Returns
the integrator algorithm type used for rendering

◆ GetISO()

float chrono::sensor::ChPhysCameraSensor::GetISO ( )
inline

Get the ISO gain.

Returns
the ISO, [1/1]

◆ GetLensModelType()

CameraLensModelType chrono::sensor::ChPhysCameraSensor::GetLensModelType ( ) const
inline

returns the lens model type used for rendering

Returns
An enum specifying which lens model is being used. (0: PINHOLE, 1: FOV, 2: Radial)

◆ GetLensParameters()

LensParams chrono::sensor::ChPhysCameraSensor::GetLensParameters ( ) const
inline

returns the lens model parameters

Returns
LensParams struct of lens parameters. Will default to zeros for any terms not used. These are coverted for the inverse model

◆ GetMaxSceneLightAmount()

float chrono::sensor::ChPhysCameraSensor::GetMaxSceneLightAmount ( )
inline

Get the maximum light amount in the scene.

Returns
the maximum light amount in the scene, [W]

◆ GetNoiseParams()

PhysCameraNoiseParams chrono::sensor::ChPhysCameraSensor::GetNoiseParams ( )
inline

Get noise model parameters in camera model.

Returns
noise model parameters in camera model, [1/1]

◆ GetPixelSize()

float chrono::sensor::ChPhysCameraSensor::GetPixelSize ( )
inline

Get the pixel size.

Returns
the pixel size, [m]

◆ GetSampleFactor()

unsigned int chrono::sensor::ChPhysCameraSensor::GetSampleFactor ( )
inline

Gets the number of samples per pixels in each direction used for super sampling.

Returns
the number of samples per pixel

◆ GetSensorWidth()

float chrono::sensor::ChPhysCameraSensor::GetSensorWidth ( )
inline

Get the sensor width.

Returns
the sensor width, [m]

◆ GetUseDenoiser()

bool chrono::sensor::ChPhysCameraSensor::GetUseDenoiser ( )
inline

returns if the cemera should use a denoiser

Returns
True if it does use a denoiser

◆ GetUseFog()

bool chrono::sensor::ChPhysCameraSensor::GetUseFog ( )
inline

returns if the cemera should use fog as dictated by the scene

Returns
True if it does request

◆ GetUseGI()

bool chrono::sensor::ChPhysCameraSensor::GetUseGI ( )
inline

returns if the cemera considers diffuse reflection

Returns
True if it does consider

◆ SetCtrlParameters()

void chrono::sensor::ChPhysCameraSensor::SetCtrlParameters ( float  aperture_num,
float  expsr_time,
float  ISO,
float  focal_length,
float  focus_dist 
)

Set camera control parameters.

Parameters
aperture_numF-number (or aperture number) = focal_length / aperture_diameter, [1/1]
expsr_timeexposure time, [sec]
ISOISO exposure gain, [1/1]
focal_lengthfocal length, [m]
focus_distfocus distance, [m]

◆ SetModelParameters()

void chrono::sensor::ChPhysCameraSensor::SetModelParameters ( float  sensor_width,
float  pixel_size,
float  max_scene_light_amount,
ChVector3f  rgb_QE_vec,
PhysCameraGainParams  gain_params,
PhysCameraNoiseParams  noise_params 
)

Set camera intrinsic model parameters.

Parameters
sensor_widthequivalent width of the image sensor, [m]
pixel_sizelength of a pixel, [m]
max_scene_light_amountmaximum light amount in the scene, consider distance-diminishing effect [lux = lumen/m^2]
rgb_QE_vecvector of RGB quantum efficiencies, [1/1]
gain_paramsall gain-related parameters in camera model, [1/1]
noise_paramsnoise model parameters in camera model

◆ SetRadialLensParameters()

void chrono::sensor::ChPhysCameraSensor::SetRadialLensParameters ( ChVector3f  params)

Sets the parameters for a radial lens distortion model Parameters should be given for the forward model The backward distortion model will then be used and calculated from the forward parameters given.

Parameters
paramsthe set of 3 radial parameters (k1, k2, k3)

The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_sensor/sensors/ChPhysCameraSensor.h
  • /builds/uwsbel/chrono/src/chrono_sensor/sensors/ChPhysCameraSensor.cpp