Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
48383fc to679931dComparejamacias commentedOct 10, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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 the 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:
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? |
asmorkalov left a comment
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.
👍
Uh oh!
There was an error while loading.Please reload this page.
Pull Request Readiness Checklist
See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.
Proposal
This PR introduces a new interface to collect the last iteration time of the
cv::TickMeterclass.Besides, two more minor changes are included:
cv::TickeMeter::reset()method so that the order matches the declaration of the variables, which makes visual inspection easier.constcorrectness inside thecv::TickMeter::stop()method.Motivation
When using the
cv::TickMeterin 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 the
cv::TickMeterclass.#17071 - Addition of methods to get the FPS and average time to the
cv::TickMeterclass.Other
I could not find any tests for the
cv::TickMeterclass. 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: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 :)