Main Content

Rotate an Image

Open the Simulink® model.

modelname = 'ex_blkrotate.slx';
open_system(modelname)

The model reads image by using the Image From File block. To rotate the input image, use the Rotate block with these parameter values:

  • Output size - Same as input image

  • Rotation angle source - Specify via dialog

  • Angle (radians) - pi/4

  • Sine value computation method - Table lookup

  • Background fill value - 255

  • Interpolation method - Bilinear

To display the input and the output images, use the Video Viewer block.

Run the model.

sim(modelname);