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
forked fromopencv/opencv

Commit2bb2c48

Browse files
asmorkalovthewoz
authored andcommitted
Merge pull requestopencv#26080 from asmorkalov:as/HAL_minMaxIdx_ND_offset
Added offset for HAL as ofs2idx expects 1-based indexopencv#26080### 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- [ ] 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 parentf9e666e commit2bb2c48

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎modules/core/src/minmax.cpp‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,8 @@ static MinMaxIdxFunc getMinmaxTab(int depth)
846846
return minmaxTab[depth];
847847
}
848848

849+
// The function expects 1-based indexing for ofs
850+
// Zero is treated as invalid offset (not found)
849851
staticvoidofs2idx(const Mat& a,size_t ofs,int* idx)
850852
{
851853
int i, d = a.dims;
@@ -1524,9 +1526,9 @@ void cv::minMaxIdx(InputArray _src, double* minVal,
15241526
{
15251527
// minIdx[0] and minIdx[0] are always 0 for "flatten" version
15261528
if (minIdx)
1527-
ofs2idx(src, minIdx[1], minIdx);
1529+
ofs2idx(src, minIdx[1]+1, minIdx);
15281530
if (maxIdx)
1529-
ofs2idx(src, maxIdx[1], maxIdx);
1531+
ofs2idx(src, maxIdx[1]+1, maxIdx);
15301532
return;
15311533
}
15321534
elseif (res != CV_HAL_ERROR_NOT_IMPLEMENTED)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp