|
CPPxDIC
C++ Digital Image Correlation library for fingertip 3D reconstruction
|
Classes | |
| struct | ViewInfo |
| Logical view = (physical camera id, which half of that camera's frame). More... | |
| struct | ViewPair |
| A mirrored stereopair: the two logical views to correlate against each other. More... | |
Enumerations | |
| enum class | MaskHalf { Left = 1 , Right = 2 } |
| Half-width mask region used to extract a single mirror view from a frame. More... | |
Functions | |
| ViewPair | resolveViewPair (int stereopair, const std::vector< int > &cam_order) |
| Resolve the two views that form a given mirrored stereopair. | |
| cv::Mat | extractViewFromFrame (const cv::Mat &frame, MaskHalf half) |
| Extract a single mirror view (full frame) from a decoded camera frame. | |
| bool | importRawViewMirrored (const Config &config, int trial, const ViewInfo &view, int frameStart, int frameEnd, int frameJump, std::vector< std::string > &out_frames) |
| Decode a physical-camera video and write per-view masked frames to disk. | |
| bool | run (const Config &config, const std::vector< int > &trials={}) |
| Run the mirrored-camera 2D DIC pipeline. | |
|
strong |
Half-width mask region used to extract a single mirror view from a frame.
Mirrors the MATLAB im_mask_width cell array in camera_info_from_view.m: half 1 -> columns [0, W/2) (MATLAB 1:W/2) half 2 -> columns [W/2, W) (MATLAB W/2+1:W)
| Enumerator | |
|---|---|
| Left | |
| Right | |
Definition at line 42 of file mirrored_mode.h.
| cv::Mat xdic::mirrored::extractViewFromFrame | ( | const cv::Mat & | frame, |
| MaskHalf | half | ||
| ) |
Extract a single mirror view (full frame) from a decoded camera frame.
Applies the half-width mask (Left/Right) and returns the cropped region as a stand-alone full-frame image, matching MATLAB temp(:, stereo_param.mask_nbr_X, :).
| frame | Decoded single-channel (or BGR) source frame. |
| half | Which half to keep. |
Definition at line 189 of file mirrored_mode.cpp.
| bool xdic::mirrored::importRawViewMirrored | ( | const Config & | config, |
| int | trial, | ||
| const ViewInfo & | view, | ||
| int | frameStart, | ||
| int | frameEnd, | ||
| int | frameJump, | ||
| std::vector< std::string > & | out_frames | ||
| ) |
Decode a physical-camera video and write per-view masked frames to disk.
This is the missing C++ counterpart of import_raw_vid_MNG.m: it reads ONE camera video, slices each requested frame with the half mask, and writes the extracted view as a PNG sequence (the same on-disk representation the CppNCorr DIC engine consumes).
| config | Resolved configuration (paths, subject, material, frames). |
| trial | Trial number (integer). |
| view | Which logical view to extract. |
| frameStart | 1-based first frame (MATLAB convention). |
| frameEnd | 1-based last frame (<=0 means "to end"). |
| frameJump | Frame stride (<=0 treated as 1). |
| out_frames | Output: paths of the written per-view PNG frames, in order. |
Definition at line 200 of file mirrored_mode.cpp.
| ViewPair xdic::mirrored::resolveViewPair | ( | int | stereopair, |
| const std::vector< int > & | cam_order | ||
| ) |
Resolve the two views that form a given mirrored stereopair.
Direct port of get_cam_view_stereopair_param.m + camera_info_from_view.m.
| stereopair | 1-based stereopair number (1..7 for the default 4-camera rig). |
| cam_order | Physical-camera ordering (MATLAB theGlobalSettings_MNG.cam_order, default {2,1,4,3}). 1-based camera ids. |
Definition at line 130 of file mirrored_mode.cpp.
| bool xdic::mirrored::run | ( | const Config & | config, |
| const std::vector< int > & | trials = {} |
||
| ) |
Run the mirrored-camera 2D DIC pipeline.
For each stereopair (config.mirrored_num_pair, geometry from config.mirrored_cam_order): resolve its two views, extract them as masked full frames, saturate + filter_like_ben (when config.im_filter_mode), then run standard 2D DIC exactly like the camerapairs StepDWorkflow – matching view1->view2 at the reference frame, mapping the ROI/seed through the matching field (StepDWorkflow::updateMaskAndSeedFromOutput), temporal tracking of each view, and finally step2_dic_finish formatting (StepDWorkflow::formatDic2DPairResults) into myDIC2DpairResults_C_{v1}_C_{v2}. Results are written under <dic_path>/<subject>/<material>/<trial>/<phase>/mirrored_pair<N>.
| config | Fully-resolved configuration. |
| trials | Trials to process (–trial/–trials selection). Empty = the reference trial only (config.ref_trial_id), as in the MATLAB single-trial script. |
Definition at line 576 of file mirrored_mode.cpp.