CROP_CVIP
crop_cvip() -Cropping a subimage from an input image.
Contents
SYNTAX
[ outImage ] = crop_cvip( inImage, sizeSI, startPoint)
Input Parameters include:
- inImage - 1-band input image of MxN size or 3-band input image of MxNx3 size. The input image can be of uint8 or uint16 or double class.
- sizeSI - Size of the subimage, i.e. width and height of subimage.Row or column vector of length 2. sizeSI(1): height sizeSI(2): width
- startPoint - Starting point of subimage, i.e. row and column coordinates of upper left corner. A vector of length 2. startPoint(1): row startPoint(2): column ([1 1] | default)
Output Parameter includes:
- outImage - Cropped subimage
DESCRIPTION
This function allows the user to specify a subimage to be cropped from an input image. The user specifies the row and column coordinates of the upper-left corner of the desired area,along with the subimage's width and height. The passed image is deleted.
REFERENCE
1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
EXAMPLE
% original images I = imread('cam.bmp'); % Calling Crop subimage with default parameter O1 = crop_cvip(I, [200 180]); % Size SI size = [120 150]; % start point start_point = [50 50]; % Calling function with user defined parameters O2 = crop_cvip(I,[120 150], [50 50]); % Display input image figure;imshow(I);title('Input Image') % Display output image figure;imshow(hist_stretch_cvip(O1,0,1,0,0));title('Output Image with default parameters'); figure;imshow(hist_stretch_cvip(O2,0,1,0,0));title('Output Image with user defined parameters');
CREDITS
Author: Norsang Lama, April 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website