1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ROSによるカメラキャリブレーション(円形パターンを使う場合)

Last updated at Posted at 2023-09-24

カメラ内部パラメータとは

カメラ画像に映った物体が3次元空間上でどこにあるのかを求めるために、画像座標系と空間座標系の変換行列(=内部パラメータ)を求める必要がある

rosを使ったキャリブレーション

一部のカメラでは内部パラメータが/camera_infoトピックで出力されている場合があるが、そうでないカメラでもsensor_msgs/Imageトピックが出ていれば、camera_calibrationパッケージで内部パラメータを推定する事ができる

#四角形パターン(チェッカーボード)を使う場合
rosrun camera_calibration cameracalibrator.py --square 0.04 --size 4x11 image:=/usb_cam/image_raw

--squareには四角形の1辺の長さ、--sizeには白と黒の四角形の交点の数(四角形の数ではない)を指定する

image:=の後はカメラから出ているsensor_msgs/Imageトピック名を指定する

円形パターンを使う場合

円形パターンを使うときの情報があまり無いので書いておく

円形パターンの対称/非対称の違いについてはMathworksの解説ページが分かりやすい

対称パターンはステレオカメラには使えないらしい

対称パターン

円が格子状に並んでいるもの

image.png

--pattern circlesを追加し、--squareには円の中心間の距離[m]、--sizeには円の配置を指定する

rosrun camera_calibration cameracalibrator.py --pattern circles --square 0.04 --size 4x11 image:=/usb_cam/image_raw

非対称パターン

円が段違いに配置されているもの

image.png

--pattern acirclesを追加し、--squareには円の中心間の距離[m]、--sizeには円の配置を指定する

rosrun camera_calibration cameracalibrator.py --pattern acircles --square 0.04 --size 4x11 image:=/usb_cam/image_raw

非対称パターンのサイズの考え方

image.png

引数を間違えるとキャリブレーションが開始しないので注意

画像引用

Calibration Patterns -MathWorks
Camera Calibration Patterns -nerian.com

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?