Skip to content

Camera Calibration is a Python project that uses OpenCV to calibrate a camera using images of a checkerboard pattern. It calculates camera intrinsic parameters and distortion coefficients to correct lens distortion, enabling more accurate computer vision applications.

Notifications You must be signed in to change notification settings

sindhu1807/camera_caliberation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Camera Calibration using OpenCV

This project performs camera calibration using a single checkerboard image. The script detects checkerboard corners, calibrates the camera, and undistorts the image. Calibration parameters and results are saved for future use.

πŸ”§ Features

  • Detects checkerboard corners using OpenCV.
  • Computes camera intrinsic matrix and distortion coefficients.
  • Saves calibration parameters (camera_calibration.npz).
  • Undistorts the original image and saves the result (undistorted_image.jpg).

🧠 Dependencies

  • Python 3.x
  • OpenCV (cv2)
  • NumPy

πŸ“· Checkerboard Setup

Ensure your checkerboard pattern has 8 inner corners per row and 6 per column (i.e., 9x7 total squares). Modify checkerboard_dims if your pattern differs.

πŸš€ How to Run

  1. Clone the repository or download the script.

  2. Place your checkerboard image in a known location and update the image_path variable in the script:

    image_path = r"D:\Path\To\Your\Image.jpg"
  3. Install the required packages:

pip install -r requirements.txt
  1. Run the script:

    python camera_calibration.py

πŸ—‚ Output

  • camera_calibration.npz β€” Numpy archive containing:

    • Camera matrix
    • Distortion coefficients
    • Rotation and translation vectors
  • undistorted_image.jpg β€” Corrected image without lens distortion.

Screenshot

Screenshot (122)

πŸ“Œ Notes

  • If the checkerboard corners are not detected, verify the pattern, lighting, and image quality.
  • You can use multiple images to improve calibration accuracy by looping through a directory.

About

Camera Calibration is a Python project that uses OpenCV to calibrate a camera using images of a checkerboard pattern. It calculates camera intrinsic parameters and distortion coefficients to correct lens distortion, enabling more accurate computer vision applications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages