cv.add - MATLAB File Help
cv.add

Calculates the per-element sum of two arrays or an array and a scalar

dst = cv.add(src1, src2)
dst = cv.add(src1, src2, 'OptionName',optionValue, ...)

Input

Output

Options

The function cv.add calculates:

where I is a multi-dimensional index of array elements. In case of multi-channel arrays, each channel is processed independently.

The first function in the list above can be replaced with matrix expressions:

dst = src1 + src2;

The input arrays and the output array can all have the same or different depths. For example, you can add a 16-bit unsigned array to a 8-bit signed array and store the sum as a 32-bit floating-point array. Depth of the output array is determined by the DType parameter. In the second and third cases above, as well as in the first case, when class(src1)==class(src2), DType can be set to the default -1. In this case, the output array will have the same depth as the input array, be it src1, src2 or both.

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.

See also