Skip to content

Commit

Permalink
Fix build issue detected by ci and due to previous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Nov 27, 2024
1 parent 6fd94b5 commit 2d07122
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
19 changes: 10 additions & 9 deletions modules/core/src/image/private/vpImageConvert_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ BEGIN_VISP_NAMESPACE
#endif

const unsigned int val_0x10000 = 0x10000;
for (int i = 2; i < val_0x10000; ++i) {
for (unsigned int i = 2; i < val_0x10000; ++i) {
histogram[i] += histogram[i - 1]; // Build a cumulative histogram for the indices in [1,0xFFFF]
}
dest_depth.resize(src_depth.getHeight(), src_depth.getWidth());
Expand Down Expand Up @@ -151,7 +151,7 @@ void vp_createDepthHistogram(const vpImage<uint16_t> &src_depth, vpImage<unsigne
#endif

const unsigned int val_0x10000 = 0x10000;
for (int i = 2; i < val_0x10000; ++i) {
for (unsigned int i = 2; i < val_0x10000; ++i) {
histogram[i] += histogram[i - 1]; // Build a cumulative histogram for the indices in [1,0xFFFF]
}
dest_depth.resize(src_depth.getHeight(), src_depth.getWidth());
Expand Down Expand Up @@ -196,15 +196,16 @@ void vp_createDepthHistogram(const vpImage<float> &src_depth, vpImage<vpRGBa> &d
}

const unsigned int val_0x10000 = 0x10000;
for (int i = 2; i < val_0x10000; ++i) {
for (unsigned int i = 2; i < val_0x10000; ++i) {
histogram[i] += histogram[i - 1]; // Build a cumulative histogram for the indices in [1,0xFFFF]
}
#ifdef VISP_HAVE_OPENMP
#pragma omp parallel for
#endif

const unsigned char val_uc_5 = 5;
const unsigned char val_uc_20 = 20;
const unsigned char val_uc_255 = 255;
#ifdef VISP_HAVE_OPENMP
#pragma omp parallel for
#endif
for (int i = 0; i < src_depth_size; ++i) {
uint16_t d = static_cast<uint16_t>(src_depth.bitmap[i]);
if (d) {
Expand Down Expand Up @@ -247,13 +248,13 @@ void vp_createDepthHistogram(const vpImage<uint16_t> &src_depth, vpImage<vpRGBa>
for (unsigned int i = 2; i < val_0x10000; ++i) {
histogram[i] += histogram[i - 1]; // Build a cumulative histogram for the indices in [1,0xFFFF]
}
#ifdef VISP_HAVE_OPENMP
#pragma omp parallel for
#endif

const unsigned char val_uc_5 = 5;
const unsigned char val_uc_20 = 20;
const unsigned char val_uc_255 = 255;
#ifdef VISP_HAVE_OPENMP
#pragma omp parallel for
#endif
for (int i = 0; i < src_depth_size; ++i) {
uint16_t d = src_depth.bitmap[i];
if (d) {
Expand Down
3 changes: 2 additions & 1 deletion modules/core/src/image/vpImageTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1217,10 +1217,11 @@ int vpImageTools::inRange(const unsigned char *hue, const unsigned char *saturat
unsigned char v_high = static_cast<unsigned char>(hsv_range[index_5]);
int size_ = static_cast<int>(size);
int cpt_in_range = 0;

const unsigned char val_uc_255 = 255;
#if defined(_OPENMP)
#pragma omp parallel for reduction(+:cpt_in_range)
#endif
const unsigned char val_uc_255 = 255;
for (int i = 0; i < size_; ++i) {
bool check_h_low_high_hue = (h_low <= hue[i]) && (hue[i] <= h_high);
bool check_s_low_high_saturation = (s_low <= saturation[i]) && (saturation[i] <= s_high);
Expand Down

0 comments on commit 2d07122

Please sign in to comment.