实现 finger 单测点手动试验采集
将精确 UV 选点、实时预览与逐档人工确认接入同一页面,并保存每次试验的视频、事件和帧采集时间。通过离线视频、页面及记录回归测试。
This commit is contained in:
@@ -46,7 +46,7 @@ from orisys_app_shared.record.video_writer import VideoSegments
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
RECORD_FORMAT_VERSION = "1.2"
|
||||
RECORD_FORMAT_VERSION = "1.3"
|
||||
|
||||
# Lifecycle states. ``failed`` and ``stopped`` are terminal; a recorder that has
|
||||
# not reached a terminal state must not be reused.
|
||||
@@ -86,6 +86,12 @@ FRAMES_HEADER = (
|
||||
"segment_frame",
|
||||
"in_video",
|
||||
"dropped",
|
||||
"t_host_mono_ns",
|
||||
"t_host_utc_ns",
|
||||
"source_frame_id",
|
||||
"time_basis",
|
||||
"media_time_ms",
|
||||
"capture_dropped",
|
||||
)
|
||||
#: ``frame_id`` was added so an operator action can be tied to a frame position.
|
||||
EVENTS_HEADER = ("at", "t_rel_s", "frame_id", "kind", "detail")
|
||||
@@ -1141,6 +1147,12 @@ class _SessionWriter:
|
||||
segment_frame,
|
||||
1 if segment else 0,
|
||||
0,
|
||||
sample.capture_mono_ns or "",
|
||||
sample.capture_utc_ns or "",
|
||||
sample.source_frame_id if sample.source_frame_id is not None else "",
|
||||
sample.time_basis,
|
||||
format_value(sample.media_time_ms),
|
||||
sample.capture_dropped,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1158,7 +1170,7 @@ class _SessionWriter:
|
||||
wall_t or time.time(), timezone.utc
|
||||
).isoformat(timespec="milliseconds")
|
||||
self._frames[1].writerow(
|
||||
(frame_id, repr(t_rel), acquired, 0, 0, 0, 1)
|
||||
(frame_id, repr(t_rel), acquired, 0, 0, 0, 1, "", "", "", "", "", "")
|
||||
)
|
||||
self.gap_rows += 1
|
||||
|
||||
|
||||
@@ -74,6 +74,12 @@ class RecordSample:
|
||||
fn_n_processed: float = float("nan")
|
||||
fx_n_processed: float = float("nan")
|
||||
fy_n_processed: float = float("nan")
|
||||
capture_mono_ns: int | None = None
|
||||
capture_utc_ns: int | None = None
|
||||
source_frame_id: int | None = None
|
||||
time_basis: str = ""
|
||||
media_time_ms: float | None = None
|
||||
capture_dropped: int = 0
|
||||
|
||||
# ------------------------------------------------------------- accessors
|
||||
def raw_triplet(self) -> tuple[float, float, float]:
|
||||
@@ -170,6 +176,14 @@ def to_record_sample(packet, *, calibration_version: str = "") -> RecordSample:
|
||||
else str(packet_version)
|
||||
)
|
||||
axes = calibrated_axes_of(packet)
|
||||
capture = {
|
||||
"capture_mono_ns": getattr(packet, "capture_mono_ns", None),
|
||||
"capture_utc_ns": getattr(packet, "capture_utc_ns", None),
|
||||
"source_frame_id": getattr(packet, "source_frame_id", None),
|
||||
"time_basis": str(getattr(packet, "time_basis", "") or ""),
|
||||
"media_time_ms": getattr(packet, "media_time_ms", None),
|
||||
"capture_dropped": int(getattr(packet, "capture_dropped", 0) or 0),
|
||||
}
|
||||
|
||||
if not valid or stale:
|
||||
if stale and not reason:
|
||||
@@ -183,6 +197,7 @@ def to_record_sample(packet, *, calibration_version: str = "") -> RecordSample:
|
||||
invalid_reason=reason,
|
||||
calibrated_axes=axes,
|
||||
calibration_version=version,
|
||||
**capture,
|
||||
)
|
||||
|
||||
raw_available = bool(getattr(packet, "raw_available", True))
|
||||
@@ -225,6 +240,7 @@ def to_record_sample(packet, *, calibration_version: str = "") -> RecordSample:
|
||||
fy_n_processed=newton[2],
|
||||
calibrated_axes=axes,
|
||||
calibration_version=version,
|
||||
**capture,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user