summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-01 13:35:10 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-01 13:35:10 +0200
commit8c5a34f9002f45bdda2f3e7240faf63766bc729a (patch)
treeb1257c21c285f44acc4963a2bb834e5b5df8a8b1 /ftnoir_tracker_pt
parent66bcf1db948ca409b7474a4efc9d447f61353060 (diff)
pt: fix sqrt eps
Diffstat (limited to 'ftnoir_tracker_pt')
-rw-r--r--ftnoir_tracker_pt/point_extractor.cpp7
1 files changed, 3 insertions, 4 deletions
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<Vec2f> 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<blob> merge(std::vector<simple_blob>& blobs)
{