Orginal
and Mutated
are images.
I need to get the difference of each r,g,b separately. I got this code to work, but it is to slow. Any help on making this fast would be nice! :)
Orginal = np.asarray(Orginal).copy()
Mutated = np.asarray(Mutated).copy()
Fittnes = 0
for x in range(0, 299):
for y in range(0, 299):
DeltaRed = (Orginal[x][y][0] - Mutated[x][y][0])
DeltaGreen = (Orginal[x][y][1] - Mutated[x][y][1])
DeltaBlue = (Orginal[x][y][2] - Mutated[x][y][2])
Fittnes += (DeltaRed * DeltaRed + DeltaGreen * DeltaGreen + DeltaBlue * DeltaBlue)
return Fittnes