MATLAB Image cropper for multiple images?

I have 19 images, and I would like to be able to crop them the same way, cropping the same area on each image. But I need to look at the first image and determine which part of the image I want to crop. Then I would like to apply this crop to all other images. My idea is that I could save the four corner points from the first crop, and then repeat all the other 18 images, using 4 points to set the crop correctly. Does this sound like a good approach? Or does anyone know of a Matlab program that does this already ?, I'm already looking.

+3
source share
1 answer

Use IMCROP from the Image Processing Toolbox.

For the first image, execute it interactively and save the selected coordinates of the rectangle as a variable ( rect):

[im_cropped rect] = imcrop(im);

Then for other images, these coordinates are applied:

im_cropped = imcrop(im, rect);
+2
source

All Articles