From 327204880f9153fec9645db68406767af854dde0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Jan 2022 00:02:19 +0100 Subject: tracker/pt: don't mask out pixels below threshold --- tracker-pt/module/point_extractor.cpp | 6 ++---- tracker-pt/module/point_extractor.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tracker-pt/module/point_extractor.cpp b/tracker-pt/module/point_extractor.cpp index 804245d2..6e79ef24 100644 --- a/tracker-pt/module/point_extractor.cpp +++ b/tracker-pt/module/point_extractor.cpp @@ -98,7 +98,6 @@ void PointExtractor::ensure_buffers(const cv::Mat& frame) frame_gray.create(H, W); frame_bin.create(H, W); - frame_gray_unmasked.create(H, W); } void PointExtractor::extract_single_channel(const cv::Mat& orig_frame, int idx, cv::Mat1b& dest) @@ -303,15 +302,14 @@ void PointExtractor::extract_points(const pt_frame& frame_, const cv::Mat& frame = frame_.as_const()->mat; ensure_buffers(frame); - color_to_grayscale(frame, frame_gray_unmasked); + color_to_grayscale(frame, frame_gray); #if defined PREVIEW cv::imshow("capture", frame_gray); cv::waitKey(1); #endif - threshold_image(frame_gray_unmasked, frame_bin); - frame_gray_unmasked.copyTo(frame_gray, frame_bin); + threshold_image(frame_gray, frame_bin); const f region_size_min = (f)s.min_point_size; const f region_size_max = (f)s.max_point_size; diff --git a/tracker-pt/module/point_extractor.h b/tracker-pt/module/point_extractor.h index b1cc86d5..3f7fb4ee 100644 --- a/tracker-pt/module/point_extractor.h +++ b/tracker-pt/module/point_extractor.h @@ -42,7 +42,7 @@ private: pt_settings s; - cv::Mat1b frame_gray_unmasked, frame_bin, frame_gray; + cv::Mat1b frame_bin, frame_gray; cv::Mat1f hist; std::vector blobs; cv::Mat1b ch[3]; -- cgit v1.2.3