Just like in v1.x, OpenCV 2.x provides some basic functions operating on matrices, like add , subtract , gemm etc. In addition, it introduces overloaded operators that give the user a convenient algebraic notation, which is nearly as fast as using the functions directly. For example, here is how the least squares problem can be solved using normal equations:
Mat x = (A.t()*A).inv()*(A.t()*b);
The complete list of overloaded operators can be found in Matrix Expressions .