Skip to content
Snippets Groups Projects
Commit 91eac3b0 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fix for multi thread call to grab

parent d047ada4
No related branches found
No related tags found
No related merge requests found
...@@ -112,12 +112,15 @@ static void disparityToDepth(const cv::Mat &disparity, cv::Mat &depth, const cv: ...@@ -112,12 +112,15 @@ static void disparityToDepth(const cv::Mat &disparity, cv::Mat &depth, const cv:
} }
void StereoVideoSource::grab() { void StereoVideoSource::grab() {
// TODO(Nick) find a way to move this to last part ... but grab can't
// be called twice by different threads and it is currently
// FIXME Call to grab from multiple threads
unique_lock<mutex> lk(mutex_);
calib_->rectified(left_, right_); calib_->rectified(left_, right_);
cv::Mat disp; cv::Mat disp;
disp_->compute(left_, right_, disp); disp_->compute(left_, right_, disp);
unique_lock<mutex> lk(mutex_);
left_.copyTo(rgb_); left_.copyTo(rgb_);
disparityToDepth(disp, depth_, calib_->getQ()); disparityToDepth(disp, depth_, calib_->getQ());
} }
......
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