CROP_CVIP

crop_cvip() -Cropping a subimage from an input image.

Contents

SYNTAX

[ outImage ] = crop_cvip( inImage, sizeSI, startPoint)

Input Parameters include:

Output Parameter includes:

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