Skip to content

Calculation of camera undistortion matrix and coefficients from chessboard image

License

Notifications You must be signed in to change notification settings

inemov/camera_undistortion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

camera_undistortion

Calculation of camera undistortion matrix and coefficients from chessboard image. The resulting coefficients are camera specific and can be used to undistort images from the camera.

For theoretical background and details see: https://docs.opencv.org/4.5.5/dc/dbb/tutorial_py_calibration.html

Use guidelines

Run APP.py. I presents 12 x 9 chessboard that can be used for taking calibration photos. Take at least 9 photos on a camera that needs to be undistorted: top-left, top-center, top-right, center-left, center-center, center-right, botton-left, bottom-center, bottom-right. Place the taken *.jpg original distorted images in a folder.

image

Click Open for Image directory and select a folder that contains original distorted images. The application will try to create 'undistorted' folder inside the selected directory. If such folder already exists, it will ask permission to remove all files from there. No original distorted images will be removed.

image

The application will analyse the original distorted images, calculate an undistortion matrix and after applying it will also save undistorted images to the 'undistorted' directory. Both original distorted and undistorted images can be viewed using 'Original view' and 'Undistorted view' radio buttons and Previous/Next buttons.

  • original distorted image

  • udistorted image

By clicking Save, undistortion_matrix.csv will be created in the originally selected directory. Its content is like:

undistortion_mtx [[861.72336592 0. 618.13980499] [ 0. 905.37241179 315.9658367 ] [ 0. 0. 1. ]]

undistortion_dist [[ 0.1061057 -0.03205427 -0.00922332 -0.00281688 -0.06070225]]

Requirements

Run pip install -r \__misc\requirements_ide.txt within virtual environment to install: spyder==5.1.5 numpy==1.22.1 opencv-python==4.5.5.62

About

Calculation of camera undistortion matrix and coefficients from chessboard image

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages