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
Using this command for install package (or clone this repository):
pip install TH-camera-calibration
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
Hashes for TH_camera_calibration-0.4.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 273d153a0e7afe85f86c4360ecf5eccaa489c94b49659a72991ad66dfcc95a89 |
|
MD5 | 64cc3eb74b6f23bdda1c1c1ecf1a57b7 |
|
BLAKE2b-256 | e76047506ece8107e603af5856d8fb2961478c4f925ced0af2e041afccbcf775 |
Hashes for TH_camera_calibration-0.4.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 029adeacd5fcbe85d2f44422751d5cfb85ec278bba30d5080f1821fb40731174 |
|
MD5 | 5e0d9997f7a0d88720769cdacd29960d |
|
BLAKE2b-256 | 5c78a0251dc22c88c9c6e0944768534c6326ee7e205f624612e8c54025a939ab |