I’m interested in scaling (multiplying by a scalar) an affine transformation for reasons. My reading thus-far indicates that the mathematical constructions underlying the homogeneous matrix representation for an affine in ITK don’t allow for direct simplistic multiplication.
So I’m wondering
Is there some sort of mathematical process to scale an affine transform?
If this isn’t possible, my next idea would be to decompose the transform and to scale the components separately and reconstruct a new affine afterwards, however, it does not appear that ITK has a generalized function for decomposing affines, is that correct?
Hi Gabriel, in itkAffineTransformation.h, there is a Scale function that might help you. There is a non isotropic scaling version just below.
Is there some sort of mathematical process to scale an affine transform?
Scaling is itself an affine transformation, the matrix has the scaling factor(s) on its diagonal, and the translation is a zero vector. So you can even concatenate your original transform and the scaling transform independently.
Have a look here to see affine transformation in homogenous coordinates.
Hi Gabriel, in itkAffineTransformation.h, there is a Scale function that might help you. There is a non isotropic scaling version just below.
I thought I was explicit enough, but I guess not. I’ll try again.
I’m not talking about image scaling. I’m talking about composing the entire transformation with a scalar fraction, i.e. If I multiply but a 0.5 scaling factor, a 3x scale becomes 1.5x, a 30 deg rotation about X becomes at 15 degree rotation etc. (this example may be wrong in details depending on how exactly such a process works, I’m okay with that)
I think the operation you refer to (scaling is a bad choice to describe it) is not possible by any simple mean. What do you want to scale? The angle in a rotation (over which center point?), a translation (in which direction?), a shear (from where?), or any of the multiple other types of transformation possible that the matrix represents. All these operation can’t be “scaled” all together because they don’t share much in common.
I guess decomposing your already known affine transformation (from rotation, translation, shear, whatever) and apply whatever factor you want to all these operations independently in the way you like is the way to go. But I would recommend you give that operation another name, it’s not scaling.
It seems that you want to interpolate between identity transform and some given transform (0% = identity transform, 100% = the target transform, 50% = “halfway between”). This kind of continuous transform interpolation is a well-studied topic.
A commonly used general-purpose method is interpolating the rotation component using SLERP and the translation component using weighted average.
If you are interested in the theory of rotation interpolation, a very short description is here, section 4 in the handout, and the original SLERP paper.