Skip to content
Snippets Groups Projects

Implement #150 splat resizing

Merged Nicolas Pope requested to merge feature/150/splatknn into master
5 files
+ 42
1
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -222,6 +222,7 @@ void ftl::gui::Camera::showSettings() {
void ftl::gui::Camera::setChannel(ftl::rgbd::channel_t c) {
channel_ = c;
switch (c) {
case ftl::rgbd::kChanEnergy:
case ftl::rgbd::kChanFlow:
case ftl::rgbd::kChanConfidence:
case ftl::rgbd::kChanNormals:
@@ -255,6 +256,19 @@ static void visualizeDepthMap( const cv::Mat &depth, cv::Mat &out,
out.setTo(cv::Scalar(255, 255, 255), mask);
}
static void visualizeEnergy( const cv::Mat &depth, cv::Mat &out,
const float max_depth)
{
DCHECK(max_depth > 0.0);
depth.convertTo(out, CV_8U, 255.0f / max_depth);
//out = 255 - out;
cv::Mat mask = (depth >= 39.0f); // TODO (mask for invalid pixels)
applyColorMap(out, out, cv::COLORMAP_JET);
out.setTo(cv::Scalar(255, 255, 255), mask);
}
static void drawEdges( const cv::Mat &in, cv::Mat &out,
const int ksize = 3, double weight = -1.0, const int threshold = 32,
const int threshold_type = cv::THRESH_TOZERO)
@@ -303,6 +317,11 @@ const GLTexture &ftl::gui::Camera::captureFrame() {
cv::Mat tmp;
switch(channel_) {
case ftl::rgbd::kChanEnergy:
if (depth.rows == 0) { break; }
visualizeEnergy(depth, tmp, 10.0);
texture_.update(tmp);
break;
case ftl::rgbd::kChanDepth:
if (depth.rows == 0) { break; }
visualizeDepthMap(depth, tmp, 7.0);
Loading