Radiation transport model plugin. More...
#include <RadiationModel.h>
Public Types | |
enum class | ColorCorrectionAlgorithm { DIAGONAL_ONLY , MATRIX_3X3_AUTO , MATRIX_3X3_FORCE } |
Color correction algorithm types for auto-calibration. More... | |
Public Member Functions | |
RadiationModel (helios::Context *context) | |
Default constructor. | |
~RadiationModel () | |
Destructor. | |
void | disableMessages () |
Disable/silence status messages. | |
void | enableMessages () |
Enable status messages. | |
void | optionalOutputPrimitiveData (const char *label) |
Add optional output primitive data values to the Context. | |
void | setDirectRayCount (const std::string &label, size_t N) |
Sets variable directRayCount, the number of rays to be used in direct radiation model. | |
void | setDiffuseRayCount (const std::string &label, size_t N) |
Sets variable diffuseRayCount, the number of rays to be used in diffuse (ambient) radiation model. | |
void | setDiffuseRadiationFlux (const std::string &label, float flux) |
Diffuse (ambient) radiation flux. | |
void | setDiffuseRadiationExtinctionCoeff (const std::string &label, float K, const helios::vec3 &peak_dir) |
Extinction coefficient of diffuse ambient radiation. | |
void | setDiffuseRadiationExtinctionCoeff (const std::string &label, float K, const helios::SphericalCoord &peak_dir) |
Extinction coefficient of diffuse ambient radiation. | |
void | setDiffuseSpectrumIntegral (float spectrum_integral) |
Set the integral of the diffuse spectral flux distribution across all possible wavelengths FOR ALL EXISTING BANDS (=∫Sdλ) | |
void | setDiffuseSpectrumIntegral (float spectrum_integral, float wavelength_min, float wavelength_max) |
Scale the source spectral flux distribution based on a prescribed integral between two wavelengths FOR ALL EXISTING BANDS (=∫Sdλ) | |
void | setDiffuseSpectrumIntegral (const std::string &band_label, float spectrum_integral) |
Set the integral of the diffuse spectral flux distribution across all possible wavelengths (=∫Sdλ) | |
void | setDiffuseSpectrumIntegral (const std::string &band_label, float spectrum_integral, float wavelength_min, float wavelength_max) |
Scale the source spectral flux distribution based on a prescribed integral between two wavelengths (=∫Sdλ) | |
void | addRadiationBand (const std::string &label) |
Add a spectral radiation band to the model. | |
void | addRadiationBand (const std::string &label, float wavelength_min, float wavelength_max) |
Add a spectral radiation band to the model with explicit specification of the spectral wave band. | |
void | copyRadiationBand (const std::string &old_label, const std::string &new_label) |
Copy a spectral radiation band based on a previously created band. | |
void | copyRadiationBand (const std::string &old_label, const std::string &new_label, float wavelength_min, float wavelength_max) |
Copy a spectral radiation band based on a previously created band and explicitly set new band wavelength range. | |
bool | doesBandExist (const std::string &label) const |
Check if a radiation band exists based on its label. | |
void | disableEmission (const std::string &label) |
Disable emission calculations for all primitives in this band. | |
void | enableEmission (const std::string &label) |
Enable emission calculations for all primitives in this band. | |
uint | addCollimatedRadiationSource () |
Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays) assuming the default direction of (0,0,1) | |
uint | addCollimatedRadiationSource (const helios::SphericalCoord &direction) |
Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays) | |
uint | addCollimatedRadiationSource (const helios::vec3 &direction) |
Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays) | |
uint | addSphereRadiationSource (const helios::vec3 &position, float radius) |
Add an external source of radiation that emits from the surface of a sphere. | |
uint | addSunSphereRadiationSource () |
Add a sphere radiation source that models the sun assuming the default direction of (0,0,1) | |
uint | addSunSphereRadiationSource (const helios::SphericalCoord &sun_direction) |
Add a sphere radiation source that models the sun. | |
uint | addSunSphereRadiationSource (const helios::vec3 &sun_direction) |
Add a sphere radiation source that models the sun. | |
uint | addRectangleRadiationSource (const helios::vec3 &position, const helios::vec2 &size, const helios::vec3 &rotation) |
Add planar rectangular radiation source. | |
uint | addDiskRadiationSource (const helios::vec3 &position, float radius, const helios::vec3 &rotation) |
Add planar circular radiation source. | |
void | deleteRadiationSource (uint sourceID) |
Delete an existing radiation source (any type) | |
void | setSourceSpectrumIntegral (uint source_ID, float source_integral) |
Set the integral of the source spectral flux distribution across all possible wavelengths (=∫Sdλ) | |
void | setSourceSpectrumIntegral (uint source_ID, float source_integral, float wavelength_min, float wavelength_max) |
Scale the source spectral flux distribution based on a prescribed integral between two wavelengths (=∫Sdλ) | |
void | setSourceFlux (uint source_ID, const std::string &band_label, float flux) |
Set the flux of radiation source for this band. | |
void | setSourceFlux (const std::vector< uint > &source_ID, const std::string &band_label, float flux) |
Set the flux of multiple radiation sources for this band. | |
float | getSourceFlux (uint source_ID, const std::string &band_label) const |
Get the flux of radiation source for this band. | |
void | setSourcePosition (uint source_ID, const helios::vec3 &position) |
Set the position/direction of radiation source based on a Cartesian vector. | |
void | setSourcePosition (uint source_ID, const helios::SphericalCoord &position) |
Set the position/direction of radiation source based on a spherical vector. | |
helios::vec3 | getSourcePosition (uint source_ID) const |
Get the position/direction of radiation source. | |
void | setSourceSpectrum (uint source_ID, const std::vector< helios::vec2 > &spectrum) |
Set the spectral distribution of a radiation source according to a vector of wavelength-intensity pairs. | |
void | setSourceSpectrum (const std::vector< uint > &source_ID, const std::vector< helios::vec2 > &spectrum) |
Set the spectral distribution of multiple radiation sources according to a vector of wavelength-intensity pairs. | |
void | setSourceSpectrum (uint source_ID, const std::string &spectrum_label) |
Set the spectral distribution of a radiation source based on global data of wavelength-intensity pairs. | |
void | setSourceSpectrum (const std::vector< uint > &source_ID, const std::string &spectrum_label) |
Set the spectral distribution of multiple radiation sources based on global data of wavelength-intensity pairs. | |
void | setDiffuseSpectrum (const std::string &band_label, const std::string &spectrum_label) |
Set the spectral distribution of diffuse ambient radiation FOR A SINGLE BAND based on global data of wavelength-intensity pairs. | |
void | setDiffuseSpectrum (const std::vector< std::string > &band_labels, const std::string &spectrum_label) |
Set the spectral distribution of diffuse ambient radiation FOR MULTIPLE BANDS based on global data of wavelength-intensity pairs. | |
float | getDiffuseFlux (const std::string &band_label) const |
Get the diffuse flux for a given band. | |
void | enableLightModelVisualization () |
Add a 3D model of the light source (rectangular, disk, and sphere) to the Context for visualization purposes. | |
void | disableLightModelVisualization () |
Remove the 3D model of the light source from the Context. | |
void | enableCameraModelVisualization () |
Add a 3D model of the camera to the Context for visualization purposes. | |
void | disableCameraModelVisualization () |
Remove the 3D model of the camera from the Context. | |
float | integrateSpectrum (const std::vector< helios::vec2 > &object_spectrum, float wavelength_min, float wavelength_max) const |
Integrate a spectral distribution between two wavelength bounds. | |
float | integrateSpectrum (const std::vector< helios::vec2 > &object_spectrum) const |
Integrate a spectral distribution across all wavelengths. | |
float | integrateSpectrum (uint source_ID, const std::vector< helios::vec2 > &object_spectrum, float wavelength_min, float wavelength_max) const |
Integrate the product of a radiation source spectral distribution with specified spectral data between two wavelength bounds. | |
float | integrateSpectrum (uint source_ID, const std::vector< helios::vec2 > &object_spectrum, const std::vector< helios::vec2 > &camera_spectrum) const |
Integrate the product of a radiation source spectral distribution, surface spectral data, and camera spectral response across all wavelengths. | |
float | integrateSpectrum (const std::vector< helios::vec2 > &object_spectrum, const std::vector< helios::vec2 > &camera_spectrum) const |
Integrate the product of surface spectral data and camera spectral response across all wavelengths. | |
float | integrateSourceSpectrum (uint source_ID, float wavelength_min, float wavelength_max) const |
Integrate a source spectral distribution between two wavelength bounds. | |
void | scaleSpectrum (const std::string &existing_global_data_label, const std::string &new_global_data_label, float scale_factor) const |
Scale an entire spectrum by a constant factor. Creates new global data for scaled spectrum. | |
void | scaleSpectrum (const std::string &global_data_label, float scale_factor) const |
Scale an entire spectrum by a constant factor. Performs scaling in-place. | |
void | scaleSpectrumRandomly (const std::string &existing_global_data_label, const std::string &new_global_data_label, float minimum_scale_factor, float maximum_scale_factor) const |
Scale an entire spectrum by a random factor following a uniform distribution. | |
void | blendSpectra (const std::string &new_spectrum_label, const std::vector< std::string > &spectrum_labels, const std::vector< float > &weights) const |
Blend one or more spectra together into a new spectrum. | |
void | blendSpectraRandomly (const std::string &new_spectrum_label, const std::vector< std::string > &spectrum_labels) const |
Blend one or more spectra together into a new spectrum, with random weights assigned to each input spectrum. | |
void | setScatteringDepth (const std::string &label, uint depth) |
Set the number of scattering iterations for a certain band. | |
void | setMinScatterEnergy (const std::string &label, uint energy) |
Set the energy threshold used to terminate scattering iterations. Scattering iterations are terminated when the maximum to-be-scattered energy among all primitives is less than "energy". | |
void | enforcePeriodicBoundary (const std::string &boundary) |
Use a periodic boundary condition in one or more lateral directions. | |
void | addRadiationCamera (const std::string &camera_label, const std::vector< std::string > &band_label, const helios::vec3 &position, const helios::vec3 &lookat, const CameraProperties &camera_properties, uint antialiasing_samples) |
Add a radiation camera sensor. | |
void | addRadiationCamera (const std::string &camera_label, const std::vector< std::string > &band_label, const helios::vec3 &position, const helios::SphericalCoord &viewing_direction, const CameraProperties &camera_properties, uint antialiasing_samples) |
Add a radiation camera sensor. | |
void | setCameraSpectralResponse (const std::string &camera_label, const std::string &band_label, const std::string &global_data) |
Set the spectral response of a camera band based on reference to global data. This function version uses all the global data array to calculate the spectral response. | |
void | setCameraSpectralResponseFromLibrary (const std::string &camera_label, const std::string &camera_library_name) |
Set the camera spectral response based on a camera available in the standard camera spectral library (radiation/spectral_data/camera_spectral_library.xml). | |
void | setCameraPosition (const std::string &camera_label, const helios::vec3 &position) |
Set the position of the radiation camera. | |
helios::vec3 | getCameraPosition (const std::string &camera_label) const |
Get the position of the radiation camera. | |
void | setCameraLookat (const std::string &camera_label, const helios::vec3 &lookat) |
Set the position the radiation camera is pointed toward (used to calculate camera orientation) | |
helios::vec3 | getCameraLookat (const std::string &camera_label) const |
Get the position the radiation camera is pointed toward (used to calculate camera orientation) | |
void | setCameraOrientation (const std::string &camera_label, const helios::vec3 &direction) |
Set the orientation of the radiation camera based on a Cartesian vector. | |
void | setCameraOrientation (const std::string &camera_label, const helios::SphericalCoord &direction) |
Set the orientation of the radiation camera based on a spherical coordinate. | |
helios::SphericalCoord | getCameraOrientation (const std::string &camera_label) const |
Get the orientation of the radiation camera based on a spherical coordinate. | |
std::vector< std::string > | getAllCameraLabels () |
Get the labels for all radiation cameras that have been added to the radiation model. | |
void | updateGeometry () |
Adds all geometric primitives from the Context to OptiX. | |
void | updateGeometry (const std::vector< uint > &UUIDs) |
Adds certain geometric primitives from the Context to OptiX as specified by a list of UUIDs. | |
void | runBand (const std::string &label) |
Run the simulation for a single radiative band. | |
void | runBand (const std::vector< std::string > &labels) |
Run the simulation for a multiple radiative bands. | |
std::vector< float > | getTotalAbsorbedFlux () |
Get the total absorbed radiation flux summed over all bands for each primitive. | |
float | getSkyEnergy () |
Get the radiative energy lost to the sky (surroundings) | |
float | calculateGtheta (helios::Context *context, helios::vec3 view_direction) |
Calculate G(theta) (i.e., projected area fraction) for a group of primitives given a certain viewing direction. | |
void | setCameraCalibration (CameraCalibration *CameraCalibration) |
void | updateCameraResponse (const std::string &orginalcameralabel, const std::vector< std::string > &sourcelabels_raw, const std::vector< std::string > &cameraresponselabels, helios::vec2 &wavelengthrange, const std::vector< std::vector< float > > &truevalues, const std::string &calibratedmark) |
Update the camera response for a given camera based on color board. | |
float | getCameraResponseScale (const std::string &orginalcameralabel, const std::vector< std::string > &cameraresponselabels, const std::vector< std::string > &bandlabels, const std::vector< std::string > &sourcelabels, helios::vec2 &wavelengthrange, const std::vector< std::vector< float > > &truevalues) |
Get the scale factor of the camera response for a given camera. | |
void | runRadiationImaging (const std::string &cameralabel, const std::vector< std::string > &sourcelabels, const std::vector< std::string > &bandlabels, const std::vector< std::string > &cameraresponselabels, helios::vec2 wavelengthrange, float fluxscale=1, float diffusefactor=0.0005, uint scatteringdepth=4) |
Run radiation imaging simulation. | |
void | runRadiationImaging (const std::vector< std::string > &cameralabels, const std::vector< std::string > &sourcelabels, const std::vector< std::string > &bandlabels, const std::vector< std::string > &cameraresponselabels, helios::vec2 wavelengthrange, float fluxscale=1, float diffusefactor=0.0005, uint scatteringdepth=4) |
Run radiation imaging simulation. | |
void | applyImageProcessingPipeline (const std::string &cameralabel, const std::string &red_band_label, const std::string &green_band_label, const std::string &blue_band_label, float saturation_adjustment=1.f, float brightness_adjustment=1.f, float contrast_adjustment=1.f, float gain_adjustment=1.f) |
Apply a digital camera-like processing pipeline to the camera image. | |
void | applyCameraColorCorrectionMatrix (const std::string &camera_label, const std::string &red_band_label, const std::string &green_band_label, const std::string &blue_band_label, const std::string &ccm_file_path) |
Apply pre-computed color correction matrix to camera data. | |
void | whiteBalanceAuto (const std::string &cameralabel, const std::string &red_band_label, const std::string &green_band_label, const std::string &blue_band_label) |
Apply auto white balancing algorithm selection based on scene analysis. | |
void | whiteBalanceWhitePatch (const std::string &cameralabel, const std::string &red_band_label, const std::string &green_band_label, const std::string &blue_band_label, float percentile=0.99f) |
Apply White Patch white balancing algorithm. | |
void | whiteBalanceGrayWorld (const std::string &cameralabel, const std::string &red_band_label, const std::string &green_band_label, const std::string &blue_band_label, float p=6.0f) |
Apply Gray World white balancing algorithm with custom Minkowski p-parameter. | |
std::string | writeCameraImage (const std::string &camera, const std::vector< std::string > &bands, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1, float flux_to_pixel_conversion=1.f) |
Write camera data for one or more bands to a JPEG image. | |
std::string | writeNormCameraImage (const std::string &camera, const std::vector< std::string > &bands, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1) |
Write normalized camera data (maximum value is 1) for one or more bands to a JPEG image. | |
void | writeCameraImageData (const std::string &camera, const std::string &band, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1) |
Write camera data for one band to an ASCII text file. | |
void | writePrimitiveDataLabelMap (const std::string &cameralabel, const std::string &primitive_data_label, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1, float padvalue=NAN) |
Write image pixel labels to text file based on primitive data. Primitive data must have type 'float', 'double', 'uint', or 'int'. | |
void | writeObjectDataLabelMap (const std::string &cameralabel, const std::string &object_data_label, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1, float padvalue=NAN) |
Write image pixel labels to text file based on object data. Object data must have type 'float', 'double', 'uint', or 'int'. | |
void | writeDepthImageData (const std::string &cameralabel, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1) |
Write depth image data to text file. | |
void | writeNormDepthImage (const std::string &cameralabel, const std::string &imagefile_base, float max_depth, const std::string &image_path="./", int frame=-1) |
Write depth image file, with grayscale normalized to the minimum and maximum depth values. | |
DEPRECATED (void writeImageBoundingBoxes(const std::string &cameralabel, const std::string &primitive_data_label, uint object_class_ID, const std::string &imagefile_base, const std::string &image_path="./", bool append_label_file=false, int frame=-1)) | |
Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'. | |
DEPRECATED (void writeImageBoundingBoxes_ObjectData(const std::string &cameralabel, const std::string &object_data_label, uint object_class_ID, const std::string &imagefile_base, const std::string &image_path="./", bool append_label_file=false, int frame=-1)) | |
Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'. | |
void | writeImageBoundingBoxes (const std::string &cameralabel, const std::string &primitive_data_label, const uint &object_class_ID, const std::string &image_file, const std::string &classes_txt_file="classes.txt", const std::string &image_path="./") |
Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'. | |
void | writeImageBoundingBoxes (const std::string &cameralabel, const std::vector< std::string > &primitive_data_label, const std::vector< uint > &object_class_ID, const std::string &image_file, const std::string &classes_txt_file="classes.txt", const std::string &image_path="./") |
Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'. | |
void | writeImageBoundingBoxes_ObjectData (const std::string &cameralabel, const std::string &object_data_label, const uint &object_class_ID, const std::string &image_file, const std::string &classes_txt_file="classes.txt", const std::string &image_path="./") |
Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'. | |
void | writeImageBoundingBoxes_ObjectData (const std::string &cameralabel, const std::vector< std::string > &object_data_label, const std::vector< uint > &object_class_ID, const std::string &image_file, const std::string &classes_txt_file="classes.txt", const std::string &image_path="./") |
Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'. | |
void | writeImageSegmentationMasks (const std::string &cameralabel, const std::string &primitive_data_label, const uint &object_class_ID, const std::string &json_filename, const std::string &image_file, bool append_file=false) |
Write segmentation masks for primitive data in COCO JSON format. Primitive data must have type of 'uint' or 'int'. | |
void | writeImageSegmentationMasks (const std::string &cameralabel, const std::vector< std::string > &primitive_data_label, const std::vector< uint > &object_class_ID, const std::string &json_filename, const std::string &image_file, bool append_file=false) |
Write segmentation masks for primitive data in COCO JSON format. Primitive data must have type of 'uint' or 'int'. | |
void | writeImageSegmentationMasks_ObjectData (const std::string &cameralabel, const std::string &object_data_label, const uint &object_class_ID, const std::string &json_filename, const std::string &image_file, bool append_file=false) |
Write segmentation masks for object data in COCO JSON format. Object data must have type of 'uint' or 'int'. | |
void | writeImageSegmentationMasks_ObjectData (const std::string &cameralabel, const std::vector< std::string > &object_data_label, const std::vector< uint > &object_class_ID, const std::string &json_filename, const std::string &image_file, bool append_file=false) |
Write segmentation masks for object data in COCO JSON format. Object data must have type of 'uint' or 'int'. | |
void | setPadValue (const std::string &cameralabel, const std::vector< std::string > &bandlabels, const std::vector< float > &padvalues) |
Set padding value for pixels do not have valid values. | |
void | calibrateCamera (const std::string &orginalcameralabel, const std::vector< std::string > &sourcelabels, const std::vector< std::string > &cameraresponselabels, const std::vector< std::string > &bandlabels, const float scalefactor, const std::vector< std::vector< float > > &truevalues, const std::string &calibratedmark) |
Calibrate camera. | |
void | calibrateCamera (const std::string &originalcameralabel, const float scalefactor, const std::vector< std::vector< float > > &truevalues, const std::string &calibratedmark) |
Calibrate camera. | |
std::string | autoCalibrateCameraImage (const std::string &camera_label, const std::string &red_band_label, const std::string &green_band_label, const std::string &blue_band_label, const std::string &output_file_path, bool print_quality_report=false, ColorCorrectionAlgorithm algorithm=ColorCorrectionAlgorithm::MATRIX_3X3_AUTO, const std::string &ccm_export_file_path="") |
Auto-calibrate camera image using colorboard reference values. | |
void | exportColorCorrectionMatrixXML (const std::string &file_path, const std::string &camera_label, const std::vector< std::vector< float > > &matrix, const std::string &source_image_path, const std::string &colorboard_type, float average_delta_e) |
Helper function to export color correction matrix to XML file (public for testing) | |
std::vector< std::vector< float > > | loadColorCorrectionMatrixXML (const std::string &file_path, std::string &camera_label_out) |
Helper function to load color correction matrix from XML file (public for testing) | |
std::vector< float > | getCameraPixelData (const std::string &camera_label, const std::string &band_label) |
Get camera pixel data for a specific band. | |
void | setCameraPixelData (const std::string &camera_label, const std::string &band_label, const std::vector< float > &pixel_data) |
Set camera pixel data for a specific band. | |
Static Public Member Functions | |
static int | selfTest (int argc=0, char **argv=nullptr) |
Self-test. | |
Radiation transport model plugin.
Definition at line 427 of file RadiationModel.h.
|
strong |
Color correction algorithm types for auto-calibration.
Definition at line 1396 of file RadiationModel.h.
|
explicit |
Default constructor.
Definition at line 26 of file RadiationModel.cpp.
RadiationModel::~RadiationModel | ( | ) |
Destructor.
Definition at line 68 of file RadiationModel.cpp.
uint RadiationModel::addCollimatedRadiationSource | ( | ) |
Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays) assuming the default direction of (0,0,1)
Definition at line 300 of file RadiationModel.cpp.
uint RadiationModel::addCollimatedRadiationSource | ( | const helios::SphericalCoord & | direction | ) |
Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays)
[in] | direction | Spherical coordinate pointing toward the radiation source |
Definition at line 305 of file RadiationModel.cpp.
uint RadiationModel::addCollimatedRadiationSource | ( | const helios::vec3 & | direction | ) |
Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays)
[in] | direction | unit vector pointing toward the radiation source |
Definition at line 309 of file RadiationModel.cpp.
uint RadiationModel::addDiskRadiationSource | ( | const helios::vec3 & | position, |
float | radius, | ||
const helios::vec3 & | rotation | ||
) |
Add planar circular radiation source.
[in] | position | (x,y,z) position of the center of the disk radiation source |
[in] | radius | Radius of disk source |
[in] | rotation | Rotation of the source in radians about the x- y- and z- axes (the sign of the rotation angle follows right-hand rule) |
Definition at line 445 of file RadiationModel.cpp.
void RadiationModel::addRadiationBand | ( | const std::string & | label | ) |
Add a spectral radiation band to the model.
[in] | label | Label used to reference the band |
Definition at line 199 of file RadiationModel.cpp.
void RadiationModel::addRadiationBand | ( | const std::string & | label, |
float | wavelength_min, | ||
float | wavelength_max | ||
) |
Add a spectral radiation band to the model with explicit specification of the spectral wave band.
[in] | label | Label used to reference the band |
[in] | wavelength_min | Lower bounding wavelength for wave band |
[in] | wavelength_max | Upper bounding wavelength for wave band |
Definition at line 218 of file RadiationModel.cpp.
void RadiationModel::addRadiationCamera | ( | const std::string & | camera_label, |
const std::vector< std::string > & | band_label, | ||
const helios::vec3 & | position, | ||
const helios::SphericalCoord & | viewing_direction, | ||
const CameraProperties & | camera_properties, | ||
uint | antialiasing_samples | ||
) |
Add a radiation camera sensor.
[in] | camera_label | A label that will be used to refer to the camera (e.g., "thermal", "multispectral", "NIR", etc.). |
[in] | band_label | Labels for radiation bands to include in camera. |
[in] | position | Cartesian (x,y,z) location of the camera sensor. |
[in] | viewing_direction | Spherical direction in which the camera is pointed. |
[in] | camera_properties | 'CameraProperties' struct containing intrinsic camera parameters. |
[in] | antialiasing_samples | Number of ray samples per pixel. More samples will decrease noise/aliasing in the image, but will take longer to run. |
Definition at line 57 of file RadiationCamera.cpp.
void RadiationModel::addRadiationCamera | ( | const std::string & | camera_label, |
const std::vector< std::string > & | band_label, | ||
const helios::vec3 & | position, | ||
const helios::vec3 & | lookat, | ||
const CameraProperties & | camera_properties, | ||
uint | antialiasing_samples | ||
) |
Add a radiation camera sensor.
[in] | camera_label | A label that will be used to refer to the camera (e.g., "thermal", "multispectral", "NIR", etc.). |
[in] | band_label | Labels for radiation bands to include in camera. |
[in] | position | Cartesian (x,y,z) location of the camera sensor. |
[in] | lookat | Cartesian (x,y,z) position at which the camera is pointed. The vector (lookat-position) is perpendicular to the camera face. |
[in] | camera_properties | 'CameraProperties' struct containing intrinsic camera parameters. |
[in] | antialiasing_samples | Number of ray samples per pixel. More samples will decrease noise/aliasing in the image, but will take longer to run. |
Definition at line 27 of file RadiationCamera.cpp.
uint RadiationModel::addRectangleRadiationSource | ( | const helios::vec3 & | position, |
const helios::vec2 & | size, | ||
const helios::vec3 & | rotation | ||
) |
Add planar rectangular radiation source.
[in] | position | (x,y,z) position of the center of the rectangular radiation source |
[in] | size | Length (.x) and width (.y) of rectangular source |
[in] | rotation | Rotation of the source in radians about the x- y- and z- axes (the sign of the rotation angle follows right-hand rule) |
Definition at line 414 of file RadiationModel.cpp.
uint RadiationModel::addSphereRadiationSource | ( | const helios::vec3 & | position, |
float | radius | ||
) |
Add an external source of radiation that emits from the surface of a sphere.
[in] | position | (x,y,z) position of the center of the sphere radiation source |
[in] | radius | Radius of the sphere radiation source |
Definition at line 344 of file RadiationModel.cpp.
uint RadiationModel::addSunSphereRadiationSource | ( | ) |
Add a sphere radiation source that models the sun assuming the default direction of (0,0,1)
Definition at line 375 of file RadiationModel.cpp.
uint RadiationModel::addSunSphereRadiationSource | ( | const helios::SphericalCoord & | sun_direction | ) |
Add a sphere radiation source that models the sun.
[in] | sun_direction | Spherical coordinate pointing towards the sun |
Definition at line 379 of file RadiationModel.cpp.
uint RadiationModel::addSunSphereRadiationSource | ( | const helios::vec3 & | sun_direction | ) |
Add a sphere radiation source that models the sun.
[in] | sun_direction | Unit vector pointing towards the sun |
Definition at line 383 of file RadiationModel.cpp.
void RadiationModel::applyCameraColorCorrectionMatrix | ( | const std::string & | camera_label, |
const std::string & | red_band_label, | ||
const std::string & | green_band_label, | ||
const std::string & | blue_band_label, | ||
const std::string & | ccm_file_path | ||
) |
Apply pre-computed color correction matrix to camera data.
[in] | camera_label | Label of the camera to apply color correction to |
[in] | red_band_label | Label for red channel band data |
[in] | green_band_label | Label for green channel band data |
[in] | blue_band_label | Label for blue channel band data |
[in] | ccm_file_path | Path to XML file containing color correction matrix |
Definition at line 5626 of file RadiationModel.cpp.
void RadiationModel::applyImageProcessingPipeline | ( | const std::string & | cameralabel, |
const std::string & | red_band_label, | ||
const std::string & | green_band_label, | ||
const std::string & | blue_band_label, | ||
float | saturation_adjustment = 1.f , |
||
float | brightness_adjustment = 1.f , |
||
float | contrast_adjustment = 1.f , |
||
float | gain_adjustment = 1.f |
||
) |
Apply a digital camera-like processing pipeline to the camera image.
This only applies to RGB cameras.
[in] | cameralabel | Label of camera to be used for processing |
[in] | red_band_label | Label of the red band |
[in] | green_band_label | Label of the green band |
[in] | blue_band_label | Label of the blue band |
[in] | saturation_adjustment | [optional] Adjustment factor for saturation (default is 1.0, which means no adjustment) |
[in] | brightness_adjustment | [optional] Adjustment factor for brightness (default is 1.0, which means no adjustment) |
[in] | contrast_adjustment | [optional] Adjustment factor for contrast (default is 1.0, which means no adjustment) |
[in] | gain_adjustment | [optional] Adjustment factor for exposure gain (default is 1.0, which uses auto-exposure) |
Definition at line 2102 of file RadiationCamera.cpp.
std::string RadiationModel::autoCalibrateCameraImage | ( | const std::string & | camera_label, |
const std::string & | red_band_label, | ||
const std::string & | green_band_label, | ||
const std::string & | blue_band_label, | ||
const std::string & | output_file_path, | ||
bool | print_quality_report = false , |
||
ColorCorrectionAlgorithm | algorithm = ColorCorrectionAlgorithm::MATRIX_3X3_AUTO , |
||
const std::string & | ccm_export_file_path = "" |
||
) |
Auto-calibrate camera image using colorboard reference values.
[in] | camera_label | Label of the camera that generated the image |
[in] | red_band_label | Label for red channel band data |
[in] | green_band_label | Label for green channel band data |
[in] | blue_band_label | Label for blue channel band data |
[in] | output_file_path | Path where corrected image will be written |
[in] | print_quality_report | If true, prints calibration quality metrics to console |
[in] | algorithm | Color correction algorithm to use (defaults to 3x3 matrix with auto-fallback) |
[in] | ccm_export_file_path | Optional path to export the computed color correction matrix to XML file |
Definition at line 4963 of file RadiationModel.cpp.
void RadiationModel::blendSpectra | ( | const std::string & | new_spectrum_label, |
const std::vector< std::string > & | spectrum_labels, | ||
const std::vector< float > & | weights | ||
) | const |
Blend one or more spectra together into a new spectrum.
[in] | new_spectrum_label | Label for new spectrum global data, which is created by blending the input spectra. |
[in] | spectrum_labels | Vector of global data labels for spectra to be blended. |
[in] | weights | Vector of weights for each spectrum to be blended. The weights must sum to 1.0. |
Definition at line 984 of file RadiationModel.cpp.
void RadiationModel::blendSpectraRandomly | ( | const std::string & | new_spectrum_label, |
const std::vector< std::string > & | spectrum_labels | ||
) | const |
Blend one or more spectra together into a new spectrum, with random weights assigned to each input spectrum.
[in] | new_spectrum_label | Label for new spectrum global data, which is created by blending the input spectra. |
[in] | spectrum_labels | Vector of global data labels for spectra to be blended. |
Definition at line 1058 of file RadiationModel.cpp.
float RadiationModel::calculateGtheta | ( | helios::Context * | context, |
helios::vec3 | view_direction | ||
) |
Calculate G(theta) (i.e., projected area fraction) for a group of primitives given a certain viewing direction.
[in] | context | Pointer to Helios context |
[in] | view_direction | Viewing direction for projected area |
Definition at line 4787 of file RadiationModel.cpp.
void RadiationModel::calibrateCamera | ( | const std::string & | orginalcameralabel, |
const std::vector< std::string > & | sourcelabels, | ||
const std::vector< std::string > & | cameraresponselabels, | ||
const std::vector< std::string > & | bandlabels, | ||
const float | scalefactor, | ||
const std::vector< std::vector< float > > & | truevalues, | ||
const std::string & | calibratedmark | ||
) |
Calibrate camera.
[in] | orginalcameralabel | Label of camera to be used for simulation |
[in] | sourcelabels | Labels of source fluxes |
[in] | cameraresponselabels | Labels of camera spectral responses |
[in] | bandlabels | Labels of radiation bands |
[in] | scalefactor | Scale factor for calibrated camera spectral response |
[in] | truevalues | True image values of the color board |
[in] | calibratedmark | Mark of the calibrated camera spectral response |
Definition at line 1988 of file RadiationCamera.cpp.
void RadiationModel::calibrateCamera | ( | const std::string & | originalcameralabel, |
const float | scalefactor, | ||
const std::vector< std::vector< float > > & | truevalues, | ||
const std::string & | calibratedmark | ||
) |
Calibrate camera.
[in] | originalcameralabel | Label of camera to be used for simulation |
[in] | scalefactor | Scale factor for calibrated camera spectral response |
[in] | truevalues | True image values of the color board |
[in] | calibratedmark | Mark of the calibrated camera spectral response |
Definition at line 2025 of file RadiationCamera.cpp.
void RadiationModel::copyRadiationBand | ( | const std::string & | old_label, |
const std::string & | new_label | ||
) |
Copy a spectral radiation band based on a previously created band.
[in] | old_label | Label of old radiation band to be copied |
[in] | new_label | Label of new radiation band to be created |
Definition at line 243 of file RadiationModel.cpp.
void RadiationModel::copyRadiationBand | ( | const std::string & | old_label, |
const std::string & | new_label, | ||
float | wavelength_min, | ||
float | wavelength_max | ||
) |
Copy a spectral radiation band based on a previously created band and explicitly set new band wavelength range.
[in] | old_label | Label of old radiation band to be copied |
[in] | new_label | Label of new radiation band to be created |
[in] | wavelength_min | Lower bounding wavelength for wave band |
[in] | wavelength_max | Upper bounding wavelength for wave band |
Definition at line 254 of file RadiationModel.cpp.
void RadiationModel::deleteRadiationSource | ( | uint | sourceID | ) |
Delete an existing radiation source (any type)
[in] | sourceID | Identifier of radiation source |
Definition at line 476 of file RadiationModel.cpp.
RadiationModel::DEPRECATED | ( | void | writeImageBoundingBoxesconst std::string &cameralabel, const std::string &primitive_data_label, uint object_class_ID, const std::string &imagefile_base, const std::string &image_path="./", bool append_label_file=false, int frame=-1 | ) |
Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'.
[in] | cameralabel | Label of target camera |
[in] | primitive_data_label | Name of the primitive data label. Primitive data must have type of 'uint' or 'int'. |
[in] | object_class_ID | Object class ID to write for the labels in this group. |
[in] | imagefile_base | Name for base of output files (will also include the camera label and a frame number in the file name) |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
[in] | append_label_file | [optional] If true, the label file will be appended to the existing file. If false, the label file will be overwritten. By default, it is false. |
[in] | frame | [optional] A frame count number to be appended to the output file (e.g., camera_thermal_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999. |
RadiationModel::DEPRECATED | ( | void | writeImageBoundingBoxes_ObjectDataconst std::string &cameralabel, const std::string &object_data_label, uint object_class_ID, const std::string &imagefile_base, const std::string &image_path="./", bool append_label_file=false, int frame=-1 | ) |
Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'.
[in] | cameralabel | Label of target camera |
[in] | object_data_label | Name of the object data label. Object data must have type of 'uint' or 'int'. |
[in] | object_class_ID | Object class ID to write for the labels in this group. |
[in] | imagefile_base | Name for base of output files (will also include the camera label and a frame number in the file name) |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
[in] | append_label_file | [optional] If true, the label file will be appended to the existing file. If false, the label file will be overwritten. By default, it is false. |
[in] | frame | [optional] A frame count number to be appended to the output file (e.g., camera_thermal_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999. |
void RadiationModel::disableCameraModelVisualization | ( | ) |
Remove the 3D model of the camera from the Context.
Definition at line 696 of file RadiationModel.cpp.
void RadiationModel::disableEmission | ( | const std::string & | label | ) |
Disable emission calculations for all primitives in this band.
[in] | label | Label used to reference the band |
Definition at line 282 of file RadiationModel.cpp.
void RadiationModel::disableLightModelVisualization | ( | ) |
Remove the 3D model of the light source from the Context.
Definition at line 680 of file RadiationModel.cpp.
void RadiationModel::disableMessages | ( | ) |
Disable/silence status messages.
Definition at line 72 of file RadiationModel.cpp.
bool RadiationModel::doesBandExist | ( | const std::string & | label | ) | const |
Check if a radiation band exists based on its label.
[in] | label | Label used to reference the band |
Definition at line 274 of file RadiationModel.cpp.
void RadiationModel::enableCameraModelVisualization | ( | ) |
Add a 3D model of the camera to the Context for visualization purposes.
Definition at line 687 of file RadiationModel.cpp.
void RadiationModel::enableEmission | ( | const std::string & | label | ) |
Enable emission calculations for all primitives in this band.
[in] | label | Label used to reference the band |
Definition at line 291 of file RadiationModel.cpp.
void RadiationModel::enableLightModelVisualization | ( | ) |
Add a 3D model of the light source (rectangular, disk, and sphere) to the Context for visualization purposes.
Definition at line 671 of file RadiationModel.cpp.
void RadiationModel::enableMessages | ( | ) |
Enable status messages.
Definition at line 76 of file RadiationModel.cpp.
void RadiationModel::enforcePeriodicBoundary | ( | const std::string & | boundary | ) |
Use a periodic boundary condition in one or more lateral directions.
[in] | boundary | Lateral direction to enforce periodic boundary - choices are "x" (periodic only in x-direction), "y" (periodic only in y-direction), or "xy" (periodic in both x- and y-directions). |
Definition at line 1119 of file RadiationModel.cpp.
void RadiationModel::exportColorCorrectionMatrixXML | ( | const std::string & | file_path, |
const std::string & | camera_label, | ||
const std::vector< std::vector< float > > & | matrix, | ||
const std::string & | source_image_path, | ||
const std::string & | colorboard_type, | ||
float | average_delta_e | ||
) |
Helper function to export color correction matrix to XML file (public for testing)
Definition at line 4809 of file RadiationModel.cpp.
std::vector< std::string > RadiationModel::getAllCameraLabels | ( | ) |
Get the labels for all radiation cameras that have been added to the radiation model.
Definition at line 177 of file RadiationCamera.cpp.
helios::vec3 RadiationModel::getCameraLookat | ( | const std::string & | camera_label | ) | const |
Get the position the radiation camera is pointed toward (used to calculate camera orientation)
[in] | camera_label | Label for the camera to be set. |
Definition at line 135 of file RadiationCamera.cpp.
helios::SphericalCoord RadiationModel::getCameraOrientation | ( | const std::string & | camera_label | ) | const |
Get the orientation of the radiation camera based on a spherical coordinate.
[in] | camera_label | Label for the camera to be set. |
Definition at line 156 of file RadiationCamera.cpp.
std::vector< float > RadiationModel::getCameraPixelData | ( | const std::string & | camera_label, |
const std::string & | band_label | ||
) |
Get camera pixel data for a specific band.
Definition at line 5701 of file RadiationModel.cpp.
helios::vec3 RadiationModel::getCameraPosition | ( | const std::string & | camera_label | ) | const |
Get the position of the radiation camera.
[in] | camera_label | Label for the camera to be set. |
Definition at line 114 of file RadiationCamera.cpp.
float RadiationModel::getCameraResponseScale | ( | const std::string & | orginalcameralabel, |
const std::vector< std::string > & | cameraresponselabels, | ||
const std::vector< std::string > & | bandlabels, | ||
const std::vector< std::string > & | sourcelabels, | ||
helios::vec2 & | wavelengthrange, | ||
const std::vector< std::vector< float > > & | truevalues | ||
) |
Get the scale factor of the camera response for a given camera.
[in] | orginalcameralabel | Label of camera to be used for simulation |
[in] | cameraresponselabels | Vector of labels of camera spectral responses |
[in] | bandlabels | Vector of labels of radiation bands to be used for simulation |
[in] | sourcelabels | Vector of labels of source spectra to be used for simulation |
[in] | wavelengthrange | Wavelength range of the camera |
[in] | truevalues | True image values of the color board |
Definition at line 578 of file RadiationCamera.cpp.
float RadiationModel::getDiffuseFlux | ( | const std::string & | band_label | ) | const |
Get the diffuse flux for a given band.
[in] | band_label | Label used to reference the band |
Definition at line 649 of file RadiationModel.cpp.
float RadiationModel::getSkyEnergy | ( | ) |
Get the radiative energy lost to the sky (surroundings)
Definition at line 3711 of file RadiationModel.cpp.
float RadiationModel::getSourceFlux | ( | uint | source_ID, |
const std::string & | band_label | ||
) | const |
Get the flux of radiation source for this band.
[in] | source_ID | Identifier of radiation source |
[in] | band_label | Label used to reference the band |
Definition at line 544 of file RadiationModel.cpp.
helios::vec3 RadiationModel::getSourcePosition | ( | uint | source_ID | ) | const |
Get the position/direction of radiation source.
[in] | source_ID | Identifier of radiation source |
Definition at line 1096 of file RadiationModel.cpp.
std::vector< float > RadiationModel::getTotalAbsorbedFlux | ( | ) |
Get the total absorbed radiation flux summed over all bands for each primitive.
Definition at line 3722 of file RadiationModel.cpp.
float RadiationModel::integrateSourceSpectrum | ( | uint | source_ID, |
float | wavelength_min, | ||
float | wavelength_max | ||
) | const |
Integrate a source spectral distribution between two wavelength bounds.
[in] | source_ID | Identifier of a radiation source. |
[in] | wavelength_min | Wavelength for lower bounds of integration |
[in] | wavelength_max | Wavelength for upper bounds of integration |
Definition at line 945 of file RadiationModel.cpp.
float RadiationModel::integrateSpectrum | ( | const std::vector< helios::vec2 > & | object_spectrum | ) | const |
Integrate a spectral distribution across all wavelengths.
[in] | object_spectrum | Vector containing spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y). |
Definition at line 866 of file RadiationModel.cpp.
float RadiationModel::integrateSpectrum | ( | const std::vector< helios::vec2 > & | object_spectrum, |
const std::vector< helios::vec2 > & | camera_spectrum | ||
) | const |
Integrate the product of surface spectral data and camera spectral response across all wavelengths.
[in] | object_spectrum | Vector containing surface spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y). |
[in] | camera_spectrum | Vector containing camera spectral response data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y). |
Definition at line 912 of file RadiationModel.cpp.
float RadiationModel::integrateSpectrum | ( | const std::vector< helios::vec2 > & | object_spectrum, |
float | wavelength_min, | ||
float | wavelength_max | ||
) | const |
Integrate a spectral distribution between two wavelength bounds.
[in] | object_spectrum | Vector containing spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y). |
[in] | wavelength_min | Wavelength for lower bounds of integration |
[in] | wavelength_max | Wavelength for upper bounds of integration |
float RadiationModel::integrateSpectrum | ( | uint | source_ID, |
const std::vector< helios::vec2 > & | object_spectrum, | ||
const std::vector< helios::vec2 > & | camera_spectrum | ||
) | const |
Integrate the product of a radiation source spectral distribution, surface spectral data, and camera spectral response across all wavelengths.
[in] | source_ID | Identifier of a radiation source. |
[in] | object_spectrum | Vector containing surface spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y). |
[in] | camera_spectrum | Vector containing camera spectral response data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y). |
Definition at line 873 of file RadiationModel.cpp.
float RadiationModel::integrateSpectrum | ( | uint | source_ID, |
const std::vector< helios::vec2 > & | object_spectrum, | ||
float | wavelength_min, | ||
float | wavelength_max | ||
) | const |
Integrate the product of a radiation source spectral distribution with specified spectral data between two wavelength bounds.
[in] | source_ID | Identifier of a radiation source. |
[in] | object_spectrum | Vector containing spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y). |
[in] | wavelength_min | Wavelength for lower bounds of integration |
[in] | wavelength_max | Wavelength for upper bounds of integration |
std::vector< std::vector< float > > RadiationModel::loadColorCorrectionMatrixXML | ( | const std::string & | file_path, |
std::string & | camera_label_out | ||
) |
Helper function to load color correction matrix from XML file (public for testing)
Definition at line 4864 of file RadiationModel.cpp.
void RadiationModel::optionalOutputPrimitiveData | ( | const char * | label | ) |
Add optional output primitive data values to the Context.
[in] | label | Name of primitive data (e.g., "reflectivity", "transmissivity") |
Definition at line 80 of file RadiationModel.cpp.
void RadiationModel::runBand | ( | const std::string & | label | ) |
Run the simulation for a single radiative band.
[in] | label | Label used to reference the band (e.g., "PAR") |
Definition at line 3050 of file RadiationModel.cpp.
void RadiationModel::runBand | ( | const std::vector< std::string > & | labels | ) |
Run the simulation for a multiple radiative bands.
[in] | labels | Label used to reference the band (e.g., "PAR") |
Definition at line 3055 of file RadiationModel.cpp.
void RadiationModel::runRadiationImaging | ( | const std::string & | cameralabel, |
const std::vector< std::string > & | sourcelabels, | ||
const std::vector< std::string > & | bandlabels, | ||
const std::vector< std::string > & | cameraresponselabels, | ||
helios::vec2 | wavelengthrange, | ||
float | fluxscale = 1 , |
||
float | diffusefactor = 0.0005 , |
||
uint | scatteringdepth = 4 |
||
) |
Run radiation imaging simulation.
[in] | cameralabel | Label of camera to be used for simulation |
[in] | sourcelabels | Vector of labels of source spectra to be used for simulation |
[in] | bandlabels | Vector of labels of radiation bands to be used for simulation |
[in] | cameraresponselabels | Vector of labels of camera spectral responses |
[in] | wavelengthrange | Wavelength range of spectra |
[in] | fluxscale | Scale factor for source flux |
[in] | diffusefactor | Diffuse factor for diffuse radiation |
[in] | scatteringdepth | Number of scattering events to simulate |
Definition at line 495 of file RadiationCamera.cpp.
void RadiationModel::runRadiationImaging | ( | const std::vector< std::string > & | cameralabels, |
const std::vector< std::string > & | sourcelabels, | ||
const std::vector< std::string > & | bandlabels, | ||
const std::vector< std::string > & | cameraresponselabels, | ||
helios::vec2 | wavelengthrange, | ||
float | fluxscale = 1 , |
||
float | diffusefactor = 0.0005 , |
||
uint | scatteringdepth = 4 |
||
) |
Run radiation imaging simulation.
[in] | cameralabels | Vector of camera labels to be used for simulation |
[in] | sourcelabels | Vector of labels of source spectra to be used for simulation |
[in] | bandlabels | Vector of labels of radiation bands to be used for simulation |
[in] | cameraresponselabels | Vector of labels of camera spectral responses |
[in] | wavelengthrange | Wavelength range of spectra |
[in] | fluxscale | Scale factor for source flux |
[in] | diffusefactor | Diffuse factor for diffuse radiation |
[in] | scatteringdepth | Number of scattering events to simulate |
Definition at line 535 of file RadiationCamera.cpp.
void RadiationModel::scaleSpectrum | ( | const std::string & | existing_global_data_label, |
const std::string & | new_global_data_label, | ||
float | scale_factor | ||
) | const |
Scale an entire spectrum by a constant factor. Creates new global data for scaled spectrum.
[in] | existing_global_data_label | Label of global data containing spectral data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity/reflectivity/transmissivity (.y). |
[in] | new_global_data_label | Label of new global data to be created containing scaled spectral data (type of vec2). |
[in] | scale_factor | Scaling factor. |
Definition at line 956 of file RadiationModel.cpp.
void RadiationModel::scaleSpectrum | ( | const std::string & | global_data_label, |
float | scale_factor | ||
) | const |
Scale an entire spectrum by a constant factor. Performs scaling in-place.
[in] | global_data_label | Label of global data containing spectral data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity/reflectivity/transmissivity (.y). |
[in] | scale_factor | Scaling factor. |
Definition at line 967 of file RadiationModel.cpp.
void RadiationModel::scaleSpectrumRandomly | ( | const std::string & | existing_global_data_label, |
const std::string & | new_global_data_label, | ||
float | minimum_scale_factor, | ||
float | maximum_scale_factor | ||
) | const |
Scale an entire spectrum by a random factor following a uniform distribution.
[in] | existing_global_data_label | Label of global data containing spectral data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity/reflectivity/transmissivity (.y). |
[in] | new_global_data_label | Label of new global data to be created containing scaled spectral data (type of vec2). |
[in] | minimum_scale_factor | Scaling factor minimum value in uniform distribution. |
[in] | maximum_scale_factor | Scaling factor maximum value in uniform distribution. |
Definition at line 978 of file RadiationModel.cpp.
|
static |
Self-test.
Definition at line 10 of file selfTest.cpp.
void RadiationModel::setCameraCalibration | ( | CameraCalibration * | CameraCalibration | ) |
Definition at line 376 of file RadiationCamera.cpp.
void RadiationModel::setCameraLookat | ( | const std::string & | camera_label, |
const helios::vec3 & | lookat | ||
) |
Set the position the radiation camera is pointed toward (used to calculate camera orientation)
[in] | camera_label | Label for the camera to be set. |
[in] | lookat | Cartesian coordinate of location camera is pointed toward. |
Definition at line 123 of file RadiationCamera.cpp.
void RadiationModel::setCameraOrientation | ( | const std::string & | camera_label, |
const helios::SphericalCoord & | direction | ||
) |
Set the orientation of the radiation camera based on a spherical coordinate.
[in] | camera_label | Label for the camera to be set. |
[in] | direction | Spherical coordinate defining the orientation of the camera. |
Definition at line 165 of file RadiationCamera.cpp.
void RadiationModel::setCameraOrientation | ( | const std::string & | camera_label, |
const helios::vec3 & | direction | ||
) |
Set the orientation of the radiation camera based on a Cartesian vector.
[in] | camera_label | Label for the camera to be set. |
[in] | direction | Cartesian vector defining the orientation of the camera. |
Definition at line 144 of file RadiationCamera.cpp.
void RadiationModel::setCameraPixelData | ( | const std::string & | camera_label, |
const std::string & | band_label, | ||
const std::vector< float > & | pixel_data | ||
) |
Set camera pixel data for a specific band.
Definition at line 5714 of file RadiationModel.cpp.
void RadiationModel::setCameraPosition | ( | const std::string & | camera_label, |
const helios::vec3 & | position | ||
) |
Set the position of the radiation camera.
[in] | camera_label | Label for the camera to be set. |
[in] | position | Cartesian coordinate of camera position. |
Definition at line 100 of file RadiationCamera.cpp.
void RadiationModel::setCameraSpectralResponse | ( | const std::string & | camera_label, |
const std::string & | band_label, | ||
const std::string & | global_data | ||
) |
Set the spectral response of a camera band based on reference to global data. This function version uses all the global data array to calculate the spectral response.
[in] | camera_label | Label for the camera to be set. |
[in] | band_label | Label for the radiation band. |
[in] | global_data | Label for global data containing camera spectral response data. This should be of type vec2 and contain wavelength-quantum efficiency pairs. |
Definition at line 64 of file RadiationCamera.cpp.
void RadiationModel::setCameraSpectralResponseFromLibrary | ( | const std::string & | camera_label, |
const std::string & | camera_library_name | ||
) |
Set the camera spectral response based on a camera available in the standard camera spectral library (radiation/spectral_data/camera_spectral_library.xml).
Consult the documentation for available cameras in the library, or examine the file radiation/spectral_data/camera_spectral_library.xml. The naming convention is that the response data for the band starts with the camera model (e.g., "iPhone11") followed by an underscore, then the band label. In order for the response to be applied to the camera, the bands must all exist. For example, for iPhone11, there must exist bands "red", "green", and "blue".
[in] | camera_label | Label for the camera to be set. |
[in] | camera_library_name | Name of the camera in the standard camera spectral library (e.g., "iPhone11", "NikonD700", etc.). |
Definition at line 76 of file RadiationCamera.cpp.
void RadiationModel::setDiffuseRadiationExtinctionCoeff | ( | const std::string & | label, |
float | K, | ||
const helios::SphericalCoord & | peak_dir | ||
) |
Extinction coefficient of diffuse ambient radiation.
The angular distribution of diffuse ambient radiation is computed according to N = Psi^-K, where Psi is the angle between the distribution peak (usually the sun direction) and the ambient direction, and K is the extinction coefficient. When K=0 the ambient distribution is uniform, which is the default setting
[in] | label | Label used to reference the radiative band |
[in] | K | Extinction coefficient value |
[in] | peak_dir | Spherical direction of the peak in diffuse radiation (this is usually the sun direction) |
Definition at line 110 of file RadiationModel.cpp.
void RadiationModel::setDiffuseRadiationExtinctionCoeff | ( | const std::string & | label, |
float | K, | ||
const helios::vec3 & | peak_dir | ||
) |
Extinction coefficient of diffuse ambient radiation.
The angular distribution of diffuse ambient radiation is computed according to N = Psi^-K, where Psi is the angle between the distribution peak (usually the sun direction) and the ambient direction, and K is the extinction coefficient. When K=0 the ambient distribution is uniform, which is the default setting
[in] | label | Label used to reference the radiative band |
[in] | K | Extinction coefficient value |
[in] | peak_dir | Unit vector pointing in the direction of the peak in diffuse radiation (this is usually the sun direction) |
Definition at line 114 of file RadiationModel.cpp.
void RadiationModel::setDiffuseRadiationFlux | ( | const std::string & | label, |
float | flux | ||
) |
Diffuse (ambient) radiation flux.
Diffuse component of radiation incident on a horizontal surface above all geometry in the domain.
[in] | label | Label used to reference the band |
[in] | flux | Radiative flux |
Definition at line 103 of file RadiationModel.cpp.
void RadiationModel::setDiffuseRayCount | ( | const std::string & | label, |
size_t | N | ||
) |
Sets variable diffuseRayCount, the number of rays to be used in diffuse (ambient) radiation model.
[in] | label | Label used to reference the band |
[in] | N | Number of rays |
Definition at line 96 of file RadiationModel.cpp.
void RadiationModel::setDiffuseSpectrum | ( | const std::string & | band_label, |
const std::string & | spectrum_label | ||
) |
Set the spectral distribution of diffuse ambient radiation FOR A SINGLE BAND based on global data of wavelength-intensity pairs.
[in] | band_label | Label used to reference the band |
[in] | spectrum_label | Label of global data containing spectral intensity data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity (.y). |
Definition at line 644 of file RadiationModel.cpp.
void RadiationModel::setDiffuseSpectrum | ( | const std::vector< std::string > & | band_labels, |
const std::string & | spectrum_label | ||
) |
Set the spectral distribution of diffuse ambient radiation FOR MULTIPLE BANDS based on global data of wavelength-intensity pairs.
[in] | band_labels | List of labels used to reference the bands |
[in] | spectrum_label | Label of global data containing spectral intensity data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity (.y). |
Definition at line 622 of file RadiationModel.cpp.
void RadiationModel::setDiffuseSpectrumIntegral | ( | const std::string & | band_label, |
float | spectrum_integral | ||
) |
Set the integral of the diffuse spectral flux distribution across all possible wavelengths (=∫Sdλ)
[in] | band_label | Label used to reference the band |
[in] | spectrum_integral | Integration of source spectral flux distribution across all possible wavelengths (=∫Sdλ) |
Definition at line 162 of file RadiationModel.cpp.
void RadiationModel::setDiffuseSpectrumIntegral | ( | const std::string & | band_label, |
float | spectrum_integral, | ||
float | wavelength_min, | ||
float | wavelength_max | ||
) |
Scale the source spectral flux distribution based on a prescribed integral between two wavelengths (=∫Sdλ)
[in] | band_label | Label used to reference the band |
[in] | spectrum_integral | Integration of source spectral flux distribution between two wavelengths (=∫Sdλ) |
[in] | wavelength_min | Lower bounding wavelength for wave band |
[in] | wavelength_max | Upper bounding wavelength for wave band |
Definition at line 182 of file RadiationModel.cpp.
void RadiationModel::setDiffuseSpectrumIntegral | ( | float | spectrum_integral | ) |
Set the integral of the diffuse spectral flux distribution across all possible wavelengths FOR ALL EXISTING BANDS (=∫Sdλ)
[in] | spectrum_integral | Integration of source spectral flux distribution across all possible wavelengths (=∫Sdλ) |
Definition at line 148 of file RadiationModel.cpp.
void RadiationModel::setDiffuseSpectrumIntegral | ( | float | spectrum_integral, |
float | wavelength_min, | ||
float | wavelength_max | ||
) |
Scale the source spectral flux distribution based on a prescribed integral between two wavelengths FOR ALL EXISTING BANDS (=∫Sdλ)
[in] | spectrum_integral | Integration of source spectral flux distribution between two wavelengths (=∫Sdλ) |
[in] | wavelength_min | Lower bounding wavelength for wave band |
[in] | wavelength_max | Upper bounding wavelength for wave band |
Definition at line 155 of file RadiationModel.cpp.
void RadiationModel::setDirectRayCount | ( | const std::string & | label, |
size_t | N | ||
) |
Sets variable directRayCount, the number of rays to be used in direct radiation model.
[in] | label | Label used to reference the band |
[in] | N | Number of rays |
Definition at line 89 of file RadiationModel.cpp.
void RadiationModel::setMinScatterEnergy | ( | const std::string & | label, |
uint | energy | ||
) |
Set the energy threshold used to terminate scattering iterations. Scattering iterations are terminated when the maximum to-be-scattered energy among all primitives is less than "energy".
[in] | label | Label used to reference the band |
[in] | energy | Energy threshold |
Definition at line 1111 of file RadiationModel.cpp.
void RadiationModel::setPadValue | ( | const std::string & | cameralabel, |
const std::vector< std::string > & | bandlabels, | ||
const std::vector< float > & | padvalues | ||
) |
Set padding value for pixels do not have valid values.
[in] | cameralabel | Label of target camera |
[in] | bandlabels | Vector of labels of radiation bands to be used for simulation |
[in] | padvalues | Vector of padding values for each band |
Definition at line 1966 of file RadiationCamera.cpp.
void RadiationModel::setScatteringDepth | ( | const std::string & | label, |
uint | depth | ||
) |
Set the number of scattering iterations for a certain band.
[in] | label | Label used to reference the band |
[in] | depth | Number of scattering iterations (depth=0 turns scattering off) |
Definition at line 1103 of file RadiationModel.cpp.
void RadiationModel::setSourceFlux | ( | const std::vector< uint > & | source_ID, |
const std::string & | band_label, | ||
float | flux | ||
) |
Set the flux of multiple radiation sources for this band.
[in] | source_ID | Vector of radiation source identifiers |
[in] | band_label | Label used to reference the band |
[in] | flux | Radiative flux normal to the direction of radiation propagation |
Definition at line 538 of file RadiationModel.cpp.
void RadiationModel::setSourceFlux | ( | uint | source_ID, |
const std::string & | band_label, | ||
float | flux | ||
) |
Set the flux of radiation source for this band.
[in] | source_ID | Identifier of radiation source |
[in] | band_label | Label used to reference the band |
[in] | flux | Radiative flux normal to the direction of radiation propagation |
Definition at line 522 of file RadiationModel.cpp.
void RadiationModel::setSourcePosition | ( | uint | source_ID, |
const helios::SphericalCoord & | position | ||
) |
Set the position/direction of radiation source based on a spherical vector.
[in] | source_ID | Identifier of radiation source |
[in] | position | If point source - (radius,elevation,azimuth) position of the radiation source. If collimated source - (elevation,azimuth) vector pointing toward the source (radius is ignored). |
Definition at line 1092 of file RadiationModel.cpp.
void RadiationModel::setSourcePosition | ( | uint | source_ID, |
const helios::vec3 & | position | ||
) |
Set the position/direction of radiation source based on a Cartesian vector.
[in] | source_ID | Identifier of radiation source |
[in] | position | If point source - (x,y,z) position of the radiation source. If collimated source - (nx,ny,nz) unit vector pointing toward the source. |
Definition at line 1073 of file RadiationModel.cpp.
void RadiationModel::setSourceSpectrum | ( | const std::vector< uint > & | source_ID, |
const std::string & | spectrum_label | ||
) |
Set the spectral distribution of multiple radiation sources based on global data of wavelength-intensity pairs.
[in] | source_ID | Vector of radiation source identifiers. |
[in] | spectrum_label | Label of global data containing spectral intensity data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity (.y). |
Definition at line 616 of file RadiationModel.cpp.
void RadiationModel::setSourceSpectrum | ( | const std::vector< uint > & | source_ID, |
const std::vector< helios::vec2 > & | spectrum | ||
) |
Set the spectral distribution of multiple radiation sources according to a vector of wavelength-intensity pairs.
[in] | source_ID | Vector of radiation source identifiers. |
[in] | spectrum | Vector containing spectral intensity data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity (.y). |
Definition at line 596 of file RadiationModel.cpp.
void RadiationModel::setSourceSpectrum | ( | uint | source_ID, |
const std::string & | spectrum_label | ||
) |
Set the spectral distribution of a radiation source based on global data of wavelength-intensity pairs.
[in] | source_ID | Identifier of radiation source. |
[in] | spectrum_label | Label of global data containing spectral intensity data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity (.y). |
Definition at line 602 of file RadiationModel.cpp.
void RadiationModel::setSourceSpectrum | ( | uint | source_ID, |
const std::vector< helios::vec2 > & | spectrum | ||
) |
Set the spectral distribution of a radiation source according to a vector of wavelength-intensity pairs.
[in] | source_ID | Identifier of radiation source. |
[in] | spectrum | Vector containing spectral intensity data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity (.y). |
Definition at line 569 of file RadiationModel.cpp.
void RadiationModel::setSourceSpectrumIntegral | ( | uint | source_ID, |
float | source_integral | ||
) |
Set the integral of the source spectral flux distribution across all possible wavelengths (=∫Sdλ)
[in] | source_ID | ID of source |
[in] | source_integral | Integration of source spectral flux distribution across all possible wavelengths (=∫Sdλ) |
Definition at line 487 of file RadiationModel.cpp.
void RadiationModel::setSourceSpectrumIntegral | ( | uint | source_ID, |
float | source_integral, | ||
float | wavelength_min, | ||
float | wavelength_max | ||
) |
Scale the source spectral flux distribution based on a prescribed integral between two wavelengths (=∫Sdλ)
[in] | source_ID | ID of source |
[in] | source_integral | Integration of source spectral flux distribution between two wavelengths (=∫Sdλ) |
[in] | wavelength_min | Lower bounding wavelength for wave band |
[in] | wavelength_max | Upper bounding wavelength for wave band |
Definition at line 502 of file RadiationModel.cpp.
void RadiationModel::updateCameraResponse | ( | const std::string & | orginalcameralabel, |
const std::vector< std::string > & | sourcelabels_raw, | ||
const std::vector< std::string > & | cameraresponselabels, | ||
helios::vec2 & | wavelengthrange, | ||
const std::vector< std::vector< float > > & | truevalues, | ||
const std::string & | calibratedmark | ||
) |
Update the camera response for a given camera based on color board.
[in] | orginalcameralabel | Label of camera to be used for simulation |
[in] | sourcelabels_raw | Vector of labels of source spectra to be used for simulation |
[in] | cameraresponselabels | Vector of labels of camera spectral responses |
[in] | wavelengthrange | Wavelength range of the camera |
[in] | truevalues | True image values of the color board |
[in] | calibratedmark | Mark of the calibrated camera |
Definition at line 381 of file RadiationCamera.cpp.
void RadiationModel::updateGeometry | ( | ) |
Adds all geometric primitives from the Context to OptiX.
This function should be called anytime Context geometry is created or modified
Definition at line 1651 of file RadiationModel.cpp.
void RadiationModel::updateGeometry | ( | const std::vector< uint > & | UUIDs | ) |
Adds certain geometric primitives from the Context to OptiX as specified by a list of UUIDs.
This function should be called anytime Context geometry is created or modified
[in] | UUIDs | Vector of universal unique identifiers of Context primitives to be updated |
Definition at line 1655 of file RadiationModel.cpp.
void RadiationModel::whiteBalanceAuto | ( | const std::string & | cameralabel, |
const std::string & | red_band_label, | ||
const std::string & | green_band_label, | ||
const std::string & | blue_band_label | ||
) |
Apply auto white balancing algorithm selection based on scene analysis.
[in] | cameralabel | Label of camera to apply white balance to |
[in] | red_band_label | Label of the red band |
[in] | green_band_label | Label of the green band |
[in] | blue_band_label | Label of the blue band |
void RadiationModel::whiteBalanceGrayWorld | ( | const std::string & | cameralabel, |
const std::string & | red_band_label, | ||
const std::string & | green_band_label, | ||
const std::string & | blue_band_label, | ||
float | p = 6.0f |
||
) |
Apply Gray World white balancing algorithm with custom Minkowski p-parameter.
[in] | cameralabel | Label of camera to apply white balance to |
[in] | red_band_label | Label of the red band |
[in] | green_band_label | Label of the green band |
[in] | blue_band_label | Label of the blue band |
[in] | p | Minkowski p-parameter (default is 6.0) |
void RadiationModel::whiteBalanceWhitePatch | ( | const std::string & | cameralabel, |
const std::string & | red_band_label, | ||
const std::string & | green_band_label, | ||
const std::string & | blue_band_label, | ||
float | percentile = 0.99f |
||
) |
Apply White Patch white balancing algorithm.
[in] | cameralabel | Label of camera to apply white balance to |
[in] | red_band_label | Label of the red band |
[in] | green_band_label | Label of the green band |
[in] | blue_band_label | Label of the blue band |
[in] | percentile | Percentile value for white patch selection (default is 0.99) |
std::string RadiationModel::writeCameraImage | ( | const std::string & | camera, |
const std::vector< std::string > & | bands, | ||
const std::string & | imagefile_base, | ||
const std::string & | image_path = "./" , |
||
int | frame = -1 , |
||
float | flux_to_pixel_conversion = 1.f |
||
) |
Write camera data for one or more bands to a JPEG image.
[in] | camera | Label for camera to be queried |
[in] | bands | Vector of labels for radiative bands to be written |
[in] | imagefile_base | Name for base of output image JPEG files (will also include the camera label and a frame number in the file name) |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
[in] | frame | [optional] A frame count number to be appended to the output image file (e.g., camera_thermal_00001.jpeg). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999. |
[in] | flux_to_pixel_conversion | [optional] A factor to convert radiative flux to 8-bit pixel values (0-255). By default, this value is 1.0, which means that the pixel values will be equal to the radiative flux. If the radiative flux is very large or very small, it may be necessary to scale the flux to a more appropriate range for the image. |
Definition at line 187 of file RadiationCamera.cpp.
void RadiationModel::writeCameraImageData | ( | const std::string & | camera, |
const std::string & | band, | ||
const std::string & | imagefile_base, | ||
const std::string & | image_path = "./" , |
||
int | frame = -1 |
||
) |
Write camera data for one band to an ASCII text file.
[in] | camera | Label for camera to be queried |
[in] | band | Label for radiative band to be written |
[in] | imagefile_base | Name for base of output image JPEG files (will also include the camera label and a frame number in the file name) |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
[in] | frame | [optional] A frame count number to be appended to the output image file (e.g., camera_thermal_00001.jpeg). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999. |
Definition at line 311 of file RadiationCamera.cpp.
void RadiationModel::writeDepthImageData | ( | const std::string & | cameralabel, |
const std::string & | imagefile_base, | ||
const std::string & | image_path = "./" , |
||
int | frame = -1 |
||
) |
Write depth image data to text file.
[in] | cameralabel | Label of target camera |
[in] | imagefile_base | Name for base of output image JPEG files (will also include the camera label and a frame number in the file name) |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
[in] | frame | [optional] A frame count number to be appended to the output image file (e.g., camera_depth_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999. |
Definition at line 779 of file RadiationCamera.cpp.
void RadiationModel::writeImageBoundingBoxes | ( | const std::string & | cameralabel, |
const std::string & | primitive_data_label, | ||
const uint & | object_class_ID, | ||
const std::string & | image_file, | ||
const std::string & | classes_txt_file = "classes.txt" , |
||
const std::string & | image_path = "./" |
||
) |
Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'.
[in] | cameralabel | Label of target camera |
[in] | primitive_data_label | Name of the primitive data label. Primitive data must have type of 'uint' or 'int'. |
[in] | object_class_ID | Object class ID to write for the labels in this group. |
[in] | image_file | Name for base of output files (will also include the camera label and a frame number in the file name) |
[in] | classes_txt_file | [optional] Name of text file to write class names. By default, it is "classes.txt". |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
Definition at line 1121 of file RadiationCamera.cpp.
void RadiationModel::writeImageBoundingBoxes | ( | const std::string & | cameralabel, |
const std::vector< std::string > & | primitive_data_label, | ||
const std::vector< uint > & | object_class_ID, | ||
const std::string & | image_file, | ||
const std::string & | classes_txt_file = "classes.txt" , |
||
const std::string & | image_path = "./" |
||
) |
Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'.
[in] | cameralabel | Label of target camera |
[in] | primitive_data_label | Name of the primitive data label. Primitive data must have type of 'uint' or 'int'. |
[in] | object_class_ID | Object class ID to write for the labels in this group. |
[in] | image_file | Name for base of output files (will also include the camera label and a frame number in the file name) |
[in] | classes_txt_file | [optional] Name of text file to write class names. By default, it is "classes.txt". |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
Definition at line 1125 of file RadiationCamera.cpp.
void RadiationModel::writeImageBoundingBoxes_ObjectData | ( | const std::string & | cameralabel, |
const std::string & | object_data_label, | ||
const uint & | object_class_ID, | ||
const std::string & | image_file, | ||
const std::string & | classes_txt_file = "classes.txt" , |
||
const std::string & | image_path = "./" |
||
) |
Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'.
[in] | cameralabel | Label of target camera |
[in] | object_data_label | Name of the object data label. Object data must have type of 'uint' or 'int'. |
[in] | object_class_ID | Object class ID to write for the labels in this group. |
[in] | image_file | Name for base of output files (will also include the camera label and a frame number in the file name) |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
[in] | classes_txt_file | [optional] Name of text file to write class names. By default, it is "classes.txt". |
Definition at line 1241 of file RadiationCamera.cpp.
void RadiationModel::writeImageBoundingBoxes_ObjectData | ( | const std::string & | cameralabel, |
const std::vector< std::string > & | object_data_label, | ||
const std::vector< uint > & | object_class_ID, | ||
const std::string & | image_file, | ||
const std::string & | classes_txt_file = "classes.txt" , |
||
const std::string & | image_path = "./" |
||
) |
Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'.
[in] | cameralabel | Label of target camera |
[in] | object_data_label | Name of the object data label. Object data must have type of 'uint' or 'int'. |
[in] | object_class_ID | Object class ID to write for the labels in this group. |
[in] | image_file | Name for base of output files (will also include the camera label and a frame number in the file name) |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
[in] | classes_txt_file | [optional] Name of text file to write class names. By default, it is "classes.txt". |
Definition at line 1246 of file RadiationCamera.cpp.
void RadiationModel::writeImageSegmentationMasks | ( | const std::string & | cameralabel, |
const std::string & | primitive_data_label, | ||
const uint & | object_class_ID, | ||
const std::string & | json_filename, | ||
const std::string & | image_file, | ||
bool | append_file = false |
||
) |
Write segmentation masks for primitive data in COCO JSON format. Primitive data must have type of 'uint' or 'int'.
[in] | cameralabel | Label of target camera |
[in] | primitive_data_label | Name of the primitive data label. Object data must have type of 'uint' or 'int'. |
[in] | object_class_ID | Object class ID to write for the labels in this group. |
[in] | json_filename | Name of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added. |
[in] | image_file | Name of the image file corresponding to these labels |
[in] | append_file | [optional] If true, the data will be appended to the existing COCO JSON file. If false, a new file will be created. By default, it is false. |
Definition at line 1778 of file RadiationCamera.cpp.
void RadiationModel::writeImageSegmentationMasks | ( | const std::string & | cameralabel, |
const std::vector< std::string > & | primitive_data_label, | ||
const std::vector< uint > & | object_class_ID, | ||
const std::string & | json_filename, | ||
const std::string & | image_file, | ||
bool | append_file = false |
||
) |
Write segmentation masks for primitive data in COCO JSON format. Primitive data must have type of 'uint' or 'int'.
[in] | cameralabel | Label of target camera |
[in] | primitive_data_label | Name of the primitive data label. Object data must have type of 'uint' or 'int'. |
[in] | object_class_ID | Object class ID to write for the labels in this group. |
[in] | json_filename | Name of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added. |
[in] | image_file | Name of the image file corresponding to these labels |
[in] | append_file | [optional] If true, the data will be appended to the existing COCO JSON file. If false, a new file will be created. By default, it is false. |
Definition at line 1782 of file RadiationCamera.cpp.
void RadiationModel::writeImageSegmentationMasks_ObjectData | ( | const std::string & | cameralabel, |
const std::string & | object_data_label, | ||
const uint & | object_class_ID, | ||
const std::string & | json_filename, | ||
const std::string & | image_file, | ||
bool | append_file = false |
||
) |
Write segmentation masks for object data in COCO JSON format. Object data must have type of 'uint' or 'int'.
[in] | cameralabel | Label of target camera |
[in] | object_data_label | Name of the object data label. Object data must have type of 'uint' or 'int'. |
[in] | object_class_ID | Object class ID to write for the labels in this group. |
[in] | json_filename | Name of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added. |
[in] | image_file | Name of the image file corresponding to these labels |
[in] | append_file | [optional] If true, the data will be appended to the existing COCO JSON file. If false, a new file will be created. By default, it is false. |
Definition at line 1872 of file RadiationCamera.cpp.
void RadiationModel::writeImageSegmentationMasks_ObjectData | ( | const std::string & | cameralabel, |
const std::vector< std::string > & | object_data_label, | ||
const std::vector< uint > & | object_class_ID, | ||
const std::string & | json_filename, | ||
const std::string & | image_file, | ||
bool | append_file = false |
||
) |
Write segmentation masks for object data in COCO JSON format. Object data must have type of 'uint' or 'int'.
[in] | cameralabel | Label of target camera |
[in] | object_data_label | Name of the object data label. Object data must have type of 'uint' or 'int'. |
[in] | object_class_ID | Object class ID to write for the labels in this group. |
[in] | json_filename | Name of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added. |
[in] | image_file | Name of the image file corresponding to these labels |
[in] | append_file | [optional] If true, the data will be appended to the existing COCO JSON file. If false, a new file will be created. By default, it is false. |
Definition at line 1876 of file RadiationCamera.cpp.
std::string RadiationModel::writeNormCameraImage | ( | const std::string & | camera, |
const std::vector< std::string > & | bands, | ||
const std::string & | imagefile_base, | ||
const std::string & | image_path = "./" , |
||
int | frame = -1 |
||
) |
Write normalized camera data (maximum value is 1) for one or more bands to a JPEG image.
[in] | camera | Label for camera to be queried |
[in] | bands | Vector of labels for radiative bands to be written |
[in] | imagefile_base | Name for base of output image JPEG files (will also include the camera label and a frame number in the file name) |
[in] | image_path | Path to directory where images should be saved |
[in] | frame | [optional] A frame count number to be appended to the output image file (e.g., camera_thermal_00001.jpeg). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999. |
Definition at line 277 of file RadiationCamera.cpp.
void RadiationModel::writeNormDepthImage | ( | const std::string & | cameralabel, |
const std::string & | imagefile_base, | ||
float | max_depth, | ||
const std::string & | image_path = "./" , |
||
int | frame = -1 |
||
) |
Write depth image file, with grayscale normalized to the minimum and maximum depth values.
[in] | cameralabel | Label of target camera |
[in] | imagefile_base | Name for base of output image JPEG files (will also include the camera label and a frame number in the file name) |
[in] | max_depth | Maximum depth value for normalization (e.g., the depth of the sky) |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
[in] | frame | [optional] A frame count number to be appended to the output image file (e.g., camera_depth_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999. |
Definition at line 834 of file RadiationCamera.cpp.
void RadiationModel::writeObjectDataLabelMap | ( | const std::string & | cameralabel, |
const std::string & | object_data_label, | ||
const std::string & | imagefile_base, | ||
const std::string & | image_path = "./" , |
||
int | frame = -1 , |
||
float | padvalue = NAN |
||
) |
Write image pixel labels to text file based on object data. Object data must have type 'float', 'double', 'uint', or 'int'.
[in] | cameralabel | Label of target camera |
[in] | object_data_label | Name of the object data label |
[in] | imagefile_base | Name for base of output image JPEG files (will also include the camera label and a frame number in the file name) |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
[in] | frame | [optional] A frame count number to be appended to the output file (e.g., camera_thermal_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999. |
[in] | padvalue | Pad value for the empty pixels |
Definition at line 687 of file RadiationCamera.cpp.
void RadiationModel::writePrimitiveDataLabelMap | ( | const std::string & | cameralabel, |
const std::string & | primitive_data_label, | ||
const std::string & | imagefile_base, | ||
const std::string & | image_path = "./" , |
||
int | frame = -1 , |
||
float | padvalue = NAN |
||
) |
Write image pixel labels to text file based on primitive data. Primitive data must have type 'float', 'double', 'uint', or 'int'.
[in] | cameralabel | Label of target camera |
[in] | primitive_data_label | Name of the primitive data label |
[in] | imagefile_base | Name for base of output image JPEG files (will also include the camera label and a frame number in the file name) |
[in] | image_path | [optional] Path to directory where images should be saved. By default, it will be placed in the current working directory. |
[in] | frame | [optional] A frame count number to be appended to the output file (e.g., camera_thermal_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999. |
[in] | padvalue | Pad value for the empty pixels |
Definition at line 600 of file RadiationCamera.cpp.