Calibração de Câmeras Cap. 6 Trucco & Verri. Câmera segue um modelo simples plano de projeção...
Transcript of Calibração de Câmeras Cap. 6 Trucco & Verri. Câmera segue um modelo simples plano de projeção...
Calibração de Câmeras
Cap. 6 Trucco & Verri
Câmera segue um modelo simples
plano de projeção
centro de projeção
Projeção cônica
caixa
filme
objetopinhole
raios de luz
imagem
Câmera
“pinhole”
Notação
Z
Yfy
Z
Xfx ,
xc
yc
zcp’
Z
Y
X
P
y'
x'
Z
Yfy
Z
Xfx ,
sinal !
OpenGLVisão
(X,Y,Z)T (x’,y’)T(xim,yim)T
yim
f xim
yc
vista lateral
oczc
f
fovy oy
xim
yim
h pi
xels
ox
oc
eixo óptico
x0
y0
yc
xc
zc
Z
Y
X
P
y'
x'
w pixels
x'
y'
(xim,yim)T (x’,y’)T
xim
yim
x’
y’
01 3 4
1
2
0
3
2
sx
sy
p'
ooy
ox
5
ximx
oxs
x
'yim
y
oys
y
'
)(
)(
yimy
ximx
oys
oxs
y
xp
(X,Y,Z)T (xim,yim)T
Z
Y
X
osf
osf
w
y
x
yy
xx
h
h
100
0
0
yy
im
xx
im
oZ
Y
s
fy
oZ
X
s
fx
wy
wx
y
x
h
h
im
im
)(
)(
yimy
ximx
oys
oxs
y
xp
ZY
ZX
f
Parâmetros intrínsecos com cisalhamento
10100
0010
0001
100
0Z
Y
X
of
osf
w
y
x
yy
xhx
h
h
P0IKp 3
yy
xx
sff
sff
][ yxhyx oosff
Parâmetros intrínsecos com distorção radial
][ 1koosff yxhyx
22
42
21
42
21
)1('
)1('
ddd
ddd
ddd
yxr
rkrkyy
rkrkxx
02
12
k
kk
Parâmetros extrínsecos
• Translação –Tx, Ty, Tz (3 g.l.)
• Rotação (3 g.l.)
333231
332221
131211
rrr
rrr
rrr
w
w
w
k
j
i
1
0
wwwwww
wwwwww
kkjjii
jkkiji
Parâmetros extrínsecosxc
yc
zc
yw
xw
zw
w
w
w
cwcwcw
cwcwcw
cwcwcw
c
c
c
cw
Z
Y
X
Z
Y
X
kkkjki
jkjjji
ikijii
P
Pw
Pc T
TPP wc
1w
w
w
z
y
x
cwcwcw
cwcwcw
cwcwcw
c
c
c
cZ
Y
X
t
t
t
Z
Y
X
kkkjki
jkjjji
ikijii
P
wc PTRP
wPTRKp
cKPp
Compondo as transformações
PTRKp ][
parâmetros extrínsecos
parâmetros intrínsecos
1100
0w
w
w
z
y
x
cwcwcw
cwcwcw
cwcwcw
yy
xhx
h
h
Z
Y
X
t
t
t
of
osf
w
y
x
kkkjki
jkjjji
ikijii
wy
wx
y
x
h
h
im
im
Calibração de câmera
• Problema: obter os parâmetros extrínsecos (R, T) e intrínsecos (K) da transformação projetiva de câmera.
• Dados: n pares de pontos correspondentes (Pi, pi) na cena e na imagem.
Calibração de câmeras
• Calibração estimação de parâmetros otimização
2,,
,,|)(|min iTRKi
TRKPfp
pontos da cena
pontos da imagem
projeção (função não linear)
Método de Tsai(compativel com notação do OpenGL)
X c
Y c
Z c p’
c
c
c
c
Z
Y
X
P
'
'
y
xp
c
c
c
c
ZY
ZX
f
y'
x'
Câmera para imagem
c
c
yyim
c
c
xxim
Z
Y
s
foy
Z
X
s
fox
)(
)(
yimy
ximx
oys
oxs
y
xp
c
c
c
c
ZY
ZX
f
Concatenando
c
c
yyim
c
c
xxim
Z
Y
s
foy
Z
X
s
fox
zwww
ywww
yyim
zwww
xwww
xxim
TZrYrXr
TZrYrXrfoy
TZrYrXr
TZrYrXrfox
333231
232221
333231
131211
cameraz
y
x
w
w
w
c
c
c
T
T
T
Z
Y
X
rrr
rrr
rrr
Z
Y
X
333231
332221
131211
Os passos do Método de TsaiPasso 1:
),( xx oo conhecidos
Distorção radial insignificante
Assuma:
zwww
ywww
yi
zwww
xwww
xi
TZrYrXr
TZrYrXrfy
TZrYrXr
TZrYrXrfx
iii
iii
iii
iii
333231
232221
333231
131211
yimiximi oyyoxx
Método de Tsai
zwww
ywww
yi
zwww
xwww
xi
TZrYrXr
TZrYrXrfy
TZrYrXr
TZrYrXrfx
iii
iii
iii
iii
333231
232221
333231
131211
ywww
i
yz
www
xwww
i
xz
www
TZrYrXry
fTZrYrXr
TZrYrXrx
fTZrYrXr
iiiiii
iiiiii
232221333231
131211333231
Método de TsaiPasso 1:
ywww
i
yz
www
xwww
i
xz
www
TZrYrXry
fTZrYrXr
TZrYrXrx
fTZrYrXr
iiiiii
iiiiii
232221333231
131211333231
xwww
xiywww
yi TZrYrXrfyTZrYrXrfx iiiiii 131211232221
xiw
iw
iw
iyiw
iw
iw
i TyrZyrYyrXyTxrZxrYxrXx iiiiii 131211232221
x
yy
xy
x
s
s
f
s
s
f
f
f
Método de TsaiPasso 1:
xiw
iw
iw
iyiw
iw
iw
i TyrZyrYyrXyTxrZxrYxrXx iiiiii 131211232221
87654321 vyvZyvYyvXyvxvZxvYxvXx iw
iw
iw
iiw
iw
iw
i iiiiii
087654321 vyvZyvYyvXyvxvZxvYxvXx iw
iw
iw
iiw
iw
iw
i iiiiii
xy TvTv
rvrv
rvrv
rvrv
84
137233
126222
115211
Correspondência
11, yx
22 , yx
33 , yx
NN yx ,
www ZYX111
,,
www ZYX222
,,
www ZYX333
,,
www
NNNZYX ,,
Sistema Ax=0
0
0
0
0
0
0
0
0
8
7
6
5
4
3
2
1
2222222222222
111111111111
2
1
v
v
v
v
v
v
v
v
yZyYyXyxZxYxXx
yZyYyXyxZxYxXx
yZyYyXyxZxYxXx
NwNN
wNN
wNNN
wNN
wNN
wNN
wwwwww
wwwwwwi
0Av 7)( Arank
Compute v by SVD decomposition of A=UDVT (The solution vector is the column of V corresponding to null (or smallest) singular value) in D.
Estimativa dos parâmetros da câmera
Fator de escala
Txy TrrrTrrrγv
trivialnãosolução umav
131211232221
, Seja
2
232
222
2122
322
21
223
222
221 ,1 Como
rrrvvv
rrr
Sinal do fator de escala
Sinal de
0131211 xww
iw
i TZrYrXrx ii
zwww
xwww
xi TZrYrXr
TZrYrXrfx
iii
iii
333231
131211
0333231 zwwwc
i TZrYrXrZ iiiComo:
Temos
Caso isto não seja verdade troque o sinal de v
Estimativa do fator
2
232
222
21222
726
25
223
222
221 have we,1 Since
rrrvvv
rrr
27
26
25
1vvv
Última linha da matriz de rotação
332221
131211
23
22
21
13
12
11
33
32
31
det
rrr
rrr
r
r
r
r
r
r
r
r
r kji
333231
332221
131211
rrr
rrr
rrr
Reortogonalize:
TT UIVRUDVR
Cáculo de fx fy e Tz
wwwii iii
ZYXyx ,, and ,pair ingcorrespondeach For
bf
TA
x
Z
Solve
xwww
xzwww
i TZrYrXrfTZrYrXrx iiiiii 131211333231
wwwixx
wwwzi iiiiii ZrYrXrxfTZrYrXrTx 333231131211
Cáculo de fx fy e Tz
xwN
wN
wNN
xwww
xwww
TZrYrXrx
TZrYrXrx
TZrYrXrx
131211
2132122112
1131121111
A
wN
wN
wNN
www
www
ZrYrXrx
ZrYrXrx
ZrYrXrx
333231
2332322312
1331321311
b
bAx bxUDV T bUVDx T1
bAx bAAxA TT bAAAx TT 1
Ponto de fuga
Cálculo do centro ótico pelos pontos de fuga
Passo 2 do Tsai
Computing Image Center yx oo ,
vv11
vv22
vv33
Pontos de fuga do padrão 3D
Tsai 2D
0wiZ
Método de Tsai planoPasso 1:
zwww
ywww
yi
zwww
xwww
xi
TZrYrXr
TZrYrXrfy
TZrYrXr
TZrYrXrfx
iii
iii
iii
iii
333231
232221
333231
131211
zww
yww
yi
zww
xww
xi
TYrXr
TYrXrfy
TYrXr
TYrXrfx
ii
ii
ii
ii
3231
2221
3231
1211
=0
Método de Tsai plano
yww
i
yz
ww
xww
i
xz
ww
TYrXry
fTYrXr
TYrXrx
fTYrXr
iiii
iiii
22213231
12113231
xww
xiyww
yi TYrXrfyTYrXrfx iiii 12112221
xiw
iw
iyiw
iw
i TyrYyrXyTxrYxrXx iiii 12112221
xiw
iw
iyiw
iw
i TyrYyrXyTxrYxrXx iiii 12112221
1
Método de TsaiPasso 1:
0654321 vyvYyvXyvxvYxvXx iw
iw
iiw
iw
i iiii
xy TvTv
rvrv
rvrv
63
125222
114211
0v0Av
3
6
222
121
512
411
vT
vT
vr
vr
vr
vr
y
x
?
?
23
13
r
r
Método de Tsai
Tc rrr 131211
ˆ i
Tc rrr 232221
ˆ j
3
6
222
121
512
411
vT
vT
vr
vr
vr
vr
y
x
051422
54214 vvvvvvvv
023132
2514
223
222
21
213
225
24
rrvvvv
rvv
rvv
5142
254215421
2 42
1vvvvvvvvvvvv
Sinal de
01211 xw
iw
i TYrXrx i
zww
xww
xi TYrXr
TYrXrfx
ii
ii
3231
1211
0ciZ
Logo
Caso isto não seja verdade troque o sinal de
2
3
6
222
121
512
411
vT
vT
vr
vr
vr
vr
y
x
escolha um sinal
Fator de escala
3
6
222
121
512
411
vT
vT
vr
vr
vr
vr
y
x
212
21113 1 rrr
222
22123 1 rrr
221221112313 rrrrrr
escolha um sinal
escolha um sinal
corrija a escolha
23
22
21
13
12
11
33
32
31
r
r
r
r
r
r
r
r
r
?
?
?
?
23
13
zT
f
r
r
Cáculo de fx fy e Tz
wwwii iii
ZYXyx ,, and ,pair ingcorrespondeach For
bf
TA
x
Z
Solve
xww
xzww
i TYrXrfTYrXrx iiii 12113231
wwixx
wwzi iiii YrXrxfTYrXrTx 32311211
Implementation of “A Flexible New Technique for Camera
Calibration”
based on the report of:
Zhengyou Zhang
December 2, 1998
Notação do artigo de Zhang:
1
0100
0
13210
0 Y
X
v
u
v
u
s trrr
MtRAm~~ s
1100
0
1210
0 Y
X
v
u
v
u
s trr
X
Y
x
y
s
vy
s
ux
Determinação de uma Homografia
MtRAm~~ s MHm
~~ s
1876
543
210
i
i
i
ii
ii
Y
X
hhh
hhh
hhh
s
ys
xs
tRAH
210 hYhXhu iii
543 hYhXhv iii
876 hYhXhs iii
876
210
hYhXh
hYhXhx
ii
iii
876
543
hYhXh
hYhXhy
ii
iii
210876 hYhXhxhYhXh iiiii
543876 hYhXhyhYhXh iiiii
X
Y
x
y
00001 876543210 hxhYxhXxhhhhhYhX iiiiiii
0100 876543210 hxhYxhXxhhYhXhhh iiiiiii
210876 hYhXhxhYhXh iiiii
543876 hYhXhyhYhXh iiiii
2 equações por ponto. 9 (8) incógnitas
int homography(int nPoints, double* modelPoints, double* imagePoints, double* H){ int k; double* L=(double*)malloc(2*nPoints*9*sizeof(double)); /* L is a 2nx9 matrix where Lij is in L[9*i+j] */
/* Assembles coeficiente matrix L */ for(k=0; k<nPoints; k++) { double X=modelPoints[3*k+0]; /* X coord of model point k */ double Y=modelPoints[3*k+1]; /* Y coord of model point k */ double W=modelPoints[3*k+2]; /* W coord of model point k */ double x=imagePoints[2*k+0]; /* x coord of image point k */ double y=imagePoints[2*k+1]; /* y coord of image point k */
int i=2*k; /* line number in matrix L */ L[9*i+0] = X; L[9*i+1] = Y; L[9*i+2] = W; L[9*i+3] = 0; L[9*i+4] = 0; L[9*i+5] = 0; L[9*i+6] = -x*X; L[9*i+7] = -x*Y; L[9*i+8] = -x*W; i=2*k+1; L[9*i+0] = 0; L[9*i+1] = 0; L[9*i+2] = 0; L[9*i+3] = X; L[9*i+4] = Y; L[9*i+5] = W; L[9*i+6] = -y*X; L[9*i+7] = -y*Y; L[9*i+8] = -y*W; } solveAx0(2*nPoints,9,L,H); /* solves the system [L]{h}={0} */
free(L); return 0;}
Minimização (Levenberg-Marquardt)
N
i i
ii
i
ii s
vy
s
ux
0
22
1876
543
210
i
i
i
i
i
Y
X
hhh
hhh
hhh
s
v
uonde:
Tome H como solução inicial
Minimize:
int homography(int nPoints, double* modelPoints, double* imagePoints, double* H){ int k; double* L=(double*)malloc(2*nPoints*9*sizeof(double)); /* L is a 2nx9 matrix where Lij is in L[9*i+j] */
/* Assembles coeficiente matrix L */ for(k=0; k<nPoints; k++) { double X=modelPoints[3*k+0]; /* X coord of model point k */ double Y=modelPoints[3*k+1]; /* Y coord of model point k */ double W=modelPoints[3*k+2]; /* W coord of model point k */ double x=imagePoints[2*k+0]; /* x coord of image point k */ double y=imagePoints[2*k+1]; /* y coord of image point k */ int i=2*k; /* line number in matrix L */
L[9*i+0] = X; L[9*i+1] = Y; L[9*i+2] = W; L[9*i+3] = 0; L[9*i+4] = 0; L[9*i+5] = 0; L[9*i+6] = -x*X; L[9*i+7] = -x*Y; L[9*i+8] = -x*W; i=2*k+1; L[9*i+0] = 0; L[9*i+1] = 0; L[9*i+2] = 0; L[9*i+3] = X; L[9*i+4] = Y; L[9*i+5] = W; L[9*i+6] = -y*X; L[9*i+7] = -y*Y; L[9*i+8] = -y*W; } solveAx0(2*nPoints,9,L,H); /* solves the system [L]{h}={0} */
if (OPTIMIZE) { double lmH[9]; lmHomography(imagePoints,modelPoints,H,nPoints,lmH); mtxMatCopy(lmH,3,3,H); } free(L); return 0;}
Restrições na matriz de parâmetros intrínsicos
MtRAm~~ s MHm
~~ s tRAH
trrAhhh 21321
21
2
11
1
1
1
hAr
hAr
1
0
2211
21
rrrr
rr
0
0
2211
21
rrrr
rrTT
T
0
0
21
211
1
21
1
hAAhhAAh
hAAhTTTT
TT
Das homografias para parâmetros intrínsecos
0
0
21
211
1
21
1
hAAhhAAh
hAAhTTTT
TT
0
0
2211
21
hBhhBh
hBhTT
T
543
421
3101
bbb
bbb
bbbT AABonde:
876
543
210
hhh
hhh
hhh
He
0)()()( 576446733167024311340010 bhhbhhhhbhhhhbhhbhhhhbhh
0)()(3)(2)()(2)( 52
72
6474633716022
42
31413002
12
0 bhhbhhhhbhhhhbhhbhhhhbhh
2 equações por homografia. 6 incógnitas
void calcB(int nH, double* H, double* B){ int m = 2*nH; int n = 6; double* V =(double*) calloc(sizeof(double),m*n); double* b =(double*) malloc(sizeof(double)*n); int i;
for(i=0;i<nH;i++){ double* h = &H[9*i]; int line1 = 2*n*i; int line2 = line1+6;
V[line1+0]=h[0]*h[1]; V[line1+1]=h[0]*h[4] + h[3]*h[1]; V[line1+2]=h[3]*h[4]; V[line1+3]=h[0]*h[7]+h[6]*h[1]; V[line1+4]=h[3]*h[7]+h[6]*h[4]; V[line1+5]=h[6]*h[7];
V[line2+0]=h[0]*h[0] - h[1]*h[1]; V[line2+1]=2*(h[0]*h[3] - h[1]*h[4]); V[line2+2]=h[3]*h[3] - h[4]*h[4]; V[line2+3]=2*(h[0]*h[6] - h[1]*h[7]); V[line2+4]=2*(h[3]*h[6] - h[4]*h[7]); V[line2+5]=h[6]*h[6] - h[7]*h[7]; if (NORMALIZE) { mtxNormalizeVector(6,&V[line1]); mtxNormalizeVector(6,&V[line2]); } }
solveAx0(m,n,V,b); /* solves the system [V]{x}={0} */
i=0; B[i++]=b[0]; B[i++]=b[1]; B[i++]=b[3]; B[i++]=b[1]; B[i++]=b[2]; B[i++]=b[4]; B[i++]=b[3]; B[i++]=b[4]; B[i++]=b[5];
free(b); free(V);}
Cálculo da matrix A
/* Get intrinsic parameters from matrix B*/int calcA(double* B, double* A){ double alpha,betha,gamma,u0,v0,lambda;
double den=B[0]*B[4]-B[1]*B[1]; if (fabs(den)< TOL ) return 0;
v0 = (B[1]*B[2]-B[0]*B[5])/den;
if (fabs(B[0])<TOL) return 0; lambda = B[8]-(B[2]*B[2]+v0*(B[1]*B[2]-B[0]*B[5]))/B[0];
if (lambda/B[0]<0) return 0; alpha=sqrt(lambda/B[0]);
if ((lambda*B[0]/den)<0) return 0; betha = sqrt(lambda*B[0]/den);
gamma = - B[1]*alpha*alpha*betha/lambda; u0=gamma*v0/betha-B[2]*alpha*alpha/lambda;
A[0]=alpha; A[1]=gamma; A[2]=u0; A[3]=0; A[4]=betha; A[5]=v0; A[6]=0; A[7]=0; A[8]=1;
return 1;}
Cálculo de R e t
Calibração de Zhang para uma câmera “boa”
yim
f xim
yc
vista lateral
oczc
f
fovy oy
xim
yim
h pi
xels
ox
oc
eixo óptico
x0
y0
yc
xc
zc
Z
Y
X
P
y'
x'
w pixels
x'
y'
2
2h
o
wo
y
x
Notação do artigo de Zhang:
1
0100
00
00
1321
Y
X
f
f
v
u
s x
x
trrr
MtRAm~~ s
1100
00
00
121
Y
X
f
f
v
u
s x
x
trr
X
Y
x
y
s
vy
s
ux
1
0100
0
13210
0 Y
X
v
u
v
u
s trrr
0
)(
00
vu
pixelemfpf
xx
Determinação de uma Homografia
MtRAm~~ s MHm
~~ s
1876
543
210
i
i
i
i
i
Y
X
hhh
hhh
hhh
s
v
u
tRAH
210 hYhXhu iii
543 hYhXhv iii
876 hYhXhs iii
876
210
hYhXh
hYhXhx
ii
iii
876
543
hYhXh
hYhXhy
ii
iii
210876 hYhXhxhYhXh iiiii
543876 hYhXhyhYhXh iiiii
X
Y
x
y
00001 876543210 hxhYxhXxhhhhhYhX iiiiiii
0100 876543210 hxhYxhXxhhYhXhhh iiiiiii
210876 hYhXhxhYhXh iiiii
543876 hYhXhyhYhXh iiiii
2 equações por ponto. 9 (8) incógnitas
int homography(int nPoints, double* modelPoints, double* imagePoints, double* H){ int k; double* L=(double*)malloc(2*nPoints*9*sizeof(double)); /* L is a 2nx9 matrix where Lij is in L[9*i+j] */
/* Assembles coeficiente matrix L */ for(k=0; k<nPoints; k++) { double X=modelPoints[3*k+0]; /* X coord of model point k */ double Y=modelPoints[3*k+1]; /* Y coord of model point k */ double W=modelPoints[3*k+2]; /* W coord of model point k */ double x=imagePoints[2*k+0]; /* x coord of image point k */ double y=imagePoints[2*k+1]; /* y coord of image point k */
int i=2*k; /* line number in matrix L */ L[9*i+0] = X; L[9*i+1] = Y; L[9*i+2] = W; L[9*i+3] = 0; L[9*i+4] = 0; L[9*i+5] = 0; L[9*i+6] = -x*X; L[9*i+7] = -x*Y; L[9*i+8] = -x*W; i=2*k+1; L[9*i+0] = 0; L[9*i+1] = 0; L[9*i+2] = 0; L[9*i+3] = X; L[9*i+4] = Y; L[9*i+5] = W; L[9*i+6] = -y*X; L[9*i+7] = -y*Y; L[9*i+8] = -y*W; } solveAx0(2*nPoints,9,L,H); /* solves the system [L]{h}={0} */
free(L); return 0;}
Minimização (Levenberg-Marquardt)
N
i i
ii
i
ii s
vy
s
ux
0
22
1876
543
210
i
i
i
i
i
Y
X
hhh
hhh
hhh
s
v
uonde:
Tome H como solução inicial
Minimize:
int homography(int nPoints, double* modelPoints, double* imagePoints, double* H){ int k; double* L=(double*)malloc(2*nPoints*9*sizeof(double)); /* L is a 2nx9 matrix where Lij is in L[9*i+j] */
/* Assembles coeficiente matrix L */ for(k=0; k<nPoints; k++) { double X=modelPoints[3*k+0]; /* X coord of model point k */ double Y=modelPoints[3*k+1]; /* Y coord of model point k */ double W=modelPoints[3*k+2]; /* W coord of model point k */ double x=imagePoints[2*k+0]; /* x coord of image point k */ double y=imagePoints[2*k+1]; /* y coord of image point k */ int i=2*k; /* line number in matrix L */
L[9*i+0] = X; L[9*i+1] = Y; L[9*i+2] = W; L[9*i+3] = 0; L[9*i+4] = 0; L[9*i+5] = 0; L[9*i+6] = -x*X; L[9*i+7] = -x*Y; L[9*i+8] = -x*W; i=2*k+1; L[9*i+0] = 0; L[9*i+1] = 0; L[9*i+2] = 0; L[9*i+3] = X; L[9*i+4] = Y; L[9*i+5] = W; L[9*i+6] = -y*X; L[9*i+7] = -y*Y; L[9*i+8] = -y*W; } solveAx0(2*nPoints,9,L,H); /* solves the system [L]{h}={0} */
if (OPTIMIZE) { double lmH[9]; lmHomography(imagePoints,modelPoints,H,nPoints,lmH); mtxMatCopy(lmH,3,3,H); } free(L); return 0;}
Restrições na matriz de parâmetros intrínsicos
MtRAm~~ s MHm
~~ s tRAH
trrAhhh 21321
21
2
11
1
1
1
hAr
hAr
1
0
2211
21
rrrr
rr
0
0
2211
21
rrrr
rrTT
T
0
0
21
211
1
21
1
hAAhhAAh
hAAhTTTT
TT
Das homografias para parâmetros intrínsecos
0
0
21
211
1
21
1
hAAhhAAh
hAAhTTTT
TT
0
0
2211
21
hBhhBh
hBhTT
T
100
01
0
001
2
2
543
421
3101
x
x
T
f
f
bbb
bbb
bbb
AABonde:
876
543
210
hhh
hhh
hhh
He
0)()()( 576446733167024311340010 bhhbhhhhbhhhhbhhbhhhhbhh
0)()(3)(2)()(2)( 52
72
6474633716022
42
31413002
12
0 bhhbhhhhbhhhhbhhbhhhhbhh 0)()(3)(2)()(2)( 52
72
6474633716022
42
31413002
12
0 bhhbhhhhbhhhhbhhbhhhhbhh
076243
210 hh
f
hh
f
hh
xx
0)( 27
262
24
23
2
21
20
hh
f
hh
f
hh
xx
76
4310
hh
hhhhf x
27
26
24
23
21
20 )()(
hh
hhhhf x
Cálculo de R e t
Proceedings of SIBGRAPI'98, Rio de Janeiro, Brazil, 1998, pp. 388-399.
Equações de projeção
c
c
c
yy
xx
Z
Y
X
of
of
w
v
u
100
0
0
wv
wu
y
x
im
im
yc
c
yim
xc
c
xim
oZ
Yfy
oZ
Xfx
z
y
x
w
w
w
c
c
c
T
T
T
Z
Y
X
rrr
rrr
rrr
Z
Y
X
333231
332221
131211
1333231
232221
131211
w
w
w
z
y
x
c
c
c
Z
Y
X
Trrr
Trrr
Trrr
Z
Y
X
1100
0
0
333231
232221
131211
w
w
w
z
y
x
yy
xx
Z
Y
X
Trrr
Trrr
Trrr
of
of
w
v
u
Equações de projeção
1100
0
0
333231
232221
131211
w
w
w
z
y
x
yy
xx
Z
Y
X
Trrr
Trrr
Trrr
of
of
w
v
u
134333231
24232221
14131211
w
w
w
Z
Y
X
mmmm
mmmm
mmmm
w
v
u
1333231
332332223121
331332123111
w
w
w
z
zxyyxyxyxy
zxxxxxxxxx
Z
Y
X
Trrr
ToTfrorfrorfrorf
ToTfrorfrorfrorf
w
v
u
Calibração a partir da matriz
134333231
24232221
14131211
wi
wi
wi
i
i
i
Z
Y
X
mmmm
mmmm
mmmm
w
v
u
34333231
24232221
34333231
14131211
mZmYmXm
mZmYmXmy
mZmYmXm
mZmYmXmx
www
www
i
www
www
i
iii
iii
iii
iii
0
0
3433323124232221
3433323114131211
mZmYmXmymZmYmXm
mZmYmXmxmZmYmXmwww
iwww
wwwi
www
iiiiii
iiiiii
Para cada ponto:
Calibração a partir da matriz
0
0
3433323124232221
3433323114131211
mZmYmXmymZmYmXm
mZmYmXmxmZmYmXmwww
iwww
wwwi
www
iiiiii
iiiiii
03
0
3433323124232221
3433323114131211
myZmymYymXymmZmYmX
mxZmxmYxmXxmmZmYmX
iw
iw
iw
iwww
iw
iw
iw
iwww
iiiiii
iiiiii
Para cada ponto:
34
33
12
11
m
m
m
m
m
0Am 0m
Calibração a partir da matriz
34333231
24232221
14131211
mmmm
mmmm
mmmm
34333231
24232221
14131211
mmmm
mmmm
mmmm1q
2q
3q
4q
z
zxyyxyxyxy
zxxxxxxxxx
Trrr
ToTfrorfrorfrorf
ToTfrorfrorfrorf
333231
332332223121
331332123111
233
232
231
233
232
2313 rrrmmmq
01 zTquetalescolha 34mTz
333332323131 ,, mrmrmr
Calibração a partir da matriz
34333231
24232221
14131211
mmmm
mmmm
mmmm
34333231
24232221
14131211
mmmm
mmmm
mmmm1q
2q
3q
4q
z
zxyyxyxyxy
zxxxxxxxxx
Trrr
ToTfrorfrorfrorf
ToTfrorfrorfrorf
333231
332332223121
331332123111
cycy
cxcx
c
of
of
kjq
kiq
kq
2
1
3
yy
xx
of
of
22
11
32
31
y
x
o
o
Calibração a partir da matriz
34333231
24232221
14131211
mmmm
mmmm
mmmm
34333231
24232221
14131211
mmmm
mmmm
mmmm1q
2q
3q
4q
z
zxyyxyxyxy
zxxxxxxxxx
Trrr
ToTfrorfrorfrorf
ToTfrorfrorfrorf
333231
332332223121
331332123111
yyy
xxx
yiiyi
xiixi
fmmoT
fmmoT
ifmmor
ifmmor
/)(
/)(
3,2,1/)(
3,2,1/)(
2433
1433
232
131
TT UIVRUDVR
Calibração no Juiz Virtual
ts
vs
us
w
y
x
hhh
hhh
hhh
w
y
x
H
333231
232221
131211
0
0
0
333231
232221
131211
kkkkk
kkkkk
kkkkk
sthwhyhx
svhwhyhx
suhwhyhxk = 1..n-1
1333231
232221
131211
hwhyhx
vhwhyhx
uhwhyhx
nnn
nnnn
nnnn
1a Opção
Calibração no Juiz Virtual
1
0
0
0
0
0
0
0
0
0
000000000
000000000
000000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
1
2
1
33
32
31
23
22
21
13
12
11
1111
1111
1111
2222
2222
2222
1111
1111
1111
n
n
nnnn
nnn
nnn
nnnn
nnnn
nnnn
v
u
s
s
s
h
h
h
h
h
h
h
h
h
wyx
wyx
wyx
twyx
vwyx
uwyx
twyx
vwyx
uwyx
twyx
vwyx
uwyx
Calibração no Juiz Virtual
ts
vs
us
w
y
x
hhh
hhh
hhh
w
y
x
H
333231
232221
131211
2a Opção
kkk
kkkk whyhxh
whyhxhu
333231
131211
kkk
kkkk whyhxh
whyhxhv
333231
232212
Mimimiza-se , onde é o resultado obtido pelatransformação encontrada.
n
kkkkk vvuu
1
22 kk vu ,
Problema não linear
Onde é o centróide dos pontos próprios Pk.
Calibração no Juiz Virtual
kkk
kkkk whyhxh
whyhxhu
333231
131211
kkk
kkkk whyhxh
whyhxhv
333231
232212
0
0
333231232221
333231131211
kkkkkkk
kkkkkkk
whyhxhvwhyhxh
whyhxhuwhyhxhk=1..n
1333231 hyhxh
Para eliminar a solução trivial H = 0,
1,0,, yx
Calibração no Juiz Virtual
A solução desse problema se dá por resolver
Minimizar || Mt ||sujeito a mTt = 1,
onde
333231232221131211 hhhhhhhhhtT
1000000 yxm e M é a representação matricial da transformação,
dada por:
vnnnnnnn
nnnnnnnn
vyvxvwyx
vyvxvwyx
vyvxvwyx
uyuxuwyx
uyuxuwyx
uyuxuwyx
M
000
000
000
000
000
000
22222222
11111111
22222222
11111111
É usado o método de multiplicadores de Lagrange, conduzindo ao seguinte sistema linear:
1
0
tm
mMtMT
T
(2n x 9)