64 if (!input_->isOrganized ())
66 PCL_ERROR (
"[pcl::FastBilateralFilterOMP] Input cloud needs to be organized.\n");
71 float base_max = -std::numeric_limits<float>::max (),
72 base_min = std::numeric_limits<float>::max ();
76 if (std::isfinite(
pt.z))
85 PCL_WARN (
"[pcl::FastBilateralFilterOMP] Given an empty cloud. Doing nothing.\n");
88#pragma omp parallel for \
90 shared(base_min, base_max, output) \
93 if (!std::isfinite (
output.at(i).z))
101 const std::size_t
small_width =
static_cast<std::size_t
> (
static_cast<float> (input_->width - 1) / sigma_s_) + 1 + 2 *
padding_xy;
102 const std::size_t
small_height =
static_cast<std::size_t
> (
static_cast<float> (input_->height - 1) / sigma_s_) + 1 + 2 *
padding_xy;
106#if OPENMP_LEGACY_CONST_DATA_SHARING_RULE
107#pragma omp parallel for \
109 shared(base_min, data, output) \
110 num_threads(threads_)
112#pragma omp parallel for \
114 shared(base_min, data, output, small_height, small_width) \
115 num_threads(threads_)
121 std::size_t
start_x =
static_cast<std::size_t
>(
122 std::max ((
static_cast<float> (
small_x) -
static_cast<float> (
padding_xy) - 0.5f) * sigma_s_ + 1, 0.f));
123 std::size_t
end_x =
static_cast<std::size_t
>(
124 std::max ((
static_cast<float> (
small_x) -
static_cast<float> (
padding_xy) + 0.5f) * sigma_s_ + 1, 0.f));
125 std::size_t
start_y =
static_cast<std::size_t
>(
126 std::max ((
static_cast<float> (
small_y) -
static_cast<float> (
padding_xy) - 0.5f) * sigma_s_ + 1, 0.f));
127 std::size_t
end_y =
static_cast<std::size_t
>(
128 std::max ((
static_cast<float> (
small_y) -
static_cast<float> (
padding_xy) + 0.5f) * sigma_s_ + 1, 0.f));
129 for (std::size_t x =
start_x; x <
end_x && x < input_->width; ++x)
131 for (std::size_t y =
start_y; y <
end_y && y < input_->height; ++y)
134 const std::size_t
small_z =
static_cast<std::size_t
> (
static_cast<float> (z) / sigma_r_ + 0.5f) +
padding_z;
142 std::vector<long int> offset (3);
143 offset[0] = &(data (1,0,0)) - &(data (0,0,0));
144 offset[1] = &(data (0,1,0)) - &(data (0,0,0));
145 offset[2] = &(data (0,0,1)) - &(data (0,0,0));
149 for (std::size_t dim = 0; dim < 3; ++dim)
155#if OPENMP_LEGACY_CONST_DATA_SHARING_RULE
156#pragma omp parallel for \
158 shared(current_buffer, current_data, dim, offset) \
159 num_threads(threads_)
161#pragma omp parallel for \
163 shared(current_buffer, current_data, dim, offset, small_depth, small_height, small_width) \
164 num_threads(threads_)
168 std::size_t x =
static_cast<std::size_t
> (i % (
small_width - 2) + 1);
169 std::size_t y =
static_cast<std::size_t
> (i / (
small_width - 2) + 1);
170 const long int off = offset[dim];
185 for (std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> >::iterator d = data.begin (); d != data.end (); ++d)
186 *d /= ((*d)[0] != 0) ? (*d)[1] : 1;
188#pragma omp parallel for \
190 shared(base_min, data, output) \
191 num_threads(threads_)
194 std::size_t x =
static_cast<std::size_t
> (i % input_->width);
195 std::size_t y =
static_cast<std::size_t
> (i / input_->width);
197 const Eigen::Vector2f
D = data.trilinear_interpolation (
static_cast<float> (x) / sigma_s_ +
padding_xy,
198 static_cast<float> (y) / sigma_s_ +
padding_xy,
205#pragma omp parallel for \
207 shared(base_min, data, output) \
208 num_threads(threads_)
211 std::size_t x =
static_cast<std::size_t
> (i % input_->width);
212 std::size_t y =
static_cast<std::size_t
> (i / input_->width);
214 const Eigen::Vector2f
D = data.trilinear_interpolation (
static_cast<float> (x) / sigma_s_ +
padding_xy,
215 static_cast<float> (y) / sigma_s_ +
padding_xy,
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.