fix timestamp

This commit is contained in:
Jason Hunter 2021-06-24 17:02:46 -04:00 committed by Blake Blackshear
parent ab93cae4c0
commit 3fb24b4bf5
2 changed files with 4 additions and 3 deletions

View File

@ -472,8 +472,8 @@ class CameraConfig(BaseModel):
)
motion: Optional[MotionConfig] = Field(title="Motion detection configuration.")
detect: Optional[DetectConfig] = Field(title="Object detection configuration.")
timestamp_style: Optional[TimestampStyleConfig] = Field(
title="Timestamp style configuration."
timestamp_style: TimestampStyleConfig = Field(
default_factory=TimestampStyleConfig, title="Timestamp style configuration."
)
def __init__(self, **config):

View File

@ -404,6 +404,7 @@ class CameraState:
)
if draw_options.get("timestamp"):
color = self.camera_config.timestamp_style.color
draw_timestamp(
frame_copy,
frame_time,
@ -411,7 +412,7 @@ class CameraState:
font_effect=self.camera_config.timestamp_style.effect,
font_scale=self.camera_config.timestamp_style.scale,
font_thickness=self.camera_config.timestamp_style.thickness,
font_color=self.camera_config.timestamp_style.color,
font_color=(color.red, color.green, color.blue),
position=self.camera_config.timestamp_style.position,
)