CPPxDIC
C++ Digital Image Correlation library for fingertip 3D reconstruction
Loading...
Searching...
No Matches
mirrored_mode.h
Go to the documentation of this file.
1
24#pragma once
25
26#include <opencv2/opencv.hpp>
27#include <string>
28#include <vector>
29
30class Config;
31
32namespace xdic {
33namespace mirrored {
34
42enum class MaskHalf { Left = 1, Right = 2 };
43
49struct ViewInfo {
50 int view_nbr = 0;
51 int cam_nbr = 0;
53};
54
65
76ViewPair resolveViewPair(int stereopair, const std::vector<int>& cam_order);
77
88cv::Mat extractViewFromFrame(const cv::Mat& frame, MaskHalf half);
89
106bool importRawViewMirrored(const Config& config, int trial, const ViewInfo& view, int frameStart,
107 int frameEnd, int frameJump, std::vector<std::string>& out_frames);
108
126bool run(const Config& config, const std::vector<int>& trials = {});
127
128} // namespace mirrored
129} // namespace xdic
cv::Mat extractViewFromFrame(const cv::Mat &frame, MaskHalf half)
Extract a single mirror view (full frame) from a decoded camera frame.
ViewPair resolveViewPair(int stereopair, const std::vector< int > &cam_order)
Resolve the two views that form a given mirrored stereopair.
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.
MaskHalf
Half-width mask region used to extract a single mirror view from a frame.
bool run(const Config &config, const std::vector< int > &trials={})
Run the mirrored-camera 2D DIC pipeline.
Logical view = (physical camera id, which half of that camera's frame).
int view_nbr
1..8 logical view index (MATLAB view_nbr)
int cam_nbr
physical camera id (from cam_order), used to find the video file
A mirrored stereopair: the two logical views to correlate against each other.
int stereopair
1-based stereopair index
ViewInfo view2
second view of the pair
ViewInfo view1
first view of the pair