41 #include <pcl/memory.h>
42 #include <pcl/pcl_macros.h>
43 #include <pcl/point_cloud.h>
44 #include <pcl/point_representation.h>
54 #define NARF_DEFAULT_SURFACE_PATCH_PIXEL_SIZE 10
78 const Narf& operator=(
const Narf& other);
86 extractFromRangeImageAndAddToList (
const RangeImage& range_image,
const Eigen::Vector3f& interest_point,
int descriptor_size,
87 float support_size,
bool rotation_invariant, std::vector<Narf*>& feature_list);
90 extractFromRangeImageAndAddToList (
const RangeImage& range_image,
float image_x,
float image_y,
int descriptor_size,
91 float support_size,
bool rotation_invariant, std::vector<Narf*>& feature_list);
95 int descriptor_size,
float support_size,
bool rotation_invariant, std::vector<Narf*>& feature_list);
98 extractForEveryRangeImagePointAndAddToList (
const RangeImage& range_image,
int descriptor_size,
float support_size,
99 bool rotation_invariant, std::vector<Narf*>& feature_list);
108 extractFromRangeImage (
const RangeImage& range_image,
const Eigen::Affine3f& pose,
int descriptor_size,
float support_size,
109 int surface_patch_world_size=NARF_DEFAULT_SURFACE_PATCH_PIXEL_SIZE);
113 extractFromRangeImage (
const RangeImage& range_image,
float x,
float y,
int descriptor_size,
float support_size);
117 extractFromRangeImage (
const RangeImage& range_image,
const InterestPoint& interest_point,
int descriptor_size,
float support_size);
121 extractFromRangeImage (
const RangeImage& range_image,
const Eigen::Vector3f& interest_point,
int descriptor_size,
float support_size);
126 extractFromRangeImageWithBestRotation (
const RangeImage& range_image,
const Eigen::Vector3f& interest_point,
127 int descriptor_size,
float support_size);
134 getRotations (std::vector<float>& rotations, std::vector<float>& strengths)
const;
143 getRotatedVersions (
const RangeImage& range_image,
const std::vector<float>& rotations, std::vector<Narf*>& features)
const;
147 getDescriptorDistance (
const Narf& other)
const;
151 getNoOfBeamPoints ()
const {
return (static_cast<int> (pcl_lrint (std::ceil (0.5f *
float (surface_patch_pixel_size_))))); }
155 copyToNarf36 (
Narf36& narf36)
const;
159 saveBinary (
const std::string& filename)
const;
173 extractDescriptor (
int descriptor_size);
189 inline const Eigen::Vector3f&
192 inline Eigen::Vector3f&
195 inline const Eigen::Affine3f&
198 inline Eigen::Affine3f&
226 freeSurfacePatch () {
delete[] surface_patch_; surface_patch_=
nullptr; surface_patch_pixel_size_=0; }
247 std::copy(descriptor, descriptor + this->nr_dimensions_, out);
258 deepCopy (
const Narf& other);
261 getBlurredSurfacePatch (
int new_pixel_size,
int blur_radius)
const;
265 saveHeader (std::ostream& file)
const;
268 loadHeader (std::istream& file)
const;
271 static const std::string
275 const static int VERSION = 1;
280 float* surface_patch_{
nullptr};
281 int surface_patch_pixel_size_{0};
282 float surface_patch_world_size_{0.0f};
283 float surface_patch_rotation_{0.0f};
284 float* descriptor_{
nullptr};
285 int descriptor_size_{0};
292 #undef NARF_DEFAULT_SURFACE_PATCH_PIXEL_SIZE
296 #include <pcl/features/impl/narf.hpp>
const float * getSurfacePatch() const
Getter (const) for the surface patch.
Eigen::Affine3f & getTransformation()
Getter for the 6DoF pose.
float & getSurfacePatchRotation()
Getter for the rotation of the surface patch.
void loadBinary(Eigen::MatrixBase< Derived > const &matrix, std::istream &file)
Read a matrix from an input stream.
int getNoOfBeamPoints() const
How many points on each beam of the gradient star are used to calculate the descriptor?
Eigen::Affine3f transformation_
RangeImage is derived from pcl/PointCloud and provides functionalities with focus on situations where...
const Eigen::Affine3f & getTransformation() const
Getter (const) for the 6DoF pose.
const float & getSurfacePatchWorldSize() const
Getter (const) for the world size of the surface patch.
int & getDescriptorSize()
Getter for the descriptor length.
int & getSurfacePatchPixelSize()
Getter for the pixel size of the surface patch (only one dimension)
const int & getSurfacePatchPixelSize() const
Getter (const) for the pixel size of the surface patch (only one dimension)
void copyToFloatArray(const PointT &p, float *out) const override
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
void saveBinary(const Eigen::MatrixBase< Derived > &matrix, std::ostream &file)
Write a matrix to an output stream.
PointRepresentation provides a set of methods for converting a point structs/object into an n-dimensi...
static const std::string getHeaderKeyword()
FeaturePointRepresentation(int nr_dimensions)
A point structure representing an interest point with Euclidean xyz coordinates, and an interest valu...
const Eigen::Vector3f & getPosition() const
Getter (const) for the position.
NARF (Normal Aligned Radial Features) is a point feature descriptor type for 3D data.
Eigen::Vector3f position_
const int & getDescriptorSize() const
Getter (const) for the descriptor length.
void setSurfacePatch(float *surface_patch)
Setter for the surface patch.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
float & getSurfacePatchWorldSize()
Getter for the world size of the surface patch.
const float * getDescriptor() const
Getter (const) for the descriptor.
static int max_no_of_threads
The maximum number of openmp threads that can be used in this class.
const float & getSurfacePatchRotation() const
Getter (const) for the rotation of the surface patch.
float * getSurfacePatch()
Getter for the surface patch.
void setDescriptor(float *descriptor)
Setter for the descriptor.
A point structure representing the Narf descriptor.
Eigen::Vector3f & getPosition()
Getter for the position.
void freeSurfacePatch()
Method to erase the surface patch and free the memory.
float * getDescriptor()
Getter for the descriptor.