Crop a sub-window from an image
Version 1.0.0.0 (1.38 KB) by
Rui Zhao
Solve the problem of build-in imcrop function when the rectangle location exceeds the boundary.
% solve the boundary problem when cropping RECT in IM
% RES = subwin(IM, RECT)
%
% INPUT
% IM: input image
% RECT: specific rectangle with coordinates (x, y, w, h)
%
% OUTPUT
% RES: cropped subwindow
%
% EXAMPLE
% im = imread('test.png');
% imshow(subwin(im, [-10, -10, 100, 100]));
%
Cite As
Rui Zhao (2024). Crop a sub-window from an image (https://www.mathworks.com/matlabcentral/fileexchange/39244-crop-a-sub-window-from-an-image), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2009b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on DICOM Format in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |