Skip to content

Commit 7ec59fc

Browse files
Revert changes of mean and meanStdDev
1 parent 46a668c commit 7ec59fc

File tree

4 files changed

+132
-310
lines changed

4 files changed

+132
-310
lines changed

modules/core/include/opencv2/core.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ CV_EXPORTS_W void findNonZero( InputArray src, OutputArray idx );
608608
609609
The function cv::mean calculates the mean value M of array elements,
610610
independently for each channel, and return it:
611-
\f[\begin{array}{l} N_c = \sum _{I: \; {\texttt{mask} (I)_c} \ne 0} 1 \\ M_c = \left ( \sum _{I: \; {\texttt{mask} (I)_c} \ne 0}{ \texttt{src} (I)_c} \right )/N_c \end{array}\f]
611+
\f[\begin{array}{l} N = \sum _{I: \; \texttt{mask} (I) \ne 0} 1 \\ M_c = \left ( \sum _{I: \; \texttt{mask} (I) \ne 0}{ \texttt{mtx} (I)_c} \right )/N \end{array}\f]
612612
When all the mask elements are 0's, the function returns Scalar::all(0)
613613
@param src input array that should have from 1 to 4 channels so that the result can be stored in
614614
Scalar_ .
@@ -622,7 +622,7 @@ CV_EXPORTS_W Scalar mean(InputArray src, InputArray mask = noArray());
622622
The function cv::meanStdDev calculates the mean and the standard deviation M
623623
of array elements independently for each channel and returns it via the
624624
output parameters:
625-
\f[\begin{array}{l} N_c = \sum _{I, {\texttt{mask} (I)_c} \ne 0} 1 \\ \texttt{mean} _c = \frac{\sum_{ I: \; {\texttt{mask} (I)_c} \ne 0} \texttt{src} (I)_c}{N_c} \\ \texttt{stddev} _c = \sqrt{\frac{\sum_{ I: \; {\texttt{mask} (I)_c} \ne 0} \left ( \texttt{src} (I)_c - \texttt{mean} _c \right )^2}{N_c}} \end{array}\f]
625+
\f[\begin{array}{l} N = \sum _{I, \texttt{mask} (I) \ne 0} 1 \\ \texttt{mean} _c = \frac{\sum_{ I: \; \texttt{mask}(I) \ne 0} \texttt{src} (I)_c}{N} \\ \texttt{stddev} _c = \sqrt{\frac{\sum_{ I: \; \texttt{mask}(I) \ne 0} \left ( \texttt{src} (I)_c - \texttt{mean} _c \right )^2}{N}} \end{array}\f]
626626
When all the mask elements are 0's, the function returns
627627
mean=stddev=Scalar::all(0).
628628
@note The calculated standard deviation is only the diagonal of the

0 commit comments

Comments
 (0)