fix meanStdDev overflow for large images#26867
Conversation
|
Isn't there a preparatory step to foresee so that |
Your concern is valid, can do the following if (src.isContinuous() && mask.isContinuous())
{
const size_t tpix = src.total();
CALL_HAL(meanStdDev, cv_hal_meanStdDev, src.data, 0, tpix, 1, src.type(),
_mean.needed() ? mean_mat.ptr<double>() : nullptr,
_sdv.needed() ? stddev_mat.ptr<double>() : nullptr,
mask.data, 0);
} |
|
The prototype of |
|
@shyama7004, the added test requires 16Gb of RAM. That's a huge number, quite inconvenient for our CI. I suggest to, first of all, consider 8U type for array, not 32F and then reduce size of the array to a smaller number of elements, ~2 billions or so (e.g. |
Ok I will implement this |
61500dc to
e8d2934
Compare
99d13df to
16fd7a7
Compare
16fd7a7 to
987ba65
Compare
Fixes : #26861
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.