cv.addWeighted - MATLAB File Help |
Calculates the weighted sum of two arrays
dst = cv.addWeighted(src1, alpha, src2, beta, gamma)
dst = cv.addWeighted(..., 'OptionName',optionValue, ...)
src1
.uint8
, int16
, double
,
etc. Must be specified if input arrays are of different types. When both
input arrays have the same depth, DType
can be set to -1, which will be
equivalent to class(src1)
. default -1The function cv.addWeighted calculates the weighted sum of two arrays as follows:
dst(I) = saturate(src1(I)*alpha + src2(I)*beta + gamma)
where I
is a multi-dimensional index of array elements. In case of
multi-channel arrays, each channel is processed independently.
Note: Saturation is not applied when the output array has the depth int32
.
You may even get result of an incorrect sign in the case of overflow.