38 #ifndef PCL_TRAJKOVIC_KEYPOINT_3D_H_ 39 #define PCL_TRAJKOVIC_KEYPOINT_3D_H_ 41 #include <pcl/keypoints/keypoint.h> 42 #include <pcl/common/intensity.h> 54 template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT = pcl::Normal>
58 typedef boost::shared_ptr<TrajkovicKeypoint3D<PointInT, PointOutT, NormalT> >
Ptr;
59 typedef boost::shared_ptr<const TrajkovicKeypoint3D<PointInT, PointOutT, NormalT> >
ConstPtr;
83 float first_threshold = 0.00046,
84 float second_threshold = 0.03589)
86 , window_size_ (window_size)
87 , first_threshold_ (first_threshold)
88 , second_threshold_ (second_threshold)
91 name_ =
"TrajkovicKeypoint3D";
98 setMethod (ComputationMethod method) { method_ = method; }
101 inline ComputationMethod
138 setNormals (
const NormalsConstPtr &normals) { normals_ = normals; }
142 getNormals (
const NormalsConstPtr &normals)
const {
return (normals_); }
167 getNormalOrNull (
int i,
int j,
int& counter)
const 170 if (!
isFinite ((*normals_) (i,j)))
return (null);
172 return ((*normals_) (i,j));
178 double nx = a.normal_x;
double ny = a.normal_y;
double nz = a.normal_z;
179 double mx = b.normal_x;
double my = b.normal_y;
double mz = b.normal_z;
180 return (static_cast<float> (1.0 - (nx*mx + ny*my + nz*mz)));
186 float diff = normalsDiff (a,b);
187 return (diff * diff);
193 greaterCornernessAtIndices (
int a,
int b)
const 198 ComputationMethod method_;
202 int half_window_size_;
204 float first_threshold_;
206 float second_threshold_;
208 unsigned int threads_;
210 NormalsConstPtr normals_;
216 #include <pcl/keypoints/impl/trajkovic_3d.hpp> 218 #endif // #ifndef PCL_TRAJKOVIC_KEYPOINT_3D_H_ A point structure representing normal coordinates and the surface curvature estimate.
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
boost::shared_ptr< TrajkovicKeypoint3D< PointInT, PointOutT, NormalT > > Ptr
bool isFinite(const PointT &pt)
Tests if the 3D components of a point are all finite param[in] pt point to be tested.
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
int getWindowSize() const
std::string name_
The key point detection method's name.
TrajkovicKeypoint3D(ComputationMethod method=FOUR_CORNERS, int window_size=3, float first_threshold=0.00046, float second_threshold=0.03589)
Constructor.
void setMethod(ComputationMethod method)
set the method of the response to be calculated.
ComputationMethod getMethod() const
PointCloudIn::ConstPtr PointCloudInConstPtr
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.
boost::shared_ptr< PointCloud< NormalT > > Ptr
Keypoint represents the base class for key points.
boost::shared_ptr< const TrajkovicKeypoint3D< PointInT, PointOutT, NormalT > > ConstPtr
float getFirstThreshold() const
Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
Normals::ConstPtr NormalsConstPtr
boost::shared_ptr< const PointCloud< PointInT > > ConstPtr
pcl::PointCloud< NormalT > Normals
Keypoint< PointInT, PointOutT >::PointCloudIn PointCloudIn
void setWindowSize(int window_size)
Set window size.
void setFirstThreshold(float threshold)
set the first_threshold to reject corners in the simple cornerness computation stage.
unsigned int getNumberOfThreads() const
void detectKeypoints(PointCloudOut &output)
Abstract key point detection method.
float getSecondThreshold() const
void setSecondThreshold(float threshold)
set the second threshold to reject corners in the final cornerness computation stage.
void getNormals(const NormalsConstPtr &normals) const