/usr/include/pcl-1.7/pcl/keypoints/susan.h is in libpcl-dev 1.7.2-14build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | /*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2010-2011, Willow Garage, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/
#ifndef PCL_SUSAN_KEYPOINT_H_
#define PCL_SUSAN_KEYPOINT_H_
#include <pcl/keypoints/keypoint.h>
#include <pcl/common/intensity.h>
namespace pcl
{
/** \brief SUSANKeypoint implements a RGB-D extension of the SUSAN detector inluding normal
* directions variation in top of intensity variation.
* It is different from Harris in that it exploits normals directly so it is faster.
* Original paper "SUSAN — A New Approach to Low Level Image Processing", Smith,
* Stephen M. and Brady, J. Michael
*
* \author Nizar Sallem
* \ingroup keypoints
*/
template <typename PointInT, typename PointOutT, typename NormalT = pcl::Normal, typename IntensityT= pcl::common::IntensityFieldAccessor<PointInT> >
class SUSANKeypoint : public Keypoint<PointInT, PointOutT>
{
public:
typedef boost::shared_ptr<SUSANKeypoint<PointInT, PointOutT, NormalT, IntensityT> > Ptr;
typedef boost::shared_ptr<const SUSANKeypoint<PointInT, PointOutT, NormalT, Intensity> > ConstPtr;
typedef typename Keypoint<PointInT, PointOutT>::PointCloudIn PointCloudIn;
typedef typename Keypoint<PointInT, PointOutT>::PointCloudOut PointCloudOut;
typedef typename Keypoint<PointInT, PointOutT>::KdTree KdTree;
typedef typename PointCloudIn::ConstPtr PointCloudInConstPtr;
typedef typename pcl::PointCloud<NormalT> PointCloudN;
typedef typename PointCloudN::Ptr PointCloudNPtr;
typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
using Keypoint<PointInT, PointOutT>::name_;
using Keypoint<PointInT, PointOutT>::input_;
using Keypoint<PointInT, PointOutT>::indices_;
using Keypoint<PointInT, PointOutT>::surface_;
using Keypoint<PointInT, PointOutT>::tree_;
using Keypoint<PointInT, PointOutT>::k_;
using Keypoint<PointInT, PointOutT>::search_radius_;
using Keypoint<PointInT, PointOutT>::search_parameter_;
using Keypoint<PointInT, PointOutT>::keypoints_indices_;
using Keypoint<PointInT, PointOutT>::initCompute;
/** \brief Constructor
* \param[in] radius the radius for normal estimation as well as for non maxima suppression
* \param[in] distance_threshold to test if the nucleus is far enough from the centroid
* \param[in] angular_threshold to test if normals are parallel
* \param[in] intensity_threshold to test if points are of same color
*/
SUSANKeypoint (float radius = 0.01f,
float distance_threshold = 0.001f,
float angular_threshold = 0.0001f,
float intensity_threshold = 7.0f)
: distance_threshold_ (distance_threshold)
, angular_threshold_ (angular_threshold)
, intensity_threshold_ (intensity_threshold)
, normals_ (new pcl::PointCloud<NormalT>)
, threads_ (0)
, label_idx_ (-1)
, out_fields_ ()
{
name_ = "SUSANKeypoint";
search_radius_ = radius;
geometric_validation_ = false;
tolerance_ = 2 * distance_threshold_;
}
/** \brief Empty destructor */
virtual ~SUSANKeypoint () {}
/** \brief set the radius for normal estimation and non maxima supression.
* \param[in] radius
*/
void
setRadius (float radius);
void
setDistanceThreshold (float distance_threshold);
/** \brief set the angular_threshold value for detecting corners. Normals are considered as
* parallel if 1 - angular_threshold <= (Ni.Nj) <= 1
* \param[in] angular_threshold
*/
void
setAngularThreshold (float angular_threshold);
/** \brief set the intensity_threshold value for detecting corners.
* \param[in] intensity_threshold
*/
void
setIntensityThreshold (float intensity_threshold);
/**
* \brief set normals if precalculated normals are available.
* \param normals
*/
void
setNormals (const PointCloudNConstPtr &normals);
virtual void
setSearchSurface (const PointCloudInConstPtr &cloud);
/** \brief Initialize the scheduler and set the number of threads to use.
* \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
*/
void
setNumberOfThreads (unsigned int nr_threads);
/** \brief Apply non maxima suppression to the responses to keep strongest corners.
* \note in SUSAN points with less response or stronger corners
*/
void
setNonMaxSupression (bool nonmax);
/** \brief Filetr false positive using geometric criteria.
* The nucleus and the centroid should at least distance_threshold_ from each other AND all the
* points belonging to the USAN must be within the segment [nucleus centroid].
* \param[in] validate
*/
void
setGeometricValidation (bool validate);
protected:
bool
initCompute ();
void
detectKeypoints (PointCloudOut &output);
/** \brief return true if a point lies within the line between the nucleus and the centroid
* \param[in] nucleus coordinate of the nucleus
* \param[in] centroid of the SUSAN
* \param[in] nc to centroid vector (used to speed up since it is constant for a given
* neighborhood)
* \param[in] point the query point to test against
* \return true if the point lies within [nucleus centroid]
*/
bool
isWithinNucleusCentroid (const Eigen::Vector3f& nucleus,
const Eigen::Vector3f& centroid,
const Eigen::Vector3f& nc,
const PointInT& point) const;
private:
float distance_threshold_;
float angular_threshold_;
float intensity_threshold_;
float tolerance_;
PointCloudNConstPtr normals_;
unsigned int threads_;
bool geometric_validation_;
bool nonmax_;
/// intensity field accessor
IntensityT intensity_;
/** \brief Set to a value different than -1 if the output cloud has a "label" field and we have
* to save the keypoints indices.
*/
int label_idx_;
/** \brief The list of fields present in the output point cloud data. */
std::vector<pcl::PCLPointField> out_fields_;
pcl::common::IntensityFieldAccessor<PointOutT> intensity_out_;
};
}
#include <pcl/keypoints/impl/susan.hpp>
#endif // #ifndef PCL_SUSAN_KEYPOINT_H_
|