ndt_matcher_d2d_feature.h
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2010, AASS Research Center, Orebro University.
00005  *  All rights reserved.
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *   * Redistributions of source code must retain the above copyright
00012  *     notice, this list of conditions and the following disclaimer.
00013  *   * Redistributions in binary form must reproduce the above
00014  *     copyright notice, this list of conditions and the following
00015  *     disclaimer in the documentation and/or other materials provided
00016  *     with the distribution.
00017  *   * Neither the name of AASS Research Center nor the names of its
00018  *     contributors may be used to endorse or promote products derived
00019  *     from this software without specific prior written permission.
00020  *
00021  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00028  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00031  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00032  *  POSSIBILITY OF SUCH DAMAGE.
00033  *
00034  */
00035 #ifndef NDTMATCHERFEATUREF2F_HH
00036 #define NDTMATCHERFEATUREF2F_HH
00037 
00038 #include <ndt_registration/ndt_matcher_d2d.h>
00039 namespace lslgeneric
00040 {
00044 class NDTMatcherFeatureD2D : public lslgeneric::NDTMatcherD2D
00045 {
00046 public:
00047     NDTMatcherFeatureD2D(const std::vector<std::pair<int, int> > &corr, double trimFactor = 1.) : _corr(corr), _trimFactor(trimFactor)
00048     {
00049         _goodCorr.resize(corr.size());
00050         std::fill(_goodCorr.begin(), _goodCorr.end(), true);
00051     }
00052 
00071     bool covariance( lslgeneric::NDTMap& target,
00072                      lslgeneric::NDTMap& source,
00073                      Eigen::Transform<double,3,Eigen::Affine,Eigen::ColMajor>& T,
00074                      Eigen::Matrix<double,6,6> &cov
00075                    );
00076 
00077     //compute the score of a point cloud to an NDT
00078     virtual double scoreNDT(std::vector<lslgeneric::NDTCell*> &source,
00079                             lslgeneric::NDTMap &target,
00080                             Eigen::Transform<double,3,Eigen::Affine,Eigen::ColMajor>& T);
00081 
00082     //compute the score gradient & hessian of a point cloud + transformation to an NDT
00083     // input: moving, fixed, tr, computeHessian
00084     //output: score_gradient, Hessian
00085     virtual double derivativesNDT(
00086             const std::vector<NDTCell*> &sourceNDT,
00087             const NDTMap &targetNDT,
00088             Eigen::MatrixXd &score_gradient,
00089             Eigen::MatrixXd &Hessian,
00090             bool computeHessian
00091     );
00092 #if 0
00093     virtual bool update_gradient_hessian(
00094         Eigen::Matrix<double,6,1> &score_gradient,
00095         Eigen::Matrix<double,6,6> &Hessian,
00096 
00097         Eigen::Vector3d &m1,
00098         Eigen::Matrix3d &C1);
00099 #endif
00100 
00101     using NDTMatcherD2D::Jest;
00102     using NDTMatcherD2D::Hest;
00103     using NDTMatcherD2D::Zest;
00104     using NDTMatcherD2D::ZHest;
00105     using NDTMatcherD2D::lfd1;
00106     using NDTMatcherD2D::lfd2;
00107     using NDTMatcherD2D::normalizeAngle;
00108     using NDTMatcherD2D::NUMBER_OF_ACTIVE_CELLS;
00109 protected:
00110     const std::vector<std::pair<int, int> > & _corr;
00111     double _trimFactor;
00112     std::vector<bool> _goodCorr;
00113 };
00114 } // namespace
00115 
00116 
00117 #endif


ndt_registration
Author(s): Todor Stoyanov, Jari Saarinen, Henrik Andreasson
autogenerated on Wed Aug 26 2015 15:24:52