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

Enhance cv::TickMeter to be able to get the last elapsed time#26212

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
asmorkalov merged 1 commit intoopencv:4.xfromjamacias:feature/TickMeter-lasttime
Oct 14, 2024

Conversation

@jamacias
Copy link
Contributor

@jamaciasjamacias commentedSep 28, 2024
edited
Loading

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 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
  • [N/A] 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

Proposal

This PR introduces a new interface to collect the last iteration time of thecv::TickMeter class.
Besides, two more minor changes are included:

  1. Reorder the variables inside thecv::TickeMeter::reset() method so that the order matches the declaration of the variables, which makes visual inspection easier.
  2. const correctness inside thecv::TickMeter::stop() method.

Motivation

When using thecv::TickMeter in a loop or in a continuous processing application, it is sometimes useful to also know the time that the last iteration took, not only the average. For example, if the user wants to report extraordinary deviations from the average, or to debug the application.

In this use case, the current implementation requires that the user implements complicated code externally that could be simply provided by the class in a more elegant way.

Related work

#6821 - Addition of thecv::TickMeter class.
#17071 - Addition of methods to get the FPS and average time to thecv::TickMeter class.

Other

I could not find any tests for thecv::TickMeter class. Now that there is increasingly more functionality, not sure if it may now be desirable to start testing this class. I could do so, if desired. We could test:

  1. The consistency between the several getters in different units (i.e., that micro is milli * 1e3, etc.).
  2. That in the first iteration the last iteration needs to be equal to the total time.
  3. Any other ideas?

This is my very first PR and I have read over the different documents on how to contribute. I hope I did not miss any detail, but let me know otherwise :)

@jamacias
Copy link
ContributorAuthor

jamacias commentedOct 10, 2024
edited
Loading

I am a bit lost about what is going on with the different CI/CD pipelines. On the first commit I made, some jobs in the GitHub actions failed because of a timeout. Similarly, one of the builds of the PR bot also failed because of the same reason, and the other one reported a failure in theCompare ABI dumps step but somehow still marked it as OK (https://pullrequest.opencv.org/buildbot/builders/precommit_linux64/builds/109089).

Since I suspected that these complains could be unrelated to my changes, I made an empty commit just to trigger the pipelines and then I got everything OK except the Android-Test which again failed with:

This request was automatically failed because there were no enabled runners online to process the request for more than 1 days.

I have now reverted the second commit so that the history is clean, which will trigger another build, but I am wondering what to do to get this through. So far it seems not very deterministic since for the same code changes I get different results, which leads me to think this may be related to the infrastructure and not the changes (i.e., no enabled runners online or the timeouts). I also do not have macOS/Android device I can try the changes on.

I don't know if I am missing something. Could someone please give me some hints? Maybe@opencv-alalek or@asmorkalov know?

Copy link
Contributor

@asmorkalovasmorkalov left a comment

Choose a reason for hiding this comment

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

👍

@asmorkalovasmorkalov self-assigned thisOct 14, 2024
@asmorkalovasmorkalov merged commit1909ac8 intoopencv:4.xOct 14, 2024
@asmorkalovasmorkalov mentioned this pull requestOct 23, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@asmorkalovasmorkalovasmorkalov approved these changes

Assignees

@asmorkalovasmorkalov

Projects

None yet

Milestone

4.11.0

Development

Successfully merging this pull request may close these issues.

3 participants

@jamacias@asmorkalov@opencv-alalek

[8]ページ先頭

©2009-2025 Movatter.jp