imsquare

function to resize an image to square size keeping the proportions of the original image.

You are now following this Submission

The images can either be cropped or grown before resizing them to the final square dimension. The ratio of the distribution of the crop or grow center defaults to 0.5 but can be adjusted as desired.

I use this function primarily to prepare images for classification purposes of CNNs.

Developed and tested on MATLAB 2018a.

Cite As

Thomas Spriestersbach (2026). imsquare (https://www.mathworks.com/matlabcentral/fileexchange/69315-imsquare), MATLAB Central File Exchange. Retrieved .

Tags

Add Tags

Add the first tag.

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0