From 844142ba7f77f17171c3cefd185862d7e5ce25b3 Mon Sep 17 00:00:00 2001 From: Matteo Munaro Date: Mon, 15 Apr 2013 13:40:14 +0200 Subject: [PATCH] Fixed bug in unit test test_people_groundBasedPeopleDetectionApp. --- test/CMakeLists.txt | 2 +- test/test_people_groundBasedPeopleDetectionApp.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0160242674b..24a149e8f36 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -75,7 +75,7 @@ if(build) PCL_ADD_TEST(a_people_detection_test test_people_detection FILES test_people_groundBasedPeopleDetectionApp.cpp LINK_WITH pcl_gtest pcl_common pcl_io pcl_kdtree pcl_search pcl_features pcl_sample_consensus pcl_filters pcl_io pcl_segmentation - ARGUMENTS ${PCL_SOURCE_DIR}/test/five_people.pcd) + ARGUMENTS ${PCL_SOURCE_DIR}/people/data/trainedLinearSVMForPeopleDetectionWithHOG.yaml ${PCL_SOURCE_DIR}/test/five_people.pcd ) if(BUILD_visualization AND (NOT UNIX OR (UNIX AND DEFINED ENV{DISPLAY}))) PCL_ADD_TEST(a_visualization_test test_visualization diff --git a/test/test_people_groundBasedPeopleDetectionApp.cpp b/test/test_people_groundBasedPeopleDetectionApp.cpp index c53332a1543..1e49ee46f55 100644 --- a/test/test_people_groundBasedPeopleDetectionApp.cpp +++ b/test/test_people_groundBasedPeopleDetectionApp.cpp @@ -100,19 +100,25 @@ int main (int argc, char** argv) { if (argc < 2) { - cerr << "No test file given. Please download `five_people.pcd` and pass their paths to the test." << endl; + cerr << "No svm filename provided. Please download `trainedLinearSVMForPeopleDetectionWithHOG.yaml` and pass its path to the test." << endl; + return (-1); + } + + if (argc < 3) + { + cerr << "No test file given. Please download 'five_people.pcd` and pass its path to the test." << endl; return (-1); } cloud = PointCloudT::Ptr (new PointCloudT); - if (pcl::io::loadPCDFile (argv[1], *cloud) < 0) + if (pcl::io::loadPCDFile (argv[2], *cloud) < 0) { cerr << "Failed to read test file. Please download `five_people.pcd` and pass its path to the test." << endl; return (-1); } // Algorithm parameters: - svm_filename = "../../people/data/trainedLinearSVMForPeopleDetectionWithHOG.yaml"; + svm_filename = argv[1]; min_confidence = -1.5; min_height = 1.3; max_height = 2.3;