From 20d6b31c31388e05b506dac066f8c47836bd2331 Mon Sep 17 00:00:00 2001 From: NicHoza Date: Sun, 5 Jan 2025 05:49:45 -0800 Subject: [PATCH] Update motion_detect_stage.cpp to allow specification of optional region name for output logging. --- post_processing_stages/motion_detect_stage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/post_processing_stages/motion_detect_stage.cpp b/post_processing_stages/motion_detect_stage.cpp index e759f161..6a9ad13c 100644 --- a/post_processing_stages/motion_detect_stage.cpp +++ b/post_processing_stages/motion_detect_stage.cpp @@ -53,6 +53,7 @@ class MotionDetectStage : public PostProcessingStage float region_threshold; int frame_period; bool verbose; + std::string region_name; } config_; Stream *stream_; unsigned lores_stride_; @@ -87,6 +88,7 @@ void MotionDetectStage::Read(boost::property_tree::ptree const ¶ms) config_.region_threshold = params.get("region_threshold", 0.005); config_.frame_period = params.get("frame_period", 5); config_.verbose = params.get("verbose", 0); + config_.region_name = params.get("region_name", ""); } void MotionDetectStage::Configure() @@ -176,7 +178,7 @@ bool MotionDetectStage::Process(CompletedRequestPtr &completed_request) } if (config_.verbose && motion_detected != motion_detected_) - LOG(1, "Motion " << (motion_detected ? "detected" : "stopped")); + LOG(1, "Motion " << (motion_detected ? "detected" : "stopped") << (config_.region_name.empty() ? "" : " in region " + config_.region_name)); motion_detected_ = motion_detected; completed_request->post_process_metadata.Set("motion_detect.result", motion_detected);