%[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://uk.mathworks.com/matlabcentral/fileexchange/82968-imautocrop), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0 |
