40 #include <pcl/keypoints/keypoint.h> 41 #include <pcl/common/intensity.h> 53 template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT = pcl::Normal>
57 using Ptr = shared_ptr<TrajkovicKeypoint3D<PointInT, PointOutT, NormalT> >;
58 using ConstPtr = shared_ptr<const TrajkovicKeypoint3D<PointInT, PointOutT, NormalT> >;
82 float first_threshold = 0.00046,
83 float second_threshold = 0.03589)
85 , window_size_ (window_size)
86 , first_threshold_ (first_threshold)
87 , second_threshold_ (second_threshold)
90 name_ =
"TrajkovicKeypoint3D";
166 getNormalOrNull (
int i,
int j,
int& counter)
const 169 if (!
isFinite ((*normals_) (i,j)))
return (null);
171 return ((*normals_) (i,j));
177 double nx = a.normal_x;
double ny = a.normal_y;
double nz = a.normal_z;
178 double mx = b.normal_x;
double my = b.normal_y;
double mz = b.normal_z;
179 return (static_cast<float> (1.0 - (nx*mx + ny*my + nz*mz)));
185 float diff = normalsDiff (a,b);
186 return (diff * diff);
192 greaterCornernessAtIndices (
int a,
int b)
const 201 int half_window_size_;
203 float first_threshold_;
205 float second_threshold_;
207 unsigned int threads_;
215 #include <pcl/keypoints/impl/trajkovic_3d.hpp> A point structure representing normal coordinates and the surface curvature estimate.
shared_ptr< const TrajkovicKeypoint3D< PointInT, PointOutT, NormalT > > ConstPtr
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
bool isFinite(const PointT &pt)
Tests if the 3D components of a point are all finite param[in] pt point to be tested return true if f...
shared_ptr< PointCloud< NormalT > > Ptr
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
TrajkovicKeypoint3D(ComputationMethod method=FOUR_CORNERS, int window_size=3, float first_threshold=0.00046, float second_threshold=0.03589)
Constructor.
float getFirstThreshold() const
void setMethod(ComputationMethod method)
set the method of the response to be calculated.
typename Keypoint< PointInT, PointOutT >::PointCloudIn PointCloudIn
float getSecondThreshold() const
std::string name_
The key point detection method's name.
typename Normals::Ptr NormalsPtr
TrajkovicKeypoint3D implements Trajkovic and Hedley corner detector on point cloud using geometric in...
void setNormals(const NormalsConstPtr &normals)
Set normals if precalculated normals are available.
bool initCompute() override
Keypoint represents the base class for key points.
typename Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
shared_ptr< TrajkovicKeypoint3D< PointInT, PointOutT, NormalT > > Ptr
void detectKeypoints(PointCloudOut &output) override
typename Normals::ConstPtr NormalsConstPtr
typename PointCloudIn::ConstPtr PointCloudInConstPtr
void setWindowSize(int window_size)
Set window size.
shared_ptr< const PointCloud< NormalT > > ConstPtr
void setFirstThreshold(float threshold)
set the first_threshold to reject corners in the simple cornerness computation stage.
ComputationMethod getMethod() const
void setSecondThreshold(float threshold)
set the second threshold to reject corners in the final cornerness computation stage.
int getWindowSize() const
unsigned int getNumberOfThreads() const