[Math] Applying a transformation matrix to a matrix of larger dimension, like a grey scale image

image processingrigid transformation

I have a new job in image processing and just earned my BS in Physics. I know enough to make a lot of mistakes…

I have been reviewing my linear algebra a lot lately, especially the affine transformation matrix.

Suppose I have a rotation matrix R = [ cos(a) sin(a) 0 ;
-sin(a) cos(a) 0 ;
0 0 1 ]

I know that I can rotate another 3×3 matrix but how is an image with, 100×100 elements, get this rotation applied ?

I have seen one person's idea, which is to use interpolation from reference points….that isn't very elegant.

I have looked into the code I use everyday, and see what I think is the application of the convolution theorem on K space…pretty complicated.

I am looking forward to your replies !
TIA,
wbg

Best Answer

Well you don't apply ther 3x3 matrix TO a 100x100 matrix representing the picture. Rather, treat it as 100x100 points, each of which has coordinates (x,y,0). Now you can apply your matrix easily to that.

Better still, methinks, look at the inverse of your rotation matrix and at the pixels of the resultant image, (x', y', 0). Applying your inverted rotation matrix to these coordinates tells yo where this pixel comes from on the original image. Then you can take the nearest neighbour of it, or interpolate, or do anything you like :)