Skip to content
Snippets Groups Projects

CUDA optical flow smoothing

Merged Sebastian Hahta requested to merge feature/off-cuda into master
4 files
+ 62
50
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -36,49 +36,8 @@ public:
* true.
*/
const cv::Mat& getChannel(const ftl::rgbd::channel_t& channel)
{
auto idx = _channelIdx(channel);
if (!(available_[idx] & mask_host))
{
if (available_[idx] & mask_gpu)
{
channels_gpu_[idx].download(channels_host_[idx]);
available_[idx] |= mask_host;
}
}
return channels_host_[idx];
}
cv::Mat& setChannel(const ftl::rgbd::channel_t& channel)
{
auto idx = _channelIdx(channel);
available_[idx] = mask_host;
return channels_host_[idx];
}
const cv::cuda::GpuMat& getChannelGpu(const ftl::rgbd::channel_t& channel)
{
auto idx = _channelIdx(channel);
if (!(available_[idx] & mask_gpu))
{
if (available_[idx] & mask_host)
{
channels_gpu_[idx].upload(channels_host_[idx]);
available_[idx] |= mask_gpu;
}
}
return channels_gpu_[idx];
}
cv::cuda::GpuMat& setChannelGpu(const ftl::rgbd::channel_t& channel)
{
auto idx = _channelIdx(channel);
available_[idx] = mask_gpu;
return channels_gpu_[idx];
}
template <typename T> const T& getChannel(const ftl::rgbd::channel_t& channel);
template <typename T> T& setChannel(const ftl::rgbd::channel_t& channel);
private:
@@ -112,4 +71,4 @@ private:
};
}
}
\ No newline at end of file
}
Loading