Created Date : 2008.11
Language : C/C++
Tool : Microsoft Visual C++
Library & Utilized : OpenCV 1.0
Reference : Learning OpenCV Book
I made Camera calibration source for my convenience using the book that is "Learning OpenCV".
First of all, prepare several pattern images. And make same file name with ordered index.
Ex) pattern1.jpg, pattern2.jpg, pattern3.jpg ...
And answer the some questions.

Pattern width box count(black box number), height box count, the number of image
and file path and file name. Then point extraction is processed.



After all processing, below file is saved in the folder that is same location as images.
Distortion.xml
Distortion.txt
intrinsic.xml
intrinsic_matrix.txt
rotation_matricex.txt
rotation_matricex.xml
translation_matrices.txt
translation_matrices.xml
The points of each pattern image is saved as below file names.
pattern1.txt, pattern2.txt, pattern3.txt......
This source uses 'cvFindChessboardCorners' and 'cvFindCornerSubPix' functions for detecting pattern point. And for drawing, 'cvDrawChessboardCorners' function is used. 'cvCalibrateCamera2' is used for calibration.
This code is programed by Microsoft Visual studio 6.0 and OpenCV 1.0 Lib.
All OpenCv 1.0 dlls are included in the zip file.
You can download heare - >
< entire source >
If you have any progressive agenda, Plz give me using reply.
Thank you.
(Please understand my bad english ability. If you point out my mistake, I would correct pleasurably. Thank you!!)
------------------------------------------------------------------------------
OpenCV๋ฅผ ์ด์ฉํ ์นด๋ฉ๋ผ ์บ๋ฆฌ๋ธ๋ ์ด์
(์บก์ณ๋ ์ด๋ฏธ์ง๋ฅผ ์ด์ฉํจ)
์ฒด์ค ๋ณด๋ ํจํด์ ๊ต์ ํ์ ์ฌ์ฉํจ
ํ๋ก๊ทธ๋จ ์คํํ
ํจํด์ ๊ฐ๋ก, ์ธ๋ก ์ ๊ฐ์ ์
๋ ฅ
ํจํด์ ๊ฒฝ๋ก ์
๋ ฅ (์: ./p1/image)
ํจํด์ ๊ฐ์ ์
๋ ฅ (10์ผ๋ก ์
๋ ฅํ๋ฉด ./p1/image1.jpg ./p1/image2.jpg ... ./p1/image10.jpg)
์ด๋ฏธ์ง ํ ์ฅ์ฉ ๊ต์ ์ ์ ์ฐพ๋๋ค.
๊ต์ ์ ์ ์ ๋๋ก ์ฐพ์ง ๋ชปํ ์ด๋ฏธ์ง๋ ์คํจ๋ก ๊ฐ์ฃผํ๊ณ ์ฌ์ฉํ์ง ์๋๋ค.
์
๋ ฅ๋ ์ด๋ฏธ์ง๋ฅผ ๋ชจ๋ ๋ค ์ฒ๋ฆฌํ ํ
Zhang's ์บ๋ฆฌ๋ธ๋ ์ด์
์ ์ํ
์ฝ์ ์ฐฝ์ ๋ด๋ถ ํ๋ผ๋ฏธํฐ Instrinsic Matrirx์ ์๊ณก ๊ณ์ Distortion Vector ๊ฐ์ ์ถ๋ ฅ ํด์ฃผ๊ณ
๋ํ ๊ฐ๊ฐ์ xml ํ์ผ๋ก ์ ์ฅํ๋ค.
๊ทธ๋ฆฌ๊ณ ๊ฐ ํจํด์ ๋ํ Rotion ๊ณผ Translation Matrix ๋ํ ์ฝ์ ์ฐฝ์ ์ถ๋ ฅํ๊ณ xmlํ์ผ๋ก ์ ์ฅํ๋ค.
์ ์ฅ๋ Instrinsic parameter, distortion coffecient๋ฅผ ์ด์ฉํ์ฌ ์ดํ๋ฆฌ์ผ์ด์
๊ตฌํ์ด ๊ฐ๋ฅํ๋ค.
์ฒด์ค๋ณด๋์์ ๊ต์ ์ ์ ์ฐพ๋ ๋ฐฉ๋ฒ์
cvFindChessboardCorners, cvFindCornerSubPix ํจ์๋ฅผ ์ด์ฉํ์์ผ๋ฉฐ
์ฐพ์ ๊ต์ ์ ์ ๊ทธ๋ ค์ฃผ๋ ํจ์๋ cvDrawChessboardCorners๋ฅผ ์ด์ฉ
์บ๋ฆฌ๋ธ๋ ์ด์
์ cvCalibrateCamera2 ํจ์๋ฅผ ์ด์ฉํจ
๋ณธ ์์ค๋ microsoft visual studio 6.0, opencv 1.0์ ์ด์ฉํ์ฌ ๋ง๋ ์์ค์
๋๋ค.
์ฌ๊ธฐ์ ๋ค์ด ๋ฐ์์ ์์ต๋๋ค. - >
< entire source >