49 template <
typename DataType>
80 using Type =
unsigned short;
87 using Type =
unsigned char;
108 template <
class DataType,
unsigned Dimension>
112 using Ptr = shared_ptr<IntegralImage2D<DataType, Dimension>>;
113 using ConstPtr = shared_ptr<const IntegralImage2D<DataType, Dimension>>;
115 using ElementType = Eigen::Matrix<typename IntegralImageTypeTraits<DataType>::IntegralType, Dimension, 1>;
122 first_order_integral_image_ (),
123 second_order_integral_image_ (),
125 compute_second_order_integral_images_ (compute_second_order_integral_images)
148 unsigned width,
unsigned height,
unsigned element_stride,
unsigned row_stride);
157 getFirstOrderSum (
unsigned start_x,
unsigned start_y,
unsigned width,
unsigned height)
const;
166 getFirstOrderSumSE (
unsigned start_x,
unsigned start_y,
unsigned end_x,
unsigned end_y)
const;
175 getSecondOrderSum (
unsigned start_x,
unsigned start_y,
unsigned width,
unsigned height)
const;
184 getSecondOrderSumSE (
unsigned start_x,
unsigned start_y,
unsigned end_x,
unsigned end_y)
const;
205 using InputType = Eigen::Matrix<typename IntegralImageTypeTraits<DataType>::Type, Dimension, 1>;
213 computeIntegralImages (
const DataType * data,
unsigned row_stride,
unsigned element_stride);
215 std::vector<ElementType, Eigen::aligned_allocator<ElementType> > first_order_integral_image_;
216 std::vector<SecondOrderType, Eigen::aligned_allocator<SecondOrderType> > second_order_integral_image_;
217 std::vector<unsigned> finite_values_integral_image_;
225 bool compute_second_order_integral_images_;
231 template <
class DataType>
235 using Ptr = shared_ptr<IntegralImage2D<DataType, 1>>;
236 using ConstPtr = shared_ptr<const IntegralImage2D<DataType, 1>>;
246 first_order_integral_image_ (),
247 second_order_integral_image_ (),
250 compute_second_order_integral_images_ (compute_second_order_integral_images)
267 unsigned width,
unsigned height,
unsigned element_stride,
unsigned row_stride);
276 getFirstOrderSum (
unsigned start_x,
unsigned start_y,
unsigned width,
unsigned height)
const;
285 getFirstOrderSumSE (
unsigned start_x,
unsigned start_y,
unsigned end_x,
unsigned end_y)
const;
294 getSecondOrderSum (
unsigned start_x,
unsigned start_y,
unsigned width,
unsigned height)
const;
303 getSecondOrderSumSE (
unsigned start_x,
unsigned start_y,
unsigned end_x,
unsigned end_y)
const;
332 computeIntegralImages (
const DataType * data,
unsigned row_stride,
unsigned element_stride);
334 std::vector<ElementType, Eigen::aligned_allocator<ElementType> > first_order_integral_image_;
335 std::vector<SecondOrderType, Eigen::aligned_allocator<SecondOrderType> > second_order_integral_image_;
336 std::vector<unsigned> finite_values_integral_image_;
344 bool compute_second_order_integral_images_;
348 #include <pcl/features/impl/integral_image2D.hpp>
typename IntegralImageTypeTraits< DataType >::IntegralType SecondOrderType
shared_ptr< IntegralImage2D< DataType, 1 > > Ptr
virtual ~IntegralImage2D()=default
Destructor.
IntegralImage2D(bool compute_second_order_integral_images)
Constructor for an Integral Image.
typename IntegralImageTypeTraits< DataType >::IntegralType ElementType
shared_ptr< const IntegralImage2D< DataType, 1 > > ConstPtr
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.
static const unsigned second_order_size
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.
virtual ~IntegralImage2D()=default
Destructor.
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.
IntegralImage2D(bool compute_second_order_integral_images)
Constructor for an Integral Image.
shared_ptr< IntegralImage2D< DataType, Dimension > > Ptr
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.
shared_ptr< const IntegralImage2D< DataType, Dimension > > ConstPtr
Defines functions, macros and traits for allocating and using memory.
unsigned int IntegralType
unsigned long IntegralType
unsigned long IntegralType