SUBTRACT_CVIP

subtract_cvip() - Subtract one image from another,or subtract a constant to image.

Contents

SYNTAX

Z = subtract_cvip(X,Y)

Input parameters include:

Output parameter includes:

DESCRIPTION

This function performs the subtraction operation on two images or on one image and a constant. The function subtracts every element in the input Y from every corresponding element in the input X and stores it in Z. If the second input is a constant, the function subtracts every pixel in X by that constant.

Z is an array of type double.

If X and Y are numeric arrays of the different size, smaller size arrays are zero padded and subtracted to larger size arrays.

To view the 8-bit image of type double, divide by 255. To view the 16-bit image of type double, divide by 65535.

REFERENCE

1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.

EXAMPLE

% Read Image

  ipImage1=imread('cam.bmp');
  ipImage2 =imread('CheckCircle.bmp');

% Call function

  outputImage=subtract_cvip( ipImage1, ipImage2);

% Display Input Image

  figure;imshow(ipImage1);title('Input Image 1');
  figure;imshow(ipImage2);title('Input Image 2');

% Display Output Image

  figure;imshow(outputImage,[]);title('Output Image');

CREDITS

Author: Deependra Mishra, March 2017
Copyright © 2017-2018 Scott E Umbaugh
For updates visit CVIP Toolbox Website