Skip to content

Instantly share code, notes, and snippets.

@maxastyler
Created February 26, 2021 12:18
Show Gist options
  • Save maxastyler/332e4fa7283f4bbd9487cf4e2b9e1d69 to your computer and use it in GitHub Desktop.
Save maxastyler/332e4fa7283f4bbd9487cf4e2b9e1d69 to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
xb = (400, 600)
first_order_yb = (700, 970)
zero_order_yb = (320, 600)
grey_values = range(256)
first_order_sums = [np.load(f"./LUTOrders/LUTOrders_{i}.npy")[xb[0]:xb[1], first_order_yb[0]:first_order_yb[1]].sum() for i in grey_values]
zero_order_sums = [np.load(f"./LUTOrders/LUTOrders_{i}.npy")[xb[0]:xb[1], zero_order_yb[0]:zero_order_yb[1]].sum() for i in grey_values]
plt.plot(grey_values, zero_order_sums, label="Zero order")
plt.plot(grey_values, first_order_sums, label="First order")
plt.ylim(0, None)
plt.title("summed intensity vs grey value")
plt.legend()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment