Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4450226

Browse files
authored
Merge pull request#25789 from asmorkalov:as/HAL_meanStdDev_tails
Fill mean and stdDev tails with zeros for HAL branch in meanStdDev#25789as it's done for other branches.### Pull Request Readiness ChecklistSee details athttps://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
1 parent204d62a commit4450226

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

‎modules/core/src/mean.dispatch.cpp‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,10 @@ void meanStdDev(InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray
544544
int dcn = (int)mean_mat.total();
545545
CV_Assert( mean_mat.type() == CV_64F && mean_mat.isContinuous() &&
546546
(mean_mat.cols ==1 || mean_mat.rows ==1) && dcn >= cn );
547+
548+
double* dptr = mean_mat.ptr<double>();
549+
for(k = cn ; k < dcn; k++ )
550+
dptr[k] =0;
547551
}
548552

549553
if (_sdv.needed())
@@ -555,6 +559,11 @@ void meanStdDev(InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray
555559
int dcn = (int)stddev_mat.total();
556560
CV_Assert( stddev_mat.type() == CV_64F && stddev_mat.isContinuous() &&
557561
(stddev_mat.cols ==1 || stddev_mat.rows ==1) && dcn >= cn );
562+
563+
double* dptr = stddev_mat.ptr<double>();
564+
for(k = cn ; k < dcn; k++ )
565+
dptr[k] =0;
566+
558567
}
559568

560569
if (src.isContinuous() && mask.isContinuous())
@@ -646,23 +655,17 @@ void meanStdDev(InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray
646655
if (_mean.needed())
647656
{
648657
constdouble* sptr = s;
649-
int dcn = (int)mean_mat.total();
650658
double* dptr = mean_mat.ptr<double>();
651659
for( k =0; k < cn; k++ )
652660
dptr[k] = sptr[k];
653-
for( ; k < dcn; k++ )
654-
dptr[k] =0;
655661
}
656662

657663
if (_sdv.needed())
658664
{
659665
constdouble* sptr = sq;
660-
int dcn = (int)stddev_mat.total();
661666
double* dptr = stddev_mat.ptr<double>();
662667
for( k =0; k < cn; k++ )
663668
dptr[k] = sptr[k];
664-
for( ; k < dcn; k++ )
665-
dptr[k] =0;
666669
}
667670
}
668671

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp