Skip to content

Instantly share code, notes, and snippets.

@celoyd
Created January 12, 2015 15:42
Show Gist options
  • Select an option

  • Save celoyd/8d85df363c0c6b64ea03 to your computer and use it in GitHub Desktop.

Select an option

Save celoyd/8d85df363c0c6b64ea03 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# not properly tested
from sys import argv
from PIL import Image
import numpy as np
A, B = (
np.asarray(Image.open(x)).astype(np.float32)
for x in argv[1:]
)
error = np.absolute(A - B)
rmse = np.mean((error**2).flatten())**0.5
print rmse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment