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

Allow non colour channels to be displayed

parent c88b9407
No related branches found
No related tags found
2 merge requests!116Implements #133 point alignment,!114Ongoing #133 improvements
...@@ -47,6 +47,10 @@ bool NvPipeEncoder::encode(const cv::Mat &in, definition_t odefinition, bitrate_ ...@@ -47,6 +47,10 @@ bool NvPipeEncoder::encode(const cv::Mat &in, definition_t odefinition, bitrate_
//LOG(INFO) << "Definition: " << ftl::codecs::getWidth(definition) << "x" << ftl::codecs::getHeight(definition); //LOG(INFO) << "Definition: " << ftl::codecs::getWidth(definition) << "x" << ftl::codecs::getHeight(definition);
if (in.empty()) {
LOG(ERROR) << "Missing data for Nvidia encoder";
return false;
}
if (!_createEncoder(in, definition, bitrate)) return false; if (!_createEncoder(in, definition, bitrate)) return false;
//LOG(INFO) << "NvPipe Encode: " << int(definition) << " " << in.cols; //LOG(INFO) << "NvPipe Encode: " << int(definition) << " " << in.cols;
......
...@@ -69,7 +69,7 @@ void Splatter::renderChannel( ...@@ -69,7 +69,7 @@ void Splatter::renderChannel(
// Accumulate attribute contributions for each pixel // Accumulate attribute contributions for each pixel
for (auto &f : scene_->frames) { for (auto &f : scene_->frames) {
// Convert colour from BGR to BGRA if needed // Convert colour from BGR to BGRA if needed
if (f.get<GpuMat>(Channel::Colour).type() == CV_8UC3) { if (f.get<GpuMat>(channel).type() == CV_8UC3) {
// Convert to 4 channel colour // Convert to 4 channel colour
auto &col = f.get<GpuMat>(Channel::Colour); auto &col = f.get<GpuMat>(Channel::Colour);
GpuMat tmp(col.size(), CV_8UC4); GpuMat tmp(col.size(), CV_8UC4);
...@@ -211,6 +211,13 @@ bool Splatter::render(ftl::rgbd::VirtualSource *src, ftl::rgbd::Frame &out, cuda ...@@ -211,6 +211,13 @@ bool Splatter::render(ftl::rgbd::VirtualSource *src, ftl::rgbd::Frame &out, cuda
out.create<GpuMat>(Channel::Right, Format<uchar4>(camera.width, camera.height)); out.create<GpuMat>(Channel::Right, Format<uchar4>(camera.width, camera.height));
out.get<GpuMat>(Channel::Right).setTo(cv::Scalar(76,76,76), cvstream); out.get<GpuMat>(Channel::Right).setTo(cv::Scalar(76,76,76), cvstream);
renderChannel(params, out, Channel::Right, stream); renderChannel(params, out, Channel::Right, stream);
} else {
if (ftl::rgbd::isFloatChannel(chan)) {
out.create<GpuMat>(chan, Format<float>(camera.width, camera.height));
} else {
out.create<GpuMat>(chan, Format<uchar4>(camera.width, camera.height));
}
renderChannel(params, out, chan, stream);
} }
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment