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

WIP Fix for snapshot and recon

parent 0d548826
Branches
Tags
No related merge requests found
...@@ -15,7 +15,10 @@ using std::vector; ...@@ -15,7 +15,10 @@ using std::vector;
SnapshotSource::SnapshotSource(ftl::rgbd::Source *host, SnapshotReader &reader, const string &id) : detail::Source(host) { SnapshotSource::SnapshotSource(ftl::rgbd::Source *host, SnapshotReader &reader, const string &id) : detail::Source(host) {
Eigen::Matrix4d pose; Eigen::Matrix4d pose;
reader.getCameraRGBD(id, rgb_, depth_, pose, params_); reader.getCameraRGBD(id, snap_rgb_, snap_depth_, pose, params_);
rgb_ = snap_rgb_;
depth_ = snap_depth_;
if (rgb_.empty()) LOG(ERROR) << "Did not load snapshot rgb - " << id; if (rgb_.empty()) LOG(ERROR) << "Did not load snapshot rgb - " << id;
if (depth_.empty()) LOG(ERROR) << "Did not load snapshot depth - " << id; if (depth_.empty()) LOG(ERROR) << "Did not load snapshot depth - " << id;
...@@ -50,3 +53,9 @@ SnapshotSource::SnapshotSource(ftl::rgbd::Source *host, SnapshotReader &reader, ...@@ -50,3 +53,9 @@ SnapshotSource::SnapshotSource(ftl::rgbd::Source *host, SnapshotReader &reader,
host->setPose(pose); host->setPose(pose);
} }
bool SnapshotSource::compute(int n, int b) {
snap_rgb_.copyTo(rgb_);
snap_depth_.copyTo(depth_);
return true;
}
...@@ -17,11 +17,13 @@ class SnapshotSource : public detail::Source { ...@@ -17,11 +17,13 @@ class SnapshotSource : public detail::Source {
SnapshotSource(ftl::rgbd::Source *, ftl::rgbd::SnapshotReader &reader, const std::string &id); SnapshotSource(ftl::rgbd::Source *, ftl::rgbd::SnapshotReader &reader, const std::string &id);
~SnapshotSource() {}; ~SnapshotSource() {};
bool compute(int n, int b) override { return true; }; bool compute(int n, int b);
bool isReady() { return true; } bool isReady() { return true; }
//void reset(); //void reset();
private:
cv::Mat snap_rgb_;
cv::Mat snap_depth_;
}; };
} }
......
...@@ -165,18 +165,18 @@ ftl::rgbd::detail::Source *Source::_createDeviceImpl(const ftl::URI &uri) { ...@@ -165,18 +165,18 @@ ftl::rgbd::detail::Source *Source::_createDeviceImpl(const ftl::URI &uri) {
void Source::getFrames(cv::Mat &rgb, cv::Mat &depth) { void Source::getFrames(cv::Mat &rgb, cv::Mat &depth) {
SHARED_LOCK(mutex_,lk); SHARED_LOCK(mutex_,lk);
//rgb_.copyTo(rgb); rgb_.copyTo(rgb);
//depth_.copyTo(depth); depth_.copyTo(depth);
//rgb = rgb_; //rgb = rgb_;
//depth = depth_; //depth = depth_;
cv::Mat tmp; /*cv::Mat tmp;
tmp = rgb; tmp = rgb;
rgb = rgb_; rgb = rgb_;
rgb_ = tmp; rgb_ = tmp;
tmp = depth; tmp = depth;
depth = depth_; depth = depth_;
depth_ = tmp; depth_ = tmp;*/
} }
Eigen::Vector4d Source::point(uint ux, uint uy) { Eigen::Vector4d Source::point(uint ux, uint uy) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment