chrono::sensor::metal_phys_cam Namespace Reference

Description

GPU (Metal compute) ports of the phys_cam_ops.cu kernels.

All image buffers are host pointers to width*height RGBA float4 pixels (Chrono's PixelHalf4 / PixelRGBDHalf4 on the non-OptiX builds).

Functions

CH_SENSOR_API bool Available ()
 True if a Metal device is present and the phys-camera kernels compiled.
 
CH_SENSOR_API bool DefocusBlur (const void *buf_in, void *buf_out, unsigned int img_w, unsigned int img_h, float f, float U, float N, float C, float defocus_gain, float defocus_bias)
 Depth-driven defocus blur. More...
 
CH_SENSOR_API bool Vignetting (void *buf_in_out, unsigned int img_w, unsigned int img_h, float f, float L, float G_vignet)
 Illumination falloff toward the frame corners. More...
 
CH_SENSOR_API bool Aggregator (void *buf_in_out, unsigned int img_w, unsigned int img_h, float N, float t, float C, float P, const float *rgb_QEs, float G_aggregator)
 Integrate irradiance over exposure time and pixel area. More...
 
CH_SENSOR_API bool Noise (void *buf_in_out, unsigned int img_w, unsigned int img_h, float t, const float *dark_currents, const float *noise_gains, const float *sigma_reads, unsigned int shot_seed, unsigned int fpn_seed, unsigned int frame)
 Shot / dark-current / read / fixed-pattern noise. More...
 
CH_SENSOR_API bool ExpsrToDV (const void *buf_in, void *buf_out, unsigned int img_w, unsigned int img_h, float ISO, const float *gains, const float *biases, float gamma, int crf_type)
 Exposure -> digital value through the camera response function. More...
 

Function Documentation

◆ Aggregator()

CH_SENSOR_API bool chrono::sensor::metal_phys_cam::Aggregator ( void *  buf_in_out,
unsigned int  img_w,
unsigned int  img_h,
float  N,
float  t,
float  C,
float  P,
const float *  rgb_QEs,
float  G_aggregator 
)

Integrate irradiance over exposure time and pixel area.

Port of cuda_phys_cam_aggregator.

Parameters
Naperture number, [1/1]
texposure time, [sec]
Cpixel size, [m]
Pmaximum scene light amount, [lux]
rgb_QEs3 RGB quantum efficiencies, [1/1]

◆ DefocusBlur()

CH_SENSOR_API bool chrono::sensor::metal_phys_cam::DefocusBlur ( const void *  buf_in,
void *  buf_out,
unsigned int  img_w,
unsigned int  img_h,
float  f,
float  U,
float  N,
float  C,
float  defocus_gain,
float  defocus_bias 
)

Depth-driven defocus blur.

Port of cuda_phys_cam_defocus_blur.

Parameters
buf_ininput RGB-D image (D = distance in the alpha slot), [m]
buf_outoutput RGBA image
ffocal length, [m]
Ufocus distance, [m]
Naperture number = focal_length / aperture_diameter, [1/1]
Clength of a pixel, [m]

◆ ExpsrToDV()

CH_SENSOR_API bool chrono::sensor::metal_phys_cam::ExpsrToDV ( const void *  buf_in,
void *  buf_out,
unsigned int  img_w,
unsigned int  img_h,
float  ISO,
const float *  gains,
const float *  biases,
float  gamma,
int  crf_type 
)

Exposure -> digital value through the camera response function.

Port of cuda_phys_cam_expsr2dv.

Parameters
ISOanalog amplification factor, [1/1]
gains3 proportional gains, [1/1]
biases3 biases, [1/1]
gammagamma of the gamma-correction CRF
crf_type0 gamma_correct, 1 sigmoid, 2 linear

◆ Noise()

CH_SENSOR_API bool chrono::sensor::metal_phys_cam::Noise ( void *  buf_in_out,
unsigned int  img_w,
unsigned int  img_h,
float  t,
const float *  dark_currents,
const float *  noise_gains,
const float *  sigma_reads,
unsigned int  shot_seed,
unsigned int  fpn_seed,
unsigned int  frame 
)

Shot / dark-current / read / fixed-pattern noise.

Port of cuda_phys_cam_noise. curand's stream cannot be reproduced, so the two RNG streams are PCG-based: the distributions match the CUDA model, individual samples do not.

Parameters
texposure time, [sec]
dark_currents3 temporal dark currents, [electrons/sec]
noise_gains3 temporal noise gains, [1/1]
sigma_reads3 STDs of FPN and readout noise, [electrons]
shot_seedseed of the shot/dark noise stream
fpn_seedseed of the FPN/read noise stream
frameframe counter, decorrelates successive frames

◆ Vignetting()

CH_SENSOR_API bool chrono::sensor::metal_phys_cam::Vignetting ( void *  buf_in_out,
unsigned int  img_w,
unsigned int  img_h,
float  f,
float  L,
float  G_vignet 
)

Illumination falloff toward the frame corners.

Port of cuda_phys_cam_vignetting.

Parameters
ffocal length, [m]
Lsensor width, [m]
G_vignetproportional gain of illumination falloff, [1/1]