Removed pointless variables

This commit is contained in:
George Tsiamasiotis 2024-09-25 10:06:46 +03:00
parent eb53733b87
commit 9616d9a524
2 changed files with 5 additions and 7 deletions

View File

@ -55,9 +55,6 @@ class PtzMotionEstimator:
self.camera_config = config
self.coord_transformations = None
self.ptz_metrics = ptz_metrics
self.ptz_start_time = self.ptz_metrics.start_time
self.ptz_stop_time = self.ptz_metrics.stop_time
self.ptz_metrics.reset.set()
logger.debug(f"{config.name}: Motion estimator init")
@ -86,7 +83,9 @@ class PtzMotionEstimator:
self.coord_transformations = None
if ptz_moving_at_frame_time(
frame_time, self.ptz_start_time.value, self.ptz_stop_time.value
frame_time,
self.ptz_metrics.start_time.value,
self.ptz_metrics.stop_time.value,
):
logger.debug(
f"{camera}: Motion estimator running - frame time: {frame_time}"

View File

@ -85,7 +85,6 @@ class NorfairTracker(ObjectTracker):
self.camera_config = config
self.detect_config = config.detect
self.ptz_metrics = ptz_metrics
self.ptz_autotracker_enabled = ptz_metrics.autotracker_enabled
self.ptz_motion_estimator = {}
self.camera_name = config.name
self.track_id_map = {}
@ -104,7 +103,7 @@ class NorfairTracker(ObjectTracker):
# the different tracker per object class
filter_factory=OptimizedKalmanFilterFactory(R=3.4),
)
if self.ptz_autotracker_enabled.value:
if self.ptz_metrics.autotracker_enabled.value:
self.ptz_motion_estimator = PtzMotionEstimator(
self.camera_config, self.ptz_metrics
)
@ -315,7 +314,7 @@ class NorfairTracker(ObjectTracker):
coord_transformations = None
if self.ptz_autotracker_enabled.value:
if self.ptz_metrics.autotracker_enabled.value:
# we must have been enabled by mqtt, so set up the estimator
if not self.ptz_motion_estimator:
self.ptz_motion_estimator = PtzMotionEstimator(