addweightedcv

Adds weighted inputs.

Syntax

R = addweightedcv(source1, w1, source2, w2, w3...)

R = addweightedcv(source1, w1, source2, w2, w3, depth)

Inputs

source1
Handle of an image. The number of rows and columns of source1 and source2 must match.
Type: integer
w1
Weight of the elements of source1.
Type: scalar
source2
Handle of an image. The number of rows and columns of source1 and source2 must match.
Type: integer
w2
Weight of the elements of source2.
Type: scalar
w3
Weight of the elements of the output R.
Type: scalar
depth
Optional parameter specifying the depth of R. Default value is -1, indicating that output R will have the same depth as input source1.
Type: integer

Outputs

R
Handle of the output image.
Type: integer

Example

Add two weighted images:

    src1 = imreadcv('addweightedcv_fig1.jpg');
    img2 = imreadcv('addweightedcv_fig2.jpg');
    size1 = imsizecv(src1);
    src2 = resizecv(img2, [size1(1) size1(2)]);

    w1 = 0.1;
    w2 = 1;
    w3 = 0;
    R = addweightedcv(src1, w1, src2, w2, w3);


Figure 1. Input image 1


Figure 2. Input image 2


Figure 3. Output image