Ask Your Question

Revision history [back]

The sum of squared entries is simply the dot-product of a vector with itself.

Scalar s = destination.dot(destination);

OpenCV documentation indicates that this operation, when applied to general matrices, treats them as 1D vectors; i.e., it does what you asked for.