coherence.hpp
Go to the documentation of this file.
00001 #ifndef PCL_TRACKING_IMPL_COHERENCE_H_
00002 #define PCL_TRACKING_IMPL_COHERENCE_H_
00003 
00004 namespace pcl
00005 {
00006   namespace tracking
00007   {
00008     
00009     template <typename PointInT> double
00010     PointCoherence<PointInT>::compute (PointInT &source, PointInT &target)
00011     {
00012       return computeCoherence (source, target);
00013     }
00014 
00015     template <typename PointInT> double
00016     PointCloudCoherence<PointInT>::calcPointCoherence (PointInT &source, PointInT &target)
00017     {
00018       double val = 0.0;
00019       for (size_t i = 0; i < point_coherences_.size (); i++)
00020       {
00021         PointCoherencePtr coherence = point_coherences_[i];
00022         double d = log(coherence->compute (source, target));
00023         //double d = coherence->compute (source, target);
00024         if (! pcl_isnan(d))
00025           val += d;
00026         else
00027           PCL_WARN ("nan!\n");
00028       }
00029       return val;
00030     }
00031     
00032     template <typename PointInT> bool
00033     PointCloudCoherence<PointInT>::initCompute ()
00034     {
00035       if (!target_input_ || target_input_->points.empty ())
00036       {
00037         PCL_ERROR ("[pcl::%s::compute] target_input_ is empty!\n", getClassName ().c_str ());
00038         return false;
00039       }
00040 
00041       return true;
00042       
00043     }
00044     
00045     template <typename PointInT> void
00046     PointCloudCoherence<PointInT>::compute (const PointCloudInConstPtr &cloud, const IndicesConstPtr &indices, float &w)
00047     {
00048       if (!initCompute ())
00049       {
00050         PCL_ERROR ("[pcl::%s::compute] Init failed.\n", getClassName ().c_str ());
00051         return;
00052       }
00053       computeCoherence (cloud, indices, w);
00054     }
00055   }
00056 }
00057 
00058 #endif


pcl
Author(s): Open Perception
autogenerated on Mon Oct 6 2014 03:14:41