41#ifndef PCL_INTEGRAL_IMAGE2D_IMPL_H_
42#define PCL_INTEGRAL_IMAGE2D_IMPL_H_
48template <
typename DataType,
unsigned Dimension>
void
55template <
typename DataType,
unsigned Dimension>
void
58 if ((width + 1) * (height + 1) > first_order_integral_image_.size () )
62 first_order_integral_image_.resize ( (width_ + 1) * (height_ + 1) );
63 finite_values_integral_image_.resize ( (width_ + 1) * (height_ + 1) );
64 if (compute_second_order_integral_images_)
65 second_order_integral_image_.resize ( (width_ + 1) * (height_ + 1) );
73 unsigned start_x,
unsigned start_y,
unsigned width,
unsigned height)
const
87 unsigned start_x,
unsigned start_y,
unsigned width,
unsigned height)
const
99template <
typename DataType,
unsigned Dimension>
unsigned
101 unsigned start_x,
unsigned start_y,
unsigned width,
unsigned height)
const
141template <
typename DataType,
unsigned Dimension>
unsigned
155template <
typename DataType,
unsigned Dimension>
void
167 if (!compute_second_order_integral_images_)
179 const InputType* element =
reinterpret_cast <const InputType*
> (&data [
valIdx]);
180 if (std::isfinite (element->sum ()))
209 const InputType* element =
reinterpret_cast <const InputType*
> (&data [
valIdx]);
210 if (std::isfinite (element->sum ()))
224template <
typename DataType>
void
227 if ((width + 1) * (height + 1) > first_order_integral_image_.size () )
231 first_order_integral_image_.resize ( (width_ + 1) * (height_ + 1) );
232 finite_values_integral_image_.resize ( (width_ + 1) * (height_ + 1) );
233 if (compute_second_order_integral_images_)
234 second_order_integral_image_.resize ( (width_ + 1) * (height_ + 1) );
242 unsigned start_x,
unsigned start_y,
unsigned width,
unsigned height)
const
256 unsigned start_x,
unsigned start_y,
unsigned width,
unsigned height)
const
268template <
typename DataType>
unsigned
270 unsigned start_x,
unsigned start_y,
unsigned width,
unsigned height)
const
310template <
typename DataType>
unsigned
324template <
typename DataType>
void
328 ElementType*
previous_row = &first_order_integral_image_[0];
336 if (!compute_second_order_integral_images_)
348 if (std::isfinite (data [
valIdx]))
375 if (std::isfinite (data[
valIdx]))
Iterator class for point clouds with or without given indices.
ConstCloudIterator(const PointCloud< PointT > &cloud)
Determines an integral image representation for a given organized data array.
void setSecondOrderComputation(bool compute_second_order_integral_images)
sets the computation for second order integral images on or off.
Eigen::Matrix< typename IntegralImageTypeTraits< DataType >::IntegralType, Dimension, 1 > ElementType
ElementType getFirstOrderSumSE(unsigned start_x, unsigned start_y, unsigned end_x, unsigned end_y) const
Compute the first order sum within a given rectangle.
ElementType getFirstOrderSum(unsigned start_x, unsigned start_y, unsigned width, unsigned height) const
Compute the first order sum within a given rectangle.
unsigned getFiniteElementsCount(unsigned start_x, unsigned start_y, unsigned width, unsigned height) const
Compute the number of finite elements within a given rectangle.
Eigen::Matrix< typename IntegralImageTypeTraits< DataType >::IntegralType, second_order_size, 1 > SecondOrderType
void setInput(const DataType *data, unsigned width, unsigned height, unsigned element_stride, unsigned row_stride)
Set the input data to compute the integral image for.
SecondOrderType getSecondOrderSumSE(unsigned start_x, unsigned start_y, unsigned end_x, unsigned end_y) const
Compute the second order sum within a given rectangle.
SecondOrderType getSecondOrderSum(unsigned start_x, unsigned start_y, unsigned width, unsigned height) const
Compute the second order sum within a given rectangle.
unsigned getFiniteElementsCountSE(unsigned start_x, unsigned start_y, unsigned end_x, unsigned end_y) const
Compute the number of finite elements within a given rectangle.