Files
opencv-MIRROR/modules
Shiven Solanki 566df44633 core: support fp8 depths in cv::sum and cv::mean (#30670)
* core: support fp8 depths in cv::sum

cv::sum and cv::trace threw for CV_8F_E4M3FN and CV_8F_E4M3FNUZ. Add
sum8f and sum8fnuz to the function table, and collect their float totals
in blocks like CV_16F and CV_16BF.

* core: test cv::sum on fp8 past the block size

Add a (1 << 15) + 1 element case to Core_Sum_FP8, so the float total is
moved to the double result and reset between blocks.

* core: support fp8 depths in cv::mean

cv::mean uses the same adding functions as cv::sum, so adding fp8 to that table made it accept these depths. Its blockSum check still left them out, so the float totals were written straight into the double result and the mean came back wrong. Use the block path for CV_8F_E4M3FN and CV_8F_E4M3FNUZ, as cv::sum does, and check cv::mean in Core_Sum_FP8.

* core: test cv::mean with a mask on fp8

* core: split Core_Sum_FP8 into sum, mean and mean_mask tests

Move the array setup into a fixture, and make the length a test parameter, so each case runs on its own.
2026-11-09 09:41:13 +05:30
..
2026-07-09 12:17:24 +03:00