95 const int height =
static_cast<int>(rgb.
getHeight()), width =
static_cast<int>(rgb.
getWidth());
96 m_mask.resize(height, width,
false);
98 const int top =
static_cast<int>(renderBB.
getTop());
99 const int left =
static_cast<int>(renderBB.
getLeft());
100 const int bottom = std::min(height - 1,
static_cast<int>(renderBB.
getBottom()));
101 const int right = std::min(width - 1,
static_cast<int>(renderBB.
getRight()));
105 if (depth.getSize() > 0 && m_depthErrorTolerance > 0.f) {
106#ifdef VISP_HAVE_OPENMP
107#pragma omp parallel for
109 for (
int i = top; i <= bottom; ++i) {
110 for (
unsigned int j = left; j <= static_cast<unsigned int>(right); ++j) {
111 m_mask[i][j] = renderDepth[i][j] > 0.f && (depth[i][j] > 0.f && fabs(renderDepth[i][j] - depth[i][j]) <= m_depthErrorTolerance);
116#ifdef VISP_HAVE_OPENMP
117#pragma omp parallel for
119 for (
int i = top; i <= bottom; ++i) {
120 for (
unsigned int j = left; j <= static_cast<unsigned int>(right); ++j) {
121 m_mask[i][j] = renderDepth[i][j] > 0.f;
126 const float numPxTotal =
static_cast<float>(m_histObjectFrame.getNumPixels() + m_histBackgroundFrame.getNumPixels());
128 const float pObject =
static_cast<float>(m_histObjectFrame.getNumPixels()) / numPxTotal;
129 const float pBackground =
static_cast<float>(m_histBackgroundFrame.getNumPixels()) / numPxTotal;
132 if (pObject != 0.f) {
133 m_histObject.merge(m_histObjectFrame, m_objectUpdateRate);
137 if (pBackground != 0.f) {
138 m_histBackground.merge(m_histBackgroundFrame, m_backgroundUpdateRate);
144 if (m_computeOnBBOnly) {
145 mask.
resize(height, width, 0.f);
146#ifdef VISP_HAVE_OPENMP
147#pragma omp parallel for
149 for (
int i = top; i <= bottom; ++i) {
150 for (
int j = left; j <= right; ++j) {
151 unsigned int index = m_histObject.colorToIndex(frame.
IRGB[i][j]);
152 mask[i][j] = probas(index);
158 mask.
resize(height, width);
159#ifdef VISP_HAVE_OPENMP
160#pragma omp parallel for
162 for (
int i = 0; i < static_cast<int>(mask.
getSize()); ++i) {
163 unsigned int index = m_histObject.colorToIndex(frame.
IRGB.
bitmap[i]);
164 mask.
bitmap[i] = probas(index);