@@ -103,8 +103,9 @@ main(int argc, char** argv)
103
103
int pose_refinement_ = 0 ;
104
104
int icp_iterations = 5 ;
105
105
106
- std::string forest_fn = " ../data/forests/forest.txt" ;
107
- std::string model_path_ = " ../data/ply_models/face.pcd" ;
106
+ // Use for example biwi_face_database from https://github.com/PointCloudLibrary/data
107
+ std::string forest_fn = " ../data/biwi_face_database/forest_example.txt" ;
108
+ std::string model_path_ = " ../data/biwi_face_database/model.pcd" ;
108
109
109
110
pcl::console::parse_argument (argc, argv, " -forest_fn" , forest_fn);
110
111
pcl::console::parse_argument (argc, argv, " -max_variance" , trans_max_variance);
@@ -119,7 +120,6 @@ main(int argc, char** argv)
119
120
pcl::console::parse_argument (argc, argv, " -icp_iterations" , icp_iterations);
120
121
121
122
pcl::RFFaceDetectorTrainer fdrf;
122
- fdrf.setForestFilename (forest_fn);
123
123
fdrf.setWSize (80 );
124
124
fdrf.setUseNormals (static_cast <bool >(use_normals));
125
125
fdrf.setWStride (STRIDE_SW);
@@ -134,7 +134,10 @@ main(int argc, char** argv)
134
134
135
135
// load forest from file and pass it to the detector
136
136
std::filebuf fb;
137
- fb.open (forest_fn.c_str (), std::ios::in);
137
+ if (!fb.open (forest_fn.c_str (), std::ios::in)) {
138
+ PCL_ERROR (" Could not open file %s\n " , forest_fn.c_str ());
139
+ return 1 ;
140
+ }
138
141
std::istream os (&fb);
139
142
140
143
using NodeType = pcl::face_detection::RFTreeNode<pcl::face_detection::FeatureType>;
0 commit comments