From 6c297fcf8716df0a9ff1170c40d60a5b59f5536b Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Fri, 24 Feb 2017 11:16:45 +0100
Subject: [PATCH] BUG: fix absurd maxDepth parameter for DTrees

---
 .../AppClassification/include/otbTrainDecisionTree.txx        | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx b/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx
index def7b605e5..96b627498e 100644
--- a/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx
+++ b/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx
@@ -34,7 +34,11 @@ LearningApplicationBase<TInputValue,TOutputValue>
                           "See complete documentation here \\url{http://docs.opencv.org/modules/ml/doc/decision_trees.html}.");
   //MaxDepth
   AddParameter(ParameterType_Int, "classifier.dt.max", "Maximum depth of the tree");
+#ifdef OTB_OPENCV_3
+  SetParameterInt("classifier.dt.max",10, false);
+#else
   SetParameterInt("classifier.dt.max",65535, false);
+#endif
   SetParameterDescription(
       "classifier.dt.max", "The training algorithm attempts to split each node while its depth is smaller than the maximum "
       "possible depth of the tree. The actual depth may be smaller if the other termination criteria are met, and/or "
-- 
GitLab