40 #ifndef PCL_FILTERS_BILATERAL_IMPL_H_ 41 #define PCL_FILTERS_BILATERAL_IMPL_H_ 43 #include <pcl/filters/bilateral.h> 46 template <
typename Po
intT>
double 48 const std::vector<int> &indices,
49 const std::vector<float> &distances)
54 for (
size_t n_id = 0; n_id < indices.size (); ++n_id)
56 int id = indices[n_id];
58 double intensity_dist = fabs (input_->points[pid].intensity - input_->points[
id].intensity);
61 double dist = std::sqrt (distances[n_id]);
62 double weight =
kernel (dist, sigma_s_) *
kernel (intensity_dist, sigma_r_);
65 BF += weight * input_->points[id].intensity;
72 template <
typename Po
intT>
void 78 PCL_ERROR (
"[pcl::BilateralFilter::applyFilter] Need a sigma_s value given before continuing.\n");
85 if (input_->isOrganized ())
91 tree_->setInputCloud (input_);
93 std::vector<int> k_indices;
94 std::vector<float> k_distances;
100 for (
size_t i = 0; i < indices_->size (); ++i)
103 tree_->radiusSearch ((*indices_)[i], sigma_s_ * 2, k_indices, k_distances);
106 output.
points[(*indices_)[i]].intensity = static_cast<float> (computePointWeight ((*indices_)[i], k_indices, k_distances));
110 #define PCL_INSTANTIATE_BilateralFilter(T) template class PCL_EXPORTS pcl::BilateralFilter<T>; 112 #endif // PCL_FILTERS_BILATERAL_IMPL_H_
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
void applyFilter(PointCloud &output)
Filter the input data and store the results into output.
PointCloud represents the base class in PCL for storing collections of 3D points.
OrganizedNeighbor is a class for optimized nearest neigbhor search in organized point clouds.
double computePointWeight(const int pid, const std::vector< int > &indices, const std::vector< float > &distances)
Compute the intensity average for a single point.