# Revision history [back]

As seen here you can call the function with a mask. Be sure that the mask only contains 0 and 1 values and is thus a binary image.

So your code should look like

cv::add(src1, src2, dst, mask);


cv::add(src1, src2, dst, mask);