You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Simple way of cropping images by specifying the amount of pixels to be cut away from the image edges.
Of course imcrop exists, but I'm not a fan of using the rectangle syntax.
So why this?
- Fast
- Practical syntax (for me at least)
- Can handle higher dimensions
- Couldn't find anything similar on FEX with expected tags
Crops along the first 2 dimensions, e.g.:
I = imread('peppers.png'); %rgb image
J = margincrop(I,[10 20],[100 100]);
subplot(1,2,1);imshow(I);
subplot(1,2,2);imshow(J);
Feedback is welcome.
Cite As
Jurgen (2026). Margincrop (https://www.mathworks.com/matlabcentral/fileexchange/39849-margincrop), MATLAB Central File Exchange. Retrieved .
Categories
Find more on Geometric Transformation and Image Registration in Help Center and MATLAB Answers
General Information
- Version 1.0.0.0 (1.58 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
