abhineet123 / MTF

Modular Tracking Framework
http://webdocs.cs.ualberta.ca/~vis/mtf/
BSD 3-Clause "New" or "Revised" License
100 stars 23 forks source link

call of overloaded ‘abs( ... ) is ambigous #7

Closed kneczaj closed 7 years ago

kneczaj commented 7 years ago

When compiling MTF with Ubuntu 16.10 gcc version 6.2.0 20161005

a couple of following errors crashes the compilation process error: call of overloaded ‘abs(...)’ is ambiguous

The following patch fixes it:

diff --git a/ThirdParty/MIL/src/cv_onlineboosting.cpp b/ThirdParty/MIL/src/cv_onlineboosting.cpp
index 43acc31..f66337d 100644
--- a/ThirdParty/MIL/src/cv_onlineboosting.cpp
+++ b/ThirdParty/MIL/src/cv_onlineboosting.cpp
@@ -1871,7 +1871,7 @@ namespace cv
           int myTarget = static_cast<int>(sign(combinedDecision));

           m_pseudoTarget[curBaseClassifier] = myTarget;
-          float myImportance = ::abs(combinedDecision);
+          float myImportance = ::fabs(combinedDecision);^M
           m_pseudoLambda[curBaseClassifier] = myImportance;

           baseClassifier[curBaseClassifier]->trainClassifier(image, ROI, myTarget, myImportance, m_errorMask);
diff --git a/ThirdParty/TLD/src/mftracker/BBPredict.cpp b/ThirdParty/TLD/src/mftracker/BBPredict.cpp
index 6f08b51..a666974 100644
--- a/ThirdParty/TLD/src/mftracker/BBPredict.cpp
+++ b/ThirdParty/TLD/src/mftracker/BBPredict.cpp
@@ -30,9 +30,7 @@
 #endif

 #include "mtf/ThirdParty/TLD/mftracker/BBPredict.h"
-
 #include <cmath>
-
 #include "mtf/ThirdParty/TLD/mftracker/Median.h"

 /**
@@ -41,7 +39,7 @@
  */
 float getBbWidth(float *bb)
 {
-    return abs(bb[2] - bb[0] + 1);
+    return fabs(bb[2] - bb[0] + 1);^M
 }
 /**
  * Returns hight of Boundingbox.
@@ -49,7 +47,7 @@ float getBbWidth(float *bb)
  */
 float getBbHeight(float *bb)
 {
-    return abs(bb[3] - bb[1] + 1);
+    return fabs(bb[3] - bb[1] + 1);^M
 }
 /**
  * Calculates the new (moved and resized) Bounding box.

To get exact errors I need to recompile the project without the patch.