39#include <pcl/common/io.h>
44 namespace occlusion_reasoning
51 template<
typename ModelT,
typename SceneT>
85 float x = (*to_be_filtered)[i].x;
86 float y = (*to_be_filtered)[i].y;
87 float z = (*to_be_filtered)[i].z;
88 int u =
static_cast<int> (f * x / z + cx);
89 int v =
static_cast<int> (f * y / z + cy);
103 if ((z -
z_oc) > threshold)
120 float cy = (
static_cast<float> (
organized_cloud->height) / 2.f - 0.5f);
129 float x = (*to_be_filtered)[i].x;
130 float y = (*to_be_filtered)[i].y;
131 float z = (*to_be_filtered)[i].z;
132 int u =
static_cast<int> (f * x / z + cx);
133 int v =
static_cast<int> (f * y / z + cy);
150 if ((z -
z_oc) > threshold)
167 float cy = (
static_cast<float> (
organized_cloud->height) / 2.f - 0.5f);
176 float x = (*to_be_filtered)[i].x;
177 float y = (*to_be_filtered)[i].y;
178 float z = (*to_be_filtered)[i].z;
179 int u =
static_cast<int> (f * x / z + cx);
180 int v =
static_cast<int> (f * y / z + cy);
197 if ((z -
z_oc) > threshold)
211#ifdef PCL_NO_PRECOMPILE
212#include <pcl/recognition/impl/hv/occlusion_reasoning.hpp>
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
Class to reason about occlusions.
void computeDepthMap(typename pcl::PointCloud< SceneT >::ConstPtr &scene, bool compute_focal=false, bool smooth=false, int wsize=3)
void filter(typename pcl::PointCloud< ModelT >::ConstPtr &model, typename pcl::PointCloud< ModelT >::Ptr &filtered, float thres=0.01)
void copyPointCloud(const pcl::PointCloud< PointInT > &cloud_in, pcl::PointCloud< PointOutT > &cloud_out)
Copy all the fields from a given point cloud into a new point cloud.
pcl::PointCloud< ModelT >::Ptr getOccludedCloud(typename pcl::PointCloud< SceneT >::Ptr &organized_cloud, typename pcl::PointCloud< ModelT >::Ptr &to_be_filtered, float f, float threshold, bool check_invalid_depth=true)
pcl::PointCloud< ModelT >::Ptr filter(typename pcl::PointCloud< SceneT >::ConstPtr &organized_cloud, typename pcl::PointCloud< ModelT >::ConstPtr &to_be_filtered, float f, float threshold)
IndicesAllocator<> Indices
Type used for indices in PCL.