addcv

Adds inputs source1 and source2.

Syntax

R = addcv(source1, source2...)

R = addcv(source1, source2, mask, depth)

Inputs

source1
Handle of an image, scalar or a 2D real matrix. If source1 and source2 are image handles, their size and number of channels must match.
Type: scalar | matrix
source2
Handle of an image, scalar or a 2D real matrix. If source1 and source2 are image handles, their size and number of channels must match.
Type: scalar | matrix
mask
Optional handle of an 8-bit single channel image or a 2D matrix of natural numbers representing the elements in R that need to be changed.
Type: integer | mat
depth
Optional parameter specifying the depth of R. If negative, the same depth as source1 and source2 will be used.
Type: integer

Outputs

R
Handle of the output image.
Type: integer

Example

Add two images:

handle1 = imreadcv('bird3.jpg');
handle2 = imreadcv('logo.jpg');

size1 = imsizecv(handle1);
handle2 = resizecv(handle2, [size1(1) size1(2)]);
R = addcv(handle1, handle2);
Figure 1. Input image 1


Figure 2. Input image 2


Figure 3. Output image