No project description provided
Project description
Calibration_camera
Created on Sunday, April 21, 2024
Author: Tung Nguyen - Handsome
Reference: Camera Calibration by OpenCV (OpenCV Tutorial)
Overview
This Python script provides a class, CameraCalibration
, to perform camera calibration based on a set of image points and their corresponding object points.
Description
This script includes functionalities to:
- Calculate camera calibration data based on a set of images.
- Save and load the camera calibration data.
- Undistort images or points using the calibration data.
Usage
Requirements
- Python 3.x
- OpenCV
- Numpy
- PyYAML (For working with YAML files) To set up the environment, install all the required libraries by using this command:
pip install -r requirements.txt
How to Use
-
Import the
CameraCalibration
class fromcamera_calibration.py
.from camera_calibration import CameraCalibration
-
Create an instance of
CameraCalibration
.camera_calibrator = CameraCalibration()
-
Calculate calibration data using a set of images with known chessboard pattern.
camera_calibrator.calculate_calibration_data( run=True, chessboardSize=(9, 6), size_of_chessboard_squares_mm=25, framesize=(1280, 720), calibrationDir=None, savepath=None, saveformat="pkl", show_process_img=True, show_calibration_data=True, )
-
Undistort an image.
undistorted_image = camera_calibrator.undistortion_img( img, method="default", img_size=(1280, 720), verbose=False )
or
undistorted_image = camera_calibrator.undistortion_img( img, method="Remapping", img_size=(1280, 720), verbose=False )
-
Undistort a set of image points.
undistorted_points = camera_calibrator.undistortion_points(points, verbose=False)
Results
Additional Information
- My email: quangtung.work73@gmail.com
- My Github: Tung Nguyen - Handsome - Github
- My Youtube channel: Tung Nguyen - Handsome - Youtube
- My linkedin: Tung Nguyen - Handsome - Linkedin
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for TH_camera_calibration-0.4.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19e8e839e14208dc0507543f8a398cc2a3d119a91f3654c3c9112cb74423b5a0 |
|
MD5 | 0717d4a8c6397c498d1e85341ea3a004 |
|
BLAKE2b-256 | eaffa99a9a52565ea1d332fb4450aaaa137b4cc38e4c14ad8bc98fbc2aff4d44 |
Close
Hashes for TH_camera_calibration-0.4.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a426e0c1becc5e0c7857a3d30ac21e40472f38f387337100dbd63f86c349cc3 |
|
MD5 | 3f44864b2a8ea85a33449f3829924661 |
|
BLAKE2b-256 | 9d04e3d1654d357bbcc59b93d35b7a7907fff2ae5c2e3a6d0ea4194091a55660 |