multi-sensor stable fps

This commit is contained in:
bluepulsar
2026-02-16 12:12:42 +08:00
parent 233ae84103
commit 810060bb16
2 changed files with 368 additions and 8 deletions
+14 -8
View File
@@ -52,17 +52,17 @@ def create_plot():
# title_font = QFont("Segoe UI", 14, QFont.Bold)
# axis_font = QFont("Segoe UI", 10, QFont.Bold)
p1 = win.addPlot(title="Normal")
p1 = win.addPlot(title="N")
# p1.titleLabel.item.setFont(title_font)
p1.getAxis('left').setStyle(showValues=show_values)
p1.showGrid(x=True, y=True, alpha=0.3)
win.nextRow()
p2 = win.addPlot(title="Shear X")
p2 = win.addPlot(title="X")
# p2.titleLabel.item.setFont(title_font)
p2.getAxis('left').setStyle(showValues=show_values)
p2.showGrid(x=True, y=True, alpha=0.3)
win.nextRow()
p3 = win.addPlot(title="Shear Y")
p3 = win.addPlot(title="Y")
# p3.titleLabel.item.setFont(title_font)
p3.getAxis('left').setStyle(showValues=show_values)
p3.setLabel('bottom', 'Time', units='s')
@@ -75,12 +75,18 @@ def create_plot():
def update(plot_af, plot_tfx, plot_tfy, data, p1, p2, p3):
# global plot_af, plot_tfx, plot_tfy, data, p1, p2, p3
max1 = max(data[:,1,0])
max2 = max(data[:,1,1])
max3 = max(data[:,1,2])
# max1 = 110000
# max2 = 260000
# max3 = 400000
plot_af.setData(data[:,:,0])
p1.setYRange(min(data[:,1,0]),max(data[:,1,0]))
p1.setYRange(min(data[:,1,0]),max1)
plot_tfx.setData(data[:,:,1])
p2.setYRange(min(data[:,1,1]),max(data[:,1,1]))
p2.setYRange(min(data[:,1,1]),max2)
plot_tfy.setData(data[:,:,2])
p3.setYRange(min(data[:,1,2]),max(data[:,1,2]))
p3.setYRange(min(data[:,1,2]),max3)
# 深度图
def draw_magnitude_map(vfield, threshold=3.0, colormap=cv2.COLORMAP_JET) -> np.ndarray:
@@ -179,7 +185,7 @@ def main():
# 显示向量场
# Background color #24292E (BGR)
black_img = np.full_like(sensor1.img, bg_color)
arrows = orisys.util.draw_arrows(img, flow, threshold=1, grid_spacing=20, arrow_scale=0.5, colormap=cv2.COLORMAP_PARULA, below_threshold_color=text_color)
arrows = orisys.util.draw_arrows(black_img, flow, threshold=1, grid_spacing=20, arrow_scale=0.5, colormap=cv2.COLORMAP_PARULA, below_threshold_color=text_color)
cv2.imshow("Deformation", arrows)
# 显示深度图
@@ -210,7 +216,7 @@ def main():
data[-1, 1, 1] = abs(fx)
data[-1, 1, 2] = abs(fy)
# Moving average on force data (column 1): simple loop, no singularities at ends
ma_window = 4
ma_window = 5
data_plot = data.copy()
for i in range(3):
x = data_plot[:, 1, i]