-
Notifications
You must be signed in to change notification settings - Fork 115
Camera calibration with OpenCV and checkerboard #163
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
This PR is ready to be reviewed and tested. The calibration worked well for me with the FLIR SSL cameras. Compared to the old calibration procedure, distortion and principal point are much more reasonable given enough checkerboard samples. I did not notice an increase in processing time, but I did not have a field with many robots yet. The imaga2field and field2image functions are slightly slower with the OpenCV method, but this should not be noticeable. |
This PR crashes on our PC with gdb tells us
master does not have this crash on startup. |
can you provide some details on your system like the OS? |
Sure. It's a "normal" Xubuntu 18.04:
|
Have you run the install script? https://github.com/RoboCup-SSL/ssl-vision/blob/master/InstallPackagesUbuntu.sh And do you have a self-compiled opencv? |
Sorry for German printouts. Our opencv is (probably) not self compiled, and while I didn't run this installer script today, we most certainly did so a few months ago and the packages seem to be correct. |
I can reproduce the error message on a SSL NUC when building with QT4. Building with QT5 seems to fix the issue. You can switch by running:
It might be time to make QT5 the default... |
This allows me to start the vision. Thanks @g3force. I'll test the PR later. Any clue why this PR triggers a conflict with QT4? |
It might be the additional opencv module 'calib3d' that was introduced in this PR. |
Are there any other blockers to merging this in once the current conflicts are fixed? |
@rhololkeolke I used to test this in our lab (Feb 2020) and it did not work at all. It's reasonable I did something wrong, but I never made it work. Nicolai has published a lot of commits since then, but I cannot test it due to COVID restrictions right now. |
I improved the capturing of the chessboard samples since then, but it still needs more testing. The main issue though is, that I'm not yet satisfied with the quality of the result. The overall calibration is not as good as with the old implementation and I could not yet find out the source for this. |
f21e991
to
be384f3
Compare
39c958a
to
c6be58f
Compare
a5622f2
to
5a0d09e
Compare
This branch is ready for another test round. I've added some notes on the OpenCV calibration to the Wiki: https://github.com/RoboCup-SSL/ssl-vision/wiki/camera-calibration#calibration-with-opencv-model |
fb4786f
to
6d92a12
Compare
dd884b4
to
96c1299
Compare
Co-authored-by: Devin Schwab <[email protected]>
- Use cv::calibrateCamera instead of cv::solvePnP to allow fine tuning of intrinsic model - Visualize additional calibration points - Use double-precision wherever possible - Fix clang-tidy issues and format
- Add calibration points to config - Allow dragging calibration points - Allow adding new calibration points - Separate calibration point detection from full calibration
47f2aa7
to
52d0657
Compare
Based on the work of @rhololkeolke I've implemented the openCV chessboard calibration with intrinsic and extrinsic models.
So far, a calibration of the intrinsics with a chessboard can be done through a new widget. I've tested it with the original SSL FLIR cameras and a DIN A4 7x9 chessboard. The RMS error is shown and the result is saved.
Additionally, there is a button to calibrate the extrinsics based on the four field corner markers.
If enabled in the config tree (Camera Calibrator), the model is used for field2Image and image2Field, but the code is not yet optimized, especially the image2field where several matrix inversions are done.
The UI widget also still needs more structure.
I'll continue work on this, but if anyone wants to start testing this branch, you are welcome.