From: Vadim Pisarevsky Date: Fri, 17 Jun 2011 19:03:26 +0000 (+0000) Subject: added reduce(..., CV_REDUCE_MIN/CV_REDUCE_MAX, ...) for 16u/16s (ticket #1145) X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~6934 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b6d8c3963fed02c582daa1f8446a183cae85da6;p=platform%2Fupstream%2Fopencv.git added reduce(..., CV_REDUCE_MIN/CV_REDUCE_MAX, ...) for 16u/16s (ticket #1145) --- diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index 0d9fa80..987b57a 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_ >; } }