Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 3x3 matrix but how is an image with, 100x100 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

share|cite|improve this question
up vote 1 down vote accepted

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 :)

share|cite|improve this answer
what you're saying is, to use only the cos(a) sin(a) 0, first row of the rotation matrix.I'll try it... – wbg Mar 18 '12 at 19:34
oops...3:3 x 3:1 = 3:1, so each x,y indice, becomes [ x 0 0; 0 y 0; 0 0 1] – wbg Mar 18 '12 at 20:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.