2009년 1월 14일 수요일

Radial distortion

카메라 렌즈에서 생기는 영상의 왜곡(distortion)현상은 크게 축 방향(radial)왜곡과 접선 방향

(tangential)왜곡으로 나눌 수 있다. 축 방향 왜곡의 경우 렌즈의 잘못된 곡면성형으로, 접선 방향 왜곡의 경우 렌즈와 카메라의 부적절한 조립으로 인해 생긴다.

아래 자료는 radial distortion에 대한 자료이다.

출처 : http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/FUSIELLO4/tutorial.html#x1-67001r131

A realistic model for a photocamera or a videocamera must take into account non-linear distortions introduced by the lenses, especially when dealing with short focal lengths or low cost devices (e.g. webcams, disposable cameras).







The more relevant effect is the radial distortion, which is modeled as a non-linear transformation from ideal (undistorted) coordinates (u,v) to real observable (distorted) coordinates (û, ):



where rd2 = 2 + 2 and (u 0,v0) are the coordinates of the image centre.

Estimating k1 Let us assume that the pinhole model is calibrated. The point m = (u,v) projected according to the pinhole model (undistorted) do not coincide with the measured points = (û, ) because of the radial distortion.

We wish to recover k1 from Eq. (131). Each point gives two equation:


hence a least squares solution for k1 is readily obtained from n > 1 points.
When calibrating a camera we are required to simultaneously estimate both the pinhole model’s parameters and the radial distortion coefficient.
The pinhole calibration we have described so far assumed no radial distortion, and the radial distortion calibration assumed a calibrated pinhole camera.
The solution (a very common one in similar cases) is to alternate between the two estimation until convergence.
Namely: start assuming k = 0, calibrate the pinhole model, then use that model to compute radial distortion. Once k1 is estimated, refine the pinhole model by solving Eq. (130) with the radial distorion in the projection, and continue until the image error is small enough.

View Original blog

2009년 1월 13일 화요일

Cholesky decomposition을 이용한 카메라 행렬 분해

카메라보정(camera calibration) 또는 Self-calibration에서 카메라의 내부(intrinsic)/외부(extrinsic)

파라미터를 계산하는 것이 중요한데 그중에서 cholesky decomposition을 이용하는 방법에 대해

쓰고자 한다.

Cholesky decompostion을 이용하여 카메라 행렬을 분해하는 방법은 아래 박사학위 논문에 언급되어있다.

T.Melen, "Geometrical modelling and calibration of video cameras for underwater navigation," doctoral dissertation, Norwegian Univ. of Science and Technology, Trondheim, Norway, 1994.

이 내용을 정리하면 아래와 같다.

---------------------------------------------------------------------------

계산된 카메라 행렬 P를 QR 분해하여 6개의 내부파라미터(K)와 6개의 외부파라미터(R, t)를 계산할 수 있다.
3x4 크기의 카메라 행렬 P에서 왼쪽 3x3 행렬을 A라고 할 때 A = KR이 된다. 여기서 A-1을 QR 분해하면 식 (1)과 같다.

A-1 = QL (1)

여기서 Q는 직교(orthogonal)하고 L은 상삼각(upper triangular)행렬이다. 식 (1)의 역행렬을 계산하면 식 (2)와 같다.

A = L-1Q-1 = L-1Qt (2)

여기서 K = L-1이고 R = Qt가 된다.

-------------------------------------------------------------------------

이렇게 하여 카메라 내부파라미터 K와 회전행렬 R을 계산할 수 있다. 이동행렬 t는 카메라

행렬 P = [KR -KRt]로 구성되어 있기 때문에 카메라 행렬 P와 내부파라미터 K, 회전행렬

R을 알면 쉽게 계산할 수 있다.

blog.naver.com/sh1nk1y



2009년 1월 12일 월요일

IPIU2009 & ICCV2009

- IPIU2009 (Workship on Image Processing and Image Understanding) 에 논문을 제출했다.


분야는 다중카메라 보정.... 2월 18일 제주도에 가겠군... 지금까지 다른 주제로 다른 학회에는 참석해봤지만 이쪽분야로는 첫 발표이다. 데뷔전...


- ICCV2009 (The Twelth IEEE International Conference on Computer Vision in Kyoto)

초록 제출기한 : 3월 1일

논문 제출기한 : 3월 10일

컴퓨터비전분야에서 세계적인 학회로 알고있다. 그리고 꼭 만나보고 싶은 Peter Sturm 이라는 분도

Tutorial chairs로 오신다고 한다.


ICCV에 참석하는 것이 올해의 목표!

2009년 1월 7일 수요일

Motion capture company .. Phoenix Technologies Incorporated

이 회사의 웹사이트는 여기(http://www.ptiphoenix.com/VZmodels.php)이다

이 회사의 모션 장비는 스테레오비전으로 모션캡처 장비를 구현하였다. 대신 카메라 사이의 간격이 상당히 넓다.

이 회사에 홈페이지에 들어갔을때 놀랐던것은

Sensing Volume: ~ 190 cubic meters of useful space, over 7.0 meters radius (at min. exposure)
Minimum Sensing Distance: 0.5 meter
Position Resolution: 0.015 mm at 1.2m distance
Number of Markers: 512 max (no 'swapping' problem)
Number of Subjects: 512 maximum
Calibration: Not required for an individual tracker
Not required for multi-tracker systems either, if VZAutoCal™ used
Scalability: 1~24 trackers
Accuracy (nominal): 0.65±0.05 mm RMS or better (3D combined; data range: 0.6~2.2m distance, ±40° yaw, ± 30° pitch)
Operation Angle: 90° (± 45°) in both pitch and yaw; 107° diagonally at 5m distance
Sensing Rate: 3300 3D data points per second (single sampling)
2666 3D data points per second (double sampling)
Data Latency: < 0.0006s at maximum sample rate
Computer Communication: Serial RS232/RS422 (921.6kbps)
Mounting Orientation: Any (no 'blinding' problem)
Ruggedness: Can operate with up to 15G acceleration applied to the tracker (optional)
Tracker Bar Weight: 4 Kg

이 스펙이다. 내가 관심있는 정확도(accuracy)가 나와있다. 비록 nominal 이라는 단어가 붙긴 하지만... 어쨌은 0.65 (+/-)0.05 mm 라고 한다. 상당히 정확한 편이다.

실제 모션 캡처를 하기 위해서는 다음과 같은 시스템이 꾸며져야 한다.

전신을 잡으려면 카메라가 사람 주위를 둘러싸야 하니 당연하다 할 수 있다.

LabVIEW, MATLAB, Autodesk Motion Builder, Visual3D 이런 프로그램과 실시간으로 호환이 가능하다고 하니 매력적인 부분이다.

Motion capture technology on BBC

캐러비안의 해적에서 데이비 존스의 얼굴이 어떻게 만들어 졌는지와 모션캡처에 대한 내용

http://news.bbc.co.uk/1/hi/technology/6571491.stm

Harris corner detector

영상의 특징점을 추출하는 방법중에 코너점을 특징점으로 하는 방법이 있는데

그중에서 Harris corner detector라는 것이 있다. 자세한 내용은 첨부파일에 있는 pdf파일에 나와있다.

그리고 가장 중요한 소스코드는 두가지 종류를 찾을 수 있었다.

먼저 Mathwork사의 홈페이지에 있는

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=9272&objectType=FILE

코드가 있고

주옥같은 매트랩 코드가 많은 아래 홈페이지에서도 찾을 수 있다.

http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/

Homography

카메라 3대에서 다음과 같은 특징점(frame_data.txt)을 추출하였다면

cam1 cam2 cam3

191 426 243 442 263 453
422 457 467 419 430 394
183 363 233 376 263 388
422 388 469 355 434 338
173 292 228 305 259 317
422 311 473 284 440 275
161 207 220 213 261 234
422 215 477 198 447 205
148 117 214 127 263 150
422 117 479 113 451 136
136 27 206 33 263 63
422 13 484 19 457 63


Matlab 코드는 아래와 같다.

-----------------------------------------------------------------------

load frame_data.txt



fcam1 = [frame_data(:,1) frame_data(:,2) ones(length(frame_data),1)]';
fcam2 = [frame_data(:,3) frame_data(:,4) ones(length(frame_data),1)]';
fcam3 = [frame_data(:,5) frame_data(:,6) ones(length(frame_data),1)]';


Homo12 = HomographyDLT(fcam2, fcam1);
Homo13 = HomographyDLT(fcam3, fcam1);


위과 같이 호모그래피를 계산하는 함수를 이용하면 된다.



호모그래피 계산 함수는 아래와 같다. Marco Zuliani 라는 분이 만든 코드로 좌표에 대한 정규화까지 수행하여 호모그래피를 계산한다. 조금더 정확한 결과를 얻고자 한다면 최적화까지 수행하여야 한다.



function [H, A] = HomographyDLT(X1, X2, mode, normalization)

% [H A] = HomographyDLT(X1, X2, mode)
%
% DESC:
% computes the homography between the point pairs X1, X2
%
% AUTHOR
% Marco Zuliani - zuliani@ece.ucsb.edu
%
% VERSION:
% 1.0.0
%
% INPUT:
% X1, X2 = point matches (cartesian coordinates)
% mode = 0 -> Hartley Zisserman formulation
% 1 -> Zuliani formulation (default)
% normalization = true (default) or false to enable/disable point
% normalzation
%
% OUTPUT:
% H = homography
% A = homogenous linear system matrix

if (nargin < 3)
mode = 'MZ';
end;

if (nargin < 4)
normalization = true;
end;

N = size(X1, 2);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% checks
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (size(X2, 2) ~= N)
error('The set of input points should have the same cardinality')
end;
if N < 4
error('At least 4 point correspondences are needed')
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% normalize the input
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if normalization
% fprintf('\nNormalizing...')
[X1, T1] = normalize_points(X1);
[X2, T2] = normalize_points(X2);
end;

% compute h
switch mode
case 'HZ'
A = get_A_HZ(X1, X2);
case 'MZ'
A = get_A_MZ(X1, X2);
end;
[U S V] = svd(A);
h = V(:, 9);

% reshape the output
switch mode
case 'HZ'
H = [h(1:3)'; h(4:6)'; h(7:9)'];
case 'MZ'
H = reshape(h, 3, 3);
end;

% and denormalize
if normalization
H = inv(T2)*H*T1;
end;

return

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Matrix construction routine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Hartley Zisserman formulation
function A = get_A_HZ(X1, X2)

X1 = cart2homo(X1);
X2 = cart2homo(X2);

N = size(X1, 2);

A = zeros(2*N, 9);
zero = [0; 0; 0];

row = 1;
for h = 1:N

a = X2(3,h)*X1(:,h)';
b = X2(2,h)*X1(:,h)';
c = X2(1,h)*X1(:,h)';
A(row, :) = [zero' -a b];
A(row+1, :) = [a zero' -c];

row = row + 2;

end;

% Zuliani's formulation
function A = get_A_MZ(X1, X2)

N = size(X1, 2);

A = zeros(2*N, 9);

row = 1;
for h = 1:N

A(row, :) = [X1(1,h) 0 -X1(1,h)*X2(1,h) X1(2,h) 0 -X1(2,h)*X2(1,h) 1 0 -X2(1,h)];
A(row+1, :) = [0 X1(1,h) -X1(1,h)*X2(2,h) 0 X1(2,h) -X1(2,h)*X2(2,h) 0 1 -X2(2,h)];

row = row + 2;

end;

return



데이터 정규화를 위한 코드(normalize_points.m)는 아래와 같다.



function [xn, T] = normalize_points(x)

% [xn, T] = normalize_points(x)
%
% DESC:
% normalize a set of points using the procedure described in the book by
% Hartley and Zisserman
%
% AUTHOR
% Marco Zuliani - zuliani@ece.ucsb.edu
%
% VERSION:
% 1.0.0
%
% INPUT:
% x = points to be normalized
%
% OUTPUT:
% Xn = normalized set of points
% T = transformation matrix such that Xn = T * X

% HISTORY
% 1.0.0 - ??/??/05 - Initial version

% compute the translation
x_bar = mean(x, 2);

% center the points
% faster than xc = x - repmat(x_bar, 1, size(x, 2));
xc(1, :) = x(1, :) - x_bar(1);
xc(2, :) = x(2, :) - x_bar(2);

% compute the average point distance
rho = sqrt(sum(xc.^2, 1));
rho_bar = mean(rho);

% compute the scale factor
s = sqrt(2)/rho_bar;

% scale the points
xn = s*xc;

% compute the transformation matrix
T = [s 0 -s*x_bar(1); 0 s -s*x_bar(2); 0 0 1];

return

RANSAC(RANdom SAmple Consensus) 알고리즘

self-calibration을 하려다보니 제일 먼저 공부해야하는 것이 RANSAC(RANdom SAmple Consensus)이다.

matlab 코드를 다운로드 받을 수 있는 곳.

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18555&objectType=file

호모그래피를 계산할때나 포인트매칭을 할 때 유용한 방법이다. 어떻게보면 별거아닌 아이디어지만

참 실용적이다. 이런 연구를 해야할텐데..

위 사이트보다는

http://www.csse.uwa.edu.au/~pk/research/matlabfns/

이 사이트가 더 유용할것 같다. 정말이지 영상처리하는 사람에게 필요한 코드가 많은 곳이다.

Camera calibration toolbox for Matlab

Camera calibration toolbox for Matlab
Modern CCD cameras are usually capable of a spatial accuracy greater than 1/50 of the pixel size. However, such accuracy is not easily attained due to various error sources that can affect the image formation process. Current calibration methods typically assume that the observations are unbiased, the only error is the zero-mean independent and identically distributed random noise in the observed image coordinates, and the camera model completely explains the mapping between the 3D coordinates and the image coordinates. In general, these conditions are not met, causing the calibration results to be less accurate than expected.


위 내용은 http://www.ee.oulu.fi/~jth/calibr/에서 퍼온 내용중 일부이다.

이 사이트에 들어가시면 matlab 소스 코드까지 받을 수 있다.

참고로 난 아직 안 써봤음..

Direct linear transfomation (DLT)

매트랩 함수로 DLT를 이용해서 카메라 보정하는 함수를 만들었다.

카메라에 찍은 u,v 좌표와 3차원 좌표를 알고있는 통제점의 좌표(x,y,z)가 입력으로 들어간다.

소스코드는 아래와 같다. 통제점의 개수에 상관없이 카메라 보정을 할 수 있다.

카메라 행렬 P는 3x4 행렬이기 때문에 총 12개의 파라미터가 있다. 12번째 파라미터를 1로 고정하고

계산하는 inhomogeneous 방법이 있고 아래의 코드처럼 12번째 파라미터를 1로 고정하지 않고 그냥

변수로 고려하는 homogeneous 방법이 있다. homogeneous 방법으로 12개 파라미터의 값을

구하기 위하여 SVD를 이용하였다.

function [L] = sky_homoDLT_2d_to_3d(u, v, x, y, z)
%function [L] = sky_homoDLT_2d_to_3d(u, v, x, y, z)
%
%L : Direct linear transformation parameter
%u : u coordinate of camera plane
%v : v coordinate of camera plane
%x, y, z : Marker data of Object plane
%u, v, x, y, z must be matrix
%
%--------------------------------------------
%Data : 2008.06.19
%Made by : Ki-Young, Shin (Ph.D course)
%University : Sungkyunkwan University

if length(u) == length(x)
%-----------------------------------------------------
%DLT Parameter를 계산하기 위한 행렬
for i=1:length(u)
X(2*i-1,:) = [x(i) y(i) z(i) 1 0 0 0 0 -u(i)*x(i) -u(i)*y(i) -u(i)*z(i) -u(i)];
X(2*i,:) = [0 0 0 0 x(i) y(i) z(i) 1 -v(i)*x(i) -v(i)*y(i) -v(i)*z(i) -v(i)];
end
%-----------------------------------------------------
%DLT Parameter 계산 using Least squares solutions of mxn (m>n)
[U, S, V] = svd(X);
L = V(:,end);
else
fprintf('Matrix size must be equal')
end

[Paper review] Calibration of 3D kinematic systems using orthogonality constraints

Tomislav Pribanic, Peter Sturm, Mario Cifrek, "Calibration of 3D kinematic systems using orthogonality constraints", Machine vision and applications (2007) 18:367-381.

동작분석기를 위한 다중 카메라 보정방법에 대한 따끈따근한 논문이다. 봉을 이용한 캘리브레이션
논문이 흔하지 않은데 찾다보니 Peter strum의 인턴으로 있던 사람이 쓴 논문이다.
카메라 보정을 위해 3축이 있는 보정틀과 마커가 3개 붙어있는 보정봉을 이용하였다.
논문은 첨부파일에... abstract 부분 번역 내용은 아래와 같다.

----------------------------------------------------------------------------


Abstract.

다중카메라시스템에 의해 획득된 영상을 처리하는 것은 오늘날 3차원복원 수행의 효과적이고 편리한 방법이다. 점의 3차원 위치와 같은 기본적인 값을 통해 속도와 가속도 같은 추가적인 운동학적 데이터에 대한 정보를 얻을 수 있다. 그러므로 많은 복원 시스템은 3차원 운동학적 시스템 같은 것을 이용하고 동작분석을 위해 폭넓게 이용되고 있다. 점들의 실제좌표 복원을 위해 선행되어야 할 것은 다중카메라 시스템의 보정이다. 현재 많은 유명한 3차원 운동학적인 시스템은 마커를 붙인 막대기를 이용하는 막대보정(wand calibration)이라고 부르는 방법을 제공한다. 이 막대 보정은 많은 엔드유저의 관점에서 많은 전통적인 방법을 넘어 선호되는 방법이다. 이 연구에서 다른 보정 방법에 대한 간단한 비평과 3차원 운동학적인 시스템을 위한 전통적인 보정방법이 설명된다. 게다가 특히 카메라 보정의 초기화 단계에 적용될 수 있는 다른 방법이 제안된다. 특별히 제안된 방법은 마커사이 거리의 고정 뿐만 아니라 두 개 또는 세 개의 연결된 막대기의 직교성에 의존한다. 또한 제안된 아이디어는 현재 일반적으로 존재하는 보정도구를 그대로 이용하고 전형적인 보정과정을 단축할 수 있다. 계산된 복원 정확도는 상업적인 3차원 운동학적인 시스템에서 계산한 것과 비교하였다.

[Paper review] Calibration of 3D kinematic systems using orthogonality constraints

Tomislav Pribanic, Peter Sturm, Mario Cifrek, "Calibration of 3D kinematic systems using orthogonality constraints", Machine vision and applications (2007) 18:367-381.

동작분석기를 위한 다중 카메라 보정방법에 대한 따끈따근한 논문이다. 봉을 이용한 캘리브레이션
논문이 흔하지 않은데 찾다보니 Peter strum의 인턴으로 있던 사람이 쓴 논문이다.
카메라 보정을 위해 3축이 있는 보정틀과 마커가 3개 붙어있는 보정봉을 이용하였다.
논문은 첨부파일에... abstract 부분 번역 내용은 아래와 같다.

----------------------------------------------------------------------------


Abstract.

다중카메라시스템에 의해 획득된 영상을 처리하는 것은 오늘날 3차원복원 수행의 효과적이고 편리한 방법이다. 점의 3차원 위치와 같은 기본적인 값을 통해 속도와 가속도 같은 추가적인 운동학적 데이터에 대한 정보를 얻을 수 있다. 그러므로 많은 복원 시스템은 3차원 운동학적 시스템 같은 것을 이용하고 동작분석을 위해 폭넓게 이용되고 있다. 점들의 실제좌표 복원을 위해 선행되어야 할 것은 다중카메라 시스템의 보정이다. 현재 많은 유명한 3차원 운동학적인 시스템은 마커를 붙인 막대기를 이용하는 막대보정(wand calibration)이라고 부르는 방법을 제공한다. 이 막대 보정은 많은 엔드유저의 관점에서 많은 전통적인 방법을 넘어 선호되는 방법이다. 이 연구에서 다른 보정 방법에 대한 간단한 비평과 3차원 운동학적인 시스템을 위한 전통적인 보정방법이 설명된다. 게다가 특히 카메라 보정의 초기화 단계에 적용될 수 있는 다른 방법이 제안된다. 특별히 제안된 방법은 마커사이 거리의 고정 뿐만 아니라 두 개 또는 세 개의 연결된 막대기의 직교성에 의존한다. 또한 제안된 아이디어는 현재 일반적으로 존재하는 보정도구를 그대로 이용하고 전형적인 보정과정을 단축할 수 있다. 계산된 복원 정확도는 상업적인 3차원 운동학적인 시스템에서 계산한 것과 비교하였다.

The image of the absolute conic

* http://www.cse.iitd.ernet.in/~suban/vision/geometry/node45.html에 가면 The image of the absolute conic에 대한 내용이 있다.
----------------------------------------------------------------------------------

Cholesky decomposition을 이용하여 카메라의 내부파라미터 K(위 자료에서는 C)를 구하려고 시도했던적이 있었다. 내부파라미터를 계산하기 위해서 positive definite matrix가 되어야 한다.

Multi-Camera Wand Calibration

http://www.ee.surrey.ac.uk/CVSSP/VMRG/WandCalibration/에 있는 내용중 일부입니다.

Multi-Camera Wand Calibration
The use of multiple CCD cameras for generating three-dimensional data of visual scenes is becoming more and more widespread. Once such example is the Prometheus Project, using multiple cameras to generate 3D television content. As part of the project, a fast wand-based method was developed to calibrate the cameras so they can be used for accurate 3D reconstruction. As an aid to researchers working in this area, this site contains linux binaries, a full C++ implementation of the calibration technique, and details of the method.

Calibration Wand
The calibration wand used in this work is shown on the right. Its purpose is to provide two spheres separated by a known distance and easily distinguishable by their colour. We used two standard tennis balls, spray-painted bright red and bright green. The balls are held a fixed distance apart by a piece of wooden dowel passing through them both. This can be done simply by puncturing each ball using a bradawl.

This wand must be waved throughout the capture volume for several seconds whilst video is recorded simultaneously from all cameras. The digitised frames of video can then be fed to the software for processing. The method is robust to clutter provided the colour of objects in the scene is different from the colours chosen for the balls. It does work best, however, when the background is plain since this provides consistently good contrast with the wand.

Tests were performed using PAL cameras, an analog-to-SDI interface, and SDI frame grabbers. It would be interesting to hear from anyone using the method, especially with other camera systems. Please send feedback, comments and suggestions to joel@codamotion.com .


--------------------------------------------------------------------------

위 사이트에 들어가시면 C언어로 되어 있는 소스코드를 다운로드 받을 수 있습니다.

[Paper review]A convenient multi-camera self-calibration for virtual environments

Tomáš Svoboda, Daniel Martinee and Tomáš Pajdla, "A convenient multi-camera self-calibration for virtual environments," Teleoperators and virtual environments(2005), 14(4):407-422.


2005년에 나온 레이저포인터를 이용한 다중 카메라 보정 논문이다.

논문중에 abstract만 번역한 내용.
--------------------------------------------------------------------------

Abstract.

가상몰입환경(virtual immersive environments) 또는 원격존재구조(telepresence setups)는 보정되어야하는 다중카메라로 구성되어있다. 이 연구에서는 카메라 보정을 위한 편리한 방법을 소개한다. 이 알고리즘에 적용하기 위한 최소의 카메라대수는 3대이며 최대는 제한이 없다. 이 방법은 완전히 자동이며 자유롭게 움직이는 밝은 점이 카메라 보정 물체로 사용된다. 가상 3차원 점들은 측정하고자하는 범위에서 밝은 점을 움직이는 것에 의해 계산된다. 그 점의 투영은 서브픽셀 정확도를 가지며 강건한 RANSAC 분석에 의해 검증된다. 카메라들은 모든 점들을 볼 수 없다. 실질적으로 카메라사이의 겹침으로 인해 보이는 마커만을 묶은 서브그룹이 필요하다. 사영 구조(projective structures)는 rank-4 인수분해를 통해 계산되고 기하학적인 구속조건에 의해 유클라디안 공간으로 변환된다. 이러한 선형계산에 의한 값은 완전히 자동적인 비선형외곡의 계산을 위한 초기해로 사용된다. 본 연구에서는 카메라 보정 물체로써 아주 일반적인 레이저 포인터를 어떻게 사용할 수 있는지 제안한다. 16대의 카메라가 있는 가상몰입환경에서 30분 이내에 재투영에러(reprojection error)가 약 1/5 픽셀에 도달하는 것이 가능함을 보인다. 이 방법은 많은 다중카메라 환경에서 성공적으로 테스트되었다.

cholesky 분해를 이용한 카메라 내부 파라미터 계산

책에 있는 내용을 참고해서 직접 작성한 코드입니다.


직교성을 가진 소실점(vanishing point)이 주어졌을 때 cholesky 분해를 이용하여 카메라 내부 파라미터 K를 계산하는 코드입니다.

여기서 가정은 square pixel이라는 것과 초점거리 fx = fy 가 같다는 것입니다.

cholesky 분해를 위해서는 Omega 행렬이 positive definite 해야만 합니다. 소실점의 값이 제대로 계산되어 입력되지 않으면 cholesky 분해에서 positive definite이 아니라는 에러가 나올 것입니다.


function K = sky_K_from_IAC(v1, v2)
% function K = sky_K_from_IAC(v1, v2)
% Input : v1, v2 -> vanishing points
% Output : K -> internal parameters
%
% Reference : Multiple view geometry in computer vision, second edition(p.226)
% Assumption : w11 = w22, w12 = w21 = 0
% w = [w1 0 w2;
% 0 w1 w3;
% w2 w3 w4];
%
% Shin, Ki-Young
% Biomedical Engineering Lab.
% Sungkyunkwan univ.
% Data : 2008/12/4


for i=1:length(v1)
A(i,:) = [ v1(i,1) * v2(i,1) + v1(i,2) * v2(i,2) v1(i,3) * v2(i,1) + v1(i,1) * v2(i,3) v1(i,3) * v2(i,2) + v1(i,2) * v2(i,3) v1(i,3) * v2(i,3)];
end

[U, S, V] = svd(A);
W = V(:,end);

% Omega must be positive definite
Omega = [W(1) 0 W(2);
0 W(1) W(3);
W(2) W(3) W(4)];

tmp_K = inv(chol(Omega));

K = tmp_K / tmp_K(3,3);


---------------------------------------------------------------------------------

주의 : 아직 위 코드가 완벽하게 검증되었다고 할 수는 없습니다.

그리고 혹시 cholesky decomposition을 할 때 positive definite가 아니라고 나오면 그 데이터 세트는 일찌감치 포기하고 다른 데이터 세트를 선택하는 것이 좋다.

3개 마커를 이용한 소실점(vanishing point) 계산

모션 장비에서 카메라 보정을 위해서 wand calibration 방법을 사용한다. wand 로 카메라를 보정하는 방법은 여러가지가 있다. 그중에서 소실점(vanishing point)으로 카메라 내부파라미터를 계산하고 3차원 복원을 하는 방법이 있다.

소실점을 계산하기 위해서 보통 마커가 3개 있는 wand를 사용한다. 3개의 마커를 이용하여 소실점을 계산하는 방법은 cross ratio를 이용하는 방법이 있다.

[참고자료 : www.geom.uiuc.edu/docs/forum/photo/]

이와같이 P, M1, M3라는 실좌표계에 점과 카메라 센터인 projection point, 그리고 image plane에 있는 점을 사이에 소실점(IH)를 계산하는 방법은

[dist(M2,P)/dist(M2,M1)] = [dist(IM2,IP)/dist(IM2,IM1)]/[dist(IH,IP)/dist(IH,IM1)].

식을 이용하면 된다.

결국 거리의 비를 이용하여 소실점의 좌표를 계산할 수 있다.

------------------------------------------------------------------------------------------
2005년 논문에 좀더 자세한 설명이 나와있다.
F.C.Wu, Z.Y.Hu, H.J.Zhu, 'Camera calibration with moving one-dimensional objects", Pattern recognition, vol. 38, pp. 755-765, 2005.

[Paper review]Estimation of relative camera positions for uncalibrated cameras

Richard I. Hartley, Estimation of relative camera positions for uncalibrated cameras, Computer vision - ECCV '92, Lecture notes in computer science-series, vol. 588, pp. 579-587, 1992.

이 논문은 Essential matrix를 분해하여 R, t를 계산한뒤 카메라 행렬을 만들었다. 카메라 행렬이 4가지로 계산되어 뭘 선택해야하는지 애매하다. 물론 알고리즘 10번항에 According to the requirement that the matched points must lie in front of both camears 라는 말이 있긴하다. 직접 구현해서 어떤 점이 좋고 나쁜지 봐야겠다. 논문은 첨부파일에...

논문내용중에
Theorem 2. Suppose the matrix Q can be factored into a product RS where R is orthogonal and S is skew-symmetric. Let the Singular Value Decomposition of Q be UDV' where D=diag(k,k,0). Then up to a scale factor the factorization is one of the following:


S = VZV' ; R = UEV' or UE'V' ; Q = RS.


where


E = [0 1 0; -1 0 0; 0 0 1], Z = [0 -1 0; 1 0 0; 0 0 0]

이고 카메라 행렬 P2는


P2 = (R -RT) is equal to (UEV' -U(0,0,1)')

이라는 내용이 있다.

Calculating the camera intrinsic parameter using cholesky decomposition

Camera calibration을 할 때 Absolute conic을 이용하여 카메라 내부 행렬을 계산할 때나 Homography를 이용하여 내부 행렬을 계산하기 위해서는 cholesky decomposition을 해야한다.

ω 행렬(카메라 내부 행렬로 구성)을 무사히 cholesky decomposition하기 위해서는 ω 행렬이 반드시 positive definite이어야 한다.

만약 positive definite이 아니면 RANSAC을 다시 수행해서 ω 행렬을 다시 계산하던지 아니면 실험을 다시해서 ω 행렬을 다시 구해야만 한다.

관련된 논문 : Richard I. Hartley, Eric Hayman, Lourdes de Agapito and Ian Reid, Camera calibration and the search for infinity. The Proceedings of the seventh IEEE international conference on computer vision, vol. 1, pp. 510-517, 1999.

논문 내용중에 ... "If the computed ω is not positive definite, then this final step of Cholesky factorization is not possible."

RESUME Personal

Date of Birth: 1979.3.14
Age: 30
Sex: male
Place of Birth: South Korea
E-mail: shinky@skku.edu

Education
2006/03 ~ present: doctoral course student (Sungkyunkwan Univ.)
2004/03 ~ 2006/02: mater degree (Sungkyunkwan Univ.)
Research topic: Plantar pressure sensor using PZT ceramic
1998/03 ~ 2004/02: undergraduate (Sungkyunkwan Univ.)

International paper (4)
- Ki Young Lee, Ki-Young Shin, Hyo Shin Kim, Joung H. Mun (2009): 'Estimating muscle fatigue of the biceps brachii using high to low band ratio in EMG during isotonic exercise', International journal of precision engineering and manufacturing, Vol. 10, No. 3, pp. 147-153.
- Sang Sik Lee, Ki-Young Shin, Joung H. Mun (2006): 'Development of Portable and Wireless Surface EMG', Key Engineering Materials , Vol.321-323, pp.1107-1110.
- Sang Sik Lee, Ki-Young Shin, Joung H. Mun (2006): 'Development of an Algorithm for a PZT Ceramic Foot Sensor', Key Engineering Materials , Vol.321-323, pp.1111-1114.
- Won-Ki Kim, Ki-Young Shin, Joung H. Mun (2006): ‘The development of a cuff for the accuracy enhancement of the sphygmomanometer, International journal of precision engineering and manufacturing, vol. 7, no. 2, pp.30-35.

International confernece (13)
- Ki-Young Shin, Sang-Sik Lee, Joung H. Mun, Double layer force sensor using the impedance variation of a piezoelectric ceramic, The 2nd international conference on advanced nondestructive evaluation, BEXCO, Busan, Korea, October 17~19, 2007.
- Sang-Sik Lee, Ki-Young Shin, Joung H. Mun, Development of a noninvasive electromyography preamplifier, The 2nd international conference on advanced nondestructive evaluation, BEXCO, Busan, Korea, October 17~19, 2007.
- A.R.Yun, H.S.Kim, K.Y.Shin, S.S.Lee, S.W.Choi, J.H.Kwon, C.H.Choi, J.H.Mun, Development and validation of peak knee extension torque prediction model during isokinetic exercise, The 2nd international conference on advanced nondestructive evaluation, BEXCO, Busan, Korea, October 17~19, 2007.
- K.Y.Lee, K.Y.Shin, J.H.Mun, Muslce fatigue prediction of the biceps brachii using hight to low band ratio in EMG during isotonic exercise, The 2nd international conference on advanced nondestructive evaluation, BEXCO, Busan, Korea, October 17~19, 2007.
- A.R.Choi, Y.H.Kim, K.Y.Shin, K.K.Min, E.C.Oh, K.S.Lee, D.H.Keum, K.Y.Lee, J.H.Mun, Bilateral asymmetries of trunk muscle forces during sagittally symmetric lifting, The 2nd international conference on advanced nondestructive evaluation, BEXCO, Busan, Korea, October 17~19, 2007.
- H.S.Kim, S.W.Choi, A.R.Yun, S.E.Lee, K.Y.Shin, S.S.Lee, J.H.Mun, Mean frequency of the surface EMG signals derived via hibert-huang transform and autoregressive model during repetitive maximum isokinetic knee extensions, The 2nd international conference on advanced nondestructive evaluation, BEXCO, Busan, Korea, October 17~19, 2007.
- Y.H.S, Y.K.Moon, H.S.Kim, K.Y.Shin, S.S.Lee, E.C.Oh, J.H.Mun, The development of the data communication controller for vital-signs using FPGA, The 2nd international conference on advanced nondestructive evaluation, BEXCO, Busan, Korea, October 17~19, 2007.
- A.R.Choi, T.Y.Sim, K.Y.Shin, J.H.Mun, The quantitative evaluation of 'crunch factor' using the L5/S1 joint moment during golf swing, The 2nd international conference on advanced nondestructive evaluation, BEXCO, Busan, Korea, October 17~19, 2007.
- H.S.Kim, K.Y.Shin, M.H.Yoo, S.S.Lee, J.H.Mun, "Tibiofemoral Kinematic Analysis using Contact Model during Normal Gait", World Congress On Medical Physics and Biomedical Engineering (Seoul, Korea), 2006.8.29-9.1.
- S.S.Lee, K.Y.Shin, J.H.Mun, "Development of a Preamplifier and a Wireless Surface EMG", World Congress On Medical Physics and Biomedical Engineering (Seoul, Korea), 2006.8.29-9.1.
- K.Y.Shin, S.S.Lee, K.K.Min, D.W.Ko, J.H.Mun, "Methodology for Force Measurement using Piezoelectric Ceramic", World Congress On Medical Physics and Biomedical Engineering (Seoul, Korea), 2006.8.29-9.1.
- K.K.Min, S.G.Kim, H.S.Kim,K.Y.Shin, J.H.Park, W.C.Lee, "The Effect of Cardiovascular System According to The Hot Water-Induced Stimulation on Foot", World Congress On Medical Physics and Biomedical Engineering (Seoul, Korea), 2006.8.29-9.1.
- Ki Young Shin, Sang Sik Lee, Joung H. Mun, "DEVELOPMENT OF A NONINVASIVE INSOLE SYSTEM FOR FOOT PRESSURE", The 1st International Conference on Advanced Nondestructive Evaluation (Jeju, Korea), pp. 126, 2005.11.7-9.

Domestic paper (5)
- 신기영, 문정환, 광학식 모션캡처를 위한 다중 카메라 보정 방법, 한국컴퓨터정보학회 논문지, vol. 14, no. 6, pp. 41-49, 2009.
- 신기영, 배장한, 문정환, 영상분할 방법 기반의 인공신경망을 적용한 카메라의 렌즈왜곡 보정, 한국컴퓨터정보학회 논문지, vol. 14. no. 4, pp. 31-38, 2009.
- 민경기, 강명서, 신기영, 이상식, 문정환, RBF와 LVQ 인공신경망을 이용한 요딥스틱 선별검사에서의 요로감염 분류, 바이오시스템공학회지, vol. 33, no. 5, pp. 340-347, 2008.
- 문용균, 송유환, 신기영, 이상식, 최창현, 문정환, 콤바인 원격 모니터링을 위한 게이트웨이 설계 및 개발, 바이오시스템공학, vol. 32, pp. 197-205, 2007.
- 김효신, 최승욱, 윤애란, 이소은, 신기영, 최재일, 문정환, 슬관절의 등속성 최대 반복 신전시 Hibert-Huang 변환과 AR 모델을 이용한 근피로 평가, 바이오시스템공학회지, Vol. 34, No. 2, 2009 (in press)

Domestic conference (9)
- 신기영, 문정환, 모션캡처장비를 위한 정규화된 호모그래피와 변환행렬을 이용한 대응점 탐색, 한국컴퓨터정보학회 하계학술대회 논문집, vol. 17, no. 1, pp. 55-58, 2009년 6월.
- 신기영, 문정환, 카메라 보정봉과 3축 보정틀을 이용한 다중 카메라 보정, 제21회 영상처리 및 이해에 관한 워크샵, pp. 528-533, 2009.
- 윤애란, 신기영, 김효신, 문정환, 등장성 운동시 AR방법과 FFT방법으로 계산한 EMG 중앙주파수의 비교분석, 바이오시스템공학회 2007 동계학술대회, vol. 12, pp. 122-126.
- 송유환, 문용균, 신기영, 문정환, FPGA를 이용한 혈압 정보 송수신 제어기 개발, 바이오시스템공학회 2007 동계학술대회, vol. 12, pp. 118-121.
- 이기영, 신기영, 문정환, 등장성 운동시 근전도 피로인자의 변화 비교 (CFP-148), 2007년 대한전자공학회 하계학술대회
- 민경기, 신기영, 김효신, 고대욱, 이상식, 문정환, "RGB에서 XYZ 좌표계로의 색 좌표 변환 기법에 관한 연구", 한국농업기계학회, vol. 11(1), pp. 108-112, 2006.2.17.
- 신기영, 이상식, 문정환, "족부압력측정을 위한 PZT세라믹의 물리적 특성", 한국농업기계학회, vol. 10(2), pp. 386-389, 2005.7.8
- 신기영, 김효신, 이규승, 문정환, "신호에 따른 노년층의 안정적 보행의 완성 시기", 대한정밀공학회, vol.1, pp. 19-22, 2003.4.25-26.
- 신기영, 김효신, 이규승, 문정환, "입식과 좌식을 고려한 일어서기 동작의 생체역학적 분석", 한국농업기계학회, vol 8(2), pp. 449-455, 2003.7.11.