mirror of
https://github.com/opencv/opencv.git
synced 2026-11-28 04:17:06 -06:00
The reduceR_/reduceC_ dispatch is a chain of explicit sdepth/ddepth pairs and has never carried a CV_8S or CV_32S source row, so cv::reduce rejected both for every operation and both dim values. 4.x has the same gap. CV_8S mirrors CV_8U and accumulates in int. CV_32S accumulates in double: OpAdd<int> evaluates a + b as int before saturate_cast can clamp it, so an int accumulator overflows. CV_32S -> CV_32S sums are left unsupported for that reason. Extend Core_ReduceTest to the new combinations, and add cases for the 32-bit overflow range and the signed 8-bit extremes, which its randu(0, 100) fill cannot reach. Its support list also omitted 16U/16S REDUCE_MAX/REDUCE_MIN, which the existing kernels already handle. Partially addresses #30569.