38#ifndef PCL_SUSAN_IMPL_HPP_
39#define PCL_SUSAN_IMPL_HPP_
41#include <pcl/common/io.h>
42#include <pcl/keypoints/susan.h>
43#include <pcl/features/normal_3d.h>
44#include <pcl/features/integral_image_normal.h>
47template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
void
54template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
void
57 geometric_validation_ = validate;
61template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
void
64 search_radius_ = radius;
68template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
void
75template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
void
82template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
void
89template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
void
96template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
void
104template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
void
215template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
bool
220 PCL_ERROR (
"[pcl::%s::initCompute] init failed!\n", name_.c_str ());
224 if (normals_->empty ())
227 normals->reserve (normals->size ());
228 if (!surface_->isOrganized ())
245 if (normals_->size () != surface_->size ())
247 PCL_ERROR (
"[pcl::%s::initCompute] normals given, but the number of normals does not match the number of input points!\n", name_.c_str ());
255template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
bool
257 const Eigen::Vector3f& centroid,
258 const Eigen::Vector3f&
nc,
261 Eigen::Vector3f
pc = centroid - point.getVector3fMap ();
262 Eigen::Vector3f
pn =
nucleus - point.getVector3fMap ();
303template <
typename Po
intInT,
typename Po
intOutT,
typename NormalT,
typename IntensityT>
void
307 response->reserve (surface_->size ());
327 Eigen::Vector3f centroid = Eigen::Vector3f::Zero ();
332 if ((index !=
point_index) && std::isfinite ((*normals_)[index].normal_x))
335 if ((std::abs (
nucleus_intensity - intensity_ ((*input_)[index])) <= intensity_threshold_) ||
339 centroid += (*input_)[index].getVector3fMap ();
340 usan.push_back (index);
349 if (!geometric_validation_)
356 if (label_idx_ != -1)
359 std::uint32_t label =
static_cast<std::uint32_t
> (
point_index);
360 memcpy (
reinterpret_cast<char*
> (&
point_out) + out_fields_[label_idx_].offset,
361 &label,
sizeof (std::uint32_t));
370 if (
dist.norm () >= distance_threshold_)
389 if (label_idx_ != -1)
392 std::uint32_t label =
static_cast<std::uint32_t
> (
point_index);
393 memcpy (
reinterpret_cast<char*
> (&
point_out) + out_fields_[label_idx_].offset,
394 &label,
sizeof (std::uint32_t));
403 response->height = 1;
404 response->width = response->size ();
409 for (std::size_t i = 0; i < response->size (); ++i)
410 keypoints_indices_->indices.push_back (i);
412 output.is_dense = input_->is_dense;
417 output.reserve (response->size());
424 const float intensity = intensity_out_ ((*response)[idx]);
434 if (intensity > intensity_out_ ((*response)[
nn_index]))
442 output.push_back ((*response)[idx]);
443 keypoints_indices_->indices.push_back (idx);
453#define PCL_INSTANTIATE_SUSAN(T,U,N) template class PCL_EXPORTS pcl::SUSANKeypoint<T,U,N>;
Iterator class for point clouds with or without given indices.
ConstCloudIterator(const PointCloud< PointT > &cloud)
std::size_t size() const
Size of the range the iterator is going through.
Surface normal estimation on organized data using integral images.
Keypoint represents the base class for key points.
shared_ptr< PointCloud< PointT > > Ptr
void setIntensityThreshold(float intensity_threshold)
set the intensity_threshold value for detecting corners.
void setGeometricValidation(bool validate)
Filetr false positive using geometric criteria.
bool isWithinNucleusCentroid(const Eigen::Vector3f &nucleus, const Eigen::Vector3f ¢roid, const Eigen::Vector3f &nc, const PointInT &point) const
return true if a point lies within the line between the nucleus and the centroid
void setRadius(float radius)
set the radius for normal estimation and non maxima supression.
void setNonMaxSupression(bool nonmax)
Apply non maxima suppression to the responses to keep strongest corners.
typename PointCloudN::Ptr PointCloudNPtr
typename PointCloudIn::ConstPtr PointCloudInConstPtr
void detectKeypoints(PointCloudOut &output) override
void setDistanceThreshold(float distance_threshold)
void setSearchSurface(const PointCloudInConstPtr &cloud) override
bool initCompute() override
typename PointCloudN::ConstPtr PointCloudNConstPtr
typename Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
void setNumberOfThreads(unsigned int nr_threads)
Initialize the scheduler and set the number of threads to use.
void setAngularThreshold(float angular_threshold)
set the angular_threshold value for detecting corners.
void setNormals(const PointCloudNConstPtr &normals)
set normals if precalculated normals are available.
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...
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
A point structure representing normal coordinates and the surface curvature estimate.