help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x = A \ B... but I know some of x!


From: Kyle Altendorf
Subject: Re: x = A \ B... but I know some of x!
Date: Mon, 10 Nov 2008 11:10:09 -0800

On Sun, Nov 9, 2008 at 1:47 AM, Marc Normandin <address@hidden> wrote:
> Kyle Altendorf wrote:
>> My math/Octave question:
>> How do I solve (or best fit) Ax=B when I know the form or some values of x?
>>
>> A bit more background:
>> I have a set of points on a rigid plate whose positions have been
>> identified with a camera.  The plate was then rotated about some point
>> (not the origin) and I am trying to identify that point.  I am already
>> calculating it using 'x = A \ B' (via QR decomposition produces the
>> same results) where A and B are m by 3 sets of coordinates (with the
>> third column filled with 1's) and then extracting the estimated angle
>> of rotation and center of rotation from x.  The problem is that when I
>> repeat the measurements, I can't get the repeatability I need in
>> identifying the center of rotation.  I hope that constraining some
>> parts of x might improve the repeatability.  I do prescribe the
>> rotation, so theta is more or less known.
>>
>> I suppose I should also clarify that I can identify the points about
>> 20 times more consistently than the center of rotation is being
>> calculated and I am using a set of 32 points.  That's why I am under
>> the impression I should be able to improve the repeatability.
>>
>> Even if you simply give me a term for what I'm trying to do so that I
>> can go research it myself, that would be appreciated.
>>
>> Thanks,
>> -kyle
>
> Hi Kyle,
>
> Sounds like you're trying to solve for the affine transformation matrix.
>  The notation typically used would be x'=Ax, where A is said matrix and
> x and x' are column vectors indicating the coordinates of a point in the
> native and transformed spaces, respectively.  If I understand the way
> you've constructed the problem, the coordinates in A and B are given in
> a row vector sense, so you'd actually be estimating the transpose of the
> affine transformation matrix.
>
> If you know some parts of x you can probably just multiply those through
> by A and subtract the result from B, then solve the modified problem for
> the remaining components of x.  If parts of x are known "more or less"
> and not with certainty, then you have yourself a more complex
> optimization problem that will require iterative fitting.
>
> Sorry if my answer's vague or rough around the edges.  If you have any
> follow-up questions or just need me to clarify I'll be glad to help, but
> please note that I'm defending my thesis on Thursday so I'll be out of
> commission for most of the week.
>
> Regards,
> Marc
>
> --
> ------------------------------------------------------------------
> Marc D. Normandin              http://web.ics.purdue.edu/~mdnorman
> Graduate Research Assistant                     address@hidden
> Indiana University School of Medicine           317-278-9841 (tel)
> Department of Radiology, Division of Research   317-274-1067 (fax)
> ------------------------------------------------------------------
>

Hi Marc,

Affine transformation matrix does sound like the correct term for what
I am trying to calculate.  It seems that my 'format' for the measured
coordinates is called homogeneous coordinates and is used to allow for
single matrix representations of affine transformations rather than
only linear transformations.  I am using coordinates such as:

[ x1 y1 1; x2 y2 1; ... ; xn yn 1;]

I have tried the following and it doesn't work, but I would like to
confirm that I read your suggestion correctly.  If I create a
transformation matrix that contains the known transformation (rotation
of theta) and call it R:

c = cos(theta);
s = sin(theta);
R = [c s 0; -s c 0; 0 0 1];

Then, rather than calculating:

A = x \ x'

I should try:

A = x \ (x' - x*R)

To identify the remaining unknown values of interest A(3,1:2)?  Since
it doesn't work, I am guessing that there is at least some truth to
what David said.  On that topic, which matrix am I supposed to be
checking for strong hall components?

Although I have reasonable confidence that I know the angle of
rotation in this case, I would certainly like to learn about
optimization which includes consideration for certainty of various
parameters.  It feels like I could derive equations for this
particular case and write code to optimize A, but I assume there is a
formal (and possibly very general) solution to this problem.  Would I
read about this in a linear algebra book?  Or does it generally fall
under a different heading?  I didn't learn much about this in school,
but I hope this ends up being a significant part of my career so I am
happy to invest time into learning rather than just finding the
solution for this particular problem.

Thanks and best of luck with your thesis,
-kyle


reply via email to

[Prev in Thread] Current Thread [Next in Thread]