From b5249be51ed3dd5f87e1628ae79f07cb3ed66a45 Mon Sep 17 00:00:00 2001 From: uvos Date: Thu, 1 Jul 2021 14:02:46 +0200 Subject: [PATCH] parallelize curve application --- src/uvosunwrap/curve.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/uvosunwrap/curve.h b/src/uvosunwrap/curve.h index 4b121b9..17e5d65 100644 --- a/src/uvosunwrap/curve.h +++ b/src/uvosunwrap/curve.h @@ -50,12 +50,5 @@ void applyCurve(cv::Mat image, cv::Mat curve) assert(curve.type() == CV_32FC1); assert(curve.rows == 2); - for(int y = 0; y < image.rows; y++) - { - float* col = image.ptr(y); - for(int x = 0; x < image.cols; ++x) - { - col[x]=applyCurve(col[x], curve); - } - } + image.forEach([&curve](float &p, const int * position){p = applyCurve(p, curve);}); }