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
|
A class for camera calibration parameters and computing projection transformations notes: there is only one source camera per camera system, this determines how the coordinate systems are organized. All other cameras are target cameras. More...
#include <DICe_CameraSystem.h>
Public Types | |
enum | System_Type_3D { UNKNOWN_SYSTEM = 0, GENERIC_SYSTEM, OPENCV, VIC3D, DICE, MAX_SYSTEM_TYPE_3D, NO_SUCH_SYSTEM_TYPE_3D } |
enum | Coordinate_Transformation_Param { ANGLE_X = 0, ANGLE_Y, ANGLE_Z, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z } |
Public Member Functions | |
Camera_System () | |
default constructor | |
Camera_System (const std::string ¶m_file_name) | |
constructor More... | |
void | read_camera_system_file (const std::string &file) |
read the camera system parameters More... | |
void | write_camera_system_file (const std::string &file) |
write the camera system parameters to an xml file More... | |
void | set_system_type (const System_Type_3D system_type) |
set the system type More... | |
System_Type_3D | system_type () const |
get the integer value for the current system type More... | |
scalar_t | diff (const Camera_System &rhs) const |
diffs all the cameras that make up a camera system | |
bool | extrinsics_relative_camera_to_camera () const |
size_t | get_camera_num_from_id (std::string &cam_id) const |
returns the number of the first camera with a matching identifier More... | |
Teuchos::RCP< Camera > | camera (const size_t i) const |
return a pointer to the camera with this vector index | |
size_t | num_cameras () const |
return the number of cameras | |
void | add_camera (Teuchos::RCP< Camera > camera_ptr) |
add a camera to the set | |
Matrix< scalar_t, 3 > | fundamental_matrix (const size_t source_cam_id=0, const size_t target_cam_id=1) |
calculate the fundamental matrix for a set of cameras | |
void | camera_to_camera_projection (const size_t source_id, const size_t target_id, const std::vector< scalar_t > &img_source_x, const std::vector< scalar_t > &img_source_y, std::vector< scalar_t > &img_target_x, std::vector< scalar_t > &img_target_y, const std::vector< scalar_t > &facet_params, std::vector< std::vector< scalar_t > > &img_target_dx, std::vector< std::vector< scalar_t > > &img_target_dy, const std::vector< scalar_t > &rigid_body_params=std::vector< scalar_t >()) |
3 parameter projection routine from the one camera to another camera More... | |
void | camera_to_camera_projection (const size_t source_id, const size_t target_id, const std::vector< scalar_t > &img_source_x, const std::vector< scalar_t > &img_source_y, std::vector< scalar_t > &img_target_x, std::vector< scalar_t > &img_target_y, const std::vector< scalar_t > &facet_params, const std::vector< scalar_t > &rigid_body_params=std::vector< scalar_t >()) |
same as above, only do not compute the partials | |
void | rot_trans_3D (const std::vector< scalar_t > &source_x, const std::vector< scalar_t > &source_y, const std::vector< scalar_t > &source_z, std::vector< scalar_t > &target_x, std::vector< scalar_t > &target_y, std::vector< scalar_t > &target_z, const std::vector< scalar_t > &rigid_body_params, std::vector< std::vector< scalar_t > > &target_dx, std::vector< std::vector< scalar_t > > &target_dy, std::vector< std::vector< scalar_t > > &target_dz) |
void | rot_trans_3D (const std::vector< scalar_t > &source_x, const std::vector< scalar_t > &source_y, const std::vector< scalar_t > &source_z, std::vector< scalar_t > &target_x, std::vector< scalar_t > &target_y, std::vector< scalar_t > &target_z, const std::vector< scalar_t > &rigid_body_params) |
same as above with no partials | |
Static Public Member Functions | |
static std::string | to_string (System_Type_3D in) |
static System_Type_3D | string_to_system_type_3d (std::string &in) |
Private Attributes | |
const size_t | max_num_cameras_allowed_ |
sets the number of cameras that can be in an input file | |
Matrix< scalar_t, 4 > | user_4x4_trans_ |
std::vector< scalar_t > | user_6x1_trans_ |
8 parameters that define a projective transform (independent from intrinsic and extrinsic parameters) | |
System_Type_3D | sys_type_ |
defines the camera system type (OPENCV VIC3D...) | |
bool | has_6_transform_ |
the user defined a 6 parameter transform to modify the world coordinate system | |
bool | has_4x4_transform_ |
the user defined a 4x transform to another coordinate system to use for the world coordinates | |
bool | extrinsics_relative_camera_to_camera_ |
std::vector< Teuchos::RCP< DICe::Camera > > | cameras_ |
cameras are stored in a vector | |
Friends | |
DICE_LIB_DLL_EXPORT friend bool | operator== (const Camera_System &lhs, const Camera_System &rhs) |
comparison operator | |
DICE_LIB_DLL_EXPORT friend bool | operator!= (const Camera_System &lhs, const Camera_System &rhs) |
comparison operator | |
DICE_LIB_DLL_EXPORT friend std::ostream & | operator<< (std::ostream &os, const Camera_System &camera_system) |
overaload the ostream operator for a camera system class | |
A class for camera calibration parameters and computing projection transformations notes: there is only one source camera per camera system, this determines how the coordinate systems are organized. All other cameras are target cameras.
rigid body rotation parameter index
valid system types
DICe::Camera_System::Camera_System | ( | const std::string & | param_file_name | ) |
constructor
param_file_name | the name of the file to parse the calibration parameters from |
void DICe::Camera_System::camera_to_camera_projection | ( | const size_t | source_id, |
const size_t | target_id, | ||
const std::vector< scalar_t > & | img_source_x, | ||
const std::vector< scalar_t > & | img_source_y, | ||
std::vector< scalar_t > & | img_target_x, | ||
std::vector< scalar_t > & | img_target_y, | ||
const std::vector< scalar_t > & | facet_params, | ||
std::vector< std::vector< scalar_t > > & | img_target_dx, | ||
std::vector< std::vector< scalar_t > > & | img_target_dy, | ||
const std::vector< scalar_t > & | rigid_body_params = std::vector< scalar_t >() |
||
) |
3 parameter projection routine from the one camera to another camera
source_id | the number id of the source camera |
target_id | the camera id of the target camera. |
img_source_x | array of x image location in the source camera |
img_source_y | array of y image location in the source camera |
img_targe_x | array of projected x image location in the target camera |
img_target_y | array of projected y image location in the target camera |
facet_params | array of ZP, THETA, PHI values that govern the projection |
img_target_dx | array of arrays of the partials in the x location wrt (ZP, THETA, PHI) |
img_target_dy | array of arrays of the partials in the y location wrt (ZP, THETA, PHI) |
rigid_body_params | 6 rotation/translation parameters to describe the rigid body motion if the rigid_body_params argument is specified points in space are established by projecting them using the 3 parameter projection, they are then transformed in a rigid body manner to a second location which is then projected into the target camera. ZP, THETA and PHI are considered fixed |
|
inline |
returns true if the extrinsic parameters are camera to camera relative rather than from world to camera (if this is the case, the first camera's extrinsics are world to camera 0, the second camera's extrinsics are the camera 0 to camera 1 transformation) This is included for legacy reasons
|
inline |
returns the number of the first camera with a matching identifier
cam_id | camera identifying string |
void DICe::Camera_System::read_camera_system_file | ( | const std::string & | file | ) |
read the camera system parameters
file | File name of the parameters file |
void DICe::Camera_System::rot_trans_3D | ( | const std::vector< scalar_t > & | source_x, |
const std::vector< scalar_t > & | source_y, | ||
const std::vector< scalar_t > & | source_z, | ||
std::vector< scalar_t > & | target_x, | ||
std::vector< scalar_t > & | target_y, | ||
std::vector< scalar_t > & | target_z, | ||
const std::vector< scalar_t > & | rigid_body_params, | ||
std::vector< std::vector< scalar_t > > & | target_dx, | ||
std::vector< std::vector< scalar_t > > & | target_dy, | ||
std::vector< std::vector< scalar_t > > & | target_dz | ||
) |
rigid body 3D rotation/translation transformation with no incoming partials and outgoing partials wrt params
source_x | array of initial x world position of the point |
source_y | array of initial y world position of the point |
source_z | array of initial z world position of the point |
targe_x | array of x world position of the point after the transformation |
target_y | array of y world position of the point after the transformation |
target_z | array of z world position of the point after the transformation |
rigid_body_params | 6 rotation/translation parameters to describe the rigid body motion (3 angles 3 translations) |
target_dx | array of arrays of the partials in the x world location wrt params |
target_dy | array of arrays of the partials in the y world location wrt params |
target_dy | array of arrays of the partials in the z world location wrt params |
|
inline |
set the system type
system_type | a System_Type_3D enum |
|
inline |
get the integer value for the current system type
system_type | integer system type value |
void DICe::Camera_System::write_camera_system_file | ( | const std::string & | file | ) |
write the camera system parameters to an xml file
file | File name of the parameters file to write to |
|
private |
the standard convention is to have the camera extrinsics be from world to camera when this flag is true, the extrinsics are the transformation from the left camera to the right instead