-
Notifications
You must be signed in to change notification settings - Fork 49
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
perf: skip frames, roi, fixed aspect ratio #225
base: tier4/universe
Are you sure you want to change the base?
perf: skip frames, roi, fixed aspect ratio #225
Conversation
copy calibration tools from private repository
merge main for galactic release
…g elements for eval mode
…and calibration parameters into a file, change ui elements in eval mode.
…luation_mode Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
…rinsics_evaluation_mode Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
…e' into feat/camera_profiles
...brator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/camera_models/camera_model.py
Show resolved
Hide resolved
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.
Left some comments, but we still need to discuss the correctness of the rectification method
…rator/intrinsic_camera_calibrator/camera_calibrator.py Co-authored-by: Kenzo Lobos Tsunekawa <kenzo.lobos@tier4.jp>
…rator/intrinsic_camera_calibrator/camera_models/camera_model.py Co-authored-by: Kenzo Lobos Tsunekawa <kenzo.lobos@tier4.jp>
I was checking a book that has a good explanation of the rectification process, and the equations used on the undistortion map seem to be good, https://amroamroamro.github.io/mexopencv/matlab/cv.initUndistortRectifyMap.html https://books.google.ch/books?id=seAgiOfu2EIC&lpg=PA373&pg=PA373#v=onepage&q&f=false |
# if chessboard was found, keep track of the region to try to detect easily in the next frame | ||
if detected: | ||
self.roi = get_roi(corners, img.shape[:2]) | ||
self.lost_frames = 0 |
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.
self.lost_frames
is reset in a protected way now, but it is not here
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.
Maybe I'm wrong, but we are protecting this value because it might change the max value on the UI side. So, is it necessary to add a lock here?
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.
In:
self.lost_frames = self.max_lost_frames.value
self.max_lost_frames
is shared with the parameter edit widget, so it needs to be protected.
restart_lost_frames_counter
modifies self.lost_frames
in another thread, and as such it needs to be protected.
To avoid a flurry of locks, you can load one time into a local variable, and write (using a lock) just once after you finish whatever processing was being done.
Another choice is to use async signals with Qt instead of using a method (this is the best approach according to this framework).
If you want to understand how things go under the hood you can print the thread ids
...intrinsic_camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/utils.py
Outdated
Show resolved
Hide resolved
..._camera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/data_collector.py
Outdated
Show resolved
Hide resolved
...mera_calibrator/intrinsic_camera_calibrator/intrinsic_camera_calibrator/camera_calibrator.py
Outdated
Show resolved
Hide resolved
…rator/intrinsic_camera_calibrator/data_collector.py Co-authored-by: Kenzo Lobos Tsunekawa <kenzo.lobos@tier4.jp>
…rator/intrinsic_camera_calibrator/utils.py Co-authored-by: Kenzo Lobos Tsunekawa <kenzo.lobos@tier4.jp>
This PR awaits a experimental confirmation of the rectification pipeline using camera-lidar calibration and a brief proof of how it works @SergioReyesSan @drwnz |
Description
This PR includes:
-ROI to keep track of the calibration board, making future detections faster (performance improvement).
-Will skip board detection on some future frames, if the board was not detected on the current frame (avoid long queues).
-Increase the decimal digits when saving intrinsic parameters, to avoid the bubble effect when rectifying the image.
-Fix the issue that suddenly was pausing the operation of the calibration tool.
-Implements a new method to fix the aspect ratio on the rectified image.
-Changes the distortion model according to the number of distortion coefficients.
Related links
Tests performed
Tested mainly on an x86 platform and using rosbags, but also non-extensive tests on anvil were performed.
Notes for reviewers
It might have some spelling errors, please let me know.
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.