Poor calibration result and depth map #31
Replies: 8 comments 5 replies
-
Hi and thanks for writing here. Could you please share the script you are running, so I can check the configuration parameters (like chessboard size)? Are the images labelled in the correct order (the first image you posted seems the right one, the second seems the left one)? Is the baseline large enough? Cheers |
Beta Was this translation helpful? Give feedback.
-
Hello, thank you very much for responding. Below, I provide you with the code you requested.
I'll provide a diagram of how the cameras are arranged and why I determined that the left image is the one I shared above initially, and the right one is the second. Regarding the baseline inquiry, I'd like to mention that the cameras are separated by approximately 15 cm. I'm unsure if increasing the separation will improve the results. I would appreciate it if you could guide me on this to achieve better outcomes. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response; I'll follow your instructions. Based on how stereo vision works, I have some questions that could help me possibly improve the results:
|
Beta Was this translation helpful? Give feedback.
-
Decadenza, thank you for your comments. I performed a new calibration following your instructions, which yielded better results. However, these results are not entirely satisfactory. I'm sharing the rectified images, which appear to have a somewhat spherical rectification, leading to poor outcomes. Additionally, I'm providing my set of calibration images in case you notice anything when reviewing them. Images for calibration: I would greatly appreciate your feedback to help achieve good results. Thank you. |
Beta Was this translation helpful? Give feedback.
-
The requested files are provided below: |
Beta Was this translation helpful? Give feedback.
-
Hi @felipe8066 I had a look at your files and there is no major problem. The effect you are experiencing is due to low number of calibration images, that do not allow the distortion coefficient to converge properly. In fact, as a quick and dirty fix, you can see that in the following script I ignored the distortion coefficients and the result is definitely acceptable. I suggest to use >100 quality images to calibrate. The more the better (if the quality is good). Be sure to cover all the working volume.
|
Beta Was this translation helpful? Give feedback.
-
Hi @decadenza , I performed a new calibration taking into account the considerations you gave me, and I obtained better results. I used 207 images for calibration, resulting in a reprojection error of 1.16. The rectifications look much better than before. Now I'm facing the issue of how to use the information. I'm working on a thesis project on a rectangular section laboratory channel, as shown in the following images: As you can see, the background is flat, and my idea is to determine the shape (heights) of the stones along the channel. However, the vertical wall is causing problems for data visualization. For this reason, I cropped the calibration images to keep only the inner part of the channel, and I obtained the following disparity map: As you observe, the gravel is represented well, but I can't make the yellow flat part of the channel have consistent depths. Additionally, there seems to be a repetition or overlap between the left and right images, giving the impression that the calculated width is larger than the actual width. Have you encountered this problem? How can I visualize the "export.ply" file? I use MeshLab, but it only shows me a rectangle instead of a 3D representation of the rocks. I would be eternally grateful if you could provide me with some guidance again to improve my results. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response; I'm glad to have a good fit in my calibration. Regarding your mention of using machine learning-based solutions, which ones could you recommend? I find it challenging to link the rig file obtained from calibration to the use of other methods. Upon investigation, I came across trained models like Hitnet and others used for depth determination. Is it possible to share any methods or solutions you know of that could be incorporated into my work if they prove to be effective? Thank you again for your support. |
Beta Was this translation helpful? Give feedback.
-
Hello, I am having issues obtaining good results using the library. I have followed the examples, starting with the calibration process, for which I captured 40 photos of the chessboard in different positions. As an example, I'm attaching an image. When using the script "003 BuildStereoRig.py," I get the following results:
Left and rigth images:
Reprojection error: 127.08500929243618
Centers: (array([0., 0., 0.]), array([ 442.39739036, -796.27468563, 851.04251781]))
Baseline: 1246.6122865943455
The error is high, but I'm currently unsure how to improve it. Moving forward, I apply the script for rig rectification, and finally, I run the script "011 Build3DPointCloud.py," resulting in a very poor outcome where nothing is visible. The issue seems to be with image rectification, but I'm unsure how to resolve it. I would appreciate your assistance as I've been stuck on this for a while and need to make progress with my work :(.
Disparity map:
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions