41 #include <pcl/pcl_config.h>
43 #include <pcl/filters/filter_indices.h>
75 template <
typename Po
intT>
84 using Ptr = shared_ptr<FrustumCulling<PointT> >;
85 using ConstPtr = shared_ptr<const FrustumCulling<PointT> >;
92 , camera_pose_ (
Eigen::Matrix4f::Identity ())
126 camera_pose_ = camera_pose;
133 return (camera_pose_);
214 if ((roi_x > 1.0f) || (roi_x < 0.0f) ||
215 (roi_y > 1.0f) || (roi_y < 0.0f) ||
216 (roi_w <= 0.0f) || (roi_w > 1.0f) ||
217 (roi_h <= 0.0f) || (roi_h > 1.0f))
219 throw PCLException (
"ROI X-Y values should be between 0 and 1. "
220 "Width and height must not be zero.",
221 "frustum_culling.h",
"setRegionOfInterest");
263 Eigen::Matrix4f camera_pose_;
286 #ifdef PCL_NO_PRECOMPILE
287 #include <pcl/filters/impl/frustum_culling.hpp>
Filter represents the base filter class.
shared_ptr< Filter< PointT > > Ptr
shared_ptr< const Filter< PointT > > ConstPtr
std::string filter_name_
The filter name.
FilterIndices represents the base class for filters that are about binary point removal.
FrustumCulling filters points inside a frustum given by pose and field of view of the camera.
float getVerticalFOV() const
Get the vertical field of view for the camera in degrees.
float getNearPlaneDistance() const
Get the near plane distance.
float getHorizontalFOV() const
Get the horizontal field of view for the camera in degrees.
void setNearPlaneDistance(float np_dist)
Set the near plane distance.
void setRegionOfInterest(float roi_x, float roi_y, float roi_w, float roi_h)
Set the region of interest (ROI) in normalized values.
void setVerticalFOV(float vfov)
Set the vertical field of view for the camera in degrees.
void setFarPlaneDistance(float fp_dist)
Set the far plane distance.
void setHorizontalFOV(float hfov)
Set the horizontal field of view for the camera in degrees.
FrustumCulling(bool extract_removed_indices=false)
float getFarPlaneDistance() const
Get the far plane distance.
Eigen::Matrix4f getCameraPose() const
Get the pose of the camera w.r.t the origin.
void setCameraPose(const Eigen::Matrix4f &camera_pose)
Set the pose of the camera w.r.t the origin.
void getRegionOfInterest(float &roi_x, float &roi_y, float &roi_w, float &roi_h) const
Get the region of interest (ROI) in normalized values.
void applyFilter(Indices &indices) override
Sample of point indices.
typename PointCloud::Ptr PointCloudPtr
typename PointCloud::ConstPtr PointCloudConstPtr
A base class for all pcl exceptions which inherits from std::runtime_error.
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
Defines all the PCL implemented PointT point type structures.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Defines functions, macros and traits for allocating and using memory.
IndicesAllocator<> Indices
Type used for indices in PCL.
A point structure representing Euclidean xyz coordinates, and the RGB color.