Utility functions for CPPXDIC Equivalent to various utility functions in Matlab xDIC.
More...
|
| static bool | dicCheck (const Config &config) |
| | Utility functions implementation for CPPXDIC.
|
| |
| static bool | fileExists (const std::string &path) |
| |
| static bool | directoryExists (const std::string &path) |
| |
| static std::vector< std::string > | findFiles (const std::string &directory, const std::string &pattern) |
| |
| static std::string | formatString (const std::string &format,...) |
| |
| static std::vector< std::string > | split (const std::string &str, char delimiter) |
| |
| static bool | importVid (const Config &config, int trial, int stereopair, std::vector< std::string > &cam1Frames, std::vector< std::string > &cam2Frames, int maxFrames=0) |
| |
| static bool | importRawVid (const Config &config, int trial, int stereopair, int frameStart, int frameEnd, int frameJump, std::vector< std::string > &cam1Frames, std::vector< std::string > &cam2Frames, int maxFrames=0) |
| |
| static bool | loadROIFromMat (const Config &config, int trial, int stereopair, std::string &roiJsonPath, std::string &roiMaskImagePath) |
| |
| static bool | loadSeedFromMat (const Config &config, int trial, int stereopair, std::string &seedJsonPath) |
| |
| static bool | loadCameraParameters (const std::string &mat_path, CameraParameters ¶ms) |
| | Load camera calibration parameters from MATLAB .mat file Matches MATLAB: load('cameraCBparameters_cam_X.mat') Expects structure 'cameraCBparameters' with field 'cameraParameters'.
|
| |
| static void | undistortPoints (const std::vector< cv::Point2d > &points_in, const CameraParameters ¶ms, std::vector< cv::Point2d > &points_out) |
| | Undistort 2D points using camera parameters Matches MATLAB: undistortPoints(points, cameraParameters)
|
| |
| static cv::Point2d | undistortPoint (const cv::Point2d &point_in, const CameraParameters ¶ms) |
| | Undistort single 2D point.
|
| |
| static bool | DLT11Calibration (const double *P2, const double *P3, size_t N, std::vector< double > &L) |
| | Compute DLT (Direct Linear Transformation) 11 parameters from 2D-3D point correspondences Matches MATLAB: L = DLT11Calibration(P2, P3) Solves the 2Nx11 least squares system M \ P2array for 11 DLT parameters.
|
| |
| static bool | computeRigidTransform (const std::vector< Eigen::Vector3d > &points_from, const std::vector< Eigen::Vector3d > &points_to, RigidTransform &transform) |
| | Compute optimal rigid body transformation between two point clouds Matches MATLAB: rigidTransformation(Pfrom, Pto) Uses SVD-based least squares minimization.
|
| |
| static std::vector< Eigen::Vector3d > | applyRigidTransform (const std::vector< Eigen::Vector3d > &points_in, const RigidTransform &transform) |
| | Apply rigid transformation to point cloud points_out = R * points_in + t.
|
| |
| static void | setCameraPairs (const std::vector< std::pair< int, int > > &camera_pairs) |
| | Register the process-wide stereopair -> (cam_first, cam_second) table.
|
| |
| static const std::vector< std::pair< int, int > > & | cameraPairs () |
| | Currently registered stereopair table (see setCameraPairs).
|
| |
| static void | getCamerasForPair (int stereopair, int &cam_first, int &cam_second) |
| | Get camera numbers for a given stereopair using the registered table (setCameraPairs).
|
| |
| static void | getCamerasForPair (int stereopair, const std::vector< std::pair< int, int > > &camera_pairs, int &cam_first, int &cam_second) |
| | Get camera numbers for a given stereopair using config camera_pairs mapping.
|
| |
| static std::string | buildBaseDataPath (const Config &config, bool with_data_or_dic_path=false, bool with_rawdata=false, bool with_speckles=false) |
| | Build base data path.
|
| |
| static std::string | buildOutputUntilTrialDir (const Config &config, int trial) |
| | Build output dir until Trial folder.
|
| |
| static std::string | buildOutputUntilPhaseDir (const Config &config, int trial) |
| | Build output dir until the Phase folder.
|
| |
| static std::string | buildPath (const Config &config, bool with_data_or_dic_path=false, bool with_rawdata=false, bool with_speckles=false, bool with_material=false, bool with_video=false, bool with_protocol=false, bool with_calib=false) |
| | Build the path based on activated parameters and return the proper string.
|
| |
| static std::string | buildUntilMaterialDir (const Config &config, bool with_data_or_dic_path, bool with_rawdata, bool with_speckles) |
| | Build path until material folder.
|
| |
| static std::string | buildOutputUntilMaterialDir (const Config &config) |
| | Build output path until material folder.
|
| |
| static std::string | buildProtocolDir (const Config &config, bool with_data_or_dic_path=false, bool with_rawdata=false, bool with_speckles=false, bool with_material=false) |
| | Build protocol path.
|
| |
| static std::string | buildVideoDir (const Config &config, bool with_data_or_dic_path=false, bool with_rawdata=false, bool with_speckles=false, bool with_material=false) |
| | Build the video path.
|
| |
| static std::string | buildCalibDir (const Config &config) |
| | Build the calib path.
|
| |
| static std::string | buildPath (const cppxdic::BaseParameters ¶meters, bool with_material=false, bool with_trial=false, bool with_phase=false, bool with_cache=false) |
| | Build the path based on activated parameters and return the proper string.
|
| |
| static std::string | buildOutputPath (const cppxdic::BaseParameters ¶meters) |
| | Build the output path.
|
| |
| static std::string | buildOutputCachePath (const cppxdic::BaseParameters ¶meters) |
| | Build the output cache path.
|
| |
| static std::string | likeRoiOrSeedPath (const std::string &path, const std::string_view &prefix, const std::string &reftrial, const std::string &phase, int stereopair, const std::string &extension) |
| |
| static std::string | likeRoiPath (const std::string &path, const std::string &reftrial, const std::string &phase, int stereopair, const std::string &extension) |
| |
| static std::string | likeSeedPath (const std::string &path, const std::string &reftrial, const std::string &phase, int stereopair, const std::string &extension) |
| |
| static std::string | buildRoiFilePath (const cppxdic::BaseParameters ¶meters, std::string reftrial, int stereopair, const std::string &extension=".mat") |
| | Build the roi file path.
|
| |
| static std::string | buildSeedFilePath (const cppxdic::BaseParameters ¶meters, std::string reftrial, int stereopair, const std::string &extension=".mat") |
| | Build the seed file path.
|
| |
| static std::string | buildMatchingFilePath (const cppxdic::BaseParameters ¶meters, std::string reftrial, int stereopair, const std::string &extension=".bin") |
| | Build the matching file path.
|
| |
| static std::string | buildDic3DCombinedFilePath (const std::string pathdir, int num_pair, const std::string &ext) |
| |
| static std::string | buildDic3DPPresultsFilePath (const std::string pathdir, int num_pair, const std::string &fileversion, const std::string &ext) |
| |
| static std::string | buildVizPath (const std::string pathdir, const std::string filename) |
| |
| static std::string | buildDic2DPairResultsFilePath (const std::string pathdir, int cam_1, int cam_2, const std::string &extension) |
| |
| static std::string | buildNcorrFilePath (const std::string pathdir, int cam_1, int cam_2=-1, const std::string &extension=".bin") |
| |
Utility functions for CPPXDIC Equivalent to various utility functions in Matlab xDIC.
Definition at line 17 of file utils.h.