9 int width = p1->getShape().at(0);
10 int height = p1->getShape().at(1);
11 int colors = p1->getShape().at(2);
13 auto first_image = p1->getDataAsVector();
14 auto second_image = p2->getDataAsVector();
18 for (
int w = 0; w < width; w++){
19 for (
int h = 0; h < height; h++){
20 for (
int c = 0;
c < colors;
c++){
21 int k = h * width * colors + w * colors +
c;
22 sum +=
std::abs(first_image.at(k) - second_image.at(k));
26 return sum / (width * height * colors);