46 m_colorMask.updateMask(frame, previousFrame, m_color);
47 m_depthMask.updateMask(frame, previousFrame, m_depth);
49 bool computeOnlyOnBB = m_colorMask.isComputedOnlyOnBoundingBox() && m_depthMask.isComputedOnlyOnBoundingBox();
50 if (!computeOnlyOnBB) {
51 mask.
resize(m_color.getHeight(), m_color.getWidth());
52#ifdef VISP_HAVE_OPENMP
53#pragma omp parallel for
55 for (
int i = 0; i < static_cast<int>(m_color.getSize()); ++i) {
56 mask.
bitmap[i] = std::min(m_color.bitmap[i], m_depth.bitmap[i]);
60 mask.
resize(m_color.getHeight(), m_color.getWidth(), 0.f);
63 const int top =
static_cast<int>(renderBB.
getTop());
64 const int left =
static_cast<int>(renderBB.
getLeft());
65 const int bottom = std::min(
static_cast<int>(m_color.getHeight()) - 1,
static_cast<int>(renderBB.
getBottom()));
66 const int right = std::min(
static_cast<int>(m_color.getWidth()) - 1,
static_cast<int>(renderBB.
getRight()));
67#ifdef VISP_HAVE_OPENMP
68#pragma omp parallel for
70 for (
int i = top; i <= bottom; ++i) {
71 const float *
const colorProbaRow = m_color[i];
72 const float *
const depthProbaRow = m_depth[i];
73 float *
const maskRow = mask[i];
74 for (
unsigned int j = left; j <= static_cast<unsigned int>(right); ++j) {
75 maskRow[j] = std::min(colorProbaRow[j], depthProbaRow[j]);