1.3.49
 
Loading...
Searching...
No Matches
RadiationModel Class Reference

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.
 

Detailed Description

Radiation transport model plugin.

Definition at line 427 of file RadiationModel.h.

Member Enumeration Documentation

◆ ColorCorrectionAlgorithm

Color correction algorithm types for auto-calibration.

Enumerator
DIAGONAL_ONLY 

Simple diagonal scaling (white balance only)

MATRIX_3X3_AUTO 

3x3 matrix with automatic fallback to diagonal if unstable

MATRIX_3X3_FORCE 

Force 3x3 matrix calculation even if potentially unstable.

Definition at line 1396 of file RadiationModel.h.

Constructor & Destructor Documentation

◆ RadiationModel()

RadiationModel::RadiationModel ( helios::Context context)
explicit

Default constructor.

Definition at line 26 of file RadiationModel.cpp.

◆ ~RadiationModel()

RadiationModel::~RadiationModel ( )

Destructor.

Definition at line 68 of file RadiationModel.cpp.

Member Function Documentation

◆ addCollimatedRadiationSource() [1/3]

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)

Returns
Source identifier

Definition at line 300 of file RadiationModel.cpp.

◆ addCollimatedRadiationSource() [2/3]

uint RadiationModel::addCollimatedRadiationSource ( const helios::SphericalCoord direction)

Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays)

Parameters
[in]directionSpherical coordinate pointing toward the radiation source
Returns
Source identifier

Definition at line 305 of file RadiationModel.cpp.

◆ addCollimatedRadiationSource() [3/3]

uint RadiationModel::addCollimatedRadiationSource ( const helios::vec3 direction)

Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays)

Parameters
[in]directionunit vector pointing toward the radiation source
Returns
Source identifier

Definition at line 309 of file RadiationModel.cpp.

◆ addDiskRadiationSource()

uint RadiationModel::addDiskRadiationSource ( const helios::vec3 position,
float  radius,
const helios::vec3 rotation 
)

Add planar circular radiation source.

Parameters
[in]position(x,y,z) position of the center of the disk radiation source
[in]radiusRadius of disk source
[in]rotationRotation of the source in radians about the x- y- and z- axes (the sign of the rotation angle follows right-hand rule)
Returns
Source identifier

Definition at line 445 of file RadiationModel.cpp.

◆ addRadiationBand() [1/2]

void RadiationModel::addRadiationBand ( const std::string &  label)

Add a spectral radiation band to the model.

Parameters
[in]labelLabel used to reference the band

Definition at line 199 of file RadiationModel.cpp.

◆ addRadiationBand() [2/2]

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.

Parameters
[in]labelLabel used to reference the band
[in]wavelength_minLower bounding wavelength for wave band
[in]wavelength_maxUpper bounding wavelength for wave band

Definition at line 218 of file RadiationModel.cpp.

◆ addRadiationCamera() [1/2]

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.

Parameters
[in]camera_labelA label that will be used to refer to the camera (e.g., "thermal", "multispectral", "NIR", etc.).
[in]band_labelLabels for radiation bands to include in camera.
[in]positionCartesian (x,y,z) location of the camera sensor.
[in]viewing_directionSpherical direction in which the camera is pointed.
[in]camera_properties'CameraProperties' struct containing intrinsic camera parameters.
[in]antialiasing_samplesNumber 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.

◆ addRadiationCamera() [2/2]

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.

Parameters
[in]camera_labelA label that will be used to refer to the camera (e.g., "thermal", "multispectral", "NIR", etc.).
[in]band_labelLabels for radiation bands to include in camera.
[in]positionCartesian (x,y,z) location of the camera sensor.
[in]lookatCartesian (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_samplesNumber 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.

◆ addRectangleRadiationSource()

uint RadiationModel::addRectangleRadiationSource ( const helios::vec3 position,
const helios::vec2 size,
const helios::vec3 rotation 
)

Add planar rectangular radiation source.

Parameters
[in]position(x,y,z) position of the center of the rectangular radiation source
[in]sizeLength (.x) and width (.y) of rectangular source
[in]rotationRotation of the source in radians about the x- y- and z- axes (the sign of the rotation angle follows right-hand rule)
Returns
Source identifier

Definition at line 414 of file RadiationModel.cpp.

◆ addSphereRadiationSource()

uint RadiationModel::addSphereRadiationSource ( const helios::vec3 position,
float  radius 
)

Add an external source of radiation that emits from the surface of a sphere.

Parameters
[in]position(x,y,z) position of the center of the sphere radiation source
[in]radiusRadius of the sphere radiation source
Returns
Source identifier

Definition at line 344 of file RadiationModel.cpp.

◆ addSunSphereRadiationSource() [1/3]

uint RadiationModel::addSunSphereRadiationSource ( )

Add a sphere radiation source that models the sun assuming the default direction of (0,0,1)

Returns
Source identifier

Definition at line 375 of file RadiationModel.cpp.

◆ addSunSphereRadiationSource() [2/3]

uint RadiationModel::addSunSphereRadiationSource ( const helios::SphericalCoord sun_direction)

Add a sphere radiation source that models the sun.

Parameters
[in]sun_directionSpherical coordinate pointing towards the sun
Returns
Source identifier

Definition at line 379 of file RadiationModel.cpp.

◆ addSunSphereRadiationSource() [3/3]

uint RadiationModel::addSunSphereRadiationSource ( const helios::vec3 sun_direction)

Add a sphere radiation source that models the sun.

Parameters
[in]sun_directionUnit vector pointing towards the sun
Returns
Source identifier

Definition at line 383 of file RadiationModel.cpp.

◆ applyCameraColorCorrectionMatrix()

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.

Parameters
[in]camera_labelLabel of the camera to apply color correction to
[in]red_band_labelLabel for red channel band data
[in]green_band_labelLabel for green channel band data
[in]blue_band_labelLabel for blue channel band data
[in]ccm_file_pathPath to XML file containing color correction matrix

Definition at line 5626 of file RadiationModel.cpp.

◆ applyImageProcessingPipeline()

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.

Parameters
[in]cameralabelLabel of camera to be used for processing
[in]red_band_labelLabel of the red band
[in]green_band_labelLabel of the green band
[in]blue_band_labelLabel 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.

◆ autoCalibrateCameraImage()

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.

Parameters
[in]camera_labelLabel of the camera that generated the image
[in]red_band_labelLabel for red channel band data
[in]green_band_labelLabel for green channel band data
[in]blue_band_labelLabel for blue channel band data
[in]output_file_pathPath where corrected image will be written
[in]print_quality_reportIf true, prints calibration quality metrics to console
[in]algorithmColor correction algorithm to use (defaults to 3x3 matrix with auto-fallback)
[in]ccm_export_file_pathOptional path to export the computed color correction matrix to XML file
Returns
Path to the written corrected image file

Definition at line 4963 of file RadiationModel.cpp.

◆ blendSpectra()

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.

Parameters
[in]new_spectrum_labelLabel for new spectrum global data, which is created by blending the input spectra.
[in]spectrum_labelsVector of global data labels for spectra to be blended.
[in]weightsVector of weights for each spectrum to be blended. The weights must sum to 1.0.
Note
The input spectra can have different sizes, but must have matching wavelength values across all spectra. The output spectra will be the size of the overlapping portion of wavelengths.

Definition at line 984 of file RadiationModel.cpp.

◆ blendSpectraRandomly()

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.

Parameters
[in]new_spectrum_labelLabel for new spectrum global data, which is created by blending the input spectra.
[in]spectrum_labelsVector of global data labels for spectra to be blended.
Note
The input spectra can have different sizes, but must have matching wavelength values across all spectra. The output spectra will be the size of the overlapping portion of wavelengths.

Definition at line 1058 of file RadiationModel.cpp.

◆ calculateGtheta()

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.

Parameters
[in]contextPointer to Helios context
[in]view_directionViewing direction for projected area
Returns
Projected area fraction G(theta)

Definition at line 4787 of file RadiationModel.cpp.

◆ calibrateCamera() [1/2]

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.

Parameters
[in]orginalcameralabelLabel of camera to be used for simulation
[in]sourcelabelsLabels of source fluxes
[in]cameraresponselabelsLabels of camera spectral responses
[in]bandlabelsLabels of radiation bands
[in]scalefactorScale factor for calibrated camera spectral response
[in]truevaluesTrue image values of the color board
[in]calibratedmarkMark of the calibrated camera spectral response

Definition at line 1988 of file RadiationCamera.cpp.

◆ calibrateCamera() [2/2]

void RadiationModel::calibrateCamera ( const std::string &  originalcameralabel,
const float  scalefactor,
const std::vector< std::vector< float > > &  truevalues,
const std::string &  calibratedmark 
)

Calibrate camera.

Parameters
[in]originalcameralabelLabel of camera to be used for simulation
[in]scalefactorScale factor for calibrated camera spectral response
[in]truevaluesTrue image values of the color board
[in]calibratedmarkMark of the calibrated camera spectral response

Definition at line 2025 of file RadiationCamera.cpp.

◆ copyRadiationBand() [1/2]

void RadiationModel::copyRadiationBand ( const std::string &  old_label,
const std::string &  new_label 
)

Copy a spectral radiation band based on a previously created band.

Parameters
[in]old_labelLabel of old radiation band to be copied
[in]new_labelLabel of new radiation band to be created

Definition at line 243 of file RadiationModel.cpp.

◆ copyRadiationBand() [2/2]

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.

Parameters
[in]old_labelLabel of old radiation band to be copied
[in]new_labelLabel of new radiation band to be created
[in]wavelength_minLower bounding wavelength for wave band
[in]wavelength_maxUpper bounding wavelength for wave band

Definition at line 254 of file RadiationModel.cpp.

◆ deleteRadiationSource()

void RadiationModel::deleteRadiationSource ( uint  sourceID)

Delete an existing radiation source (any type)

Parameters
[in]sourceIDIdentifier of radiation source

Definition at line 476 of file RadiationModel.cpp.

◆ DEPRECATED() [1/2]

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'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label. Primitive data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]imagefile_baseName 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.

◆ DEPRECATED() [2/2]

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'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]imagefile_baseName 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.

◆ disableCameraModelVisualization()

void RadiationModel::disableCameraModelVisualization ( )

Remove the 3D model of the camera from the Context.

Definition at line 696 of file RadiationModel.cpp.

◆ disableEmission()

void RadiationModel::disableEmission ( const std::string &  label)

Disable emission calculations for all primitives in this band.

Parameters
[in]labelLabel used to reference the band

Definition at line 282 of file RadiationModel.cpp.

◆ disableLightModelVisualization()

void RadiationModel::disableLightModelVisualization ( )

Remove the 3D model of the light source from the Context.

Definition at line 680 of file RadiationModel.cpp.

◆ disableMessages()

void RadiationModel::disableMessages ( )

Disable/silence status messages.

Note
Error messages are still displayed.

Definition at line 72 of file RadiationModel.cpp.

◆ doesBandExist()

bool RadiationModel::doesBandExist ( const std::string &  label) const

Check if a radiation band exists based on its label.

Parameters
[in]labelLabel used to reference the band

Definition at line 274 of file RadiationModel.cpp.

◆ enableCameraModelVisualization()

void RadiationModel::enableCameraModelVisualization ( )

Add a 3D model of the camera to the Context for visualization purposes.

Definition at line 687 of file RadiationModel.cpp.

◆ enableEmission()

void RadiationModel::enableEmission ( const std::string &  label)

Enable emission calculations for all primitives in this band.

Parameters
[in]labelLabel used to reference the band

Definition at line 291 of file RadiationModel.cpp.

◆ enableLightModelVisualization()

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.

◆ enableMessages()

void RadiationModel::enableMessages ( )

Enable status messages.

Definition at line 76 of file RadiationModel.cpp.

◆ enforcePeriodicBoundary()

void RadiationModel::enforcePeriodicBoundary ( const std::string &  boundary)

Use a periodic boundary condition in one or more lateral directions.

Parameters
[in]boundaryLateral 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).
Note
This method should be called prior to calling RadiationModel::updateGeometry(), otherwise the boundary condition will not be enforced.

Definition at line 1119 of file RadiationModel.cpp.

◆ exportColorCorrectionMatrixXML()

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.

◆ getAllCameraLabels()

std::vector< std::string > RadiationModel::getAllCameraLabels ( )

Get the labels for all radiation cameras that have been added to the radiation model.

Returns
Vector of strings corresponding to each camera label.

Definition at line 177 of file RadiationCamera.cpp.

◆ getCameraLookat()

helios::vec3 RadiationModel::getCameraLookat ( const std::string &  camera_label) const

Get the position the radiation camera is pointed toward (used to calculate camera orientation)

Parameters
[in]camera_labelLabel for the camera to be set.
Returns
Cartesian coordinate of location camera is pointed toward.

Definition at line 135 of file RadiationCamera.cpp.

◆ getCameraOrientation()

helios::SphericalCoord RadiationModel::getCameraOrientation ( const std::string &  camera_label) const

Get the orientation of the radiation camera based on a spherical coordinate.

Parameters
[in]camera_labelLabel for the camera to be set.
Returns
Spherical coordinate defining the orientation of the camera.

Definition at line 156 of file RadiationCamera.cpp.

◆ getCameraPixelData()

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.

◆ getCameraPosition()

helios::vec3 RadiationModel::getCameraPosition ( const std::string &  camera_label) const

Get the position of the radiation camera.

Parameters
[in]camera_labelLabel for the camera to be set.
Returns
Cartesian coordinate of camera position.

Definition at line 114 of file RadiationCamera.cpp.

◆ getCameraResponseScale()

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.

Parameters
[in]orginalcameralabelLabel of camera to be used for simulation
[in]cameraresponselabelsVector of labels of camera spectral responses
[in]bandlabelsVector of labels of radiation bands to be used for simulation
[in]sourcelabelsVector of labels of source spectra to be used for simulation
[in]wavelengthrangeWavelength range of the camera
[in]truevaluesTrue image values of the color board
Returns
scale factor

Definition at line 578 of file RadiationCamera.cpp.

◆ getDiffuseFlux()

float RadiationModel::getDiffuseFlux ( const std::string &  band_label) const

Get the diffuse flux for a given band.

Parameters
[in]band_labelLabel used to reference the band
Returns
Diffuse flux for the band

Definition at line 649 of file RadiationModel.cpp.

◆ getSkyEnergy()

float RadiationModel::getSkyEnergy ( )

Get the radiative energy lost to the sky (surroundings)

Definition at line 3711 of file RadiationModel.cpp.

◆ getSourceFlux()

float RadiationModel::getSourceFlux ( uint  source_ID,
const std::string &  band_label 
) const

Get the flux of radiation source for this band.

Parameters
[in]source_IDIdentifier of radiation source
[in]band_labelLabel used to reference the band
Returns
Radiative flux normal to the direction of radiation propagation

Definition at line 544 of file RadiationModel.cpp.

◆ getSourcePosition()

helios::vec3 RadiationModel::getSourcePosition ( uint  source_ID) const

Get the position/direction of radiation source.

Parameters
[in]source_IDIdentifier of radiation source
Returns
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 1096 of file RadiationModel.cpp.

◆ getTotalAbsorbedFlux()

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.

◆ integrateSourceSpectrum()

float RadiationModel::integrateSourceSpectrum ( uint  source_ID,
float  wavelength_min,
float  wavelength_max 
) const

Integrate a source spectral distribution between two wavelength bounds.

Parameters
[in]source_IDIdentifier of a radiation source.
[in]wavelength_minWavelength for lower bounds of integration
[in]wavelength_maxWavelength for upper bounds of integration
Returns
Integral of spectral data from wavelength_min to wavelength_max

Definition at line 945 of file RadiationModel.cpp.

◆ integrateSpectrum() [1/5]

float RadiationModel::integrateSpectrum ( const std::vector< helios::vec2 > &  object_spectrum) const

Integrate a spectral distribution across all wavelengths.

Parameters
[in]object_spectrumVector containing spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
Returns
Integral of spectral data from minimum to maximum wavelength

Definition at line 866 of file RadiationModel.cpp.

◆ integrateSpectrum() [2/5]

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.

Parameters
[in]object_spectrumVector containing surface spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
[in]camera_spectrumVector containing camera spectral response data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
Returns
Integral of product of a radiation source spectral distribution, surface spectral data, and camera spectral response across all wavelengths

Definition at line 912 of file RadiationModel.cpp.

◆ integrateSpectrum() [3/5]

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.

Parameters
[in]object_spectrumVector containing spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
[in]wavelength_minWavelength for lower bounds of integration
[in]wavelength_maxWavelength for upper bounds of integration
Returns
Integral of spectral data from wavelength_min to wavelength_max

◆ integrateSpectrum() [4/5]

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.

Parameters
[in]source_IDIdentifier of a radiation source.
[in]object_spectrumVector containing surface spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
[in]camera_spectrumVector containing camera spectral response data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
Returns
Integral of product of a radiation source spectral distribution, surface spectral data, and camera spectral response across all wavelengths

Definition at line 873 of file RadiationModel.cpp.

◆ integrateSpectrum() [5/5]

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.

Parameters
[in]source_IDIdentifier of a radiation source.
[in]object_spectrumVector containing spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
[in]wavelength_minWavelength for lower bounds of integration
[in]wavelength_maxWavelength for upper bounds of integration
Returns
Integral of product of source energy spectrum and spectral data from minimum to maximum wavelength

◆ loadColorCorrectionMatrixXML()

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.

◆ optionalOutputPrimitiveData()

void RadiationModel::optionalOutputPrimitiveData ( const char *  label)

Add optional output primitive data values to the Context.

Parameters
[in]labelName of primitive data (e.g., "reflectivity", "transmissivity")

Definition at line 80 of file RadiationModel.cpp.

◆ runBand() [1/2]

void RadiationModel::runBand ( const std::string &  label)

Run the simulation for a single radiative band.

Parameters
[in]labelLabel used to reference the band (e.g., "PAR")
Note
Before running the band simulation, you must 1) add at least one radiative band to the simulation (see RadiationModel::addRadiationBand()), 2) update the Context geometry in the model (see RadiationModel::updateGeometry()), and 3) update radiative properties in the model (see RadiationModel::updateRadiativeProperties()).

Definition at line 3050 of file RadiationModel.cpp.

◆ runBand() [2/2]

void RadiationModel::runBand ( const std::vector< std::string > &  labels)

Run the simulation for a multiple radiative bands.

Parameters
[in]labelsLabel used to reference the band (e.g., "PAR")
Note
Before running the band simulation, you must 1) add at least one radiative band to the simulation (see RadiationModel::addRadiationBand()), 2) update the Context geometry in the model (see RadiationModel::updateGeometry()), and 3) update radiative properties in the model (see RadiationModel::updateRadiativeProperties()).

Definition at line 3055 of file RadiationModel.cpp.

◆ runRadiationImaging() [1/2]

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.

Parameters
[in]cameralabelLabel of camera to be used for simulation
[in]sourcelabelsVector of labels of source spectra to be used for simulation
[in]bandlabelsVector of labels of radiation bands to be used for simulation
[in]cameraresponselabelsVector of labels of camera spectral responses
[in]wavelengthrangeWavelength range of spectra
[in]fluxscaleScale factor for source flux
[in]diffusefactorDiffuse factor for diffuse radiation
[in]scatteringdepthNumber of scattering events to simulate

Definition at line 495 of file RadiationCamera.cpp.

◆ runRadiationImaging() [2/2]

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.

Parameters
[in]cameralabelsVector of camera labels to be used for simulation
[in]sourcelabelsVector of labels of source spectra to be used for simulation
[in]bandlabelsVector of labels of radiation bands to be used for simulation
[in]cameraresponselabelsVector of labels of camera spectral responses
[in]wavelengthrangeWavelength range of spectra
[in]fluxscaleScale factor for source flux
[in]diffusefactorDiffuse factor for diffuse radiation
[in]scatteringdepthNumber of scattering events to simulate

Definition at line 535 of file RadiationCamera.cpp.

◆ scaleSpectrum() [1/2]

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.

Parameters
[in]existing_global_data_labelLabel 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_labelLabel of new global data to be created containing scaled spectral data (type of vec2).
[in]scale_factorScaling factor.

Definition at line 956 of file RadiationModel.cpp.

◆ scaleSpectrum() [2/2]

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.

Parameters
[in]global_data_labelLabel 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_factorScaling factor.

Definition at line 967 of file RadiationModel.cpp.

◆ scaleSpectrumRandomly()

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.

Parameters
[in]existing_global_data_labelLabel 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_labelLabel of new global data to be created containing scaled spectral data (type of vec2).
[in]minimum_scale_factorScaling factor minimum value in uniform distribution.
[in]maximum_scale_factorScaling factor maximum value in uniform distribution.

Definition at line 978 of file RadiationModel.cpp.

◆ selfTest()

int RadiationModel::selfTest ( int  argc = 0,
char **  argv = nullptr 
)
static

Self-test.

Returns
0 if test was successful, 1 if test failed

Definition at line 10 of file selfTest.cpp.

◆ setCameraCalibration()

void RadiationModel::setCameraCalibration ( CameraCalibration CameraCalibration)

Definition at line 376 of file RadiationCamera.cpp.

◆ setCameraLookat()

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)

Parameters
[in]camera_labelLabel for the camera to be set.
[in]lookatCartesian coordinate of location camera is pointed toward.

Definition at line 123 of file RadiationCamera.cpp.

◆ setCameraOrientation() [1/2]

void RadiationModel::setCameraOrientation ( const std::string &  camera_label,
const helios::SphericalCoord direction 
)

Set the orientation of the radiation camera based on a spherical coordinate.

Parameters
[in]camera_labelLabel for the camera to be set.
[in]directionSpherical coordinate defining the orientation of the camera.

Definition at line 165 of file RadiationCamera.cpp.

◆ setCameraOrientation() [2/2]

void RadiationModel::setCameraOrientation ( const std::string &  camera_label,
const helios::vec3 direction 
)

Set the orientation of the radiation camera based on a Cartesian vector.

Parameters
[in]camera_labelLabel for the camera to be set.
[in]directionCartesian vector defining the orientation of the camera.

Definition at line 144 of file RadiationCamera.cpp.

◆ setCameraPixelData()

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.

◆ setCameraPosition()

void RadiationModel::setCameraPosition ( const std::string &  camera_label,
const helios::vec3 position 
)

Set the position of the radiation camera.

Parameters
[in]camera_labelLabel for the camera to be set.
[in]positionCartesian coordinate of camera position.

Definition at line 100 of file RadiationCamera.cpp.

◆ setCameraSpectralResponse()

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.

Parameters
[in]camera_labelLabel for the camera to be set.
[in]band_labelLabel for the radiation band.
[in]global_dataLabel for global data containing camera spectral response data. This should be of type vec2 and contain wavelength-quantum efficiency pairs.
Note
If global data in the standard camera spectral library is referenced, the library will be automatically loaded.

Definition at line 64 of file RadiationCamera.cpp.

◆ setCameraSpectralResponseFromLibrary()

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".

Parameters
[in]camera_labelLabel for the camera to be set.
[in]camera_library_nameName of the camera in the standard camera spectral library (e.g., "iPhone11", "NikonD700", etc.).

Definition at line 76 of file RadiationCamera.cpp.

◆ setDiffuseRadiationExtinctionCoeff() [1/2]

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

Parameters
[in]labelLabel used to reference the radiative band
[in]KExtinction coefficient value
[in]peak_dirSpherical direction of the peak in diffuse radiation (this is usually the sun direction)

Definition at line 110 of file RadiationModel.cpp.

◆ setDiffuseRadiationExtinctionCoeff() [2/2]

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

Parameters
[in]labelLabel used to reference the radiative band
[in]KExtinction coefficient value
[in]peak_dirUnit 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.

◆ setDiffuseRadiationFlux()

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.

Parameters
[in]labelLabel used to reference the band
[in]fluxRadiative flux

Definition at line 103 of file RadiationModel.cpp.

◆ setDiffuseRayCount()

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.

Parameters
[in]labelLabel used to reference the band
[in]NNumber of rays
Note
Default is 1000 rays/primitive.

Definition at line 96 of file RadiationModel.cpp.

◆ setDiffuseSpectrum() [1/2]

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.

Parameters
[in]band_labelLabel used to reference the band
[in]spectrum_labelLabel 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.

◆ setDiffuseSpectrum() [2/2]

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.

Parameters
[in]band_labelsList of labels used to reference the bands
[in]spectrum_labelLabel 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.

◆ setDiffuseSpectrumIntegral() [1/4]

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λ)

Parameters
[in]band_labelLabel used to reference the band
[in]spectrum_integralIntegration of source spectral flux distribution across all possible wavelengths (=∫Sdλ)
Note
This function will call setDiffuseFlux() for all bands to update source fluxes based on the new spectrum integral

Definition at line 162 of file RadiationModel.cpp.

◆ setDiffuseSpectrumIntegral() [2/4]

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λ)

Parameters
[in]band_labelLabel used to reference the band
[in]spectrum_integralIntegration of source spectral flux distribution between two wavelengths (=∫Sdλ)
[in]wavelength_minLower bounding wavelength for wave band
[in]wavelength_maxUpper bounding wavelength for wave band
Note
This function will call setDiffuseFlux() for all bands to update source fluxes based on the new spectrum integral

Definition at line 182 of file RadiationModel.cpp.

◆ setDiffuseSpectrumIntegral() [3/4]

void RadiationModel::setDiffuseSpectrumIntegral ( float  spectrum_integral)

Set the integral of the diffuse spectral flux distribution across all possible wavelengths FOR ALL EXISTING BANDS (=∫Sdλ)

Parameters
[in]spectrum_integralIntegration of source spectral flux distribution across all possible wavelengths (=∫Sdλ)
Note
This function will call setDiffuseFlux() for all bands to update source fluxes based on the new spectrum integral

Definition at line 148 of file RadiationModel.cpp.

◆ setDiffuseSpectrumIntegral() [4/4]

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λ)

Parameters
[in]spectrum_integralIntegration of source spectral flux distribution between two wavelengths (=∫Sdλ)
[in]wavelength_minLower bounding wavelength for wave band
[in]wavelength_maxUpper bounding wavelength for wave band
Note
This function will call setDiffuseFlux() for all bands to update source fluxes based on the new spectrum integral

Definition at line 155 of file RadiationModel.cpp.

◆ setDirectRayCount()

void RadiationModel::setDirectRayCount ( const std::string &  label,
size_t  N 
)

Sets variable directRayCount, the number of rays to be used in direct radiation model.

Parameters
[in]labelLabel used to reference the band
[in]NNumber of rays
Note
Default is 100 rays/primitive.

Definition at line 89 of file RadiationModel.cpp.

◆ setMinScatterEnergy()

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".

Parameters
[in]labelLabel used to reference the band
[in]energyEnergy threshold

Definition at line 1111 of file RadiationModel.cpp.

◆ setPadValue()

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.

Parameters
[in]cameralabelLabel of target camera
[in]bandlabelsVector of labels of radiation bands to be used for simulation
[in]padvaluesVector of padding values for each band

Definition at line 1966 of file RadiationCamera.cpp.

◆ setScatteringDepth()

void RadiationModel::setScatteringDepth ( const std::string &  label,
uint  depth 
)

Set the number of scattering iterations for a certain band.

Parameters
[in]labelLabel used to reference the band
[in]depthNumber of scattering iterations (depth=0 turns scattering off)

Definition at line 1103 of file RadiationModel.cpp.

◆ setSourceFlux() [1/2]

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.

Parameters
[in]source_IDVector of radiation source identifiers
[in]band_labelLabel used to reference the band
[in]fluxRadiative flux normal to the direction of radiation propagation

Definition at line 538 of file RadiationModel.cpp.

◆ setSourceFlux() [2/2]

void RadiationModel::setSourceFlux ( uint  source_ID,
const std::string &  band_label,
float  flux 
)

Set the flux of radiation source for this band.

Parameters
[in]source_IDIdentifier of radiation source
[in]band_labelLabel used to reference the band
[in]fluxRadiative flux normal to the direction of radiation propagation

Definition at line 522 of file RadiationModel.cpp.

◆ setSourcePosition() [1/2]

void RadiationModel::setSourcePosition ( uint  source_ID,
const helios::SphericalCoord position 
)

Set the position/direction of radiation source based on a spherical vector.

Parameters
[in]source_IDIdentifier of radiation source
[in]positionIf 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.

◆ setSourcePosition() [2/2]

void RadiationModel::setSourcePosition ( uint  source_ID,
const helios::vec3 position 
)

Set the position/direction of radiation source based on a Cartesian vector.

Parameters
[in]source_IDIdentifier of radiation source
[in]positionIf 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.

◆ setSourceSpectrum() [1/4]

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.

Parameters
[in]source_IDVector of radiation source identifiers.
[in]spectrum_labelLabel 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.

◆ setSourceSpectrum() [2/4]

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.

Parameters
[in]source_IDVector of radiation source identifiers.
[in]spectrumVector containing spectral intensity data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity (.y).

Definition at line 596 of file RadiationModel.cpp.

◆ setSourceSpectrum() [3/4]

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.

Parameters
[in]source_IDIdentifier of radiation source.
[in]spectrum_labelLabel 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.

◆ setSourceSpectrum() [4/4]

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.

Parameters
[in]source_IDIdentifier of radiation source.
[in]spectrumVector containing spectral intensity data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity (.y).

Definition at line 569 of file RadiationModel.cpp.

◆ setSourceSpectrumIntegral() [1/2]

void RadiationModel::setSourceSpectrumIntegral ( uint  source_ID,
float  source_integral 
)

Set the integral of the source spectral flux distribution across all possible wavelengths (=∫Sdλ)

Parameters
[in]source_IDID of source
[in]source_integralIntegration of source spectral flux distribution across all possible wavelengths (=∫Sdλ)
Note
This function will call setSourceFlux() for all bands to update source fluxes based on the new spectrum integral

Definition at line 487 of file RadiationModel.cpp.

◆ setSourceSpectrumIntegral() [2/2]

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λ)

Parameters
[in]source_IDID of source
[in]source_integralIntegration of source spectral flux distribution between two wavelengths (=∫Sdλ)
[in]wavelength_minLower bounding wavelength for wave band
[in]wavelength_maxUpper bounding wavelength for wave band
Note
This function will call setSourceFlux() for all bands to update source fluxes based on the new spectrum integral

Definition at line 502 of file RadiationModel.cpp.

◆ updateCameraResponse()

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.

Parameters
[in]orginalcameralabelLabel of camera to be used for simulation
[in]sourcelabels_rawVector of labels of source spectra to be used for simulation
[in]cameraresponselabelsVector of labels of camera spectral responses
[in]wavelengthrangeWavelength range of the camera
[in]truevaluesTrue image values of the color board
[in]calibratedmarkMark of the calibrated camera

Definition at line 381 of file RadiationCamera.cpp.

◆ updateGeometry() [1/2]

void RadiationModel::updateGeometry ( )

Adds all geometric primitives from the Context to OptiX.

This function should be called anytime Context geometry is created or modified

Note
RadiationModel::updateGeometry() must be called before simulation can be run

Definition at line 1651 of file RadiationModel.cpp.

◆ updateGeometry() [2/2]

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

Parameters
[in]UUIDsVector of universal unique identifiers of Context primitives to be updated
Note
RadiationModel::updateGeometry() must be called before simulation can be run

Definition at line 1655 of file RadiationModel.cpp.

◆ whiteBalanceAuto()

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.

Parameters
[in]cameralabelLabel of camera to apply white balance to
[in]red_band_labelLabel of the red band
[in]green_band_labelLabel of the green band
[in]blue_band_labelLabel of the blue band

◆ whiteBalanceGrayWorld()

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.

Parameters
[in]cameralabelLabel of camera to apply white balance to
[in]red_band_labelLabel of the red band
[in]green_band_labelLabel of the green band
[in]blue_band_labelLabel of the blue band
[in]pMinkowski p-parameter (default is 6.0)

◆ whiteBalanceWhitePatch()

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.

Parameters
[in]cameralabelLabel of camera to apply white balance to
[in]red_band_labelLabel of the red band
[in]green_band_labelLabel of the green band
[in]blue_band_labelLabel of the blue band
[in]percentilePercentile value for white patch selection (default is 0.99)

◆ writeCameraImage()

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.

Parameters
[in]cameraLabel for camera to be queried
[in]bandsVector of labels for radiative bands to be written
[in]imagefile_baseName 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.
Returns
Name of the output image file that was written

Definition at line 187 of file RadiationCamera.cpp.

◆ writeCameraImageData()

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.

Parameters
[in]cameraLabel for camera to be queried
[in]bandLabel for radiative band to be written
[in]imagefile_baseName 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.

◆ writeDepthImageData()

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.

Parameters
[in]cameralabelLabel of target camera
[in]imagefile_baseName 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.

◆ writeImageBoundingBoxes() [1/2]

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'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label. Primitive data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]image_fileName 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.
Note
The lengths of primitive_data_label and object_class_ID vectors must be the same.

Definition at line 1121 of file RadiationCamera.cpp.

◆ writeImageBoundingBoxes() [2/2]

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'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label. Primitive data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]image_fileName 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.
Note
The lengths of primitive_data_label and object_class_ID vectors must be the same.

Definition at line 1125 of file RadiationCamera.cpp.

◆ writeImageBoundingBoxes_ObjectData() [1/2]

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'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]image_fileName 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".
Note
The lengths of object_data_label and object_class_ID vectors must be the same.

Definition at line 1241 of file RadiationCamera.cpp.

◆ writeImageBoundingBoxes_ObjectData() [2/2]

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'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]image_fileName 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".
Note
The lengths of object_data_label and object_class_ID vectors must be the same.

Definition at line 1246 of file RadiationCamera.cpp.

◆ writeImageSegmentationMasks() [1/2]

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'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]json_filenameName of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added.
[in]image_fileName 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.
Note
The lengths of primitive_data_label and object_class_ID vectors must be the same.

Definition at line 1778 of file RadiationCamera.cpp.

◆ writeImageSegmentationMasks() [2/2]

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'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]json_filenameName of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added.
[in]image_fileName 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.
Note
The lengths of primitive_data_label and object_class_ID vectors must be the same.

Definition at line 1782 of file RadiationCamera.cpp.

◆ writeImageSegmentationMasks_ObjectData() [1/2]

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'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]json_filenameName of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added.
[in]image_fileName 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.
Note
The lengths of object_data_label and object_class_ID vectors must be the same.

Definition at line 1872 of file RadiationCamera.cpp.

◆ writeImageSegmentationMasks_ObjectData() [2/2]

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'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]json_filenameName of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added.
[in]image_fileName 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.
Note
The lengths of object_data_label and object_class_ID vectors must be the same.

Definition at line 1876 of file RadiationCamera.cpp.

◆ writeNormCameraImage()

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.

Parameters
[in]cameraLabel for camera to be queried
[in]bandsVector of labels for radiative bands to be written
[in]imagefile_baseName for base of output image JPEG files (will also include the camera label and a frame number in the file name)
[in]image_pathPath 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.
Returns
Name of the output image file that was written

Definition at line 277 of file RadiationCamera.cpp.

◆ writeNormDepthImage()

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.

Parameters
[in]cameralabelLabel of target camera
[in]imagefile_baseName for base of output image JPEG files (will also include the camera label and a frame number in the file name)
[in]max_depthMaximum 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.

◆ writeObjectDataLabelMap()

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'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label
[in]imagefile_baseName 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]padvaluePad value for the empty pixels

Definition at line 687 of file RadiationCamera.cpp.

◆ writePrimitiveDataLabelMap()

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'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label
[in]imagefile_baseName 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]padvaluePad value for the empty pixels

Definition at line 600 of file RadiationCamera.cpp.


The documentation for this class was generated from the following files: