Ask Your Question

Revision history [back]

You could write it as

sum1 = cv::sum(block).val[0]
sum2 = cv::sum(block.mul(block)).val[0]