All Projects → Kazuhito00 → OpenCV-CameraCalibration-Example

Kazuhito00 / OpenCV-CameraCalibration-Example

Licence: Apache-2.0 license
OpenCVを用いたカメラキャリブレーションのサンプルです。2021/06/21時点でPython実装のある3種類(通常カメラ向け、魚眼レンズ向け(fisheyeモジュール)、全方位カメラ向け(omnidirモジュール))について用意しています。

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to OpenCV-CameraCalibration-Example

babelcalib
BabelCalib: A Universal Approach to Calibrating Central Cameras. In ICCV (2021)
Stars: ✭ 43 (+72%)
Mutual labels:  camera-calibration, fisheye
vision-based estimations
Vision-based Robot 3D Pose and Velocities Estimations
Stars: ✭ 32 (+28%)
Mutual labels:  camera-calibration
Computer Vision Guide
📖 This guide is to help you understand the basics of the computerized image and develop computer vision projects with OpenCV. Includes Python, Java, JavaScript, C# and C++ examples.
Stars: ✭ 244 (+876%)
Mutual labels:  camera-calibration
zhang
Numpy implementation of Z. Zhang's camera calibration algorithm
Stars: ✭ 36 (+44%)
Mutual labels:  camera-calibration
camera calib matlab
Camera calibration with matlab
Stars: ✭ 22 (-12%)
Mutual labels:  camera-calibration
RWHEC-Tabb-AhmadYousef
This code provides methods for robot-world, hand-eye(s) calibration, updated in June 2018..
Stars: ✭ 32 (+28%)
Mutual labels:  camera-calibration
Gyroflow
Video stabilization using gyro data from GoPro or external logs
Stars: ✭ 204 (+716%)
Mutual labels:  camera-calibration
camera calibration
Code and resources for camera calibration using arUco markers and opencv
Stars: ✭ 38 (+52%)
Mutual labels:  camera-calibration
camera-fusion
Multiple cameras calibration and fusion with OpenCV Python.
Stars: ✭ 27 (+8%)
Mutual labels:  camera-calibration
calicam
CaliCam: Calibrated Fisheye Stereo & Mono Camera
Stars: ✭ 98 (+292%)
Mutual labels:  fisheye
CameraCalibTools
List of Camera Calibration Tools + Patterns
Stars: ✭ 64 (+156%)
Mutual labels:  camera-calibration
three-fspy-camera-loader
Script for importing fSpy camera data into three.js.
Stars: ✭ 16 (-36%)
Mutual labels:  camera-calibration
VideoStitching
solve real time video stitching problem: 4 camera example by opencv surf
Stars: ✭ 42 (+68%)
Mutual labels:  camera-calibration
pose-estimation-3d-with-stereo-camera
This demo uses a deep neural network and two generic cameras to perform 3D pose estimation.
Stars: ✭ 40 (+60%)
Mutual labels:  camera-calibration
Structured-Light-Laser-Stripe-Reconstruction
Reconstructs a 3D stripe on the area of an object on which a laser falls as seen by the camera
Stars: ✭ 35 (+40%)
Mutual labels:  camera-calibration
Augmentedunreality
Augmented reality for Unreal Engine 4
Stars: ✭ 243 (+872%)
Mutual labels:  camera-calibration
RGBDAcquisition
A uniform library wrapper for input from V4L2,Freenect,OpenNI,OpenNI2,DepthSense,Intel Realsense,OpenGL simulations and other types of video and depth input..
Stars: ✭ 56 (+124%)
Mutual labels:  camera-calibration
DREAM
DREAM: Deep Robot-to-Camera Extrinsics for Articulated Manipulators (ICRA 2020)
Stars: ✭ 109 (+336%)
Mutual labels:  camera-calibration
AdvancedLaneLines
Lane identification system for camera based systems.
Stars: ✭ 61 (+144%)
Mutual labels:  camera-calibration
sportsfield release
Code release for WACV 2020, "Optimizing Through Learned Errors for Accurate Sports Field Registration"
Stars: ✭ 49 (+96%)
Mutual labels:  camera-calibration

OpenCV-CameraCalibration-Example

FishEyeCameraCalibration.mp4

OpenCVを用いたカメラキャリブレーションのサンプルです
2021/06/21時点でPython実装のある以下3種類について用意しています。

  • 通常カメラ向け
  • 魚眼レンズ向け(fisheyeモジュール)
  • 全方位カメラ向け(omnidirモジュール)
    全方位カメラは以下のような構造のカメラを想定しています。

    画像はWikipediaのOmnidirectional (360-degree) cameraから引用

Requirement

  • opencv-python 4.5.2.54 or later
  • opencv-contrib-python 4.5.2.54 or later ※omnidirモジュールを使用する場合のみ

Calibration Pattern

サンプルでは以下の7×10のチェスボード型のキャリブレーションパターンを使用します。

他の行列数のキャリブレーションパターンを使用したい場合は、以下を参照して作成or入手してください。

また、以下のようなサークル型のパターンやセクターベース型のパターンのサンプルは用意していません。

Usage

calibrateCameraのサンプルでキャリブレーションパラメータをcsvに保存し、
undistortのサンプルで歪み補正を実施してください。

01.calibrateCamera

python 01-01_calibrateCamera.py
python 02-01_fisheyeCalibrateCamera.py
python 03-01_omnidirCalibrateCamera.py

キャリブレーションパターン検出時にEnterを押すことで撮影します。
ESCを押すことでプログラムを終了し、キャリブレーションパラメータを保存します。

実行時には、以下のオプションが指定可能です。

オプション指定
  • --device
    カメラデバイス番号の指定
    デフォルト:
    • 01-01_calibrateCamera:0
    • 02-01_fisheyeCalibrateCamera.py:0
    • 03-01_omnidirCalibrateCamera.py:0
  • --file
    動画ファイル名の指定 ※指定時はカメラデバイスより優先し動画を読み込む
    デフォルト:
    • 01-01_calibrateCamera:None
    • 02-01_fisheyeCalibrateCamera.py:None
    • 03-01_omnidirCalibrateCamera.py:None
  • --width
    カメラキャプチャ時の横幅
    デフォルト:
    • 01-01_calibrateCamera:640
    • 02-01_fisheyeCalibrateCamera.py:640
    • 03-01_omnidirCalibrateCamera.py:640
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:
    • 01-01_calibrateCamera:360
    • 02-01_fisheyeCalibrateCamera.py:360
    • 03-01_omnidirCalibrateCamera.py:360
  • --square_len
    キャリブレーションパターン(チェスボード)の1辺の長さ(mm)
    デフォルト:
    • 01-01_calibrateCamera:23.0
    • 02-01_fisheyeCalibrateCamera.py:23.0
    • 03-01_omnidirCalibrateCamera.py:23.0
  • --grid_size
    キャリブレーションパターン(チェスボード)の行列数(カンマ区切り指定)
    デフォルト:
    • 01-01_calibrateCamera:10,7
    • 02-01_fisheyeCalibrateCamera.py:10,7
    • 03-01_omnidirCalibrateCamera.py:10,7
  • --k_filename
    半径方向の歪み係数の保存ファイル名(csv)
    デフォルト:
    • 01-01_calibrateCamera:K.csv
    • 02-01_fisheyeCalibrateCamera.py:K_fisheye.csv
    • 03-01_omnidirCalibrateCamera.py:K_omni.csv
  • --d_filename
    円周方向の歪み係数の保存ファイル名(csv)
    デフォルト:
    • 01-01_calibrateCamera:d.csv
    • 02-01_fisheyeCalibrateCamera.py:d_fisheye.csv
    • 03-01_omnidirCalibrateCamera.py:d_omni.csv
  • --xi_filename
    Mei'sモデルパラメータxiの保存ファイル名(csv)
    デフォルト:
    • 03-01_omnidirCalibrateCamera.py:xi_omni.csv
  • --use_autoappend
    キャリブレーションパターン検出時に自動で撮影するか否か(指定しない場合はEnterで明示的に撮影)
    デフォルト:
    • 01-01_calibrateCamera:指定なし
    • 02-01_fisheyeCalibrateCamera.py:指定なし
    • 03-01_omnidirCalibrateCamera.py:指定なし
  • --interval_time
    use_autoappend指定時の撮影間隔(ms)
    デフォルト:
    • 01-01_calibrateCamera:500
    • 02-01_fisheyeCalibrateCamera.py:500
    • 03-01_omnidirCalibrateCamera.py:500

02.undistort

python 01-02_undistort.py
python 02-02_fisheyeUndistort.py
python 03-02_omnidirUndistort.py

実行時には、以下のオプションが指定可能です。

オプション指定
  • --device
    カメラデバイス番号の指定
    デフォルト:
    • 01-01_calibrateCamera:0
    • 02-01_fisheyeCalibrateCamera.py:0
    • 03-01_omnidirCalibrateCamera.py:0
  • --file
    動画ファイル名の指定 ※指定時はカメラデバイスより優先し動画を読み込む
    デフォルト:
    • 01-01_calibrateCamera:None
    • 02-01_fisheyeCalibrateCamera.py:None
    • 03-01_omnidirCalibrateCamera.py:None
  • --width
    カメラキャプチャ時の横幅
    デフォルト:
    • 01-01_calibrateCamera:640
    • 02-01_fisheyeCalibrateCamera.py:640
    • 03-01_omnidirCalibrateCamera.py:640
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:
    • 01-01_calibrateCamera:360
    • 02-01_fisheyeCalibrateCamera.py:360
    • 03-01_omnidirCalibrateCamera.py:360
  • --k_filename
    半径方向の歪み係数の読み込みファイル名(csv)
    デフォルト:
    • 01-01_calibrateCamera:K.csv
    • 02-01_fisheyeCalibrateCamera.py:K_fisheye.csv
    • 03-01_omnidirCalibrateCamera.py:K_omni.csv
  • --d_filename
    円周方向の歪み係数の読み込みファイル名(csv)
    デフォルト:
    • 01-01_calibrateCamera:d.csv
    • 02-01_fisheyeCalibrateCamera.py:d_fisheye.csv
    • 03-01_omnidirCalibrateCamera.py:d_omni.csv
  • --xi_filename
    Mei'sモデルパラメータxiの読み込みファイル名(csv)
    デフォルト:
    • 03-01_omnidirCalibrateCamera.py:xi_omni.csv
  • --k_new_param
    Knewパラメータ指定時のスケール
    デフォルト:
    • 01-01_calibrateCamera:1.0
    • 02-01_fisheyeCalibrateCamera.py:0.9
    • 03-01_omnidirCalibrateCamera.py:0.5

Reference

Author

高橋かずひと(https://twitter.com/KzhtTkhs)

License

OpenCV-CameraCalibration-Example is under Apache-2.0 License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].