/Camera-Calibration

Primary LanguagePythonMIT LicenseMIT

Camera-Calibration

Screenshot

The above image shows the calibration in action . I have used a 7*9 chessboard image for calibration .

To Run the program

  1. Create a virtual environment

    Windows

    python -m venv .\venv
    venv\Scripts\activate.bat

    macOS & Linux

    python -m venv ./venv
    source venv/bin/activate
  2. Install the project dependencies with the following command.

pip install -r requirements.txt
  1. Run the project

     python .\main.py

Storing file for calibration:

The calibration images can be stored at calibration_images

For testing the distortion we can put the files in test_images and type the file name in main.py .The output of the corrected images are stored as filename_undistorted.png and filename_undistorted_method_2.png .

To check the difference between them we can use the difference function in removeDistortion.py which saves the files as filenamesubtract.png

Camera configurations are stored as HDF5 file , we can view the contents of the file using HDFView.

Here is a screenshot of the HDF5 file.

HDF5file

Example of undistorted image using this program:

corrected

References

OpenCV reference page