43 #include <pcl/point_cloud.h>
44 #include <pcl/point_representation.h>
54 #define NARF_DEFAULT_SURFACE_PATCH_PIXEL_SIZE 10
87 float support_size,
bool rotation_invariant, std::vector<Narf*>& feature_list);
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);
99 bool rotation_invariant, std::vector<Narf*>& feature_list);
109 int surface_patch_world_size=NARF_DEFAULT_SURFACE_PATCH_PIXEL_SIZE);
127 int descriptor_size,
float support_size);
134 getRotations (std::vector<float>& rotations, std::vector<float>& strengths)
const;
147 getDescriptorDistance (
const Narf& other)
const;
155 copyToNarf36 (
Narf36& narf36)
const;
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);
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>
NARF (Normal Aligned Radial Features) is a point feature descriptor type for 3D data.
const float & getSurfacePatchRotation() const
Getter (const) for the rotation of the surface patch.
const float * getSurfacePatch() const
Getter (const) for the surface patch.
float & getSurfacePatchRotation()
Getter for the rotation of the surface patch.
int & getDescriptorSize()
Getter for the descriptor length.
static int max_no_of_threads
The maximum number of openmp threads that can be used in this class.
bool extractFromRangeImage(const RangeImage &range_image, const InterestPoint &interest_point, int descriptor_size, float support_size)
Same as above.
void setSurfacePatch(float *surface_patch)
Setter for the surface patch.
const int & getDescriptorSize() const
Getter (const) for the descriptor length.
static void extractFromRangeImageAndAddToList(const RangeImage &range_image, const Eigen::Vector3f &interest_point, int descriptor_size, float support_size, bool rotation_invariant, std::vector< Narf * > &feature_list)
Add features extracted at the given interest point and add them to the list.
Narf(const Narf &other)
Copy Constructor.
const Narf & operator=(const Narf &other)
Assignment operator.
void freeSurfacePatch()
Method to erase the surface patch and free the memory.
const Eigen::Affine3f & getTransformation() const
Getter (const) for the 6DoF pose.
int loadHeader(std::istream &file) const
Read header from input stream.
void saveBinary(std::ostream &file) const
Write to output stream.
static const std::string getHeaderKeyword()
void getRotatedVersions(const RangeImage &range_image, const std::vector< float > &rotations, std::vector< Narf * > &features) const
const int & getSurfacePatchPixelSize() const
Getter (const) for the pixel size of the surface patch (only one dimension)
bool extractFromRangeImage(const RangeImage &range_image, float x, float y, int descriptor_size, float support_size)
Same as above, but determines the transformation from the surface in the range image.
float & getSurfacePatchWorldSize()
Getter for the world size of the surface patch.
Eigen::Affine3f & getTransformation()
Getter for the 6DoF pose.
float * getSurfacePatch()
Getter for the surface patch.
int getNoOfBeamPoints() const
How many points on each beam of the gradient star are used to calculate the descriptor?
const float * getDescriptor() const
Getter (const) for the descriptor.
float * getBlurredSurfacePatch(int new_pixel_size, int blur_radius) const
Get the surface patch with a blur on it.
int & getSurfacePatchPixelSize()
Getter for the pixel size of the surface patch (only one dimension)
bool extractFromRangeImage(const RangeImage &range_image, const Eigen::Affine3f &pose, int descriptor_size, float support_size, int surface_patch_world_size=NARF_DEFAULT_SURFACE_PATCH_PIXEL_SIZE)
Method to extract a NARF feature from a certain 3D point using a range image.
void saveHeader(std::ostream &file) const
Write header to output stream.
void loadBinary(const std::string &filename)
Read from file.
void saveBinary(const std::string &filename) const
Write to file.
Eigen::Affine3f transformation_
const float & getSurfacePatchWorldSize() const
Getter (const) for the world size of the surface patch.
float * getDescriptor()
Getter for the descriptor.
bool extractFromRangeImageWithBestRotation(const RangeImage &range_image, const Eigen::Vector3f &interest_point, int descriptor_size, float support_size)
Same as above, but using the rotational invariant version by choosing the best extracted rotation aro...
void reset()
Reset al members to default values and free allocated memory.
static void extractFromRangeImageAndAddToList(const RangeImage &range_image, float image_x, float image_y, int descriptor_size, float support_size, bool rotation_invariant, std::vector< Narf * > &feature_list)
Same as above.
bool extractDescriptor(int descriptor_size)
Create the descriptor from the already set other members.
static void extractForEveryRangeImagePointAndAddToList(const RangeImage &range_image, int descriptor_size, float support_size, bool rotation_invariant, std::vector< Narf * > &feature_list)
Extract an NARF for every point in the range image.
const Eigen::Vector3f & getPosition() const
Getter (const) for the position.
void loadBinary(std::istream &file)
Read from input stream.
Eigen::Vector3f & getPosition()
Getter for the position.
static void extractForInterestPoints(const RangeImage &range_image, const PointCloud< InterestPoint > &interest_points, int descriptor_size, float support_size, bool rotation_invariant, std::vector< Narf * > &feature_list)
Get a list of features from the given interest points.
bool extractFromRangeImage(const RangeImage &range_image, const Eigen::Vector3f &interest_point, int descriptor_size, float support_size)
Same as above.
void getRotations(std::vector< float > &rotations, std::vector< float > &strengths) const
void deepCopy(const Narf &other)
Create a deep copy of other.
Eigen::Vector3f position_
void setDescriptor(float *descriptor)
Setter for the descriptor.
PointCloud represents the base class in PCL for storing collections of 3D points.
PointRepresentation provides a set of methods for converting a point structs/object into an n-dimensi...
RangeImage is derived from pcl/PointCloud and provides functionalities with focus on situations where...
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Defines functions, macros and traits for allocating and using memory.
Defines all the PCL and non-PCL macros used.
A point structure representing an interest point with Euclidean xyz coordinates, and an interest valu...
A point structure representing the Narf descriptor.
~FeaturePointRepresentation() override=default
Empty destructor.
void copyToFloatArray(const PointT &p, float *out) const override
FeaturePointRepresentation(int nr_dimensions)