diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-17 14:34:16 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-03-29 00:04:48 +0200 |
| commit | 0abd7625ad329e291f33f86c4771813dc34235c5 (patch) | |
| tree | 3db488adf748b2072c7776513ceecc9b086d3cee /tracker-trackhat/frame.cpp | |
| parent | 377a965bbb2661d6fa08dfc05e37c43ee172452f (diff) | |
tracker/trackhat: measure points by area
Diffstat (limited to 'tracker-trackhat/frame.cpp')
| -rw-r--r-- | tracker-trackhat/frame.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tracker-trackhat/frame.cpp b/tracker-trackhat/frame.cpp index 750c46df..28690fc4 100644 --- a/tracker-trackhat/frame.cpp +++ b/tracker-trackhat/frame.cpp @@ -85,6 +85,7 @@ void trackhat_preview::draw_points() void trackhat_frame::init_points(const trackHat_ExtendedPoints_t& points_, double min_size, double max_size) { trackHat_ExtendedPoints_t copy = points_; + points = {}; std::sort(std::begin(copy.m_point), std::end(copy.m_point), [](trackHat_ExtendedPoint_t p1, trackHat_ExtendedPoint_t p2) { @@ -100,11 +101,11 @@ void trackhat_frame::init_points(const trackHat_ExtendedPoints_t& points_, doubl point p = {}; - const double radius = std::sqrt(pt.m_area) / std::sqrt(M_PI); - if (i < 3 && radius >= min_size && radius <= max_size) + if (pt.m_area >= min_size && pt.m_area <= max_size) p.ok = true; p.brightness = pt.m_averageBrightness; + p.area = pt.m_area; p.W = std::max(1, pt.m_boundryRigth - pt.m_boundryLeft); p.H = std::max(1, pt.m_boundryDown - pt.m_boundryUp); p.x = trackhat_camera::sensor_size-1-pt.m_coordinateX; @@ -112,7 +113,4 @@ void trackhat_frame::init_points(const trackHat_ExtendedPoints_t& points_, doubl points[i++] = p; } - - for (; i < std::size(points); i++) - points[i] = {}; } |
