10 int width = p1->getShape().at(0);
11 int height = p1->getShape().at(1);
12 int colors = p1->getShape().at(2);
14 auto first_image = p1->getDataAsVector();
15 auto second_image = p2->getDataAsVector();
19 for (
int w = 0; w < width; w++)
21 for (
int h = 0; h < height; h++)
23 for (
int c = 0;
c < colors;
c++)
25 int k = h * width * colors + w * colors +
c;
26 sum +=
std::abs(first_image.at(k) - second_image.at(k));
30 return sum / (width * height * colors);