Advertisement
Guest User

Untitled

a guest
Jul 17th, 2021
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. import matplotlib.image as img
  3. import numpy as np
  4.  
  5. native = img.imread('native.jpg')
  6. dlss = img.imread('dlss.jpg')
  7. fsr = img.imread('fsr.jpg')
  8.  
  9. x_start, x_end, y_start, y_end = 0,1000,800,1960
  10. mse_of_section = lambda z: np.mean((z[y_start:y_end, x_start:x_end] - native[y_start:y_end, x_start:x_end])**2)
  11.  
  12. print('Native - DLSS MSE: ' + str(mse_of_section(dlss)))
  13. print('Native - FSR MSE: ' + str(mse_of_section(fsr)))
  14.  
  15. for img,img_name in zip([native, dlss, fsr], ['native', 'dlss', 'fsr']):
  16.     plt.figure()
  17.     plt.imshow(img[y_start:y_end, x_start:x_end])
  18.     plt.savefig(f'cropped_{img_name}.png')
  19.     plt.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement