Cropping an Image with draggable rectangle
% Crops the Image from a draggable rectangle
% & returns the Cropped Image and its co-ordinates
%
% I is the Image to be cropped assumed to be in the
% matlab workspace
%
% w : width (default value : cols/2)
% h : height (default value : rows/2)
%
% EXAMPLES
%
% I = imread('circuit.tif');
% [O] = Crop_it(I);
%
% [O I_crop]=Crop_it(I,0);
%
% [O I_crop]=Crop_it(I,1,100,100);
Cite As
Shripad Kondra (2026). Cropping an Image with draggable rectangle (https://se.mathworks.com/matlabcentral/fileexchange/17460-cropping-an-image-with-draggable-rectangle), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Image Processing Toolbox > Display and Exploration > Build Interactive Tools >
Tags
Acknowledgements
Inspired: Cropping an Image with resizable and draggable rectangle
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 | To enable initializing the rectangle by hand. |
