diff --git a/applications/reconstruct/src/reconstruction.cpp b/applications/reconstruct/src/reconstruction.cpp index c9ce1bf8983a6d3fba981f0a69b497475070308c..be99d1581c3555b1d52aab156bb9ed316d559de6 100644 --- a/applications/reconstruct/src/reconstruction.cpp +++ b/applications/reconstruct/src/reconstruction.cpp @@ -107,5 +107,6 @@ void Reconstruction::render(ftl::rgbd::VirtualSource *vs, ftl::rgbd::Frame &out) // transform.setIdentity(); //} - renderer_->render(vs, out, transform); + Eigen::Affine3d sm = Eigen::Affine3d(Eigen::Scaling(double(value("scale", 1.0f)))); + renderer_->render(vs, out, sm.matrix() * transform); } \ No newline at end of file diff --git a/components/renderers/cpp/include/ftl/render/tri_render.hpp b/components/renderers/cpp/include/ftl/render/tri_render.hpp index dbe7977972a77ea82da079e6cac288057771ba9e..27b6db318c1a751cfcb99dec829828b69237b618 100644 --- a/components/renderers/cpp/include/ftl/render/tri_render.hpp +++ b/components/renderers/cpp/include/ftl/render/tri_render.hpp @@ -42,6 +42,8 @@ class Triangular : public ftl::render::Renderer { ftl::render::SplatParams params_; cudaStream_t stream_; float3 light_pos_; + Eigen::Matrix4d transform_; + float scale_; cv::cuda::GpuMat env_image_; ftl::cuda::TextureObject<uchar4> env_tex_; diff --git a/components/renderers/cpp/src/tri_render.cpp b/components/renderers/cpp/src/tri_render.cpp index d1cf0c8a1682c5d5c718835560b01d82423919c5..9ef51d9d124e6ebc6da70a5034dab28f845c062f 100644 --- a/components/renderers/cpp/src/tri_render.cpp +++ b/components/renderers/cpp/src/tri_render.cpp @@ -216,6 +216,8 @@ void Triangular::__reprojectChannel(ftl::rgbd::Frame &output, ftl::codecs::Chann temp_.createTexture<float>(Channel::Contribution); + //float scale = value("scale",1.0f); + for (size_t i=0; i < scene_->frames.size(); ++i) { auto &f = scene_->frames[i]; auto *s = scene_->sources[i]; @@ -228,6 +230,7 @@ void Triangular::__reprojectChannel(ftl::rgbd::Frame &output, ftl::codecs::Chann cv::cuda::cvtColor(tmp,col, cv::COLOR_BGR2BGRA); } + //Eigen::Affine3f sm = Eigen::Affine3f(Eigen::Scaling(scale)); auto transform = MatrixConversion::toCUDA(t.cast<float>().inverse() * s->getPose().cast<float>().inverse()) * params_.m_viewMatrixInverse; auto transformR = MatrixConversion::toCUDA(t.cast<float>().inverse() * s->getPose().cast<float>().inverse()).getFloat3x3(); @@ -328,6 +331,8 @@ void Triangular::_mesh(ftl::rgbd::Frame &out, ftl::rgbd::Source *src, const Eige temp_.get<GpuMat>(Channel::Depth2).setTo(cv::Scalar(0x7FFFFFFF), cvstream); } + //float scale = value("scale",1.0f); + // For each source depth map for (size_t i=0; i < scene_->frames.size(); ++i) { auto &f = scene_->frames[i]; @@ -338,6 +343,7 @@ void Triangular::_mesh(ftl::rgbd::Frame &out, ftl::rgbd::Source *src, const Eige continue; } + //Eigen::Affine3f sm = Eigen::Affine3f(Eigen::Scaling(scale)); auto pose = MatrixConversion::toCUDA(t.cast<float>() * s->getPose().cast<float>()); // Calculate and save virtual view screen position of each source pixel