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

Implement ArgMax and ArgMin#20733

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
alalek merged 3 commits intoopencv:4.xfromrogday:argmaxnd
Nov 28, 2021
Merged

Implement ArgMax and ArgMin#20733

alalek merged 3 commits intoopencv:4.xfromrogday:argmaxnd
Nov 28, 2021

Conversation

@rogday
Copy link
Member

@rogdayrogday commentedSep 22, 2021
edited
Loading

Related#20679

Pull Request Readiness Checklist

See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to 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

asmorkalov reacted with thumbs up emojiasmorkalov reacted with hooray emoji
@rogdayrogday marked this pull request as draftSeptember 24, 2021 10:25
@rogdayrogday marked this pull request as ready for reviewSeptember 28, 2021 09:09
@rogdayrogday requested a review fromalalekSeptember 28, 2021 11:23
@asmorkalov
Copy link
Contributor

@alalek could you look at the PR?

@vpisarev
Copy link
Contributor

vpisarev commentedNov 12, 2021
edited
Loading

The names of functions are too generic and thus quite confusing. There is minMaxLoc() that finds global minimum and maximum together with their locations. If we don't want to make reduce() heavier, maybe, let's split reduce() into multiple functions and add two more: reduceArgMin() and reduceArgMax().

alalek reacted with thumbs up emoji

@rogdayrogday marked this pull request as draftNovember 16, 2021 13:55
@rogdayrogdayforce-pushed theargmaxnd branch 4 times, most recently from5bdb9ec to0be4f3fCompareNovember 16, 2021 20:05
@rogdayrogday marked this pull request as ready for reviewNovember 16, 2021 21:01
#include<float.h>
#include<limits.h>
#include"opencv2/imgproc/types_c.h"
#include"../src/utils/depth_dispatch.hpp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It makes sense to put this header intocore/include/ instead ofcore/src/

Copy link
MemberAuthor

@rogdayrogdayNov 18, 2021
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you help me identify the correct naming/subfolder, so that this header doesn't leak to the public API?
reduce_arg.private.hpp incore/include/opecv2/core/utils or.../private doesn't work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

leak to the public API

What do you mean?

  • documentation? - look for//! @cond IGNORED for the whole file
  • install directory? - AFAIK, "private/" handles that.

Implementation itself should be marked as "static inline" (it is template anyway) and may be placed intocv::detail namespace.


  • "core/utils/" - contains low level / system utility functions (not a good place)
  • "core/detail/" - good candidate
  • just "opencv2/core/" should work too (but don't include that into core.hpp or base.hpp)

Preferable name is "dispatch_helper.impl.hpp".

Copy link
Member

@alalekalalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you for update!

Copy link
Member

@alalekalalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you for update! Looks good to me 👍

typedef tuple<Size, MatType,int> Size_MatType_RMode_t;
typedef perf::TestBaseWithParam<Size_MatType_RMode_t> Size_MatType_RMode;

PERF_TEST_P(Size_MatType_RMode, reduceArgMinMax, testing::Combine(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we really need performance tests now? Can we disable them by default (DISABLED_reduceArgMinMax)?

  • what is about 3D / 4D layouts? (DNN doesn't use 2D matrices in general)

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

3D/4D layouts perform similarly if the number of pixels is the same.

@alalekalalek merged commitf044037 intoopencv:4.xNov 28, 2021
@rogdayrogday deleted the argmaxnd branchDecember 2, 2021 17:15
@alalekalalek mentioned this pull requestDec 30, 2021
@alalekalalek mentioned this pull requestFeb 22, 2022
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull requestMar 30, 2023
Implement ArgMax and ArgMin* add reduceArgMax and reduceArgMin* fix review comments* address review concerns
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@alalekalalekalalek approved these changes

Assignees

@alalekalalek

Projects

None yet

Milestone

4.5.5

Development

Successfully merging this pull request may close these issues.

4 participants

@rogday@asmorkalov@vpisarev@alalek

[8]ページ先頭

©2009-2025 Movatter.jp