From 8c5a34f9002f45bdda2f3e7240faf63766bc729a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 1 Jul 2015 13:35:10 +0200 Subject: pt: fix sqrt eps --- ftnoir_tracker_pt/point_extractor.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ftnoir_tracker_pt') diff --git a/ftnoir_tracker_pt/point_extractor.cpp b/ftnoir_tracker_pt/point_extractor.cpp index 71023a38..dd75852c 100644 --- a/ftnoir_tracker_pt/point_extractor.cpp +++ b/ftnoir_tracker_pt/point_extractor.cpp @@ -72,20 +72,19 @@ std::vector PointExtractor::extract_points(Mat& frame) struct simple_blob { - double radius; + double radius_2; cv::Vec2d pos; double confid; bool taken; double area; - simple_blob(double radius, const cv::Vec2d& pos, double confid, double area) : radius(radius), pos(pos), confid(confid), taken(false), area(area) + simple_blob(double radius, const cv::Vec2d& pos, double confid, double area) : radius_2(radius*radius), pos(pos), confid(confid), taken(false), area(area) { //qDebug() << "radius" << radius << "pos" << pos[0] << pos[1] << "confid" << confid; } bool inside(const simple_blob& other) { cv::Vec2d tmp = pos - other.pos; - double p = sqrt(1e-4 + tmp.dot(tmp)); - return p < radius; + return tmp.dot(tmp) < radius_2; } static std::vector merge(std::vector& blobs) { -- cgit v1.2.3