diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index 0d0576a47c..8c3842a315 100644 --- a/modules/core/src/matrix.cpp +++ b/modules/core/src/matrix.cpp @@ -1872,8 +1872,10 @@ void cv::reduce(const InputArray& _src, OutputArray _dst, int dim, int op, int d { op = CV_REDUCE_SUM; if( sdepth < CV_32S && ddepth < CV_32S ) + { temp.create(dst.rows, dst.cols, CV_32SC(cn)); - //ddepth = CV_32S; + ddepth = CV_32S; + } } ReduceFunc func = 0;