O'Reilly logo

Visual Media Processing Using MATLAB Beginner's Guide by George Siogkas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – cropping and resizing an image, then saving it as BMP

To get a better grasp of the three functions we presented in the previous three sections, we can use the example of a very common image processing drill, which is to select and crop a part of an image we would like to keep and then resize it to our desired dimensions and save it as a new image. We'll use our previous image as a start, so our first move is to load it. The whole process is described in the following steps:

  1. Load the image using imread and save it in the variable img:
    >> img = imread('my_image.bmp');
  2. Crop the image using imcrop and save the result in the variable cropped:
    >> cropped = imcrop(img);
  3. Now, resize the resulting image to double its size using imresize and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required