Digital Image Correlation Engine  Version 1.0
A modular, high-performance, image correlation tool used to compute full-field displacements and strains from digital images
Classes | Functions
DICe::utils Namespace Reference

utilities that wont build with NVCC so they are separated out into another namespace More...

Classes

class  Image_Reader_Cache
 

Functions

DICE_LIB_DLL_EXPORT std::string netcdf_file_name (const char *decorated_netcdf_file)
 
DICE_LIB_DLL_EXPORT int_t netcdf_index (const char *decorated_netcdf_file)
 
DICE_LIB_DLL_EXPORT std::string cine_file_name (const char *decorated_cine_file)
 
DICE_LIB_DLL_EXPORT void cine_index (const char *decorated_cine_file, int_t &start_index, int_t &end_index, bool &is_avg)
 
DICE_LIB_DLL_EXPORT Image_File_Type image_file_type (const char *file_name)
 
DICE_LIB_DLL_EXPORT void read_image_dimensions (const char *file_name, int_t &width, int_t &height)
 
DICE_LIB_DLL_EXPORT void read_image (const char *file_name, intensity_t *intensities, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
 
DICE_LIB_DLL_EXPORT void spread_histogram (const int_t width, const int_t height, intensity_t *intensities)
 
DICE_LIB_DLL_EXPORT void round_intensities (const int_t width, const int_t height, intensity_t *intensities)
 
DICE_LIB_DLL_EXPORT void remove_outliers (const int_t width, const int_t height, intensity_t *intensities, const intensity_t &rep_value=-1.0)
 
DICE_LIB_DLL_EXPORT void floor_intensities (const int_t width, const int_t height, intensity_t *intensities)
 
DICE_LIB_DLL_EXPORT void undistort_intensities (const int_t width, const int_t height, intensity_t *intensities, const Teuchos::RCP< Teuchos::ParameterList > &params)
 
DICE_LIB_DLL_EXPORT void write_image (const char *file_name, const int_t width, const int_t height, intensity_t *intensities, const bool is_layout_right=true)
 
DICE_LIB_DLL_EXPORT void write_color_overlap_image (const char *file_name, const int_t width, const int_t height, intensity_t *bottom_intensities, intensity_t *top_intensities)
 
DICE_LIB_DLL_EXPORT cv::Mat read_image (const char *file_name)
 
DICE_LIB_DLL_EXPORT void read_rawi_image_dimensions (const char *file_name, int_t &width, int_t &height)
 
DICE_LIB_DLL_EXPORT void read_rawi_image (const char *file_name, intensity_t *intensities, const bool is_layout_right=true)
 
DICE_LIB_DLL_EXPORT void write_rawi_image (const char *file_name, const int_t width, const int_t height, intensity_t *intensities, const bool is_layout_right=true)
 

Detailed Description

utilities that wont build with NVCC so they are separated out into another namespace

Function Documentation

◆ cine_file_name()

DICE_LIB_DLL_EXPORT std::string DICe::utils::cine_file_name ( const char *  decorated_cine_file)

returns the name of a file given a decorated file name string

Parameters
decorated_cine_filethe decorated string that contains the name

◆ cine_index()

DICE_LIB_DLL_EXPORT void DICe::utils::cine_index ( const char *  decorated_cine_file,
int_t start_index,
int_t end_index,
bool &  is_avg 
)

returns the start index decyphered from the cine file descriptor passed in

Parameters
decorated_cine_filethe descriptor that has the cine name and index concatendated
start_index[out] the start index requested
end_index[out] returned as -1 unless the descriptor has an "avg" tag appended
is_avgtrue if more than one frame gets averaged together The convention is as follows cine_file_0.cine would lead to a file name of cine_file.cine and an index of 0 Another example would be cine_file_avg45to51.cine that would lead to a file name of cine_file.cine and averaging of frames 45 through 51 inclusive. negative numbers are okay e.g. cine_file_avg-12to-10.cine or cine_file_-500.cine

◆ floor_intensities()

DICE_LIB_DLL_EXPORT void DICe::utils::floor_intensities ( const int_t  width,
const int_t  height,
intensity_t intensities 
)

Round the image intensity values to the nearest integer value

Parameters
width
height
intensities

◆ image_file_type()

DICE_LIB_DLL_EXPORT Image_File_Type DICe::utils::image_file_type ( const char *  file_name)

returns the type of file based on the name

Parameters
file_namethe name of the file

◆ netcdf_file_name()

DICE_LIB_DLL_EXPORT std::string DICe::utils::netcdf_file_name ( const char *  decorated_netcdf_file)

returns the name of a netcdf file given a decorated cine string

Parameters
decorated_netcdf_file_stringthe decorated string that contains the name

◆ netcdf_index()

DICE_LIB_DLL_EXPORT int_t DICe::utils::netcdf_index ( const char *  decorated_netcdf_file)

returns the frame index decyphered from the netcdf file descriptor passed in

Parameters
decorated_netcdf_filethe descriptor that has the netcdf name and index concatendated

◆ read_image() [1/2]

DICE_LIB_DLL_EXPORT cv::Mat DICe::utils::read_image ( const char *  file_name)

Read an image into the host memory returning an opencv Mat object

Parameters
file_namethe name of the file

◆ read_image() [2/2]

DICE_LIB_DLL_EXPORT void DICe::utils::read_image ( const char *  file_name,
intensity_t intensities,
const Teuchos::RCP< Teuchos::ParameterList > &  params = Teuchos::null 
)

Read an image into the host memory

Parameters
file_namethe name of the file
intensities[out] populated with the image intensities
paramsapply special filters or select sub portions of the image

◆ read_image_dimensions()

DICE_LIB_DLL_EXPORT void DICe::utils::read_image_dimensions ( const char *  file_name,
int_t width,
int_t height 
)

read the image dimensions

Parameters
file_namethe name of the file
width[out] returned as the width of the image
height[out] returned as the height of the image

◆ read_rawi_image()

DICE_LIB_DLL_EXPORT void DICe::utils::read_rawi_image ( const char *  file_name,
intensity_t intensities,
const bool  is_layout_right = true 
)

Read an image into the host memory

Parameters
file_namethe name of the .rawi file
intensities[out] populated with the pixel intensity values
is_layout_right[optional] memory layout is LayoutRight (row-major)

◆ read_rawi_image_dimensions()

DICE_LIB_DLL_EXPORT void DICe::utils::read_rawi_image_dimensions ( const char *  file_name,
int_t width,
int_t height 
)

Raw Intensity Format (.rawi), allows saving decimal numbers as well as negative numbers, neither of which are enabled for standard image file formats read the image dimensions

Parameters
file_namethe .rawi file name
width[out] returned as the width of the image
height[out] returned as the height of the image

◆ remove_outliers()

DICE_LIB_DLL_EXPORT void DICe::utils::remove_outliers ( const int_t  width,
const int_t  height,
intensity_t intensities,
const intensity_t rep_value = -1.0 
)

Set the intensity value for outlier pixels (the ones with the highest intensity value) to the second highest value This is helpful in removing failed cine pixels

Parameters
width
height
intensities
valuereplacement value

◆ round_intensities()

DICE_LIB_DLL_EXPORT void DICe::utils::round_intensities ( const int_t  width,
const int_t  height,
intensity_t intensities 
)

Round the image intensity values to the nearest integer value

Parameters
width
height
intensities

◆ spread_histogram()

DICE_LIB_DLL_EXPORT void DICe::utils::spread_histogram ( const int_t  width,
const int_t  height,
intensity_t intensities 
)

Spread the image intensity histogram if it's grouped in a cluster

Parameters
width
height
intensities

◆ undistort_intensities()

DICE_LIB_DLL_EXPORT void DICe::utils::undistort_intensities ( const int_t  width,
const int_t  height,
intensity_t intensities,
const Teuchos::RCP< Teuchos::ParameterList > &  params 
)

undistort image intensity values to correct for lens distortion

Parameters
width
height
intensities
params

◆ write_color_overlap_image()

DICE_LIB_DLL_EXPORT void DICe::utils::write_color_overlap_image ( const char *  file_name,
const int_t  width,
const int_t  height,
intensity_t bottom_intensities,
intensity_t top_intensities 
)

write an image to disk with two base images overlayed with transparency

Parameters
file_namethe name of the file
widththe width of the image to write
heightthe height of the image
bottom_intensitiesassumed to be an array of size width x height
top_intensitiesassumed to be an array of size width x height

◆ write_image()

DICE_LIB_DLL_EXPORT void DICe::utils::write_image ( const char *  file_name,
const int_t  width,
const int_t  height,
intensity_t intensities,
const bool  is_layout_right = true 
)

write an image to disk (always output as an 8-bit grayscale image) for more precise output, for example to read the intensity values in later with the same precision, use the .rawi format (see DICe::rawi)

Parameters
file_namethe name of the file
widththe width of the image to write
heightthe height of the image
intensitiesassumed to be an array of size width x height
is_layout_right[optional] memory layout is LayoutRight (row-major)

◆ write_rawi_image()

DICE_LIB_DLL_EXPORT void DICe::utils::write_rawi_image ( const char *  file_name,
const int_t  width,
const int_t  height,
intensity_t intensities,
const bool  is_layout_right = true 
)

write an image to disk

Parameters
file_namethe name of the .rawi file
widththe width of the image to write
heightthe height of the image
intensitiesassumed to be an array of size width x height
is_layout_right[optional] memory layout is LayoutRight (row-major)