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

Reduce operators exceptions

parent d7122ebd
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
......@@ -47,8 +47,19 @@ bool MultiViewMLS::apply(ftl::rgbd::FrameSet &in, ftl::rgbd::FrameSet &out, cuda
bool show_consistency = config()->value("show_consistency", false);
bool show_adjustment = config()->value("show_adjustment", false);
if (in.frames.size() < 1) return false;
auto size = in.firstFrame().get<GpuMat>(Channel::Depth).size();
if (in.frames.size() < 1 || in.count == 0) return false;
cv::Size size(0,0);
for (auto &f : in.frames) {
if (f.hasChannel(Channel::Depth)) {
size = f.get<GpuMat>(Channel::Depth).size();
break;
}
}
if (size.width == 0) {
in.firstFrame().message(ftl::data::Message::Warning_MISSING_CHANNEL, "Missing Depth Channel in MVMLS operator");
return false;
}
// Make sure we have enough buffers
while (normals_horiz_.size() < in.frames.size()) {
......
......@@ -19,7 +19,8 @@ Normals::~Normals() {
bool Normals::apply(ftl::rgbd::Frame &in, ftl::rgbd::Frame &out, cudaStream_t stream) {
if (!in.hasChannel(Channel::Depth)) {
out.message(ftl::data::Message::Warning_MISSING_CHANNEL, "Missing Depth Channel in Normals operator");
throw FTL_Error("Missing depth channel in Normals operator");
//throw FTL_Error("Missing depth channel in Normals operator");
return false;
}
if (out.hasChannel(Channel::Normals)) {
......@@ -49,7 +50,8 @@ NormalDot::~NormalDot() {
bool NormalDot::apply(ftl::rgbd::Frame &in, ftl::rgbd::Frame &out, cudaStream_t stream) {
if (!in.hasChannel(Channel::Depth)) {
out.message(ftl::data::Message::Warning_MISSING_CHANNEL, "Missing Depth Channel in Normals operator");
throw FTL_Error("Missing depth channel in Normals operator");
//throw FTL_Error("Missing depth channel in Normals operator");
return false;
}
if (out.hasChannel(Channel::Normals)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment