Applying geometric transformations
By now you have already mastered how to open an image and display it as it is using the Command Window. Now, it is time to learn how to apply basic geometric transformations to an image and display them along with the original. Geometric transformations are probably the most common functionalities of every image editor, no matter how basic it is. They do not generally alter the content of an image, but actually change the grid of pixels so that processes, such as image rotation or mirroring are achieved. Cropping and resizing of images are also two basic geometric transformations. In this section, we will see how all these transformations can be achieved in MATLAB.
Performing image rotation
For image rotation, you can use the function imrotate
. Again, you will be working in the Command Window, where you will have to type the functions to perform the transformations. Only this time, we will use a few more lines of code, to display the results in a single window.