Crop padding and resize images

バージョン 1.0.3 (2.38 KB) 作成者: YT
Easy to use function for cropping padding and resizing of RGB/grayscale images.
ダウンロード: 68
更新 2018/10/16

ライセンスの表示

I've made this cropping/resizing function because the other functions available here on File Exchange did not work for me 100% of the time. This function is easy to use and crops the image based on the RGB/Grayscale value of the padding.

>> Required input arguments <<
- FILENAME
The name of your image ('C:\Users\John\test-image.jpg' ; 'test-image.jpg'). This file wil be overwritten with the cropped image.
- POS
The position of the padding on the image, specified by 'T' (TOP), 'B' (BOTTOM), 'L' (LEFT) or 'R' (RIGHT). If the padding is on multiple sides of the images, just pick one of the characters T, B, L or R. This argument is necessary to automatically determine the padding colour.

>> Optional input argument <<
- RESOLUTION
Resize the image to the specified width. For example, using the value 1080 will resize the image (after cropping) to X-by-1080 pixels.

>> Output argument <<
- IM
The output image after cropping/resizing.

>> Examples <<

% Crop image
IM = CropAndResize('test-image.jpg','T');
imshow(IM);

% Crop and resize image to X-by-1080 pixels
IM = CropAndResize('test-image.jpg','T',1080);
imshow(IM);

引用

Yves Terzibasiyan (2018). Cropping and resizing images with the CropAndResize function (https://mathworks.com/matlabcentral/fileexchange/69107-crop-padding-and-resize-images), MATLAB Central File Exchange. Retrieved October 14, 2018.

MATLAB リリースの互換性
作成: R2018a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersRead, Write, and Modify Image についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.0.3

changed citation

1.0.2

Title changes

1.0.1

Created with: R2018a

1.0.0