Camera calibration

OpenCV, Python and other image processing questions
Post Reply
ducnan
Posts: 9
Joined: Sun Dec 22, 2019 9:54 pm

Camera calibration

Post by ducnan »

Hi all,

I am trying to calibrate the stereo camera and have several questions.

1. I saw the calibration scripts in the tutorial(https://github.com/realizator/stereopi-tutorial) and it seems like storing the calibration result into many executable files, but I would need a yaml file to feed into a SLAM task. So is there another tool/package that can do the calibration or I could write a simple script that reads the calibration files and export a yaml file?

2. I mainly use the SLP image and would it matter if I calibrate it totally following the tutorial scripts after switching to the Rasbian image? Are there any parameters I need to pay attention to in order to keep them the same?

Thanks in advance and happy new year!

Duncan

stereomaton
Posts: 174
Joined: Tue May 21, 2019 12:33 pm
Location: France

Re: Camera calibration

Post by stereomaton »

The script is totally related to cameras (it computes focal length, centering of the sensor on the optical axis, lens distortion and so on), so it does not matter if you change the operating system. Also SLP is based on raspbian.
The parameters (matrices) are stored in binary with/by a library called numpy (save doc here: https://docs.scipy.org/doc/numpy/refere ... .save.html) so you can get the content by using the numpy load function (example in above link). Once opened, you can format them the way you want.
Also, there is an updated version (which also work for large fov cameras), but I don't remember the address. Realizator could probably add a note in the README of this repo.
Stereophotographer and hacker
Despite my quite active participation in the forum, I am not in the StereoPi team
StereoPi Standard Edition + CM3Lite module + a few cameras

ducnan
Posts: 9
Joined: Sun Dec 22, 2019 9:54 pm

Re: Camera calibration

Post by ducnan »

Thank you very much and it helps a lot.

Duncan

User avatar
Realizator
Site Admin
Posts: 582
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Camera calibration

Post by Realizator »

Stereomaton, thank you for your answer! :-)
The code you've mentioned is our updated code for the camera calibration and depth map (with the fisheye support) is here:
https://github.com/realizator/stereopi-fisheye-robot

I'd recommend to use it instead of old "stereopi-tutorial" code. New code uses updated OpenCV and Python version, has better chessboard detection, and includes all you need without reference to external libs.

Duncan, I have nothing to add to the Stereomaton's answer :-)
Eugene a.k.a. Realizator

Post Reply