Skip to content

zeryabmoussaoui/camera_calibration_tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Author : Zeryab Moussaoui Contributer: Raphael Casimir

Real time camera calibration tool

A very simple tool to calibrate your monocular camera.

Requirements

Python 2.7.12 is supported, but should also work on Python3.

The following libraries shall be installed :

  • numpy
  • pyyaml
  • opencv-python

Installation

  • Download the github project (zip)
  • Unzip and copy all files in any directory.

Howto

Find camera id

In Linux

Install v4l2-tools and run :

v4l2-ctl --list-devices

Which outputs :

Integrated Camera (usb-0000:00:1a.0-1.6):
        /dev/video0

In Windows

Please see tutorial : https://www.codepool.biz/multiple-camera-opencv-python-windows.html

Update id

If it is different from 0 : edit L24 of calibrate_camera.py

Preparation

Print the chessboard.png and stick it to a flat surface.

Launch the tool

Run :

python camera_calibration.py

it will display a video stream :

Taking chessboard images

Depending on your environment, move either the camera or the cheesboard in all the operation.

Press [Space] on the displayed screen, if corners are detected you will see:

Repeat operation to get at least 10 images

Calibrate

Press [c] to compute calibration , it will save them in a yaml file :

camera_matrix:
- - 611.4552961374491
  - 0.0
  - 315.59196871694695
- - 0.0
  - 590.4987441125558
  - 225.73019949244863
- - 0.0
  - 0.0
  - 1.0
dist_coeff:
- - -0.42142237717306885
  - 0.3413019078047165
  - 5.686155424228582e-05
  - 0.00041026072376253945
  - 0.01644419849720093

You can add more images using [space] and perform calibration again to see if mean error is descreasing.

Other commands

Press :

  • [ESC] to exit.
  • [r] to reset operation.

About

A real time camera calibration tool in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages