New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transform offset to indeces for MatND in minMaxIdx HAL #25563
Conversation
@mplatings please take a look. |
Co-authored-by: Michael Platings <michael@platin.gs>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Transform offset to indeces for MatND in minMaxIdx HAL opencv#25563 Address comments in opencv#25553 ### 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 - [x] 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
if (res == CV_HAL_ERROR_OK) | ||
{ | ||
if (minIdx) | ||
ofs2idx(src, minIdx[0], minIdx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asmorkalov I've done some more testing and I believe it should be minIdx[1]
and maxIdx[1]
. I thought that minIdx[0] would correspond to the X direction, but it seems that in OpenCV it corresponds to the row. According do the docs:
single-row matrix is 1xN matrix (and therefore minIdx/maxIdx will be (0,j1)/(0,j2))
If I change these indices from 0 to 1 then my tests pass.
Address comments in #25553
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.