diff --git a/deploy/cpp/utils/utils.h b/deploy/cpp/utils/utils.h index 75d0b6c8dbb8cd54d9ca3ae181e60503857ca4f0..45ffde509f151d8798108dcf77170d0c4bdc2596 100644 --- a/deploy/cpp/utils/utils.h +++ b/deploy/cpp/utils/utils.h @@ -108,10 +108,11 @@ namespace utils { int rh = im.rows; int rw = im.cols; int rc = im.channels(); - int top_index = 0; + #pragma omp parallel for for (int h = 0; h < rh; ++h) { const uchar* ptr = im.ptr(h); int im_index = 0; + int top_index = h * rw * rc; for (int w = 0; w < rw; ++w) { for (int c = 0; c < rc; ++c) { float pixel = static_cast(ptr[im_index++]);