summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-06-12 16:58:10 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-06-14 18:14:46 +0200
commitaa635343aa5f4a84b9491ad8fb008bf17544a3fe (patch)
tree0b85e3b20c0787eff3176d806ab21eedc9cf42f9
parent6b7e7f988d58e84a9e051fd6a40ed4535f73e687 (diff)
tracker/pt: use unsigned index where able
-rw-r--r--tracker-pt/point_tracker.cpp10
-rw-r--r--tracker-pt/point_tracker.h10
2 files changed, 10 insertions, 10 deletions
diff --git a/tracker-pt/point_tracker.cpp b/tracker-pt/point_tracker.cpp
index abb69fa9..d3a3d400 100644
--- a/tracker-pt/point_tracker.cpp
+++ b/tracker-pt/point_tracker.cpp
@@ -65,15 +65,15 @@ PointTracker::PointOrder PointTracker::find_correspondences_previous(const std::
// set correspondences by minimum distance to projected model point
bool point_taken[PointModel::N_POINTS];
- for (int i=0; i<PointModel::N_POINTS; ++i)
+ for (unsigned i=0; i<PointModel::N_POINTS; ++i)
point_taken[i] = false;
- for (int i=0; i<PointModel::N_POINTS; ++i)
+ for (unsigned i=0; i<PointModel::N_POINTS; ++i)
{
float min_sdist = 0;
- int min_idx = 0;
+ unsigned min_idx = 0;
// find closest point to projected model point i
- for (int j=0; j<PointModel::N_POINTS; ++j)
+ for (unsigned j=0; j<PointModel::N_POINTS; ++j)
{
cv::Vec2f d = p.points[i]-points[j];
float sdist = d.dot(d);
@@ -133,7 +133,7 @@ PointTracker::PointOrder PointTracker::find_correspondences(const std::vector<cv
d);
// set correspondences
PointOrder p;
- for (int i=0; i<PointModel::N_POINTS; ++i)
+ for (unsigned i = 0; i < PointModel::N_POINTS; ++i)
p.points[model_d_order[i]] = points[point_d_order[i]];
return p;
diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h
index e70059ff..f964a107 100644
--- a/tracker-pt/point_tracker.h
+++ b/tracker-pt/point_tracker.h
@@ -56,7 +56,7 @@ class PointModel
{
friend class PointTracker;
public:
- static constexpr int N_POINTS = 3;
+ static constexpr unsigned N_POINTS = 3;
cv::Vec3f M01; // M01 in model frame
cv::Vec3f M02; // M02 in model frame
@@ -64,7 +64,7 @@ public:
cv::Vec3f u; // unit vector perpendicular to M01,M02-plane
cv::Matx22f P;
-
+
enum Model { Clip = 0, Cap = 1, Custom = 2 };
PointModel(settings_pt& s)
@@ -80,7 +80,7 @@ public:
float s22 = M02.dot(M02);
P = 1/(s11*s22-s12*s12) * cv::Matx22f(s22, -s12, -s12, s11);
}
-
+
void set_model(settings_pt& s)
{
switch (s.active_model_panel)
@@ -99,7 +99,7 @@ public:
break;
}
}
-
+
void get_d_order(const std::vector<cv::Vec2f>& points, int* d_order, cv::Vec2f d) const;
};
@@ -124,7 +124,7 @@ private:
cv::Vec2f points[PointModel::N_POINTS];
PointOrder()
{
- for (int i = 0; i < PointModel::N_POINTS; i++)
+ for (unsigned i = 0; i < PointModel::N_POINTS; i++)
points[i] = cv::Vec2f(0, 0);
}
};