|
CPPxDIC
C++ Digital Image Correlation library for fingertip 3D reconstruction
|
MatWriter class Provides utilities for writing MAT files with proper xDIC structure. More...
#include <mat_writer.h>
Static Public Member Functions | |
| static bool | writeMatchingFile (const std::string &filename, const cv::Mat &ref_img, const cv::Mat &cur_img, const cv::Mat &ref_roi, const cv::Mat &cur_roi, const ncorr::DIC_analysis_output &dic_output, const std::map< std::string, double > &dispinfo) |
| Write MATCHING2xxx_pair.mat file Structure: | |
| static bool | writeMatchingFile (const std::string &filename, const cv::Mat &ref_img, const cv::Mat &cur_img, const cv::Mat &ref_roi, const cv::Mat &cur_roi, const ncorr::DIC_analysis_output &dic_lagrangian, const ncorr::DIC_analysis_output &dic_eulerian, const std::map< std::string, double > &dispinfo) |
| Write MATCHING2xxx_pair.mat file with both Lagrangian and Eulerian perspectives. | |
| static bool | writeROIMaskFile (const std::string &filename, const cv::Mat &mask) |
| Write REF_MASK_xxx_phase_pairX.mat file Simple structure: refmask (uint8 2D array) | |
| static bool | writeSeedFile (const std::string &filename, int seed_x, int seed_y) |
| Write REF_SEED_xxx_phase_pairX.mat file Simple structure: seed_point (uint16 1D array [x, y]) | |
| static bool | writeTrialInfoFile (const std::string &filename, double fps, const std::vector< int > &frame_indices) |
| Write dic_info_data_target_pairX.mat file Structure: | |
| static bool | writeMultiFrameNcorrFile (const std::string &filename, const cv::Mat &ref_img, const std::vector< cv::Mat > &cur_imgs, const cv::Mat &ref_roi, const std::vector< cv::Mat > &cur_rois, const std::vector< ncorr::DIC_analysis_output > &dic_outputs, const std::map< std::string, double > &dispinfo, const std::string &type_str="load", const std::string &ref_name="reference") |
| Write multi-frame ncorr files (ncorr1.mat, ncorr2.mat, etc.) For tracking DIC with multiple current frames. | |
| static bool | writeDICResultFile (const std::string &filename, const ncorr::DIC_analysis_input &dic_input, const ncorr::DIC_analysis_output &dic_output) |
| Write ncorr1.mat / ncorr2.mat / ncorr12.mat files Full DIC results with dispinfo and displacements Structure matches xDIC output format with: | |
| static bool | convertBinToMat (const std::string &bin_path, const std::string &mat_path, const ncorr::DIC_analysis_input &dic_input) |
| Convert ncorr .bin output to .mat format Wrapper to load .bin and save as MATLAB-compatible .mat. | |
| static bool | writeDIC2DPairResults (const std::string &filename, const DIC2DPairResults &results) |
| Write myDIC2DpairResults_C_X_C_Y.mat file Contains processed 2D DIC results with triangulation. | |
| static bool | write3DCombinedResults (const std::string &filename, const DIC3Dcombined &combined, const std::string &struct_name="DIC3Dcombined") |
| Write DIC3Dcombined_XPairs_stitched.mat file Contains 3D reconstruction results. | |
| static matvar_t * | buildCombinedStructFields (mat_t *matfp, const DIC3Dcombined &combined, const std::string &struct_name, const std::vector< std::string > &extra_fields={}) |
| Build combined struct fields as a matvar_t* (for embedding in parent struct) Does NOT write to file. | |
| static bool | write3DPPresults (const std::string &filename, const DIC3DPPresults &ppresults) |
| Write DIC3DPPresults_XPairs_Y_v1.mat file Contains deformation and strain analysis results. | |
| static bool | writeDeformationGroup (mat_t *matfp, const std::string &group_name, const FrameDeformationResult &deform_data) |
| Write deformation fields to HDF5 group Writes all 36 deformation measures as cell arrays. | |
| static matvar_t * | buildDeformationStruct (const std::string &group_name, const FrameDeformationResult &deform_data) |
| Build deformation struct as matvar_t* for embedding in parent struct Does NOT write to file. | |
| static bool | writeDisplacementGroup (mat_t *matfp, const std::vector< std::vector< Eigen::Vector3d > > &disp_vec, const std::vector< std::vector< double > > &disp_mgn, size_t n_frames) |
| Write displacement group (DispVec, DispMgn) | |
| static bool | writeFaceArrays (mat_t *matfp, const std::vector< std::vector< Eigen::Vector3d > > &face_centroids, const std::vector< std::vector< double > > &face_corr_comb, const std::vector< std::vector< double > > &face_iso_ind, size_t n_frames) |
| Write face-based cell arrays (FaceCentroids, FaceCorrComb, FaceIsoInd) | |
| static bool | writeCalibrationGroup (mat_t *matfp, const CalibrationData &calibration) |
| Write calibration group (DLTparameters, DLTpath) | |
| static bool | writeDistortionGroup (mat_t *matfp, const DistortionData &distortion) |
| Write distortion group (distortionModel, distortionPath) | |
| static matvar_t * | buildAllPairsResultsVar (const std::vector< DIC3DpairResults > &all_pairs) |
| Build the AllPairsResults cell array (full DIC3DpairResults structs) purely in memory — the caller attaches it to a struct and owns it. | |
| static matvar_t * | buildDIC2DinfoVar (const std::vector< DIC2DPairResults > &dic2d_info) |
| Build the DIC2Dinfo cell array of DIC2DPairResults purely in memory — the caller attaches it to a struct and owns it. | |
MatWriter class Provides utilities for writing MAT files with proper xDIC structure.
Definition at line 26 of file mat_writer.h.
|
static |
Build the AllPairsResults cell array (full DIC3DpairResults structs) purely in memory — the caller attaches it to a struct and owns it.
| all_pairs | Vector of DIC3DpairResults (individual pair results) |
Definition at line 2023 of file mat_writer.cpp.
|
static |
Build combined struct fields as a matvar_t* (for embedding in parent struct) Does NOT write to file.
Caller is responsible for writing and freeing.
| matfp | MAT file pointer (needed for AllPairsResults/DIC2Dinfo) |
| combined | 3D combined results structure |
| struct_name | Name of the wrapping struct |
| extra_fields | Additional field names to add to the struct |
Definition at line 1331 of file mat_writer.cpp.
|
static |
Build deformation struct as matvar_t* for embedding in parent struct Does NOT write to file.
Caller owns the returned pointer.
Definition at line 1651 of file mat_writer.cpp.
|
static |
Build the DIC2Dinfo cell array of DIC2DPairResults purely in memory — the caller attaches it to a struct and owns it.
| dic2d_info | Vector of 2D DIC results |
Definition at line 2289 of file mat_writer.cpp.
|
static |
Convert ncorr .bin output to .mat format Wrapper to load .bin and save as MATLAB-compatible .mat.
| bin_path | Path to .bin file |
| mat_path | Output .mat file path |
| dic_input | DIC input parameters |
Definition at line 1104 of file mat_writer.cpp.
|
static |
Write DIC3Dcombined_XPairs_stitched.mat file Contains 3D reconstruction results.
| filename | Output MAT filename |
| combined | 3D combined results structure |
Definition at line 1566 of file mat_writer.cpp.
|
static |
Write DIC3DPPresults_XPairs_Y_v1.mat file Contains deformation and strain analysis results.
| filename | Output MAT filename |
| ppresults | Post-processing results structure |
Definition at line 1588 of file mat_writer.cpp.
|
static |
Write calibration group (DLTparameters, DLTpath)
| matfp | MAT file pointer (must be open for writing) |
| calibration | Calibration data structure |
Definition at line 1906 of file mat_writer.cpp.
|
static |
Write deformation fields to HDF5 group Writes all 36 deformation measures as cell arrays.
| matfp | MAT file pointer (must be open for writing) |
| group_name | Name of the group (e.g., "Deform") |
| deform_data | Frame-based deformation results |
Definition at line 1797 of file mat_writer.cpp.
|
static |
Write myDIC2DpairResults_C_X_C_Y.mat file Contains processed 2D DIC results with triangulation.
| filename | Output MAT filename |
| results | DIC 2D pair results structure |
Definition at line 1126 of file mat_writer.cpp.
|
static |
Write ncorr1.mat / ncorr2.mat / ncorr12.mat files Full DIC results with dispinfo and displacements Structure matches xDIC output format with:
| filename | Output MAT filename |
| dic_input | DIC analysis input parameters |
| dic_output | DIC analysis output |
Definition at line 466 of file mat_writer.cpp.
|
static |
Write displacement group (DispVec, DispMgn)
| matfp | MAT file pointer (must be open for writing) |
| disp_vec | Displacement vectors per frame (Nx3 per frame) |
| disp_mgn | Displacement magnitudes per frame (Nx1 per frame) |
| n_frames | Number of frames |
Definition at line 1818 of file mat_writer.cpp.
|
static |
Write distortion group (distortionModel, distortionPath)
| matfp | MAT file pointer (must be open for writing) |
| distortion | Distortion data structure |
Definition at line 1961 of file mat_writer.cpp.
|
static |
Write face-based cell arrays (FaceCentroids, FaceCorrComb, FaceIsoInd)
| matfp | MAT file pointer (must be open for writing) |
| face_centroids | Face centroids per frame (Mx3 per frame) |
| face_corr_comb | Face correlation coefficients per frame (Mx1 per frame) |
| face_iso_ind | Face isotropy indices per frame (Mx1 per frame) |
| n_frames | Number of frames |
Definition at line 1856 of file mat_writer.cpp.
|
static |
Write MATCHING2xxx_pair.mat file with both Lagrangian and Eulerian perspectives.
| filename | Output MAT filename |
| ref_img | Reference image |
| cur_img | Current image |
| ref_roi | Reference ROI |
| cur_roi | Current ROI |
| dic_lagrangian | Lagrangian (reference) DIC output |
| dic_eulerian | Eulerian (current) DIC output |
| dispinfo | DIC parameters |
Definition at line 53 of file mat_writer.cpp.
|
static |
Write MATCHING2xxx_pair.mat file Structure:
| filename | Output MAT filename |
| ref_img | Reference image |
| cur_img | Current image |
| ref_roi | Reference ROI |
| cur_roi | Current ROI |
| dic_output | DIC analysis output |
| dispinfo | DIC parameters |
Definition at line 30 of file mat_writer.cpp.
|
static |
Write multi-frame ncorr files (ncorr1.mat, ncorr2.mat, etc.) For tracking DIC with multiple current frames.
| filename | Output MAT filename |
| ref_img | Reference image |
| cur_imgs | Vector of current images (one per frame) |
| ref_roi | Reference ROI |
| cur_rois | Vector of current ROIs (one per frame) |
| dic_outputs | Vector of DIC outputs (one per frame) |
| dispinfo | DIC parameters |
| type_str | Type string for all frames (default: "load") |
| ref_name | Reference image name (default: "reference") |
Definition at line 188 of file mat_writer.cpp.
|
static |
Write REF_MASK_xxx_phase_pairX.mat file Simple structure: refmask (uint8 2D array)
| filename | Output MAT filename |
| mask | ROI mask |
Definition at line 405 of file mat_writer.cpp.
|
static |
Write REF_SEED_xxx_phase_pairX.mat file Simple structure: seed_point (uint16 1D array [x, y])
| filename | Output MAT filename |
| seed_x | X coordinate |
| seed_y | Y coordinate |
Definition at line 420 of file mat_writer.cpp.
|
static |
Write dic_info_data_target_pairX.mat file Structure:
| filename | Output MAT filename |
| fps | FPS value |
| frame_indices | Frame indices |
Definition at line 440 of file mat_writer.cpp.