Add option to force reopen camera in interactive calibration tool#22135
Add option to force reopen camera in interactive calibration tool#22135opencv-pushbot merged 1 commit intoopencv:4.xfrom
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.
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.
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.
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.
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.