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
-
N aperture number, [1/1] t exposure time, [sec] C pixel size, [m] P maximum scene light amount, [lux] rgb_QEs 3 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_in input RGB-D image (D = distance in the alpha slot), [m] buf_out output RGBA image f focal length, [m] U focus distance, [m] N aperture number = focal_length / aperture_diameter, [1/1] C length 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
-
ISO analog amplification factor, [1/1] gains 3 proportional gains, [1/1] biases 3 biases, [1/1] gamma gamma of the gamma-correction CRF crf_type 0 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
-
t exposure time, [sec] dark_currents 3 temporal dark currents, [electrons/sec] noise_gains 3 temporal noise gains, [1/1] sigma_reads 3 STDs of FPN and readout noise, [electrons] shot_seed seed of the shot/dark noise stream fpn_seed seed of the FPN/read noise stream frame frame 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
-
f focal length, [m] L sensor width, [m] G_vignet proportional gain of illumination falloff, [1/1]