Point Cloud Library (PCL)
1.10.1
|
47 #include <pcl/for_each_type.h>
57 template <
typename Po
intT>
105 bool is_valid =
true;
109 const float* temp = reinterpret_cast<const float*>(&p);
113 if (!std::isfinite (temp[i]))
127 if (!std::isfinite (temp[i]))
142 template <
typename OutputType>
void
155 out[i] = temp[i] *
alpha_[i];
177 template <
typename Po
intDefault>
210 const float* ptr = reinterpret_cast<const float*> (&p);
219 template <
typename Po
intDefault>
226 struct IncrementFunctor
228 IncrementFunctor (
int &n) : n_ (n)
233 template<
typename Key>
inline void operator () ()
242 struct NdCopyPointFunctor
246 NdCopyPointFunctor (
const PointDefault &p1,
float * p2)
247 : p1_ (reinterpret_cast<const Pod&>(p1)), p2_ (p2), f_idx_ (0) { }
249 template<
typename Key>
inline void operator() ()
257 template <
typename Key,
typename FieldT,
int NrDims>
260 static void copyPoint (
const Pod &p1,
float * p2,
int &f_idx)
262 const std::uint8_t * data_ptr = reinterpret_cast<const std::uint8_t *> (&p1) +
264 p2[f_idx++] = *reinterpret_cast<const FieldT*> (data_ptr);
268 template <
typename Key,
typename FieldT,
int NrDims>
269 struct Helper<Key, FieldT[NrDims], NrDims>
271 static void copyPoint (
const Pod &p1,
float * p2,
int &f_idx)
273 const std::uint8_t * data_ptr = reinterpret_cast<const std::uint8_t *> (&p1) +
275 int nr_dims = NrDims;
276 const FieldT * array = reinterpret_cast<const FieldT *> (data_ptr);
277 for (
int i = 0; i < nr_dims; ++i)
279 p2[f_idx++] = array[i];
299 pcl::for_each_type <FieldList> (IncrementFunctor (
nr_dimensions_));
311 pcl::for_each_type <FieldList> (NdCopyPointFunctor (p, out));
531 template <
typename Po
intDefault>
569 const float *ptr = (reinterpret_cast<const float*> (&p)) +
start_dim_;
Defines all the PCL and non-PCL macros used.
DefaultPointRepresentation()
A point structure representing the Point Feature Histogram (PFH).
This file defines compatibility wrappers for low level I/O functions.
CustomPointRepresentation(const int max_dim=3, const int start_dim=0)
Constructor.
DefaultPointRepresentation()
~DefaultPointRepresentation()
void copyToFloatArray(const PointXYZ &p, float *out) const override
Copy point data from input point to a float array.
A point structure representing the Normal Based Signature for a feature matrix of 4-by-3.
typename pcl::traits::fieldList< PFHSignature125 >::type FieldList
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape descriptor.
int getNumberOfDimensions() const
Return the number of dimensions in the point's vector representation.
void vectorize(const PointT &p, OutputType &out) const
Convert input point into a vector representation, rescaling by alpha.
DefaultPointRepresentation extends PointRepresentation to define default behavior for common point ty...
A point structure representing the Fast Point Feature Histogram (FPFH).
shared_ptr< const PointRepresentation< Narf * > > ConstPtr
bool isTrivial() const
Returns whether this point representation is trivial.
CustomPointRepresentation extends PointRepresentation to allow for sub-part selection on the point.
virtual bool isValid(const PointT &p) const
Verify that the input point is valid.
DefaultPointRepresentation()
DefaultFeatureRepresentation()
shared_ptr< const DefaultPointRepresentation< PointDefault > > ConstPtr
void copyToFloatArray(const PointNormal &p, float *out) const override
Copy point data from input point to a float array.
A point structure representing Euclidean xyz coordinates, and the RGB color.
void copyToFloatArray(const ShapeContext1980 &p, float *out) const override
Copy point data from input point to a float array.
A point structure representing a Unique Shape Context.
A point structure representing a Shape Context.
DefaultPointRepresentation()
DefaulFeatureRepresentation extends PointRepresentation and is intended to be used when defining the ...
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descr...
void copyToFloatArray(const SHOT1344 &p, float *out) const override
Copy point data from input point to a float array.
static void copyPoint(const Pod &p1, float *p2, int &f_idx)
int max_dim_
Use at most this many dimensions (i.e.
void copyToFloatArray(const Narf36 &p, float *out) const override
Copy point data from input point to a float array.
void copyToFloatArray(const PointXYZI &p, float *out) const override
Copy point data from input point to a float array.
shared_ptr< CustomPointRepresentation< PointDefault > > Ptr
A point structure representing Euclidean xyz coordinates.
PointRepresentation provides a set of methods for converting a point structs/object into an n-dimensi...
A point structure for storing the Point Pair Feature (PPF) values.
DefaultPointRepresentation()
shared_ptr< DefaultPointRepresentation< PointDefault > > Ptr
shared_ptr< DefaultFeatureRepresentation< PointDefault > > Ptr
static void copyPoint(const Pod &p1, float *p2, int &f_idx)
A point structure representing the Point Feature Histogram with colors (PFHRGB).
bool trivial_
Indicates whether this point representation is trivial.
std::vector< float > alpha_
A vector containing the rescale factor to apply to each dimension.
int start_dim_
Use dimensions only starting with this one (i.e.
A point structure representing Euclidean xyz coordinates, together with normal coordinates and the su...
DefaultPointRepresentation()
DefaultPointRepresentation()
void copyToFloatArray(const SHOT352 &p, float *out) const override
Copy point data from input point to a float array.
A point structure representing the Narf descriptor.
DefaultPointRepresentation()
virtual ~PointRepresentation()=default
Empty destructor.
int nr_dimensions_
The number of dimensions in this point's vector (i.e.
virtual void copyToFloatArray(const PointDefault &p, float *out) const
Copy the point data into a float array.
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descr...
DefaultPointRepresentation()
shared_ptr< PointRepresentation< Narf * > > Ptr
void copyToFloatArray(const PPFSignature &p, float *out) const override
Copy point data from input point to a float array.
void setRescaleValues(const float *rescale_array)
Set the rescale values to use when vectorizing points.
A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape+col...
DefaultPointRepresentation()
A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape onl...
shared_ptr< const CustomPointRepresentation< PointDefault > > ConstPtr
void copyToFloatArray(const UniqueShapeContext1960 &p, float *out) const override
Copy point data from input point to a float array.
void copyToFloatArray(const PointDefault &p, float *out) const override
Copy point data from input point to a float array.
virtual void copyToFloatArray(const PointT &p, float *out) const =0
Copy point data from input point to a float array.
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
A point structure representing the Viewpoint Feature Histogram (VFH).
void copyToFloatArray(const PointDefault &p, float *out) const override
Copy point data from input point to a float array.