imAutoCrop

automatically crops 2D and 3D images

You are now following this Submission

%[I_out, Dim1Range, Dim2Range, Dim3Range] = IMAUTOCROP(I_in,m) autocrops a binary image I_in with margins m
% Works for 2D and 3D images
%Inputs
% I_in binary input image, 2D or 3D
% m (optional) scalar margin around foreground, default: m=0
%Outputs
% I_out croped output image
% Dim1Range Range of I_in in 1st dimension that is cut to produce I_out
% Dim2Range Range of I_in in 2nd dimension that is cut to produce I_out
% Dim3Range Range of I_in in 3rd dimension that is cut to produce I_out

Cite As

Simon Schiele (2026). imAutoCrop (https://au.mathworks.com/matlabcentral/fileexchange/82968-imautocrop), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

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