hi, how can i add each pixel of a matrix in a loop in android
below is my c++ code :
for(int x=0;x<=4;x++)
{
for(int y=0;y<=4;y++)
{
sum1=sum1+ block.at<uchar>(x, y); // Addition of all elements
sum2=sum2+block.at<uchar>(x,y)*block.at<uchar>(x,y); //Addition of all element square
}
}
where block is a 5x5 mat