Geometric image transforms using matrix multiplication

692 Views Asked by At

I am relatively new to the field of image processing and I am a bit confused by image transforms. So I understand the basic idea behind rotation/scaling/translation/shearing is to multiply a 3x3 matrix to the homogeneous coordinates, which transforms the co-ordinate axes to the required setting. But we do this matrix multiplication for each co-ordinate individually? I mean can I not express the entire relevant image as one matrix and somehow have the product expressed as one single matrix multiplication operation?

1

There are 1 best solutions below

0
On

Sure you can. If you "unfold" your image and stack the pixels into a "horizontal" matrix $I\in\mathbb{R}^{3\times N}$, where $N$ is the number of pixels, then you can apply the transform $T\in\mathbb{R}^{3\times 3}$ with a single multiplication: $$ \widetilde{I} = TI. $$ After that, you have to "refold" the matrix $\widetilde{I}$ into an image.

A couple of "logistical" concerns. First, you are transforming coordinates, not pixel values. Second, you cannot really just "move" the pixel values to match the new transformed coordinates. This is because there will be "holes" in the output in places where the transform stretched out the coordinates. Instead what you can do is resample $\widetilde{I}$ into a new image after reshaping, using interpolation into the values of the original image $I$.