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
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,10 @@ using std::vector;
SnapshotSource::SnapshotSource(ftl::rgbd::Source *host, SnapshotReader &reader, const string &id) : detail::Source(host) {
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 (depth_.empty()) LOG(ERROR) << "Did not load snapshot depth - " << id;
......@@ -50,3 +53,9 @@ SnapshotSource::SnapshotSource(ftl::rgbd::Source *host, SnapshotReader &reader,
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 {
SnapshotSource(ftl::rgbd::Source *, ftl::rgbd::SnapshotReader &reader, const std::string &id);
~SnapshotSource() {};
bool compute(int n, int b) override { return true; };
bool compute(int n, int b);
bool isReady() { return true; }
//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) {
void Source::getFrames(cv::Mat &rgb, cv::Mat &depth) {
SHARED_LOCK(mutex_,lk);
//rgb_.copyTo(rgb);
//depth_.copyTo(depth);
rgb_.copyTo(rgb);
depth_.copyTo(depth);
//rgb = rgb_;
//depth = depth_;
cv::Mat tmp;
/*cv::Mat tmp;
tmp = rgb;
rgb = rgb_;
rgb_ = tmp;
tmp = depth;
depth = depth_;
depth_ = tmp;
depth_ = tmp;*/
}
Eigen::Vector4d Source::point(uint ux, uint uy) {
......
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