From ad5e8d62e71a2a01c7362cc43b16313983d566be Mon Sep 17 00:00:00 2001 From: Dmytro Bobkov Date: Fri, 3 Feb 2017 10:07:21 +0100 Subject: [PATCH 1/3] Fixed errors in the main file, added some more description --- README.md | 8 +++++--- main.cpp | 26 +++++++++++++++++--------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a30cee6..2243512 100644 --- a/README.md +++ b/README.md @@ -22,17 +22,19 @@ Pretrained networks can be found at [webpage](https://sites.google.com/view/boul # Usage -HoughCNN_Exec [options] -m path_to_the_torch_model -i input_file.xyz +HoughCNN_Exec [options] -m path_to_the_torch_model -i input_file.xyz -c Note: the input file must currently be at xyz format, it is possible to generate such file with Meshlab. -Note: the file predict.lua should be next to the executable +Note: the file predict.lua should be next to the executable. + +Note: number of scales has to be consistent with the used model (there are separate models for different scales). # Example A file cube_100k is located in the test directory. -HoughCNN_Exec [options] -m path_to_the_torch_model -i test/cube_100k.xyz +HoughCNN_Exec [options] -m path_to_the_torch_model -i test/cube_100k.xyz -c # Author diff --git a/main.cpp b/main.cpp index b2d984b..495bd97 100644 --- a/main.cpp +++ b/main.cpp @@ -47,6 +47,11 @@ using namespace std; #include "houghCNN.h" +void printHelp() +{ + cout << " -i -o -c -k -t -d -m " + << "-s -e " << endl; +} int main(int argc, char** argv){ srand (time(NULL)); @@ -62,26 +67,27 @@ int main(int argc, char** argv){ int k_density = 5; int c; + opterr = 0; - while ((c = getopt (argc, argv, "i:o:m:k:t:d:p:r:a:e:")) != -1) + while ((c = getopt (argc, argv, "i:o:m:k:t:d:c:s:e")) != -1) switch (c){ case 'i':{ - input = optarg; + input = optarg; // input file break; } case 'o':{ - output = optarg; + output = optarg; // output file break; } case 'm':{ - model = optarg; + model = optarg; break; } case 'k':{ stringstream sstr(""); sstr << optarg; - sstr >> k; + sstr >> k; // neighborhoods break; } case 't':{ @@ -123,10 +129,12 @@ int main(int argc, char** argv){ if(input=="-1"){ cout << "Error need input file" << endl; + printHelp(); return 1; } if(model=="-1"){ cout << "Error need model file" << endl; + printHelp(); return 1; } @@ -136,7 +144,7 @@ int main(int argc, char** argv){ // load the point cloud MatrixX3 pc, normals; - pc_load(input,pc); + pc_load(input, pc); cout << "Point cloud size: " << pc.rows() << endl; if(pc.rows() == 0){ @@ -145,7 +153,7 @@ int main(int argc, char** argv){ } // create the estimator - NormEst ne(pc,normals); + NormEst ne(pc, normals); ne.access_A() = s; // accumulator size ne.access_T() = T; // number of hypothesis @@ -165,10 +173,10 @@ int main(int argc, char** argv){ } // estimation - ne.estimate(model,Ks, ua); + ne.estimate(model, Ks, ua); // save the point cloud - pc_save(output,pc, normals); + pc_save(output, pc, normals); From ba746d1836cb4056e37369fadb043f4ee121a621 Mon Sep 17 00:00:00 2001 From: Dmytro Bobkov Date: Fri, 3 Feb 2017 10:10:12 +0100 Subject: [PATCH 2/3] Not showing <> in readme, fixing --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2243512..a020592 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Pretrained networks can be found at [webpage](https://sites.google.com/view/boul # Usage -HoughCNN_Exec [options] -m path_to_the_torch_model -i input_file.xyz -c +HoughCNN_Exec [options] -m path_to_the_torch_model -i input_file.xyz -c number_of_scales Note: the input file must currently be at xyz format, it is possible to generate such file with Meshlab. @@ -34,7 +34,7 @@ Note: number of scales has to be consistent with the used model (there are separ A file cube_100k is located in the test directory. -HoughCNN_Exec [options] -m path_to_the_torch_model -i test/cube_100k.xyz -c +HoughCNN_Exec [options] -m path_to_the_torch_model -i test/cube_100k.xyz -c scale # Author From 1e676159ae8151b2bf9ad58d5e2a5bb81064d1ae Mon Sep 17 00:00:00 2001 From: Dmytro Bobkov Date: Fri, 3 Feb 2017 10:25:44 +0100 Subject: [PATCH 3/3] Fixed tabulation --- main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 495bd97..1ff7a49 100644 --- a/main.cpp +++ b/main.cpp @@ -49,8 +49,10 @@ using namespace std; void printHelp() { - cout << " -i -o -c -k -t -d -m " - << "-s -e " << endl; + cout << "Usage: \n -i\t \n -o\t \n -c\t \n" + << " -m\t \n" + << " -k\t \n -t\t \n -d\t \n" + << " -s\t \n -e\t \n" << endl; } int main(int argc, char** argv){