diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index 0d9fa8009d..987b57a086 100644 --- a/modules/core/src/matrix.cpp +++ b/modules/core/src/matrix.cpp @@ -1888,41 +1888,49 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype) { if(sdepth == CV_8U && ddepth == CV_32S) func = reduceR_ >; - if(sdepth == CV_8U && ddepth == CV_32F) + else if(sdepth == CV_8U && ddepth == CV_32F) func = reduceR_ >; - if(sdepth == CV_8U && ddepth == CV_64F) + else if(sdepth == CV_8U && ddepth == CV_64F) func = reduceR_ >; - if(sdepth == CV_16U && ddepth == CV_32F) + else if(sdepth == CV_16U && ddepth == CV_32F) func = reduceR_ >; - if(sdepth == CV_16U && ddepth == CV_64F) + else if(sdepth == CV_16U && ddepth == CV_64F) func = reduceR_ >; - if(sdepth == CV_16S && ddepth == CV_32F) + else if(sdepth == CV_16S && ddepth == CV_32F) func = reduceR_ >; - if(sdepth == CV_16S && ddepth == CV_64F) + else if(sdepth == CV_16S && ddepth == CV_64F) func = reduceR_ >; - if(sdepth == CV_32F && ddepth == CV_32F) + else if(sdepth == CV_32F && ddepth == CV_32F) func = reduceR_ >; - if(sdepth == CV_32F && ddepth == CV_64F) + else if(sdepth == CV_32F && ddepth == CV_64F) func = reduceR_ >; - if(sdepth == CV_64F && ddepth == CV_64F) + else if(sdepth == CV_64F && ddepth == CV_64F) func = reduceR_ >; } else if(op == CV_REDUCE_MAX) { if(sdepth == CV_8U && ddepth == CV_8U) func = reduceR_ >; - if(sdepth == CV_32F && ddepth == CV_32F) + else if(sdepth == CV_16U && ddepth == CV_16U) + func = reduceR_ >; + else if(sdepth == CV_16S && ddepth == CV_16S) + func = reduceR_ >; + else if(sdepth == CV_32F && ddepth == CV_32F) func = reduceR_ >; - if(sdepth == CV_64F && ddepth == CV_64F) + else if(sdepth == CV_64F && ddepth == CV_64F) func = reduceR_ >; } else if(op == CV_REDUCE_MIN) { if(sdepth == CV_8U && ddepth == CV_8U) func = reduceR_ >; - if(sdepth == CV_32F && ddepth == CV_32F) + else if(sdepth == CV_16U && ddepth == CV_16U) + func = reduceR_ >; + else if(sdepth == CV_16S && ddepth == CV_16S) + func = reduceR_ >; + else if(sdepth == CV_32F && ddepth == CV_32F) func = reduceR_ >; - if(sdepth == CV_64F && ddepth == CV_64F) + else if(sdepth == CV_64F && ddepth == CV_64F) func = reduceR_ >; } } @@ -1932,41 +1940,49 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype) { if(sdepth == CV_8U && ddepth == CV_32S) func = reduceC_ >; - if(sdepth == CV_8U && ddepth == CV_32F) + else if(sdepth == CV_8U && ddepth == CV_32F) func = reduceC_ >; - if(sdepth == CV_8U && ddepth == CV_64F) + else if(sdepth == CV_8U && ddepth == CV_64F) func = reduceC_ >; - if(sdepth == CV_16U && ddepth == CV_32F) + else if(sdepth == CV_16U && ddepth == CV_32F) func = reduceC_ >; - if(sdepth == CV_16U && ddepth == CV_64F) + else if(sdepth == CV_16U && ddepth == CV_64F) func = reduceC_ >; - if(sdepth == CV_16S && ddepth == CV_32F) + else if(sdepth == CV_16S && ddepth == CV_32F) func = reduceC_ >; - if(sdepth == CV_16S && ddepth == CV_64F) + else if(sdepth == CV_16S && ddepth == CV_64F) func = reduceC_ >; - if(sdepth == CV_32F && ddepth == CV_32F) + else if(sdepth == CV_32F && ddepth == CV_32F) func = reduceC_ >; - if(sdepth == CV_32F && ddepth == CV_64F) + else if(sdepth == CV_32F && ddepth == CV_64F) func = reduceC_ >; - if(sdepth == CV_64F && ddepth == CV_64F) + else if(sdepth == CV_64F && ddepth == CV_64F) func = reduceC_ >; } else if(op == CV_REDUCE_MAX) { if(sdepth == CV_8U && ddepth == CV_8U) func = reduceC_ >; - if(sdepth == CV_32F && ddepth == CV_32F) + else if(sdepth == CV_16U && ddepth == CV_16U) + func = reduceC_ >; + else if(sdepth == CV_16S && ddepth == CV_16S) + func = reduceC_ >; + else if(sdepth == CV_32F && ddepth == CV_32F) func = reduceC_ >; - if(sdepth == CV_64F && ddepth == CV_64F) + else if(sdepth == CV_64F && ddepth == CV_64F) func = reduceC_ >; } else if(op == CV_REDUCE_MIN) { if(sdepth == CV_8U && ddepth == CV_8U) func = reduceC_ >; - if(sdepth == CV_32F && ddepth == CV_32F) + else if(sdepth == CV_16U && ddepth == CV_16U) + func = reduceC_ >; + else if(sdepth == CV_16S && ddepth == CV_16S) + func = reduceC_ >; + else if(sdepth == CV_32F && ddepth == CV_32F) func = reduceC_ >; - if(sdepth == CV_64F && ddepth == CV_64F) + else if(sdepth == CV_64F && ddepth == CV_64F) func = reduceC_ >; } }