#ifndef PCL_TRACKING_IMPL_COHERENCE_H_ #define PCL_TRACKING_IMPL_COHERENCE_H_ #include #include namespace pcl { namespace tracking { template double PointCoherence::compute(PointInT& source, PointInT& target) { return computeCoherence(source, target); } template double PointCloudCoherence::calcPointCoherence(PointInT& source, PointInT& target) { double val = 0.0; for (std::size_t i = 0; i < point_coherences_.size(); i++) { PointCoherencePtr coherence = point_coherences_[i]; double d = std::log(coherence->compute(source, target)); // double d = coherence->compute (source, target); if (!std::isnan(d)) val += d; else PCL_WARN("nan!\n"); } return val; } template bool PointCloudCoherence::initCompute() { if (!target_input_ || target_input_->points.empty()) { PCL_ERROR("[pcl::%s::compute] target_input_ is empty!\n", getClassName().c_str()); return false; } return true; } template void PointCloudCoherence::compute(const PointCloudInConstPtr& cloud, const IndicesConstPtr& indices, float& w) { if (!initCompute()) { PCL_ERROR("[pcl::%s::compute] Init failed.\n", getClassName().c_str()); return; } computeCoherence(cloud, indices, w); } } // namespace tracking } // namespace pcl #endif