diff --git a/Classification/examples/Classification/example_random_forest.cpp b/Classification/examples/Classification/example_random_forest.cpp index 44b5d3f8fc3..768350c7448 100644 --- a/Classification/examples/Classification/example_random_forest.cpp +++ b/Classification/examples/Classification/example_random_forest.cpp @@ -40,7 +40,7 @@ typedef Classification::Point_set_feature_generator int main (int argc, char** argv) { std::string filename (argc > 1 ? argv[1] : "data/b9_training.ply"); - std::ifstream in (filename.c_str()); + std::ifstream in (filename.c_str(), std::ios::binary); Point_set pts; std::cerr << "Reading input" << std::endl; @@ -91,7 +91,7 @@ int main (int argc, char** argv) Classification::classify_with_graphcut (pts, pts.point_map(), labels, classifier, generator.neighborhood().k_neighbor_query(12), - 0.2, 1, label_indices); + 0.2f, 1, label_indices); t.stop(); std::cerr << "Classification with graphcut done in " << t.time() << " second(s)" << std::endl; diff --git a/Classification/include/CGAL/Classification/Random_forest_classifier.h b/Classification/include/CGAL/Classification/Random_forest_classifier.h index 10844a3496e..596b8b8018a 100644 --- a/Classification/include/CGAL/Classification/Random_forest_classifier.h +++ b/Classification/include/CGAL/Classification/Random_forest_classifier.h @@ -135,7 +135,7 @@ public: { for (std::size_t f = 0; f < m_features.size(); ++ f) training_features.at(int(index), int(f)) = m_features[f]->value(i); - training_labels.at(int(index), 0) = ground_truth[i]; + training_labels.at(int(index), 0) = static_cast(ground_truth[i]); ++ index; }