diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-18 13:50:04 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-18 13:53:47 +0200 |
commit | d6907613e89b906edb3f2b7c0049f8b13f3524ee (patch) | |
tree | e88d83b15724f0b2915eb555ea2f47f179b5bddf /tracker-pt/module/point_extractor.cpp | |
parent | cfd70f5aea911db4cab1a8f2916d40ac59854166 (diff) |
tracker/pt: fix support for grayscale input video
Diffstat (limited to 'tracker-pt/module/point_extractor.cpp')
-rw-r--r-- | tracker-pt/module/point_extractor.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tracker-pt/module/point_extractor.cpp b/tracker-pt/module/point_extractor.cpp index a92c87c9..5e57ef34 100644 --- a/tracker-pt/module/point_extractor.cpp +++ b/tracker-pt/module/point_extractor.cpp @@ -124,6 +124,13 @@ void PointExtractor::filter_single_channel(const cv::Mat& orig_frame, float r, f void PointExtractor::color_to_grayscale(const cv::Mat& frame, cv::Mat1b& output) { + if (frame.channels() == 1) + { + output.create(frame.rows, frame.cols); + frame.copyTo(output); + return; + } + switch (s.blob_color) { case pt_color_green_only: |