Added bus_info for v4l2. Added optional forcing OpenCV or V4L2. Added non-linear transform. Added transparent overlay.

This commit is contained in:
Josh Miklos
2020-06-22 16:09:34 -07:00
parent 823bb3e173
commit b8453da881
24 changed files with 334 additions and 719 deletions

View File

@ -42,7 +42,7 @@ def test_pub_cam_int():
cam_pub.assert_has_calls([mock.call(img)] * 4)
reg_cam.assert_called_once_with("0")
reg_cam.assert_called_once_with("0", cap)
cam_cmd_sub.assert_called_once_with("0")
cap.set.assert_has_calls(

View File

@ -57,7 +57,7 @@ def test_loop():
ud.loop()
mock_pubcam_thread.assert_called_once_with(0, (-1, -1), True, float("inf"))
mock_pubcam_thread.assert_called_once_with(0, (-1, -1), True, float("inf"), "")
mock_frame_sub.assert_called_once_with("0")
handler_cmd_sub.assert_called_once_with("0")
sub_cam.get.assert_has_calls([mock.call(blocking=True, timeout=1.0)] * 3)

View File

@ -495,8 +495,12 @@ def test_display():
fup.assert_has_calls(
[
mock.call(0, fps_limit=float("inf"), request_size=(50, 50)),
mock.call(1, fps_limit=float("inf"), request_size=(50, 50)),
mock.call(
0, force_backend="", fps_limit=float("inf"), request_size=(50, 50)
),
mock.call(
1, force_backend="", fps_limit=float("inf"), request_size=(50, 50)
),
]
)
assert fup_inst.start.call_count == 2
@ -541,10 +545,18 @@ def test_display_callbacks():
fup.assert_has_calls(
[
mock.call(
0, callbacks=[cb], fps_limit=float("inf"), request_size=(-1, -1)
0,
callbacks=[cb],
force_backend="",
fps_limit=float("inf"),
request_size=(-1, -1),
),
mock.call(
1, callbacks=[cb], fps_limit=float("inf"), request_size=(-1, -1)
1,
callbacks=[cb],
force_backend="",
fps_limit=float("inf"),
request_size=(-1, -1),
),
]
)
@ -557,8 +569,20 @@ def test_display_callbacks():
fup.assert_has_calls(
[
mock.call(0, callbacks=[cb, cb2], fps_limit=60, request_size=(-1, -1)),
mock.call(1, callbacks=[cb, cb2], fps_limit=60, request_size=(-1, -1)),
mock.call(
0,
callbacks=[cb, cb2],
force_backend="",
fps_limit=60,
request_size=(-1, -1),
),
mock.call(
1,
callbacks=[cb, cb2],
force_backend="",
fps_limit=60,
request_size=(-1, -1),
),
]
)
@ -579,16 +603,25 @@ def test_display_callbacks_dict():
fup.assert_has_calls(
[
mock.call(
0, callbacks=[cb1], fps_limit=float("inf"), request_size=(-1, -1)
),
mock.call(
1,
callbacks=[cb1, cb2],
0,
callbacks=[cb1],
force_backend="",
fps_limit=float("inf"),
request_size=(-1, -1),
),
mock.call(
2, callbacks=[cb3], fps_limit=float("inf"), request_size=(-1, -1)
1,
callbacks=[cb1, cb2],
force_backend="",
fps_limit=float("inf"),
request_size=(-1, -1),
),
mock.call(
2,
callbacks=[cb3],
force_backend="",
fps_limit=float("inf"),
request_size=(-1, -1),
),
]
)