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

Fix for camera device bug

parent 441a703f
No related branches found
No related tags found
No related merge requests found
Pipeline #11286 passed
......@@ -15,12 +15,22 @@ using std::unique_lock;
StereoVideoSource::StereoVideoSource(ftl::rgbd::Source *host)
: ftl::rgbd::detail::Source(host) {
init("");
}
StereoVideoSource::StereoVideoSource(ftl::rgbd::Source *host, const string &file)
: ftl::rgbd::detail::Source(host), ready_(false) {
init(file);
}
StereoVideoSource::~StereoVideoSource() {
delete disp_;
delete calib_;
delete lsrc_;
}
void StereoVideoSource::init(const string &file) {
if (ftl::is_video(file)) {
// Load video file
LOG(INFO) << "Using video file...";
......@@ -77,12 +87,6 @@ StereoVideoSource::StereoVideoSource(ftl::rgbd::Source *host, const string &file
ready_ = true;
}
StereoVideoSource::~StereoVideoSource() {
delete disp_;
delete calib_;
delete lsrc_;
}
static void disparityToDepth(const cv::Mat &disparity, cv::Mat &depth, const cv::Mat &q) {
cv::Matx44d _Q;
q.convertTo(_Q, CV_64F);
......
......@@ -39,6 +39,8 @@ class StereoVideoSource : public detail::Source {
cv::Mat left_;
cv::Mat right_;
cv::Mat mask_l_;
void init(const std::string &);
};
}
......
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