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)
89 name_ =
"TrajkovicKeypoint3D";
165 getNormalOrNull (
int i,
int j,
int& counter)
const
168 if (!
isFinite ((*normals_) (i,j)))
return (
null);
170 return ((*normals_) (i,j));
176 double nx = a.normal_x;
double ny = a.normal_y;
double nz = a.normal_z;
177 double mx = b.normal_x;
double my = b.normal_y;
double mz = b.normal_z;
178 return (
static_cast<float> (1.0 - (nx*mx + ny*my + nz*mz)));
184 float diff = normalsDiff (a,b);
185 return (diff * diff);
191 greaterCornernessAtIndices (
int a,
int b)
const
200 int half_window_size_;
202 float first_threshold_;
204 float second_threshold_;
206 unsigned int threads_{1};
214 #include <pcl/keypoints/impl/trajkovic_3d.hpp>
Keypoint represents the base class for key points.
std::string name_
The key point detection method's name.
shared_ptr< PointCloud< NormalT > > Ptr
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
shared_ptr< const PointCloud< NormalT > > ConstPtr
TrajkovicKeypoint3D implements Trajkovic and Hedley corner detector on point cloud using geometric in...
typename Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
shared_ptr< TrajkovicKeypoint3D< PointInT, PointOutT, NormalT > > Ptr
typename Keypoint< PointInT, PointOutT >::PointCloudIn PointCloudIn
void setFirstThreshold(float threshold)
set the first_threshold to reject corners in the simple cornerness computation stage.
bool initCompute() override
typename Normals::ConstPtr NormalsConstPtr
unsigned int getNumberOfThreads() const
ComputationMethod getMethod() const
void setMethod(ComputationMethod method)
set the method of the response to be calculated.
void detectKeypoints(PointCloudOut &output) override
typename PointCloudIn::ConstPtr PointCloudInConstPtr
void setWindowSize(int window_size)
Set window size.
float getSecondThreshold() const
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
int getWindowSize() const
float getFirstThreshold() const
shared_ptr< const TrajkovicKeypoint3D< PointInT, PointOutT, NormalT > > ConstPtr
void setNormals(const NormalsConstPtr &normals)
Set normals if precalculated normals are available.
TrajkovicKeypoint3D(ComputationMethod method=FOUR_CORNERS, int window_size=3, float first_threshold=0.00046, float second_threshold=0.03589)
Constructor.
void setSecondThreshold(float threshold)
set the second threshold to reject corners in the final cornerness computation stage.
typename Normals::Ptr NormalsPtr
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...
A point structure representing normal coordinates and the surface curvature estimate.