diff --git a/samples/tutorials/util/pc_viewer.cc b/samples/tutorials/util/pc_viewer.cc index 1ad50a1..08bcce6 100644 --- a/samples/tutorials/util/pc_viewer.cc +++ b/samples/tutorials/util/pc_viewer.cc @@ -84,7 +84,7 @@ void PCViewer::ConvertMatToPointCloud( for (int i = 0; i < xyz.rows; i++) { for (int j = 0; j < xyz.cols; j++) { auto &&p = xyz.at(i, j); - if (std::abs(p.z) > 9999) continue; + if (std::abs(p.z) > 9999) continue; if (std::isfinite(p.x) && std::isfinite(p.y) && std::isfinite(p.z)) { // LOG(INFO) << "[" << i << "," << j << "] x: " << p.x << ", y: " << p.y // << ", z: " << p.z; diff --git a/src/mynteye/api/processor/disparity_processor.cc b/src/mynteye/api/processor/disparity_processor.cc index b662366..c60de02 100644 --- a/src/mynteye/api/processor/disparity_processor.cc +++ b/src/mynteye/api/processor/disparity_processor.cc @@ -27,34 +27,33 @@ DisparityProcessor::DisparityProcessor(std::int32_t proc_period) : Processor(std::move(proc_period)) { VLOG(2) << __func__ << ": proc_period=" << proc_period; - int blockSize_ = 15; // 15 - int numDisparities_ = 64; // 64 + int blockSize_ = 15; // 15 + int numDisparities_ = 64; // 64 #ifdef WITH_OPENCV2 - bm_ = cv::Ptr( - new cv::StereoBM( - cv::StereoBM::BASIC_PRESET, - numDisparities_, - blockSize_)); + bm_ = cv::Ptr( + new cv::StereoBM( + cv::StereoBM::BASIC_PRESET, + numDisparities_, + blockSize_)); #else - int minDisparity_ = 0; // 0 - int preFilterSize_ = 9; // 9 - int preFilterCap_ = 31; // 31 - int uniquenessRatio_ = 15; // 15 - int textureThreshold_ = 10; // 10 - int speckleWindowSize_ = 100; // 100 - int speckleRange_ = 4; // 4 - - bm_ = cv::StereoBM::create(16, 9); - bm_->setBlockSize(blockSize_); - bm_->setMinDisparity(minDisparity_); - bm_->setNumDisparities(numDisparities_); - bm_->setPreFilterSize(preFilterSize_); - bm_->setPreFilterCap(preFilterCap_); - bm_->setUniquenessRatio(uniquenessRatio_); - bm_->setTextureThreshold(textureThreshold_); - bm_->setSpeckleWindowSize(speckleWindowSize_); - bm_->setSpeckleRange(speckleRange_); + int minDisparity_ = 0; // 0 + int preFilterSize_ = 9; // 9 + int preFilterCap_ = 31; // 31 + int uniquenessRatio_ = 15; // 15 + int textureThreshold_ = 10; // 10 + int speckleWindowSize_ = 100; // 100 + int speckleRange_ = 4; // 4 + bm_ = cv::StereoBM::create(16, 9); + bm_->setBlockSize(blockSize_); + bm_->setMinDisparity(minDisparity_); + bm_->setNumDisparities(numDisparities_); + bm_->setPreFilterSize(preFilterSize_); + bm_->setPreFilterCap(preFilterCap_); + bm_->setUniquenessRatio(uniquenessRatio_); + bm_->setTextureThreshold(textureThreshold_); + bm_->setSpeckleWindowSize(speckleWindowSize_); + bm_->setSpeckleRange(speckleRange_); #endif } @@ -78,11 +77,11 @@ bool DisparityProcessor::OnProcess( cv::Mat disparity; #ifdef WITH_OPENCV2 - (*bm_)(input->first, input->second, disparity); + (*bm_)(input->first, input->second, disparity); #else bm_->compute(input->first, input->second, disparity); #endif - disparity.convertTo(output->value, CV_32F, 1./16); + disparity.convertTo(output->value, CV_32F, 1./16); return true; } diff --git a/src/mynteye/api/processor/rectify_processor.cc b/src/mynteye/api/processor/rectify_processor.cc index ab47402..2b14e12 100644 --- a/src/mynteye/api/processor/rectify_processor.cc +++ b/src/mynteye/api/processor/rectify_processor.cc @@ -72,15 +72,15 @@ void RectifyProcessor::InitParams( in_right.cy, 0, 0, 1); cv::Mat D1(1, 5, CV_64F, in_left.coeffs); cv::Mat D2(1, 5, CV_64F, in_right.coeffs); - /* + /* cv::Mat R = (cv::Mat_(3, 3) << ex_right_to_left.rotation[0][0], ex_right_to_left.rotation[0][1], ex_right_to_left.rotation[0][2], ex_right_to_left.rotation[1][0], ex_right_to_left.rotation[1][1], ex_right_to_left.rotation[1][2], ex_right_to_left.rotation[2][0], ex_right_to_left.rotation[2][1], ex_right_to_left.rotation[2][2]); - */ - cv::Mat R = + */ + cv::Mat R = (cv::Mat_(3, 3) << 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); cv::Mat T(3, 1, CV_64F, ex_right_to_left.translation);