5 #include <opencv2/opencv.hpp>
74 mode = cv::StereoSGBM::MODE_SGBM_3WAY;
89 std::string path = getHiddenDir();
93 if(!fs.open(par_file, cv::FileStorage::READ))
95 std::cerr <<
"Error opening stereo parameters file. Using default values." << std::endl << std::endl;
115 std::cout <<
"Stereo parameters load done: " << par_file << std::endl << std::endl;
122 std::string path = getHiddenDir();
126 if(!fs.open(par_file, cv::FileStorage::WRITE))
128 std::cerr <<
"Error saving stereo parameters. Cannot open file for writing: " << par_file << std::endl << std::endl;
135 fs <<
"mode" <<
mode;
145 std::cout <<
"Stereo parameters write done: " << par_file << std::endl << std::endl;
152 std::cout <<
"Stereo SGBM parameters:" << std::endl;
153 std::cout <<
"------------------------------------------" << std::endl;
154 std::cout <<
"blockSize:\t\t" <<
blockSize << std::endl;
155 std::cout <<
"minDisparity:\t" <<
minDisparity << std::endl;
157 std::cout <<
"mode:\t\t" <<
mode << std::endl;
158 std::cout <<
"disp12MaxDiff:\t" <<
disp12MaxDiff << std::endl;
159 std::cout <<
"preFilterCap:\t" <<
preFilterCap << std::endl;
162 std::cout <<
"speckleRange:\t" <<
speckleRange << std::endl;
163 std::cout <<
"P1:\t\t" <<
P1 <<
" [Calculated]" << std::endl;
164 std::cout <<
"P2:\t\t" <<
P2 <<
" [Calculated]" << std::endl;
166 std::cout <<
"minDepth_mm:\t" <<
minDepth_mm << std::endl;
167 std::cout <<
"maxDepth_mm:\t" <<
maxDepth_mm << std::endl;
168 std::cout <<
"------------------------------------------" << std::endl << std::endl;