Arithmetic operators are overloaded. This means that we can operate on
Mat images like we can in this example:
imgblend = 0.2*img1 + 0.8*img2;
In OpenCV, the result value of an operation is subject to the so-called saturation arithmetic. This means that the final value is actually the nearest integer in the 0..255 range.
bitwise_not() can be very useful when working with masks. Masks are binary images that indicate the pixels in which an operation is to be performed (instead of the whole image). The following bitwise_and example shows you how to use the AND operation to crop part of an image:
#include <opencv2/opencv.hpp> using namespace cv; using namespace std; ...