Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you can use per-element multiplication for the square, like this:

Mat destSquared = destination.mul(destination);

then get the sum

Scalar s = Core.sumElems (destSquared);
double sum = s[0]; // 1st channel