imAutoCrop

automatically crops 2D and 3D images
7 Downloads
Updated 17 Nov 2020

View License

%[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
Created with R2020b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0