Skip to content
Snippets Groups Projects
Commit 7fbcf3a7 authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

Use temporary Mat when capturing a frame.

parent 5d489294
No related branches found
No related tags found
No related merge requests found
...@@ -493,14 +493,15 @@ bool Calibrate::_recalibrate(vector<vector<Point2f>> *imagePoints, ...@@ -493,14 +493,15 @@ bool Calibrate::_recalibrate(vector<vector<Point2f>> *imagePoints,
} }
bool Calibrate::undistort(cv::Mat &l, cv::Mat &r) { bool Calibrate::undistort(cv::Mat &l, cv::Mat &r) {
local_->get(l, r); Mat l_tmp, r_tmp;
local_->get(l_tmp, r_tmp);
if (!calibrated_) return false; if (!calibrated_) return false;
if (l.empty() || r.empty()) { if (l_tmp.empty() || r_tmp.empty()) {
LOG(ERROR) << "l/r empty in undistort()!!!"; LOG(ERROR) << "l/r empty in undistort()!!!";
return false; return false;
} }
remap(l, l, map1_[0], map2_[0], INTER_LINEAR); remap(l_tmp, l, map1_[0], map2_[0], INTER_LINEAR);
if (local_->isStereo()) remap(r, r, map1_[1], map2_[1], INTER_LINEAR); if (local_->isStereo()) remap(r_tmp, r, map1_[1], map2_[1], INTER_LINEAR);
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment