Straight to the point : Can anyone tell me 1) How I can convert the transformation matrix about the top left corner to the transformation about the center pixel? I assume this is some simple linear algebra ? or better yet. 2) How to use imregister() about the center pixel of the moving and fixed image?
This is why I am interested: I want to be able to apply a transformation onto a picture about its center , then use imregister to match it with the original picture and find out what imregister thinks the transformation that I applied was.
What I have done:
*I relied on this paper ( pages 6 and 7 has some relevant equations ).
1) I decided on transformation parameters ( translation in xy, rotation ccw, shear, and scale in xy). Then I made a transformation matrix from it based on the work of the reference above. 1)I took the original picture , translated it to the picture to the center pixel , applied the transformation , then applied an inverse of the translation matrix onto it. (ie inv(trans)*Transformaton*trans = newTransform.
2)I ran imregister with moving = transformed picture , fixed = original picture , standard optimization and metric parameters.
3)I extracted the tform.T martix that imregtransform() finds ( inside of imregister ).
4) I used the following reference above calculations to break down the transformation matrix into the parameters of the imregister transformation ( rotation, shear...etc)
5) I compared the inverse of the transformation I originally applied and the transformation that imregister found ... and they are not at all similar.
I made a similar program that did all the transformations about the top left corner and then imregister had no problem finding the right numbers...
I also tried to shift the moving and fixed pictures so that the center pixel is at the origin and run imregister. This also did not work.
Thanks in advance :)