An image is defined as two-dimensional function,` f(x, y)`

, where* x* and *y* are spatial (plane) coordinates, and the amplitude of *f* at any pair of `coordinates(x, y)`

is called the Intensity or the *Gray level of the image* at that point. When x, y and the intensity values of *f* are all finite, discrete quantities, the image is digital image.

Digital image is composed of a finite number of elements, each of which has a particular location and value. These elements are called picture elements, image elements and pixels. Pixel is the smallest element of an image. Each pixel corresponds to any one value. For an 8-bit gray scale image, the value of the pixel is between 0-255.

## Image Rotation –

The rows are rotated from end to -1 keeping the step size 1. To rotate the image clockwise, the columns are rotated from end to -1 keeping the step size 1.

**Approach:**

- Read the image using imread function.
- Show the image using imshow function.
- Rotate the image.
- Display the image using imshow.

**Below is the implementation:**

`% Read the Image ` `a = imread(` `"cameraman.png"` `); ` ` ` `% Display the image ` `imshow(a); ` ` ` `% Rotate the image clockwise ` `i = a(` `end` `:-1 : 1, ` `end` `:-1 : 1); ` ` ` `% Display the rotated image ` `figure, imshow(i); ` |

*chevron_right*

*filter_none*

**Output:**

**Original Image – **

**Rotated Image – **

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

## Recommended Posts:

- Matlab | Edge Detection of an image without using in-built function
- MATLAB | Converting a Grayscale Image to Binary Image using Thresholding
- MATLAB | RGB image to grayscale image conversion
- LSB based Image steganography using MATLAB
- Create Mirror Image using MATLAB
- How to vertically flip an Image using MATLAB
- MATLAB - Image Edge Detection using Prewitt Operator from Scratch
- MATLAB - Image Edge Detection using Sobel Operator from Scratch
- MATLAB - Image Edge Detection using Robert Operator from Scratch
- Extract bit planes from an Image in Matlab
- Image Processing in MATLAB | Fundamental Operations
- MATLAB | RGB image representation
- MATLAB | Complement colors in a Binary image
- MATLAB | Complement colors in RGB Image
- MATLAB | Complement colors in a Grayscale Image
- MATLAB | Display histogram of a grayscale Image
- Display the red, green and blue color planes of a color image in MATLAB
- Image Complement in Matlab
- Image Resizing in Matlab
- Flip image across Secondary Diagonal in MATLAB

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.