https://github.com/ccomkhj/charuco_stereo_calibrator
Charuco Camera Calibrator for Stereo vision and raspberry pi camera
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.0%) to scientific vocabulary
Keywords
Repository
Charuco Camera Calibrator for Stereo vision and raspberry pi camera
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Overview
The CharucoStereoCalibrator, StereoCalibrator and Rectifier are Python tools for stereo camera calibration and rectification. They compute intrinsic and stereo parameters, rectify stereo images, and visualize epipolar geometry, essential for 3D vision tasks like depth estimation and 3D reconstruction.
Features
StereoCalibrator
- Automatic detection of chessboard corners in stereo images.
- Computes intrinsic parameters (camera matrix, distortion coefficients).
- Computes stereo parameters (rotation, translation, rectification, projection, and Q matrix).
- Saves calibration data to
stereoMap.xml. - Visualizes calibration errors and highlights outliers.
CharucoStereoCalibrator
- Support same feature with
StereoCalibratorbut using Charucoboard.
CharucoCalibrator
- One camera calibrator using Charucoboard.
- Feel free to use
generate_charuco.pyto generate your own Charucoboard. It's designed for A4 printing.
Rectifier
- Loads stereo calibration data from
stereoMap.xml. - Rectifies stereo image pairs for horizontal alignment.
- Computes the Fundamental Matrix (F).
- Visualizes epipolar geometry with epilines and matched points.
- Saves rectified images and visualization outputs.
Quick Start
0. Installation
conda create -n csc python=3.12 -y
conda activate csc
pip install -e .
CharucoCalibrator is sensitive to opencv version, because there's big update since 4.6
1. Calibration
```python from csc.charucostereocalibrator import CharucoStereoCalibrator import glob
Specify image paths
imagesleft = glob.glob("input/charuco/left/*.jpg") imagesright = glob.glob("input/charuco/right/*.jpg")
Specify number of column, row of checkerboard
chessboard_size = (11, 8)
Specify image sizes
framesizeh = 1296 framesizew = 2304
[Optional] if you don't know camera spec, then algorithm figure this out.
finmm = 4.74 # or None pixelsizemm = 1.4e-3 # or None debug = False # or False
stereocalibrator = CharucoStereoCalibrator( chessboardsize=chessboardsize, framesizeh=framesizeh, framesizew=framesizew, finmm=finmm, pixelsizemm=pixelsize_mm, debug=debug, )
Specify samples to show epipolar geometry qualitatively to evaluate calibration
leftshow = "demo/samples/leftsample.jpg" rightshow = "demo/samples/rightsample.jpg"
stereocalibrator.performcalibration(imagesleft, imagesright) stereocalibrator.saverectifiedimages(imagesleft, imagesright) stereocalibrator.visualizeepipolar(leftshow, rightshow, save=debug) stereocalibrator.printresults() stereocalibrator.measure_outlier() ```
Note: To explore additional examples, please refer to the __main__ section within each function.
Outputs
- Calibration Data:
stereoMap.xml(camera matrices, rectification maps, etc.). - Rectified Images: Horizontally aligned stereo pairs.
- Epipolar Visualizations: Saved epipolar images highlighting epilines and point matches.
Key Methods
StereoCalibrator.perform_calibration()- Calibrate cameras.Rectifier.rectify_image()- Rectify stereo image pairs.Rectifier.visualize_epipolar()- Draw epilines and visualize epipolar geometry.
Notes
- Ensure chessboard size matches the setup (
chessboard_size). - Use
visualize_epipolar()to verify and debug calibration. - Unlike Checker board, Charuco board is strict for the order of
col,row- Checker board considers the number of conjunctions.
- Charuco board considers the number of rows and columns of blocks.
License
This project is licensed under the MIT License.
Owner
- Name: Huijo
- Login: ccomkhj
- Kind: user
- Location: Germany
- Company: @hexafarms
- Website: https://ccomkhj.github.io/
- Repositories: 3
- Profile: https://github.com/ccomkhj
Self Learner
GitHub Events
Total
- Watch event: 1
- Push event: 10
- Fork event: 1
Last Year
- Watch event: 1
- Push event: 10
- Fork event: 1
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- matplotlib *
- numpy *
- opencv-python ==4.10.0.84
- pandas *
- Dependencies *
- line.strip *