diff --git a/components/operators/src/fusion/correspondence_common.hpp b/components/operators/src/fusion/correspondence_common.hpp index 1bb546994cd578727e167be595453887de32e124..9f19ef7119979f232fd85c0de15831ffc19b5ce5 100644 --- a/components/operators/src/fusion/correspondence_common.hpp +++ b/components/operators/src/fusion/correspondence_common.hpp @@ -14,8 +14,8 @@ __device__ inline bool isBadCor(float depth, const float2 &pos, const ftl::rgbd: depth >= cam.maxDepth || pos.x < 0.5f || pos.y < 0.5f || - pos.x >= cam.width-0.5f || - pos.y >= cam.height-0.5f; + pos.x >= float(cam.width)-0.5f || + pos.y >= float(cam.height)-0.5f; } __device__ inline float square(float v) { return v*v; } diff --git a/components/operators/src/fusion/mvmls.cpp b/components/operators/src/fusion/mvmls.cpp index 3bb77a52f2b85381c77b67d4a6b9e44d3a49b34e..55b992957805ec2cb6fe9d00baad4b7f5193202f 100644 --- a/components/operators/src/fusion/mvmls.cpp +++ b/components/operators/src/fusion/mvmls.cpp @@ -2,6 +2,7 @@ #include "smoothing_cuda.hpp" #include <ftl/utility/matrix_conversion.hpp> #include "mvmls_cuda.hpp" +#include <ftl/cuda/normals.hpp> #include <opencv2/cudaarithm.hpp> @@ -335,6 +336,16 @@ bool MultiViewMLS::apply(ftl::rgbd::FrameSet &in, ftl::rgbd::FrameSet &out, cuda // Reduce window size for next iteration //win = max(win>>1, 4); + + // Redo normals + for (size_t i=0; i<in.frames.size(); ++i) { + auto &f = in.frames[i]; + ftl::cuda::normals( + f.getTexture<half4>(Channel::Normals), + f.getTexture<float>(Channel::Depth), + f.getLeftCamera(), stream + ); + } } for (int iter=0; iter<iters; ++iter) {