From 029030095cab1510c16deb603157325d025e1d7a Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Wed, 25 Jun 2025 20:48:14 +0300 Subject: [PATCH] doc: added note to normalize function --- modules/core/include/opencv2/core.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/core/include/opencv2/core.hpp b/modules/core/include/opencv2/core.hpp index 12951d2a98..153bd17320 100644 --- a/modules/core/include/opencv2/core.hpp +++ b/modules/core/include/opencv2/core.hpp @@ -805,6 +805,11 @@ Possible usage with some positive example data: normalize(positiveData, normalizedData_minmax, 1.0, 0.0, NORM_MINMAX); @endcode +@note Due to rounding issues, min-max normalization can result in values outside provided boundaries. +If exact range conformity is needed, following workarounds can be used: +- use double floating point precision (dtype = CV_64F) +- manually clip values (`cv::max(res, left_bound, res)`, `cv::min(res, right_bound, res)` or `np.clip`) + @param src input array. @param dst output array of the same size as src . @param alpha norm value to normalize to or the lower range boundary in case of the range