toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Toon-members] tag/tag ransac_estimators.h


From: Ethan Eade
Subject: [Toon-members] tag/tag ransac_estimators.h
Date: Tue, 13 Jun 2006 02:37:32 +0000

CVSROOT:        /cvsroot/toon
Module name:    tag
Changes by:     Ethan Eade <ethaneade>  06/06/13 02:37:32

Modified files:
        tag            : ransac_estimators.h 

Log message:
        More fixes, mostly namespace qualification issues.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/tag/tag/ransac_estimators.h?cvsroot=toon&r1=1.3&r2=1.4

Patches:
Index: ransac_estimators.h
===================================================================
RCS file: /cvsroot/toon/tag/tag/ransac_estimators.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ransac_estimators.h 13 Jun 2006 01:50:44 -0000      1.3
+++ ransac_estimators.h 13 Jun 2006 02:37:32 -0000      1.4
@@ -11,11 +11,12 @@
 #include <TooN/LU.h>
 #include <TooN/SVD.h>
 #include <TooN/SymEigen.h>
+#include <TooN/se3.h>
 
 namespace tag {
 
-    template <class T> inline const Vector<2>& first_point(const T& t) { 
return t.first; }
-    template <class T> inline const Vector<2>& second_point(const T& t) { 
return t.second; }
+    template <class T> inline const typename T::first_type& first_point(const 
T& t) { return t.first; }
+    template <class T> inline const typename T::second_type& 
second_point(const T& t) { return t.second; }
     template <class T> inline double noise(const T& t) { return 1.0; }
     
 
@@ -28,12 +29,12 @@
 
        TooN::WLS<8> wls;
        for (It it=begin; it!=end; it++) {
-           const Vector<2>& a = first_point(*it);
-           const Vector<2>& b = first_point(*it);
+           const TooN::Vector<2>& a = first_point(*it);
+           const TooN::Vector<2>& b = first_point(*it);
            const double rows[2][8] = {{a[0], a[1], 1, 0, 0, 0, -b[0]*a[0], 
-b[0]*a[1]},
                                       {0, 0, 0, a[0], a[1], 1, -b[1]*a[0], 
-b[1]*a[1]}};
-           wls.add_df(b[0], Vector<8>(rows[0]));
-           wls.add_df(b[1], Vector<8>(rows[1]));
+           wls.add_df(b[0], TooN::Vector<8>(rows[0]));
+           wls.add_df(b[1], TooN::Vector<8>(rows[1]));
        }
        wls.compute();
        TooN::Vector<8> h = wls.get_mu();
@@ -91,7 +92,7 @@
     struct EssentialMatrix {
        TooN::Matrix<3> E;
        template <class It> bool estimate(It begin, It end) {
-           TooN::Matrix<9> M = zeros<9,9>();
+           TooN::Matrix<9> M = TooN::zeros<9,9>();
            for (It it=begin; it!= end; ++it) {
                const TooN::Vector<2>& a = first_point(*it);
                const TooN::Vector<2>& b = second_point(*it);
@@ -210,11 +211,10 @@
        TooN::WLS<3> wls_x, wls_y;
        wls_x.clear();
        wls_y.clear();
-       size_t i=0;
-        for (It it = begin; it!= end; ++it, ++i) {         
-           const TooN::Vector<2>& a = first_point(matches[i]);
-           const TooN::Vector<2>& b = second_point(matches[i]);
-           const double weight = 1.0 / noise(matches[i]);
+        for (It it = begin; it!= end; ++it) {
+           const TooN::Vector<2>& a = first_point(*it);
+           const TooN::Vector<2>& b = second_point(*it);
+           const double weight = 1.0 / noise(*it);
            wls_x.add_df(b[0], TooN::unproject(a), weight);
            wls_y.add_df(b[1], TooN::unproject(a), weight);
         }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]