fix(studio): 统一 Box/Mini 箭头网格与强度着色

This commit is contained in:
ykcheungab
2026-10-10 16:07:26 +08:00
parent 48de5b74e6
commit f94b51e2de
4 changed files with 47 additions and 12 deletions
+19
View File
@@ -1080,3 +1080,22 @@ def test_a_box_result_on_the_sdk_grid_matches_the_live_painter():
)
assert np.array_equal(np.asarray(drawn), np.asarray(live))
assert _painted(drawn) > 0
@pytest.mark.parametrize("draw_style", ["box", "mini"])
def test_box_family_keeps_sparse_idle_dots_and_distinct_motion_colours(draw_style):
from orisys_app_shared.acquisition.arrows import FLOW_IDLE_HEX, hex_to_bgr, sdk_box_policy
policy = sdk_box_policy()
base = np.zeros((100, 120, 3), np.uint8)
flow = np.zeros((100, 120, 2), np.float32)
flow[50, 50, 0] = 1.25 # 2.5 px displacement, just over the box floor.
flow[50, 90, 0] = 3.0 # 6 px displacement on the same frame.
drawn = draw_arrow_display(
base, flow, draw_style=draw_style, policy=policy,
colormap=flow_colormap("dark"),
)
tint = np.array(hex_to_bgr(FLOW_IDLE_HEX), np.uint8)
assert _marker_is_there(drawn, 30, 30, tint)
assert not _marker_is_there(drawn, 50, 50, tint)
assert not np.array_equal(drawn[50, 50], drawn[50, 90])