Re: Problem solving A*X = B



On Mon, 23 Oct 2006 05:37:52 -0700, Jeser Zalba wrote:


Hi all,

let me introduce myself and my problem, as it's the first time I'm
posting here...

I'm working in machine vision applications dedicated to the inspection
of different 3D objects. The problem is that I reach a system of
equations of the form:

A*X = B

where X is 12-element vector corresponding to the elements of a 3x4
projective transformation matrix, composed by R, a 3x3 rotation matrix,
and T, a 3x1 translation matrix.

The system should have one solution, but when I solve it using SVD, the
solution I obtain is not coherent, since the submatrix corresponding to
the obtained rotation matrix is not orthogonal.

Should I use this solution to begin some iterative algorithm to find a
real solution??

Any other idea of how should I impose some condition to solve the
system and get an appropiate solution??

Thanks in advance! Best regards,

Jeser
Are your equations derived from N pairs of points P[i], Q[i] in that
you want to find R, t so that Q[i] = R*P[i] + t?

If so then one way would be to seek R and t to minimise
E = Sum{ (Q[i]-R*P[i]-t)'*(Q[i]-R*P[i]-t)} (' is transpose).
subject to R being a rotation.

This can be done as follows:
a/ compute the mean mQ of the Q's and mP of the P's
and compute for all i p[i] = P[i]-mP, q[i] = Q[i]-mQ
b/ compute the matrix C = Sum{ p[i]*q[i]'}
c/ compute the svd of C, C = U*D*V'
d/ compute R = V*U' and t = mQ - R*mP

Below are some scribblings in justification:
given R it's not hard so see that the minimising t is
mQ - R*mP, where mQ = Sum{ Q[i]}/N and mP = Sum{ P[i]}/N
and then
E = Sum{ (q[i]-R*p[i])'*(q[i]-R*p[i])}
where p[i] = P[i]-mP, q[i] = Q[i]-mQ
write E = Sum{ Tr(q[i]-R*p[i])'*(q[i]-R*p[i])} (Tr is trace)
and using the properties of Tr, and the requirement R'*R = I
its straightforward to show
E = Sum{ q[i]'*q[i] + p[i]'*p[i]} - 2*Tr( R*C)
where C = Sum{ p[i]*q[i]'}
So we want to find R to maximise Tr( R*C)
If C = U*D*V' (svd) then Tr(R*C) = Tr( V'*R*U*D)
= Tr( S*D) where S = V'*R*U. The maximising (orthogonal) S is
unique if D is non singular, and is I, so the
maximising R is V*S*U' = V*U'
This R is orthogonal, but it might not be a rotation...
But if the Q's do come from the P's as above, that won't happen.

Duncan

.



Relevant Pages

  • Re: Problem solving A*X = B
    ... I'm working in machine vision applications dedicated to the inspection ... The system should have one solution, but when I solve it using SVD, the ... the obtained rotation matrix is not orthogonal. ...
    (sci.math.num-analysis)
  • Problem solving A*X = B
    ... posting here... ... I'm working in machine vision applications dedicated to the inspection ... the obtained rotation matrix is not orthogonal. ...
    (sci.math.num-analysis)
  • Re: Problem solving A*X = B
    ... I'm working in machine vision applications dedicated to the inspection ... The system should have one solution, but when I solve it using SVD, the ... the obtained rotation matrix is not orthogonal. ... the problem as a nonlinear equation. ...
    (sci.math.num-analysis)