-
Notifications
You must be signed in to change notification settings - Fork 54
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
How to calibrate 360 camera #23
Comments
Thank you for your interest in MC-Calib. Here is the Charuco board: It has main three components:
Does it answer your question @vswdigitall ? |
@vswdigitall yes, you are correct. |
Thank you. I need to know transformation of every pixel from camera to camera. |
Hello, I recommend you calibrate all the cameras at once since the toolbox can chain all the transformations and implicitly enforce the poses to be consistent. The application will calibrate together all the intrinsic and extrinsic parameters. To calibrate your system, you will have two options:
A final comment, if you consider method 2, you will have to avoid purely planar motion (try to rotate the system in all directions). P.S: Regarding your comment, "I need to know transformation of every pixel from camera to camera.". This can be done only assuming you have a neglectable translation between your cameras therefore, you will exclusively utilize the rotation matrices returned by the calibration toolbox. |
Thank you. I've ordered 80x80cm 8x8 rigid high quality charuco boards, 3pcs, with different id's. I will try 2nd case. Will rotate and move rig to cover all cameras by boards. |
CONFIG: %YAML:1.0 number_x_square: 6 #number of squares in the X direction distortion_model: 0 cam_params_path: "/home/vsw/calib.yml" root_path: "/home/vsw/1659813866954/" ransac_threshold: 10 he_approach: 1 number_x_square_per_board: [] distortion_model: 0 cam_params_path: "/home/vsw/calib.yml" root_path: "/home/vsw/1659813866954/" ransac_threshold: 10 he_approach: 1 save_path: "/home/vsw/1659813866954/out/" |
But result is very far from reality. |
Hello, your setup looks great, the problem might come from the pictures, the synchronization or simply from a bug in the toolbox.
Thank you very for testing MC-Calib! |
Hi, thank you for help. Please share your email. I will send you images. Yes, it is hardware synchronized rig. |
Here is intrinsic, computed with checker board. Same for all cameras. camera_matrix: !!opencv-matrix # 3x3 intrinsic matrix [fx, 0, cx, 0, fy, cy, 0, 0, 1] |
Have sent 2 datasets to alexandr.baylo email. |
Good morning, First of all, thank you again for sharing your data with us. With the data you provided, we identified a bug in the toolbox when using multiple boards of different sizes. Specific instructions to use the toolboxI also figured out a few mistakes in how you used the toolbox (which are probably not clear enough in the tutorial that we might need to improve for future users).
It will generate 3 boards you can use for your calibration!
Bug in the toolboxRegarding the bug in the toolbox side, when using multiple boards with different sizes, the toolbox failed to deal with the indexing. We determined how to deal with this problem, and the new version will be available very soon. Calibration results using a single boarddespite all these shortcomings, I manage to figure out the indexing of one of your boards. So I calibrate your system using this single board without any prior intrinsic calibration. The configuration file I used is the following:
I obtained a reprojection error ~2.4 pixels; most errors seem to come from the inaccuracy of the fisheye model (so you might improve it further with more various viewpoints). I only used the dataset1 you provided. Thank you again very much for your support and the data you provided. It is very valuable to us. Please keep us in touch regarding your project. |
Unsing a single board on your second sequence with the parameters |
Thank you very much for help. 1,2. I generated 6 boards with resolution 2200px. Will make them. My boards are from calib.io, why they are failed (800x800, 6x6)? Also i have questions:
|
okay, I understand better why I struggled with the indexing; for MC-Calib, the calibration boards must be generated with the toolbox itself. For your additional questions:
|
Ok, got it. |
Also i always got this error in python and zoom not working: Exception in Tkinter callback |
Thanks a lot, indeed I faced the same problem during my last test. It is due to the versioning of matplotlib. Now matplotlib supports orthogonal view so the lines:
should removed and the declaration of the figure should be changed accordingly:
in the figure declaration. I will try to include these changes in the next PR. I also noticed a minor display error probably also related to this versioning issue. |
Confirmed, works now. Also zoom works with right mouse btn too. |
I am now waiting for the other contributors to approve the next push request, and everything should be fine (they are quite busy, so it might take up to a few days). But if you print the boards as I mentioned before, you can just use the current version of the code without trouble. |
Thank you. I've start produce boards, when ready will try and reply. |
Hi, we have built new generated boards and made tests. All tests with 6 boards and 1 board failed for 3 cameras ( mre always >10+9px ), but for 2 cameras mre < 1px. Please help to fix more than 2 camera calibration. Previous links updated: |
Hello! Thank you very much for your feedback. Your images look great; I managed to calibrate your camera system directly with this configuration file --> projection error 0.35px on dataset1 (I just did not adjust the parameter square_size to your board size, so the scale is obviously wrong ): https://files.catbox.moe/c2k1lq.yml Here is the calibration result: https://files.catbox.moe/2l40n6.yml It seems the calibration worked well this time. However, I have a few additional pieces of advice in case you calibrate more complex systems (non-overlapping) or if you want to be sure to have a reliable calibration:
Now it seems to me that you will be able to have a well-calibrated system very soon and that you can move forward in your project to have a full 360-surrounding view camera ;-). Best P.S: @BAILOOL did a wonderful job speeding up the calibration process via multi-threading. I will try to test, and merge this modification on the main branch soon! |
Hi, thank you but i can't reproduce your result. May be we are using different version of mc-calib? |
That's great, try to force the translation vector to be full of zeros and try again plz. It will correspond to a single view point configuration which is the commonly admitted assumption for building a panorama. If it does not work it might be a problem with the undistortion or with the "direction" of the transformation, I will personally check on Monday if needed. I am pretty sure the calibration is okay ;-)! |
Ok, i will try board as world origin, to measure true distance. |
Will try. |
On Monday we will make calibration with more images and angles. |
Yes, everything is expressed in the referential of cam0
Very difficult to say, such kind of measurement will simply give you a rough idea about the quality of the calibration Today, I tested your calibration results but plotted epipolar lines between images and it looks quite correct to me. |
Hi, thanks for help. Can you help to solve this error? I uploaded it to /dataset1.zip |
Hello! |
I managed to reproduce your error, and I dug a little bit into it. After quickly lurking through the internet, this bug is quite common and occurs when the corners are too close to the image's border. The good news is that there is an easy fix to that: the corners too close to the image's borders can be removed from consideration. The bad news is that we have to implement it manually and that it might take me a bit of time before proposing a new PR (we have national holidays here, so you will have to be patient until at least the end of next week, but I will try my best to propose it asap). Another quick and temporary fix I tried is to use prior camera calibration parameters to avoid the OpenCV intrinsic calibration function, so in the configuration file, I activated:
and the calibration is working properly with a mean projection error inferior to 0.4px. So if you have some prior calibration of the camera's intrinsic (even an approximation of it), it should work properly! Thank you again for your feedback, every problem you face makes MC-Calib more robust ;-) |
Good news! I fixed it actually quickly; your calibration is now working with these modifications. I sent a PR #27 , and I am waiting for feedback from other contributors. The feature will be available soon on the main. I basically remove boards with points too close to the borders of the image (empirically with a 5% margin, to be exact), thus about 30 boards have been removed from your initialization process in your sequence. Thankfully this fix: 1) only affects fisheye cameras, 2) the "bad" boards are removed only for the camera intrinsic initialization process conducted by the OpenCV library, but all the boards are still used in the rest of the calibration process. Regarding your calibration, it now works smoothly with a projection error ~0.33px. |
Thank you, it works now. Now we will build full 360 setup and test. Will reply. |
Got it. Thanks. |
Here we start calibration full 360 camera: https://youtu.be/JJ4M4WmVNCQ |
Thank you so much for sharing your progress. |
Hi Rameau, |
Hello, Line 28 in ac6e173
For instance, by setting a higher threshold like 0.1 or 0.2 (and recompiling the project), I believe it should solve the problem. Regarding the point extraction saving, it is a great idea (especially for big project like that). I will try to include this feature in the coming weeks! Best regards |
Congratulations! |
Hello, we are looking at developing a similar system with machine vision cameras. Its great to see that you were able to get such an accurate calibration. May I ask what algorithm you are using to generate the spherical from the images, the quality looks great! |
Thanks for that @vswdigitall, I assume the opencv fisheye undistortion was used to undistort the separate images but how did you handle the stitching and combination of the images? |
It is opencv too. Stitching details example does all steps. |
Hi,
Tell me please what is the square_size?
Square_length is measured length of every square. Marker_length is inside in each square. In my case 0.02m and 0.16m.
In you example 0.04m, 0.03m and square_size 0.192m Why?
And it is resolution X Y? Frame width and height?
The text was updated successfully, but these errors were encountered: