Point Cloud Library (PCL)  1.7.0
/tmp/buildd/pcl-1.7-1.7.0/tracking/include/pcl/tracking/normal_coherence.h
00001 #ifndef PCL_TRACKING_NORMAL_COHERENCE_H_
00002 #define PCL_TRACKING_NORMAL_COHERENCE_H_
00003 
00004 #include <pcl/tracking/coherence.h>
00005 namespace pcl
00006 {
00007   namespace tracking
00008   {
00009     /** \brief @b NormalCoherence computes coherence between two points from the angle
00010         between their normals. the coherence is calculated by 1 / (1 + weight * theta^2 ).
00011       * \author Ryohei Ueda
00012       * \ingroup tracking
00013       */
00014     template <typename PointInT>
00015     class NormalCoherence: public PointCoherence<PointInT>
00016     {
00017     public:
00018 
00019       /** \brief initialize the weight to 1.0. */
00020       NormalCoherence ()
00021       : PointCoherence<PointInT> ()
00022       , weight_ (1.0)
00023         {}
00024 
00025       /** \brief set the weight of coherence
00026         * \param weight the weight of coherence
00027         */
00028       inline void setWeight (double weight) { weight_ = weight; }
00029 
00030       /** \brief get the weight of coherence */
00031       inline double getWeight () { return weight_; }
00032 
00033     protected:
00034 
00035       /** \brief return the normal coherence between the two points.
00036         * \param source instance of source point.
00037         * \param target instance of target point.
00038         */
00039       double computeCoherence (PointInT &source, PointInT &target);
00040 
00041       /** \brief the weight of coherence */
00042       double weight_;
00043       
00044     };
00045   }
00046 }
00047 
00048 // #include <pcl/tracking/impl/normal_coherence.hpp>
00049 #ifdef PCL_NO_PRECOMPILE
00050 #include <pcl/tracking/impl/normal_coherence.hpp>
00051 #endif
00052 
00053 #endif