Skip to content

Commit

Permalink
Allow to set the field of view of the point cloud
Browse files Browse the repository at this point in the history
In order to be able to cut off outliers, the z-dimensions of the field
of view can be set from outside the people tracker. If there is only a
single outlier, it might not be able to filter the point cloud due to
a lack of memory.
  • Loading branch information
moritzblume committed Apr 24, 2014
1 parent ce26e6d commit 7ce8eda
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
15 changes: 15 additions & 0 deletions people/include/pcl/people/ground_based_people_detection_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ namespace pcl
void
setClassifier (pcl::people::PersonClassifier<pcl::RGB> person_classifier);

/**
* \brief Set the field of view of the point cloud in z direction.
*
* \param[in] min The beginning of the field of view in z-direction, should be usually set to zero.
* \param[in] max The end of the field of view in z-direction.
*/
void
setFOV (float min, float max);

/**
* \brief Set sensor orientation (vertical = true means portrait mode, vertical = false means landscape mode).
*
Expand Down Expand Up @@ -288,6 +297,12 @@ namespace pcl
/** \brief person clusters minimum width, used to estimate how many points minimally represent a person cluster */
float min_width_;

/** \brief the beginning of the field of view in z-direction, should be usually set to zero */
float min_fov_;

/** \brief the end of the field of view in z-direction */
float max_fov_;

/** \brief if true, the sensor is considered to be vertically placed (portrait mode) */
bool vertical_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ pcl::people::GroundBasedPeopleDetectionApp<PointT>::GroundBasedPeopleDetectionAp
voxel_size_ = 0.06;
vertical_ = false;
head_centroid_ = true;
min_fov_ = 0;
max_fov_ = 50;
min_height_ = 1.3;
max_height_ = 2.3;
min_width_ = 0.1;
Expand Down Expand Up @@ -108,6 +110,13 @@ pcl::people::GroundBasedPeopleDetectionApp<PointT>::setClassifier (pcl::people::
person_classifier_set_flag_ = true;
}

template <typename PointT> void
pcl::people::GroundBasedPeopleDetectionApp<PointT>::setFOV (float min_fov, float max_fov)
{
min_fov_ = min_fov;
max_fov_ = max_fov;
}

template <typename PointT> void
pcl::people::GroundBasedPeopleDetectionApp<PointT>::setSensorPortraitOrientation (bool vertical)
{
Expand Down Expand Up @@ -232,6 +241,8 @@ pcl::people::GroundBasedPeopleDetectionApp<PointT>::filter ()
pcl::VoxelGrid<PointT> grid;
grid.setInputCloud(cloud_);
grid.setLeafSize(voxel_size_, voxel_size_, voxel_size_);
grid.setFilterFieldName("z");
grid.setFilterLimits(min_fov_, max_fov_);
grid.filter(*cloud_filtered_);
}

Expand Down

0 comments on commit 7ce8eda

Please sign in to comment.