views:

82

answers:

1

Hi all,

So I have a 3D image that's getting transformed into a space via an affine transform. That transform is composed of the traditional 4x4 matrix plus a center coordinate about which the transform is performed. How can I invert that center point in order to go back into the original space? I have the coordinate, but its a 1x3 vector (or 3x1, depending on row/column order). I assume that to do get the appropriate center of the inverse, I need to make the vector into 1x4, but if that's the case, what should I put into the fourth position? Obvious candidates are 0 and 1, but I'm not sure if that's the Right Thing to do.

The idea is that if I transform an image into the space, and then invert the transform, the resulting image should be identical (within rounding errors/aliasing effects from resampling). However, at the moment, I'm just using the same center coordinate, and that's producing an image that's shifted by some amount rather than producing the exact same image. So, how can I transform that center point?

+1  A: 

I assume your transformation goes like this

x' = Mx + t

Solving for x should give

x = M_inv (x' - t) 

Working with 4x4 matrices in a 3D coordinate system usally mean working in homogeneous coordinates. You store a multiplicative value in the 4th coordinate that is usally called w. The value 1 works well for positions, the value 0 is meant for vectors. That's because the translation information stored in matrix M should affect only positions (this is a very basic explanation, sorry). So, yes, negating the translation vector should already do the trick. Add 0 as 4th component.

Thanks, checking that out now.
mmr