Cleaned up parameters a bit

release/4.3a0
dellaert 2015-06-20 13:09:39 -07:00
parent 2ce252fdc0
commit 1f8adc9381
1 changed files with 19 additions and 23 deletions

View File

@ -53,7 +53,7 @@ public:
/// @name Parameters governing the triangulation /// @name Parameters governing the triangulation
/// @{ /// @{
mutable TriangulationParameters triangulationParameters; mutable TriangulationParameters triangulation;
const double retriangulationThreshold; ///< threshold to decide whether to re-triangulate const double retriangulationThreshold; ///< threshold to decide whether to re-triangulate
/// @} /// @}
@ -65,13 +65,11 @@ public:
// Constructor // Constructor
SmartProjectionParams(LinearizationMode linMode = HESSIAN, SmartProjectionParams(LinearizationMode linMode = HESSIAN,
DegeneracyMode degMode = IGNORE_DEGENERACY, double rankTol = 1, DegeneracyMode degMode = IGNORE_DEGENERACY, bool throwCheirality = false,
bool enableEPI = false, double landmarkDistanceThreshold = 1e10, bool verboseCheirality = false) :
double dynamicOutlierRejectionThreshold = -1) : linearizationMode(linMode), degeneracyMode(degMode), retriangulationThreshold(
linearizationMode(linMode), degeneracyMode(degMode), triangulationParameters( 1e-5), throwCheirality(throwCheirality), verboseCheirality(
rankTol, enableEPI, landmarkDistanceThreshold, verboseCheirality) {
dynamicOutlierRejectionThreshold), retriangulationThreshold(1e-5), throwCheirality(
false), verboseCheirality(false) {
} }
virtual ~SmartProjectionParams() { virtual ~SmartProjectionParams() {
@ -80,14 +78,14 @@ public:
void print(const std::string& str) const { void print(const std::string& str) const {
std::cout << " linearizationMode: " << linearizationMode << "\n"; std::cout << " linearizationMode: " << linearizationMode << "\n";
std::cout << " degeneracyMode: " << degeneracyMode << "\n"; std::cout << " degeneracyMode: " << degeneracyMode << "\n";
std::cout << " rankTolerance: " std::cout << " rankTolerance: " << triangulation.rankTolerance
<< triangulationParameters.rankTolerance << "\n"; << "\n";
std::cout << " enableEPI: " std::cout << " enableEPI: " << triangulation.enableEPI
<< triangulationParameters.enableEPI << "\n"; << "\n";
std::cout << " landmarkDistanceThreshold: " std::cout << " landmarkDistanceThreshold: "
<< triangulationParameters.landmarkDistanceThreshold << "\n"; << triangulation.landmarkDistanceThreshold << "\n";
std::cout << " OutlierRejectionThreshold: " std::cout << " OutlierRejectionThreshold: "
<< triangulationParameters.dynamicOutlierRejectionThreshold << "\n"; << triangulation.dynamicOutlierRejectionThreshold << "\n";
std::cout.flush(); std::cout.flush();
} }
@ -98,7 +96,7 @@ public:
return degeneracyMode; return degeneracyMode;
} }
TriangulationParameters getTriangulationParameters() const { TriangulationParameters getTriangulationParameters() const {
return triangulationParameters; return triangulation;
} }
bool getVerboseCheirality() const { bool getVerboseCheirality() const {
return verboseCheirality; return verboseCheirality;
@ -113,18 +111,16 @@ public:
degeneracyMode = degMode; degeneracyMode = degMode;
} }
void setRankTolerance(double rankTol) { void setRankTolerance(double rankTol) {
triangulationParameters.rankTolerance = rankTol; triangulation.rankTolerance = rankTol;
} }
void setEnableEPI(bool enableEPI) { void setEnableEPI(bool enableEPI) {
triangulationParameters.enableEPI = enableEPI; triangulation.enableEPI = enableEPI;
} }
void setLandmarkDistanceThreshold(bool landmarkDistanceThreshold) { void setLandmarkDistanceThreshold(bool landmarkDistanceThreshold) {
triangulationParameters.landmarkDistanceThreshold = triangulation.landmarkDistanceThreshold = landmarkDistanceThreshold;
landmarkDistanceThreshold;
} }
void setDynamicOutlierRejectionThreshold(bool dynOutRejectionThreshold) { void setDynamicOutlierRejectionThreshold(bool dynOutRejectionThreshold) {
triangulationParameters.dynamicOutlierRejectionThreshold = triangulation.dynamicOutlierRejectionThreshold = dynOutRejectionThreshold;
dynOutRejectionThreshold;
} }
}; };
@ -188,7 +184,7 @@ public:
std::cout << s << "SmartProjectionFactor\n"; std::cout << s << "SmartProjectionFactor\n";
std::cout << "linearizationMode:\n" << params_.linearizationMode std::cout << "linearizationMode:\n" << params_.linearizationMode
<< std::endl; << std::endl;
std::cout << "triangulationParameters:\n" << params_.triangulationParameters std::cout << "triangulationParameters:\n" << params_.triangulation
<< std::endl; << std::endl;
std::cout << "result:\n" << result_ << std::endl; std::cout << "result:\n" << result_ << std::endl;
Base::print("", keyFormatter); Base::print("", keyFormatter);
@ -247,7 +243,7 @@ public:
bool retriangulate = decideIfTriangulate(cameras); bool retriangulate = decideIfTriangulate(cameras);
if (retriangulate) if (retriangulate)
result_ = gtsam::triangulateSafe(cameras, this->measured_, result_ = gtsam::triangulateSafe(cameras, this->measured_,
params_.triangulationParameters); params_.triangulation);
return result_; return result_;
} }