mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
Merge pull request #25789 from asmorkalov:as/HAL_meanStdDev_tails
Fill mean and stdDev tails with zeros for HAL branch in meanStdDev #25789 as it's done for other branches. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
parent
204d62ae12
commit
445022682e
@ -544,6 +544,10 @@ void meanStdDev(InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray
|
||||
int dcn = (int)mean_mat.total();
|
||||
CV_Assert( mean_mat.type() == CV_64F && mean_mat.isContinuous() &&
|
||||
(mean_mat.cols == 1 || mean_mat.rows == 1) && dcn >= cn );
|
||||
|
||||
double* dptr = mean_mat.ptr<double>();
|
||||
for(k = cn ; k < dcn; k++ )
|
||||
dptr[k] = 0;
|
||||
}
|
||||
|
||||
if (_sdv.needed())
|
||||
@ -555,6 +559,11 @@ void meanStdDev(InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray
|
||||
int dcn = (int)stddev_mat.total();
|
||||
CV_Assert( stddev_mat.type() == CV_64F && stddev_mat.isContinuous() &&
|
||||
(stddev_mat.cols == 1 || stddev_mat.rows == 1) && dcn >= cn );
|
||||
|
||||
double* dptr = stddev_mat.ptr<double>();
|
||||
for(k = cn ; k < dcn; k++ )
|
||||
dptr[k] = 0;
|
||||
|
||||
}
|
||||
|
||||
if (src.isContinuous() && mask.isContinuous())
|
||||
@ -646,23 +655,17 @@ void meanStdDev(InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray
|
||||
if (_mean.needed())
|
||||
{
|
||||
const double* sptr = s;
|
||||
int dcn = (int)mean_mat.total();
|
||||
double* dptr = mean_mat.ptr<double>();
|
||||
for( k = 0; k < cn; k++ )
|
||||
dptr[k] = sptr[k];
|
||||
for( ; k < dcn; k++ )
|
||||
dptr[k] = 0;
|
||||
}
|
||||
|
||||
if (_sdv.needed())
|
||||
{
|
||||
const double* sptr = sq;
|
||||
int dcn = (int)stddev_mat.total();
|
||||
double* dptr = stddev_mat.ptr<double>();
|
||||
for( k = 0; k < cn; k++ )
|
||||
dptr[k] = sptr[k];
|
||||
for( ; k < dcn; k++ )
|
||||
dptr[k] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user