Skip to content
Snippets Groups Projects
Commit c85a927a authored by Sebastian Hahta's avatar Sebastian Hahta Committed by Nicolas Pope
Browse files

feature/vision mls

parent 1fd0d7ca
Branches
Tags
No related merge requests found
......@@ -75,8 +75,10 @@ static Eigen::Affine3d create_rotation_matrix(float ax, float ay, float az) {
return rz * rx * ry;
}
// TODO: Remove this class (requires more general solution). Also does not
// TODO: * Remove this class (requires more general solution). Also does not
// process disconnections/reconnections/types etc. correctly.
// * Update when new options become available.
class ConfigProxy {
private:
vector<ftl::UUID> peers_;
......@@ -99,6 +101,7 @@ class ConfigProxy {
auto config = json_t::parse(net_->call<string>(peers_[0], "get_cfg", uris_[0] + "/" + uri));
auto *proxy = ftl::create<ftl::Configurable>(root, name);
try {
for (auto &itm : config.get<json::object_t>()) {
auto key = itm.first;
auto value = itm.second;
......@@ -115,6 +118,10 @@ class ConfigProxy {
});
}
}
catch (nlohmann::detail::type_error) {
LOG(ERROR) << "Failed to add config proxy for: " << uri << "/" << name;
}
}
};
static void run(ftl::Configurable *root) {
......@@ -174,6 +181,8 @@ static void run(ftl::Configurable *root) {
configproxy->add(disparity, "source/disparity/algorithm", "algorithm");
configproxy->add(disparity, "source/disparity/bilateral_filter", "bilateral_filter");
configproxy->add(disparity, "source/disparity/optflow_filter", "optflow_filter");
configproxy->add(disparity, "source/disparity/mls", "mls");
configproxy->add(disparity, "source/disparity/cross", "cross");
}
// Create scene transform, intended for axis aligning the walls and floor
......@@ -289,7 +298,7 @@ static void run(ftl::Configurable *root) {
// TODO: Write pose+calibration+config packets
auto sources = group->sources();
for (int i=0; i<sources.size(); ++i) {
for (size_t i=0; i<sources.size(); ++i) {
//writeSourceProperties(writer, i, sources[i]);
sources[i]->inject(Channel::Calibration, sources[i]->parameters(), Channel::Left, sources[i]->getCapabilities());
sources[i]->inject(sources[i]->getPose());
......
......
File changed. Contains only whitespace changes. Show whitespace changes.
......@@ -253,6 +253,11 @@ bool AggreMLS::apply(ftl::rgbd::Frame &in, ftl::rgbd::Frame &out, ftl::rgbd::Sou
return false;
}
if (!in.hasChannel(Channel::Support1)) {
LOG(ERROR) << "Required support channel missing for MLS";
return false;
}
auto size = in.get<GpuMat>(Channel::Depth).size();
centroid_horiz_.create(size.height, size.width);
normals_horiz_.create(size.height, size.width);
......
......
......@@ -8,7 +8,14 @@
#include "ftl/operators/opticalflow.hpp"
#endif
#include "ftl/operators/smoothing.hpp"
#include "ftl/operators/colours.hpp"
#include "ftl/operators/normals.hpp"
#include "ftl/operators/filling.hpp"
#include "ftl/operators/segmentation.hpp"
#include "ftl/operators/disparity.hpp"
#include "ftl/operators/mask.hpp"
#include "ftl/threads.hpp"
#include "calibrate.hpp"
......@@ -132,6 +139,11 @@ void StereoVideoSource::init(const string &file) {
#endif
pipeline_depth_->append<ftl::operators::DisparityBilateralFilter>("bilateral_filter");
pipeline_depth_->append<ftl::operators::DisparityToDepth>("calculate_depth");
pipeline_depth_->append<ftl::operators::ColourChannels>("colour"); // Convert BGR to BGRA
pipeline_depth_->append<ftl::operators::Normals>("normals"); // Estimate surface normals
pipeline_depth_->append<ftl::operators::CrossSupport>("cross");
pipeline_depth_->append<ftl::operators::DiscontinuityMask>("discontinuity_mask");
pipeline_depth_->append<ftl::operators::AggreMLS>("mls"); // Perform MLS (using smoothing channel)
LOG(INFO) << "StereoVideo source ready...";
ready_ = true;
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment