-
-
Notifications
You must be signed in to change notification settings - Fork 56.3k
Add option to force reopen camera in interactive calibration tool #22135
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
Conversation
Need to squash commits and rebase this PR: Conflicting files |
do | ||
{ | ||
open_camera(); | ||
} while (!mCapture.isOpened() || !mCapture.grab()); |
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.
Instead of blank screen for infinite period of time I prefer to see messages like these:
- "Reopening camera (try #N) ..."
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.
Thank you, I added "trying to reopen" message only before the loop since thousands of messages/sec about which try it is aren't very informative in my opinion.
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.
Why is not informative? It indicates that process hang or not.
To avoid thousands of messages/sec delay could be used, e.g. cv::waitKey()
(also it reduce unnecessary CPU load)
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.
Because there are no functions that can hang, I think.(correct me if I'm wrong). CPU load is not an issue because this application already uses all resources it can find. Artificial delay would only slow us down if errors are common enough, but pass quickly. But if the delay is too short - we'll get a lot of messages if the errors are rare, but last longer. How many ms do you have in mind for delay?
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.