import cv2 import numpy as np import matplotlib.pyplot as plt file = open('dump_y16_640x513_2025-08-23-21_47_05.data','rb') dy500 = np.zeros(1500) dy300 = np.zeros(1500) for i in range(1500): frame = file.read(640*513*2+640*513+640*4) y8 = np.frombuffer(frame[640*513*2:640*513*2+640*513],dtype=np.uint8).reshape([513,640]) y16 = np.frombuffer(frame[0:640*513*2],dtype=np.uint16).reshape([513,640]) dy500[i] = abs(y16[500,:].astype(np.int16) - (y16[501,:]).astype(np.int16)).mean() dy300[i] = abs(y16[300,:].astype(np.int16) - (y16[301,:]).astype(np.int16)).mean() cv2.imshow("",y8) cv2.waitKey(1) plt.plot(dy500) plt.plot(dy300) plt.show()