Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 4bc66056a634db26a1f4d0845dc41ca6 > files > 494

mrpt-doc-0.9.5-0.1.20110925svn2670.fc16.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>CFeature.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<div align="left"><a href="http://www.mrpt.org/">Main MRPT website</a> &gt; <b>C++ reference</b> </div>
<div align="right">
<a href="index.html"><img border="0" src="mrpt_logo.png" alt="MRPT logo"></a>
</div>
<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
          <div class="left">
            <form id="FSearchBox" action="search.php" method="get">
              <img id="MSearchSelect" src="search/mag.png" alt=""/>
              <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" 
                     onfocus="searchBox.OnSearchFieldFocus(true)" 
                     onblur="searchBox.OnSearchFieldFocus(false)"/>
            </form>
          </div><div class="right"></div>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">CFeature.h</div>  </div>
</div>
<div class="contents">
<a href="_c_feature_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* +---------------------------------------------------------------------------+</span>
<a name="l00002"></a>00002 <span class="comment">   |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |</span>
<a name="l00003"></a>00003 <span class="comment">   |                                                                           |</span>
<a name="l00004"></a>00004 <span class="comment">   |                       http://www.mrpt.org/                                |</span>
<a name="l00005"></a>00005 <span class="comment">   |                                                                           |</span>
<a name="l00006"></a>00006 <span class="comment">   |   Copyright (C) 2005-2011  University of Malaga                           |</span>
<a name="l00007"></a>00007 <span class="comment">   |                                                                           |</span>
<a name="l00008"></a>00008 <span class="comment">   |    This software was written by the Machine Perception and Intelligent    |</span>
<a name="l00009"></a>00009 <span class="comment">   |      Robotics Lab, University of Malaga (Spain).                          |</span>
<a name="l00010"></a>00010 <span class="comment">   |    Contact: Jose-Luis Blanco  &lt;jlblanco@ctima.uma.es&gt;                     |</span>
<a name="l00011"></a>00011 <span class="comment">   |                                                                           |</span>
<a name="l00012"></a>00012 <span class="comment">   |  This file is part of the MRPT project.                                   |</span>
<a name="l00013"></a>00013 <span class="comment">   |                                                                           |</span>
<a name="l00014"></a>00014 <span class="comment">   |     MRPT is free software: you can redistribute it and/or modify          |</span>
<a name="l00015"></a>00015 <span class="comment">   |     it under the terms of the GNU General Public License as published by  |</span>
<a name="l00016"></a>00016 <span class="comment">   |     the Free Software Foundation, either version 3 of the License, or     |</span>
<a name="l00017"></a>00017 <span class="comment">   |     (at your option) any later version.                                   |</span>
<a name="l00018"></a>00018 <span class="comment">   |                                                                           |</span>
<a name="l00019"></a>00019 <span class="comment">   |   MRPT is distributed in the hope that it will be useful,                 |</span>
<a name="l00020"></a>00020 <span class="comment">   |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |</span>
<a name="l00021"></a>00021 <span class="comment">   |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |</span>
<a name="l00022"></a>00022 <span class="comment">   |     GNU General Public License for more details.                          |</span>
<a name="l00023"></a>00023 <span class="comment">   |                                                                           |</span>
<a name="l00024"></a>00024 <span class="comment">   |     You should have received a copy of the GNU General Public License     |</span>
<a name="l00025"></a>00025 <span class="comment">   |     along with MRPT.  If not, see &lt;http://www.gnu.org/licenses/&gt;.         |</span>
<a name="l00026"></a>00026 <span class="comment">   |                                                                           |</span>
<a name="l00027"></a>00027 <span class="comment">   +---------------------------------------------------------------------------+ */</span>
<a name="l00028"></a>00028 <span class="preprocessor">#ifndef CFeature_H</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define CFeature_H</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;<a class="code" href="_c_image_8h.html">mrpt/utils/CImage.h</a>&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="stl__extensions_8h.html">mrpt/utils/stl_extensions.h</a>&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="_c_matrix_8h.html">mrpt/math/CMatrix.h</a>&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="ops__matrices_8h.html" title="This file implements miscelaneous matrix and matrix/vector operations, plus internal functions in mrp...">mrpt/math/ops_matrices.h</a>&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="_k_d_tree_capable_8h.html">mrpt/math/KDTreeCapable.h</a>&gt;</span>
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;<a class="code" href="vision_2include_2mrpt_2vision_2types_8h.html">mrpt/vision/types.h</a>&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;<a class="code" href="vision_2include_2mrpt_2vision_2link__pragmas_8h.html">mrpt/vision/link_pragmas.h</a>&gt;</span>
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <span class="keyword">namespace </span>mrpt
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042         <span class="keyword">namespace </span>vision
<a name="l00043"></a>00043         {
<a name="l00044"></a>00044                 <span class="keyword">using namespace </span>mrpt::utils;
<a name="l00045"></a>00045                 <span class="keyword">using namespace </span>mrpt::math;
<a name="l00046"></a>00046                 <span class="keyword">using namespace </span>std;
<a name="l00047"></a>00047 
<a name="l00048"></a>00048                 <span class="keyword">class </span>CFeatureList;
<a name="l00049"></a>00049                 <span class="keyword">class </span>CMatchedFeatureList;
<a name="l00050"></a>00050 
<a name="l00051"></a><a class="code" href="namespacemrpt_1_1vision.html#a134cb9579c5bea92ba1cb60857b9cd88">00051</a>                 <span class="keyword">enum</span> <a class="code" href="namespacemrpt_1_1vision.html#a134cb9579c5bea92ba1cb60857b9cd88">TListIdx</a>
<a name="l00052"></a>00052                 {
<a name="l00053"></a><a class="code" href="namespacemrpt_1_1vision.html#a134cb9579c5bea92ba1cb60857b9cd88a74f7dc03bf5edb3db74e4fccbb7ce091">00053</a>                     <a class="code" href="namespacemrpt_1_1vision.html#a134cb9579c5bea92ba1cb60857b9cd88a74f7dc03bf5edb3db74e4fccbb7ce091">firstList</a> = 0,
<a name="l00054"></a><a class="code" href="namespacemrpt_1_1vision.html#a134cb9579c5bea92ba1cb60857b9cd88a9646f2ebe6beefc0aa5e699908f1c7e6">00054</a>                     <a class="code" href="namespacemrpt_1_1vision.html#a134cb9579c5bea92ba1cb60857b9cd88a9646f2ebe6beefc0aa5e699908f1c7e6">secondList</a>,
<a name="l00055"></a><a class="code" href="namespacemrpt_1_1vision.html#a134cb9579c5bea92ba1cb60857b9cd88a02d29ffec6b775a2cc22dff008970e9c">00055</a>                     <a class="code" href="namespacemrpt_1_1vision.html#a134cb9579c5bea92ba1cb60857b9cd88a02d29ffec6b775a2cc22dff008970e9c">bothLists</a>
<a name="l00056"></a>00056                 };
<a name="l00057"></a>00057 <span class="comment"></span>
<a name="l00058"></a>00058 <span class="comment">                /** \defgroup mrptvision_features Feature detection, tracking, descriptors and matching </span>
<a name="l00059"></a>00059 <span class="comment">                  * \ingroup mrpt_vision_grp</span>
<a name="l00060"></a>00060 <span class="comment">                  */</span>
<a name="l00061"></a>00061 <span class="comment"></span>
<a name="l00062"></a>00062 <span class="comment">                /** \addtogroup  mrptvision_features</span>
<a name="l00063"></a>00063 <span class="comment">                    @{ */</span>
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 
<a name="l00066"></a>00066                 <span class="comment">/****************************************************</span>
<a name="l00067"></a>00067 <span class="comment">                                                Class CFEATURE</span>
<a name="l00068"></a>00068 <span class="comment">                *****************************************************/</span>
<a name="l00069"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_ptr.html#a5826e8727db74348abc9e5df29995570">00069</a>                 <a class="code" href="_c_serializable_8h.html#a9ef523d787f6cb837a0585b790882588" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE</a>( <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html" title="A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...">CFeature</a>, <a class="code" href="classmrpt_1_1utils_1_1_c_serializable.html" title="The virtual base class which provides a unified interface for all persistent objects in MRPT...">mrpt::utils::CSerializable</a>, <a class="code" href="vision_2include_2mrpt_2vision_2link__pragmas_8h.html#aa4a17fb846aac61f4e57b17b6f784559">VISION_IMPEXP</a> )
<a name="l00070"></a>00070 
<a name="l00071"></a>00071                 <span class="comment">/** A generic 2D feature from an image, extracted with \a CFeatureExtraction</span>
<a name="l00072"></a>00072 <span class="comment">                  * Each feature may have one or more descriptors (see \a descriptors), in addition to an image patch.</span>
<a name="l00073"></a>00073 <span class="comment">                  * The (Euclidean) distance between descriptors in a pair of features can be computed with  descriptorDistanceTo,</span>
<a name="l00074"></a>00074 <span class="comment">                  *  while the similarity of the patches is given by patchCorrelationTo.</span>
<a name="l00075"></a>00075 <span class="comment">                  *</span>
<a name="l00076"></a>00076 <span class="comment">                  *  \sa CFeatureList, TSimpleFeature, TSimpleFeatureList</span>
<a name="l00077"></a>00077 <span class="comment">                  */</span>
<a name="l00078"></a>00078                 class <a class="code" href="vision_2include_2mrpt_2vision_2link__pragmas_8h.html#aa4a17fb846aac61f4e57b17b6f784559">VISION_IMPEXP</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html" title="A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...">CFeature</a> : public mrpt::utils::<a class="code" href="classmrpt_1_1utils_1_1_c_serializable.html" title="The virtual base class which provides a unified interface for all persistent objects in MRPT...">CSerializable</a>
<a name="l00079"></a>00079                 {
<a name="l00080"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a521f5cedd5e4d98289b2cfe5f0d8205c">00080</a>                         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html" title="A list of visual features, to be used as output by detectors, as input/output by trackers, etc.">CFeatureList</a>;
<a name="l00081"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a90961e6253ca0296ff545fa3f24e93ff">00081</a>                         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html" title="A list of features.">CMatchedFeatureList</a>;
<a name="l00082"></a>00082 
<a name="l00083"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a09faf4f457e1a0b4409d5d5ae91141fc">00083</a>                         <a class="code" href="_c_serializable_8h.html#a72ab55bf7ae009c89b75715cfa21e84d" title="This declaration must be inserted in all CSerializable classes definition, within the class declarati...">DEFINE_SERIALIZABLE</a>( <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html" title="A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...">CFeature</a> )
<a name="l00084"></a>00084 
<a name="l00085"></a>00085                 public:
<a name="l00086"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a34d51f0ab1403fad111966fea0a189bb">00086</a>                         <span class="keywordtype">float</span>                           x,<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>;                    <span class="comment">//!&lt; Coordinates in the image</span>
<a name="l00087"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#ae8262ee5f1d1efee77a149bf92b10857">00087</a> <span class="comment"></span>                        <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a>                      ID;                             <span class="comment">//!&lt; ID of the feature</span>
<a name="l00088"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a545ebf109fad4aa3f089c1756273ba39">00088</a> <span class="comment"></span>                        <a class="code" href="classmrpt_1_1utils_1_1_c_image.html" title="A class for storing images as grayscale or RGB bitmaps.">CImage</a>                          patch;                  <span class="comment">//!&lt; A patch of the image surrounding the feature</span>
<a name="l00089"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#af6e767426f8ef7725728ea83568db1c0">00089</a> <span class="comment"></span>                        uint16_t                        patchSize;              <span class="comment">//!&lt; Size of the patch (patchSize x patchSize) (it must be an odd number)</span>
<a name="l00090"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a17e54b7e3c647e0b6bd1769f394e1aff">00090</a> <span class="comment"></span>                        <a class="code" href="group__mrpt__vision__grp.html#ga3a5b54ab814bafc8bb108e37bbee4e19" title="Types of features - This means that the point has been detected with this algorithm, which is independent of additional descriptors a feature may also have.">TFeatureType</a>            type;                   <span class="comment">//!&lt; Type of the feature: featNotDefined, featSIFT, featKLT,    featHarris, featSURF, featBeacon</span>
<a name="l00091"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#af26ec678d14ebe951cafce7f5b39f68f">00091</a> <span class="comment"></span>                        <a class="code" href="group__mrpt__vision__grp.html#ga0437f34e59ac06cddc3a490e2605bb71">TFeatureTrackStatus</a>     track_status;   <span class="comment">//!&lt; Status of the feature tracking process (old name: KLT_status)</span>
<a name="l00092"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a30a046641495c6130125bc0df13cb656">00092</a> <span class="comment"></span>                        <span class="keywordtype">float</span>                           response;               <span class="comment">//!&lt; A measure of the &quot;goodness&quot; of the feature (old name: KLT_val)</span>
<a name="l00093"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#adb8b4bebf2422e7eb9788c913b13fb3b">00093</a> <span class="comment"></span>                        <span class="keywordtype">float</span>                           orientation;    <span class="comment">//!&lt; Main orientation of the feature</span>
<a name="l00094"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a615b5c2a81711780cf4369b4327b08d8">00094</a> <span class="comment"></span>                        <span class="keywordtype">float</span>                           scale;                  <span class="comment">//!&lt; Feature scale into the scale space</span>
<a name="l00095"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#aabe958650b22716faaae030b0a0e85fa">00095</a> <span class="comment"></span>                        uint8_t                         user_flags;             <span class="comment">//!&lt; A field for any other flags needed by the user (this has not a predefined meaning)</span>
<a name="l00096"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#aa7bde20667ca29510bfcbf3927fe0d84">00096</a> <span class="comment"></span>                        uint16_t            nTimesSeen;     <span class="comment">//!&lt; Number of frames it has been seen in a sequence of images.</span>
<a name="l00097"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a9239cf1b0f348eb39b35ea2484dce54b">00097</a> <span class="comment"></span>                        uint16_t            nTimesNotSeen;  <span class="comment">//!&lt; Number of frames it has not been seen in a sequence of images.</span>
<a name="l00098"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#acc28dd774bd05e2fa9561f0a23359409">00098</a> <span class="comment"></span>                        uint16_t            nTimesLastSeen; <span class="comment">//!&lt; Number of frames since it was seen for the last time.</span>
<a name="l00099"></a>00099 <span class="comment"></span>
<a name="l00100"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#af82dad9cbeed15cfc2bbca9b08b0b6e0">00100</a>             <span class="keywordtype">double</span>                          depth;              <span class="comment">//!&lt; The estimated depth in 3D of this feature wrt the camera in the current frame</span>
<a name="l00101"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a541c454fe08c7add9a60f17bd2ed9bf6">00101</a> <span class="comment"></span>            <span class="keywordtype">double</span>                          initialDepth;       <span class="comment">//!&lt; The estimated depth in 3D of this feature wrt the camera that took its image</span>
<a name="l00102"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a37197c69996589ebeb19c9152b2225d8">00102</a> <span class="comment"></span>            <a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a>                        p3D;                <span class="comment">//!&lt; The estimated 3D point of this feature wrt its camera</span>
<a name="l00103"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a9b77ed9364f6801aa274b06f85da3803">00103</a> <span class="comment"></span>            <a class="code" href="classstd_1_1deque.html" title="STL class.">deque</a>&lt;<span class="keywordtype">double</span>&gt;                   multiScales;        <span class="comment">//!&lt; A set of scales where the multi-resolution descriptor has been computed</span>
<a name="l00104"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#a80b73e2eb9ace233890b75c9753efb83">00104</a> <span class="comment"></span>            <a class="code" href="classstd_1_1deque.html" title="STL class.">deque</a>&lt;<a class="code" href="classstd_1_1vector.html" title="STL class.">vector</a>&lt;<span class="keywordtype">double</span>&gt; &gt;          multiOrientations;  <span class="comment">//!&lt; A vector of main orientations (there is a vector of orientations for each scale)</span>
<a name="l00105"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#ac674ae699d575cad99c3b2cdfd96adaf">00105</a> <span class="comment"></span>            <a class="code" href="classstd_1_1deque.html" title="STL class.">deque</a>&lt;<a class="code" href="classstd_1_1vector.html" title="STL class.">vector</a>&lt;<a class="code" href="classstd_1_1vector.html" title="STL class.">vector</a>&lt;int32_t&gt; &gt; &gt;    multiHashCoeffs;    <span class="comment">//!&lt; A set of vectors containing the coefficients for a HASH table of descriptors</span>
<a name="l00106"></a>00106 <span class="comment"></span>                        <span class="keywordtype">bool</span> isPointFeature() const;                            <span class="comment">//!&lt; Return false only for Blob detectors (SIFT, SURF)</span>
<a name="l00107"></a>00107 <span class="comment"></span><span class="comment"></span>
<a name="l00108"></a>00108 <span class="comment">                        /** All the possible descriptors this feature may have */</span>
<a name="l00109"></a>00109                         struct <a class="code" href="vision_2include_2mrpt_2vision_2link__pragmas_8h.html#aa4a17fb846aac61f4e57b17b6f784559">VISION_IMPEXP</a> <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html" title="All the possible descriptors this feature may have.">TDescriptors</a>
<a name="l00110"></a>00110                         {
<a name="l00111"></a>00111                                 TDescriptors();  <span class="comment">// Initialization</span>
<a name="l00112"></a>00112 
<a name="l00113"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#aa6fe6280408ed643765558463f9ffd7b">00113</a>                                 std<a class="code" href="classstd_1_1vector.html">::vector&lt;uint8_t&gt;</a>            <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#aa6fe6280408ed643765558463f9ffd7b" title="Feature descriptor.">SIFT</a>;                           <span class="comment">//!&lt; Feature descriptor</span>
<a name="l00114"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a706e7b780afdfd7ccc48f675fefcd1e5">00114</a> <span class="comment"></span>                                std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a>                          <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a706e7b780afdfd7ccc48f675fefcd1e5" title="Feature descriptor.">SURF</a>;                               <span class="comment">//!&lt; Feature descriptor</span>
<a name="l00115"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a6e2499b082a8e8a08cb01613c99dc093">00115</a> <span class="comment"></span>                                std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a>                          <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a6e2499b082a8e8a08cb01613c99dc093" title="The 2D histogram as a single row.">SpinImg</a>;                    <span class="comment">//!&lt; The 2D histogram as a single row</span>
<a name="l00116"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a281cb1b27e23ca5f98b048fc07f1a362">00116</a> <span class="comment"></span>                                uint16_t                                            <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a281cb1b27e23ca5f98b048fc07f1a362" title="The number of rows (corresponding to range bins in the 2D histogram) of the original matrix from whic...">SpinImg_range_rows</a>;     <span class="comment">//!&lt; The number of rows (corresponding to range bins in the 2D histogram) of the original matrix from which SpinImg was extracted as a vector.</span>
<a name="l00117"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a35150168816666807208bcc857b92488">00117</a> <span class="comment"></span>                                mrpt<a class="code" href="classmrpt_1_1math_1_1_c_matrix.html" title="This class is a &quot;CSerializable&quot; wrapper for &quot;CMatrixFloat&quot;.">::math::CMatrix</a>                         <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a35150168816666807208bcc857b92488" title="A polar image centered at the interest point.">PolarImg</a>;                   <span class="comment">//!&lt; A polar image centered at the interest point</span>
<a name="l00118"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a863c79ae61394eb9da166a220982aa15">00118</a> <span class="comment"></span>                                mrpt<a class="code" href="classmrpt_1_1math_1_1_c_matrix.html" title="This class is a &quot;CSerializable&quot; wrapper for &quot;CMatrixFloat&quot;.">::math::CMatrix</a>                         <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a863c79ae61394eb9da166a220982aa15" title="A log-polar image centered at the interest point.">LogPolarImg</a>;                <span class="comment">//!&lt; A log-polar image centered at the interest point</span>
<a name="l00119"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a81dbc3e4cb5b8a8eeb4280e1d84c52dd">00119</a> <span class="comment"></span>                                <span class="keywordtype">bool</span>                                                <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a81dbc3e4cb5b8a8eeb4280e1d84c52dd" title="If set to true (manually, default=false) the call to &quot;descriptorDistanceTo&quot; will not consider all the...">polarImgsNoRotation</a>;    <span class="comment">//!&lt; If set to true (manually, default=false) the call to &quot;descriptorDistanceTo&quot; will not consider all the rotations between polar image descriptors (PolarImg, LogPolarImg)</span>
<a name="l00120"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#afe4b8e4b615154611ceb4ca4263be97f">00120</a> <span class="comment"></span>                                <a class="code" href="classstd_1_1deque.html" title="STL class.">deque&lt;vector&lt;vector&lt;int32_t&gt;</a> &gt; &gt;    <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#afe4b8e4b615154611ceb4ca4263be97f" title="A set of SIFT-like descriptors for each orientation and scale of the multiResolution feature (there i...">multiSIFTDescriptors</a>;   <span class="comment">//!&lt; A set of SIFT-like descriptors for each orientation and scale of the multiResolution feature (there is a vector of descriptors for each scale)</span>
<a name="l00121"></a>00121 <span class="comment"></span>
<a name="l00122"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#aa9824d804a805027b808e3ac759d7ba9">00122</a>                                 <span class="keywordtype">bool</span> <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#aa9824d804a805027b808e3ac759d7ba9">hasDescriptorSIFT</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !SIFT.empty(); };                       <span class="comment">//!&lt; Whether this feature has this kind of descriptor</span>
<a name="l00123"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a7b2f75a916c6d14bc0770eb4a341c88b">00123</a> <span class="comment"></span>                                <span class="keywordtype">bool</span> <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a7b2f75a916c6d14bc0770eb4a341c88b" title="Whether this feature has this kind of descriptor.">hasDescriptorSURF</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !SURF.empty(); }                        <span class="comment">//!&lt; Whether this feature has this kind of descriptor</span>
<a name="l00124"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a03c8fc504f026704b519216912caac65">00124</a> <span class="comment"></span>                                <span class="keywordtype">bool</span> <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a03c8fc504f026704b519216912caac65">hasDescriptorSpinImg</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !SpinImg.empty(); };                 <span class="comment">//!&lt; Whether this feature has this kind of descriptor</span>
<a name="l00125"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a29666c99728bc7ebb6609db231d8c172">00125</a> <span class="comment"></span>                                <span class="keywordtype">bool</span> <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a29666c99728bc7ebb6609db231d8c172" title="Whether this feature has this kind of descriptor.">hasDescriptorPolarImg</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> PolarImg.<a class="code" href="class_eigen_1_1_plain_object_base.html#a4f740be94c28777819aecb8d47e3bdb4">rows</a>()!=0; } ;             <span class="comment">//!&lt; Whether this feature has this kind of descriptor</span>
<a name="l00126"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a873b0f67867b8358cad434d7c4e38d38">00126</a> <span class="comment"></span>                                <span class="keywordtype">bool</span> <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#a873b0f67867b8358cad434d7c4e38d38" title="Whether this feature has this kind of descriptor.">hasDescriptorLogPolarImg</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> LogPolarImg.<a class="code" href="class_eigen_1_1_plain_object_base.html#a4f740be94c28777819aecb8d47e3bdb4">rows</a>()!=0; } ;       <span class="comment">//!&lt; Whether this feature has this kind of descriptor</span>
<a name="l00127"></a><a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#ae9c47dc7e188eaafd2dcf770d4c86883">00127</a> <span class="comment"></span>                                <span class="keywordtype">bool</span> <a class="code" href="structmrpt_1_1vision_1_1_c_feature_1_1_t_descriptors.html#ae9c47dc7e188eaafd2dcf770d4c86883" title="Whether this feature has this kind of descriptor.">hasDescriptorMultiSIFT</a>()<span class="keyword"> const </span>{
<a name="l00128"></a>00128                     <span class="keywordflow">return</span> (multiSIFTDescriptors.size() &gt; 0 &amp;&amp; multiSIFTDescriptors[0].size() &gt; 0); <span class="comment">//!&lt; Whether this feature has this kind of descriptor</span>
<a name="l00129"></a>00129 <span class="comment"></span>                }
<a name="l00130"></a>00130                         }
<a name="l00131"></a>00131                         descriptors;
<a name="l00132"></a>00132 <span class="comment"></span>
<a name="l00133"></a>00133 <span class="comment">                        /** Return the first found descriptor, as a matrix.</span>
<a name="l00134"></a>00134 <span class="comment">                          * \return false on error, i.e. there is no valid descriptor.</span>
<a name="l00135"></a>00135 <span class="comment">                          */</span>
<a name="l00136"></a>00136                         <span class="keywordtype">bool</span> getFirstDescriptorAsMatrix(<a class="code" href="classmrpt_1_1math_1_1_c_matrix_template_numeric.html" title="A matrix of dynamic size.">mrpt::math::CMatrixFloat</a> &amp;desc) <span class="keyword">const</span>;
<a name="l00137"></a>00137 <span class="comment"></span>
<a name="l00138"></a>00138 <span class="comment">                        /** Computes the normalized cross-correlation between the patches of this and another feature (normalized in the range [0,1], such as 0=best, 1=worst).</span>
<a name="l00139"></a>00139 <span class="comment">                          *  \note If this or the other features does not have patches or they are of different sizes, an exception will be raised.</span>
<a name="l00140"></a>00140 <span class="comment">                          * \sa descriptorDistanceTo</span>
<a name="l00141"></a>00141 <span class="comment">                          */</span>
<a name="l00142"></a>00142                         <span class="keywordtype">float</span> patchCorrelationTo( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html" title="A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...">CFeature</a> &amp;oFeature) <span class="keyword">const</span>;
<a name="l00143"></a>00143 <span class="comment"></span>
<a name="l00144"></a>00144 <span class="comment">                        /** Computes the Euclidean Distance between this feature&#39;s and other feature&#39;s descriptors, using the given descriptor or the first present one.</span>
<a name="l00145"></a>00145 <span class="comment">                          *  \note If descriptorToUse is not descAny and that descriptor is not present in one of the features, an exception will be raised.</span>
<a name="l00146"></a>00146 <span class="comment">                          * \sa patchCorrelationTo</span>
<a name="l00147"></a>00147 <span class="comment">                          */</span>
<a name="l00148"></a>00148                         <span class="keywordtype">float</span> descriptorDistanceTo( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html" title="A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...">CFeature</a> &amp;oFeature,  <a class="code" href="group__mrpt__vision__grp.html#ga1953f4dfcaf2e07e1049bc0a6bbf53ba" title="The bitwise OR combination of values of TDescriptorType are used in CFeatureExtraction::computeDescri...">TDescriptorType</a> descriptorToUse = <a class="code" href="group__mrpt__vision__grp.html#gga1953f4dfcaf2e07e1049bc0a6bbf53baad98c1e9e6948d609e0a2b639dffc0867" title="Used in some methods to mean &quot;any of the present descriptors&quot;.">descAny</a>, <span class="keywordtype">bool</span> normalize_distances = <span class="keyword">true</span> ) <span class="keyword">const</span>;
<a name="l00149"></a>00149 <span class="comment"></span>
<a name="l00150"></a>00150 <span class="comment">                        /** Computes the Euclidean Distance between &quot;this&quot; and the &quot;other&quot; descriptors */</span>
<a name="l00151"></a>00151                         <span class="keywordtype">float</span> descriptorSIFTDistanceTo( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html" title="A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...">CFeature</a> &amp;oFeature, <span class="keywordtype">bool</span> normalize_distances = <span class="keyword">true</span> ) <span class="keyword">const</span>;
<a name="l00152"></a>00152 <span class="comment"></span>
<a name="l00153"></a>00153 <span class="comment">                        /** Computes the Euclidean Distance between &quot;this&quot; and the &quot;other&quot; descriptors */</span>
<a name="l00154"></a>00154                         <span class="keywordtype">float</span> descriptorSURFDistanceTo( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html" title="A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...">CFeature</a> &amp;oFeature, <span class="keywordtype">bool</span> normalize_distances = <span class="keyword">true</span>  ) <span class="keyword">const</span>;
<a name="l00155"></a>00155 <span class="comment"></span>
<a name="l00156"></a>00156 <span class="comment">                        /** Computes the Euclidean Distance between &quot;this&quot; and the &quot;other&quot; descriptors */</span>
<a name="l00157"></a>00157                         <span class="keywordtype">float</span> descriptorSpinImgDistanceTo( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html" title="A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...">CFeature</a> &amp;oFeature, <span class="keywordtype">bool</span> normalize_distances = <span class="keyword">true</span> ) <span class="keyword">const</span>;
<a name="l00158"></a>00158 <span class="comment"></span>
<a name="l00159"></a>00159 <span class="comment">                        /** Returns the minimum Euclidean Distance between &quot;this&quot; and the &quot;other&quot; polar image descriptor, for the best shift in orientation.</span>
<a name="l00160"></a>00160 <span class="comment">                          * \param oFeature The other feature to compare with.</span>
<a name="l00161"></a>00161 <span class="comment">                          * \param minDistAngle The placeholder for the angle at which the smallest distance is found.</span>
<a name="l00162"></a>00162 <span class="comment">                          * \return The distance for the best orientation (minimum distance).</span>
<a name="l00163"></a>00163 <span class="comment">                          */</span>
<a name="l00164"></a>00164                         <span class="keywordtype">float</span> descriptorPolarImgDistanceTo(
<a name="l00165"></a>00165                                 <span class="keyword">const</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html" title="A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...">CFeature</a> &amp;oFeature,
<a name="l00166"></a>00166                                 <span class="keywordtype">float</span> &amp;minDistAngle,
<a name="l00167"></a>00167                                 <span class="keywordtype">bool</span> normalize_distances = <span class="keyword">true</span> ) <span class="keyword">const</span>;
<a name="l00168"></a>00168 <span class="comment"></span>
<a name="l00169"></a>00169 <span class="comment">                        /** Returns the minimum Euclidean Distance between &quot;this&quot; and the &quot;other&quot; log-polar image descriptor, for the best shift in orientation.</span>
<a name="l00170"></a>00170 <span class="comment">                          * \param oFeature The other feature to compare with.</span>
<a name="l00171"></a>00171 <span class="comment">                          * \param minDistAngle The placeholder for the angle at which the smallest distance is found.</span>
<a name="l00172"></a>00172 <span class="comment">                          * \return The distance for the best orientation (minimum distance).</span>
<a name="l00173"></a>00173 <span class="comment">                          */</span>
<a name="l00174"></a>00174                         <span class="keywordtype">float</span> descriptorLogPolarImgDistanceTo(
<a name="l00175"></a>00175                                 <span class="keyword">const</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html" title="A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...">CFeature</a> &amp;oFeature,
<a name="l00176"></a>00176                                 <span class="keywordtype">float</span> &amp;minDistAngle,
<a name="l00177"></a>00177                                 <span class="keywordtype">bool</span> normalize_distances = <span class="keyword">true</span> ) <span class="keyword">const</span>;
<a name="l00178"></a>00178 <span class="comment"></span>
<a name="l00179"></a>00179 <span class="comment">                        /** Save the feature to a text file in this format:</span>
<a name="l00180"></a>00180 <span class="comment">              *    &quot;%% Dump of mrpt::vision::CFeatureList. Each line format is:\n&quot;</span>
<a name="l00181"></a>00181 <span class="comment">              *    &quot;%% ID TYPE X Y ORIENTATION SCALE TRACK_STATUS RESPONSE HAS_SIFT [SIFT] HAS_SURF [SURF] HAS_MULTI [MULTI]_i&quot;</span>
<a name="l00182"></a>00182 <span class="comment">              *    &quot;%% |---------------------- feature ------------------| |---------------------- descriptors ------------------------|&quot;</span>
<a name="l00183"></a>00183 <span class="comment">              *    &quot;%% with:\n&quot;</span>
<a name="l00184"></a>00184 <span class="comment">              *    &quot;%%  TYPE  : The used detector: 0:KLT, 1: Harris, 2: BCD, 3: SIFT, 4: SURF, 5: Beacon, 6: FAST\n&quot;</span>
<a name="l00185"></a>00185 <span class="comment">              *    &quot;%%  HAS_* : 1 if a descriptor of that type is associated to the feature.&quot;</span>
<a name="l00186"></a>00186 <span class="comment">              *    &quot;%%  SIFT  : Present if HAS_SIFT=1: N DESC_0 ... DESC_N-1&quot;</span>
<a name="l00187"></a>00187 <span class="comment">              *    &quot;%%  SURF  : Present if HAS_SURF=1: N DESC_0 ... DESC_N-1&quot;</span>
<a name="l00188"></a>00188 <span class="comment">              *    &quot;%%  MULTI : Present if HAS_MULTI=1: SCALE ORI N DESC_0 ... DESC_N-1&quot;</span>
<a name="l00189"></a>00189 <span class="comment">              *    &quot;%%-------------------------------------------------------------------------------------------\n&quot;);</span>
<a name="l00190"></a>00190 <span class="comment">                        */</span>
<a name="l00191"></a>00191             <span class="keywordtype">void</span> <a class="code" href="eigen__plugins_8h.html#abea6659e38ab7a50b625ea1a4af3ec72" title="Save matrix to a text file, compatible with MATLAB text format (see also the methods of matrix classe...">saveToTextFile</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;filename, <span class="keywordtype">bool</span> APPEND = <span class="keyword">false</span> );
<a name="l00192"></a>00192 <span class="comment"></span>
<a name="l00193"></a>00193 <span class="comment">                        /** Get the type of the feature</span>
<a name="l00194"></a>00194 <span class="comment">                        */</span>
<a name="l00195"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#ad3b21c3cc4e99c9fe6ea0e44a91844eb">00195</a>                         <a class="code" href="group__mrpt__vision__grp.html#ga3a5b54ab814bafc8bb108e37bbee4e19" title="Types of features - This means that the point has been detected with this algorithm, which is independent of additional descriptors a feature may also have.">TFeatureType</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#ad3b21c3cc4e99c9fe6ea0e44a91844eb" title="Get the type of the feature.">get_type</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> type; }
<a name="l00196"></a>00196 <span class="comment"></span>
<a name="l00197"></a>00197 <span class="comment">                        /** Dump feature information into a text stream */</span>
<a name="l00198"></a>00198                         <span class="keywordtype">void</span> dumpToTextStream( <a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">mrpt::utils::CStream</a> &amp;out) <span class="keyword">const</span>;
<a name="l00199"></a>00199 
<a name="l00200"></a>00200                         <span class="keywordtype">void</span> dumpToConsole() <span class="keyword">const</span>;
<a name="l00201"></a>00201 <span class="comment"></span>
<a name="l00202"></a>00202 <span class="comment">                        /** Constructor</span>
<a name="l00203"></a>00203 <span class="comment">                        */</span>
<a name="l00204"></a>00204                         <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html" title="A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...">CFeature</a>();
<a name="l00205"></a>00205 <span class="comment"></span>
<a name="l00206"></a>00206 <span class="comment">                        /** Virtual destructor */</span>
<a name="l00207"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#ae0e8a9bd8393d5732baea7c182ebe9cc">00207</a>                         <span class="keyword">virtual</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature.html#ae0e8a9bd8393d5732baea7c182ebe9cc" title="Virtual destructor.">~CFeature</a>() {}
<a name="l00208"></a>00208 
<a name="l00209"></a>00209 
<a name="l00210"></a>00210                 <span class="keyword">protected</span>:
<a name="l00211"></a>00211 <span class="comment"></span>
<a name="l00212"></a>00212 <span class="comment">                        /** Internal function used by &quot;descriptorLogPolarImgDistanceTo&quot; and &quot;descriptorPolarImgDistanceTo&quot;</span>
<a name="l00213"></a>00213 <span class="comment">                          */</span>
<a name="l00214"></a>00214                         <span class="keyword">static</span> <span class="keywordtype">float</span> internal_distanceBetweenPolarImages(
<a name="l00215"></a>00215                                 <span class="keyword">const</span> <a class="code" href="classmrpt_1_1math_1_1_c_matrix.html" title="This class is a &quot;CSerializable&quot; wrapper for &quot;CMatrixFloat&quot;.">mrpt::math::CMatrix</a> &amp;desc1,
<a name="l00216"></a>00216                                 <span class="keyword">const</span> <a class="code" href="classmrpt_1_1math_1_1_c_matrix.html" title="This class is a &quot;CSerializable&quot; wrapper for &quot;CMatrixFloat&quot;.">mrpt::math::CMatrix</a> &amp;desc2,
<a name="l00217"></a>00217                                 <span class="keywordtype">float</span> &amp;minDistAngle,
<a name="l00218"></a>00218                                 <span class="keywordtype">bool</span> normalize_distances,
<a name="l00219"></a>00219                                 <span class="keywordtype">bool</span> dont_shift_angle );
<a name="l00220"></a>00220 
<a name="l00221"></a>00221                 }; <span class="comment">// end of class</span>
<a name="l00222"></a>00222 
<a name="l00223"></a>00223 
<a name="l00224"></a>00224                 <span class="comment">/****************************************************</span>
<a name="l00225"></a>00225 <span class="comment">                                                Class CFEATURELIST</span>
<a name="l00226"></a>00226 <span class="comment">                *****************************************************/</span><span class="comment"></span>
<a name="l00227"></a>00227 <span class="comment">                /** A list of visual features, to be used as output by detectors, as input/output by trackers, etc.</span>
<a name="l00228"></a>00228 <span class="comment">                  */</span>
<a name="l00229"></a>00229                 <span class="keyword">class </span><a class="code" href="vision_2include_2mrpt_2vision_2link__pragmas_8h.html#aa4a17fb846aac61f4e57b17b6f784559">VISION_IMPEXP</a> CFeatureList : <span class="keyword">public</span> mrpt::math::<a class="code" href="classmrpt_1_1math_1_1_k_d_tree_capable.html" title="A generic adaptor class for providing Approximate Nearest Neighbors (ANN) (via the nanoflann library)...">KDTreeCapable</a>&lt;CFeatureList&gt;
<a name="l00230"></a>00230                 {
<a name="l00231"></a>00231                 <span class="keyword">protected</span>:
<a name="l00232"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ad78c7429f48503c5628d0589eca29117">00232</a>                         <span class="keyword">typedef</span> std<a class="code" href="classstd_1_1vector.html">::vector&lt;CFeaturePtr&gt;</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ad78c7429f48503c5628d0589eca29117">TInternalFeatList</a>;
<a name="l00233"></a>00233 
<a name="l00234"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ad0c2dc38a9e2b8cbc6ba88c143d8c57f">00234</a>                         <a class="code" href="classstd_1_1vector.html">TInternalFeatList</a>  <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ad0c2dc38a9e2b8cbc6ba88c143d8c57f" title="The actual container with the list of features.">m_feats</a>; <span class="comment">//!&lt; The actual container with the list of features</span>
<a name="l00235"></a>00235 <span class="comment"></span>
<a name="l00236"></a>00236                 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00237"></a>00237 <span class="comment">                        /** The type of the first feature in the list */</span>
<a name="l00238"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ae699258ecc3e2527591875f2114f2118">00238</a>                         <span class="keyword">inline</span> <a class="code" href="group__mrpt__vision__grp.html#ga3a5b54ab814bafc8bb108e37bbee4e19" title="Types of features - This means that the point has been detected with this algorithm, which is independent of additional descriptors a feature may also have.">TFeatureType</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ae699258ecc3e2527591875f2114f2118" title="The type of the first feature in the list.">get_type</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="eigen__plugins_8h.html#a05ed04d61c4f7d75d93908c25a09d8c4">empty</a>() ? <a class="code" href="group__mrpt__vision__grp.html#gga3a5b54ab814bafc8bb108e37bbee4e19a9a6d1ea2a8c8957c81147e2ce5e9f3f1" title="Non-defined feature (also used for Occupancy features)">featNotDefined</a> : (*<a class="code" href="eigen__plugins_8h.html#ab295fd8164bf1b1acecbcb29520d62b7">begin</a>())-&gt;<a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ae699258ecc3e2527591875f2114f2118" title="The type of the first feature in the list.">get_type</a>(); }
<a name="l00239"></a>00239 <span class="comment"></span>
<a name="l00240"></a>00240 <span class="comment">                        /** Save feature list to a text file */</span>
<a name="l00241"></a>00241                         <span class="keywordtype">void</span> <a class="code" href="eigen__plugins_8h.html#abea6659e38ab7a50b625ea1a4af3ec72" title="Save matrix to a text file, compatible with MATLAB text format (see also the methods of matrix classe...">saveToTextFile</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;fileName, <span class="keywordtype">bool</span> APPEND = <span class="keyword">false</span> );
<a name="l00242"></a>00242 <span class="comment"></span>
<a name="l00243"></a>00243 <span class="comment">                        /** Save feature list to a text file */</span>
<a name="l00244"></a>00244                         <span class="keywordtype">void</span> <a class="code" href="eigen__plugins_8h.html#ad3c68c35368d8a0254192e3c34ea5f61" title="Load matrix from a text file, compatible with MATLAB text format.">loadFromTextFile</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;fileName );
<a name="l00245"></a>00245 <span class="comment"></span>
<a name="l00246"></a>00246 <span class="comment">                        /** Copies the content of another CFeatureList inside this one. The inner features are also copied. */</span>
<a name="l00247"></a>00247                         <span class="keywordtype">void</span> copyListFrom( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html" title="A list of visual features, to be used as output by detectors, as input/output by trackers, etc.">CFeatureList</a> &amp;otherList );
<a name="l00248"></a>00248 <span class="comment"></span>
<a name="l00249"></a>00249 <span class="comment">                        /** Get the maximum ID into the list */</span>
<a name="l00250"></a>00250                         <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> getMaxID() <span class="keyword">const</span>;
<a name="l00251"></a>00251 <span class="comment"></span>
<a name="l00252"></a>00252 <span class="comment">                        /** Get a reference to a Feature from its ID */</span>
<a name="l00253"></a>00253                         <a class="code" href="structmrpt_1_1vision_1_1_c_feature_ptr.html">CFeaturePtr</a> getByID( <span class="keyword">const</span> <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> &amp;ID ) <span class="keyword">const</span>;
<a name="l00254"></a>00254                         <a class="code" href="structmrpt_1_1vision_1_1_c_feature_ptr.html">CFeaturePtr</a> getByID( <span class="keyword">const</span> <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> &amp;ID, <span class="keywordtype">int</span> &amp;out_idx ) <span class="keyword">const</span>;
<a name="l00255"></a>00255 <span class="comment"></span>
<a name="l00256"></a>00256 <span class="comment">            /** Get a vector of references to a subset of features from their IDs */</span>
<a name="l00257"></a>00257             <span class="keywordtype">void</span> getByMultiIDs( <span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html" title="STL class.">vector&lt;TFeatureID&gt;</a> &amp;IDs, <a class="code" href="classstd_1_1vector.html">vector&lt;CFeaturePtr&gt;</a> &amp;out, <a class="code" href="classstd_1_1vector.html">vector&lt;int&gt;</a> &amp;outIndex ) <span class="keyword">const</span>;
<a name="l00258"></a>00258 <span class="comment"></span>
<a name="l00259"></a>00259 <span class="comment">                        /** Get a reference to the nearest feature to the a given 2D point (version returning distance to closest feature in &quot;max_dist&quot;)</span>
<a name="l00260"></a>00260 <span class="comment">                        *   \param x [IN] The query point x-coordinate</span>
<a name="l00261"></a>00261 <span class="comment">                        *   \param y [IN] The query point y-coordinate</span>
<a name="l00262"></a>00262 <span class="comment">                        *   \param max_dist [IN/OUT] At input: The maximum distance to search for. At output: The actual distance to the feature.</span>
<a name="l00263"></a>00263 <span class="comment">                        *  \return A reference to the found feature, or a NULL smart pointer if none found.</span>
<a name="l00264"></a>00264 <span class="comment">                        *  \note See also all the available KD-tree search methods, listed in mrpt::math::KDTreeCapable</span>
<a name="l00265"></a>00265 <span class="comment">                        */</span>
<a name="l00266"></a>00266                         <a class="code" href="structmrpt_1_1vision_1_1_c_feature_ptr.html">CFeaturePtr</a> nearest( <span class="keyword">const</span> <span class="keywordtype">float</span> x, <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>, <span class="keywordtype">double</span> &amp;max_dist ) <span class="keyword">const</span>;
<a name="l00267"></a>00267 <span class="comment"></span>
<a name="l00268"></a>00268 <span class="comment">                        /** Constructor */</span>
<a name="l00269"></a>00269                         <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html" title="A list of visual features, to be used as output by detectors, as input/output by trackers, etc.">CFeatureList</a>();
<a name="l00270"></a>00270 <span class="comment"></span>
<a name="l00271"></a>00271 <span class="comment">                        /** Virtual destructor */</span>
<a name="l00272"></a>00272                         <span class="keyword">virtual</span> ~<a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html" title="A list of visual features, to be used as output by detectors, as input/output by trackers, etc.">CFeatureList</a>();
<a name="l00273"></a>00273 <span class="comment"></span>
<a name="l00274"></a>00274 <span class="comment">                        /** Call this when the list of features has been modified so the KD-tree is marked as outdated. */</span>
<a name="l00275"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a524563954d19cf20dee5b70e5f71780b">00275</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a524563954d19cf20dee5b70e5f71780b" title="Call this when the list of features has been modified so the KD-tree is marked as outdated...">mark_kdtree_as_outdated</a>()<span class="keyword"> const </span>{ kdtree_mark_as_outdated(); }
<a name="l00276"></a>00276 <span class="comment"></span>
<a name="l00277"></a>00277 <span class="comment">                        /** @name Method and datatypes to emulate a STL container</span>
<a name="l00278"></a>00278 <span class="comment">                            @{ */</span>
<a name="l00279"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a76ce4dd9b8a0d1d002c94381d46fc4c1">00279</a>                         <span class="keyword">typedef</span> <a class="code" href="classstd_1_1vector.html">TInternalFeatList</a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a76ce4dd9b8a0d1d002c94381d46fc4c1">::iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a76ce4dd9b8a0d1d002c94381d46fc4c1">iterator</a>;
<a name="l00280"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a6312f92a49f307ac17a295aaae6585b8">00280</a>                         <span class="keyword">typedef</span> <a class="code" href="classstd_1_1vector.html">TInternalFeatList</a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a6312f92a49f307ac17a295aaae6585b8">::const_iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a6312f92a49f307ac17a295aaae6585b8">const_iterator</a>;
<a name="l00281"></a>00281 
<a name="l00282"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a6b0fa203794dfd9c460add1010ec8547">00282</a>                         <span class="keyword">typedef</span> <a class="code" href="classstd_1_1vector.html">TInternalFeatList</a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a6b0fa203794dfd9c460add1010ec8547">::reverse_iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a6b0fa203794dfd9c460add1010ec8547">reverse_iterator</a>;
<a name="l00283"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a56f07e5ecb033082f0bf40d1113def3a">00283</a>                         <span class="keyword">typedef</span> <a class="code" href="classstd_1_1vector.html">TInternalFeatList</a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a56f07e5ecb033082f0bf40d1113def3a">::const_reverse_iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a56f07e5ecb033082f0bf40d1113def3a">const_reverse_iterator</a>;
<a name="l00284"></a>00284 
<a name="l00285"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a51d87725bb158a2a648b18e0b99ddad0">00285</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a76ce4dd9b8a0d1d002c94381d46fc4c1">iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a51d87725bb158a2a648b18e0b99ddad0">begin</a>() { <span class="keywordflow">return</span> m_feats.begin(); }
<a name="l00286"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a8aeaa665d175d6586be382752a2cef41">00286</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a76ce4dd9b8a0d1d002c94381d46fc4c1">iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a8aeaa665d175d6586be382752a2cef41">end</a>() { <span class="keywordflow">return</span> m_feats.end(); }
<a name="l00287"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ad38b0a919f5e601862979777bafbec9e">00287</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a6312f92a49f307ac17a295aaae6585b8">const_iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ad38b0a919f5e601862979777bafbec9e">begin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_feats.begin(); }
<a name="l00288"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a2b69dadf0399fb55b32c893c7995a5c9">00288</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a6312f92a49f307ac17a295aaae6585b8">const_iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a2b69dadf0399fb55b32c893c7995a5c9">end</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_feats.end(); }
<a name="l00289"></a>00289 
<a name="l00290"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a618d64dcb5d749fd5b4af2d60757ced1">00290</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a6b0fa203794dfd9c460add1010ec8547">reverse_iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a618d64dcb5d749fd5b4af2d60757ced1">rbegin</a>() { <span class="keywordflow">return</span> m_feats.rbegin(); }
<a name="l00291"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#afb2ae6eeaf50b9553c097c5a6f5efe6a">00291</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a6b0fa203794dfd9c460add1010ec8547">reverse_iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#afb2ae6eeaf50b9553c097c5a6f5efe6a">rend</a>() { <span class="keywordflow">return</span> m_feats.rend(); }
<a name="l00292"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a17fe09fb4c4fbb16daa5a95f5aebe8a7">00292</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a56f07e5ecb033082f0bf40d1113def3a">const_reverse_iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a17fe09fb4c4fbb16daa5a95f5aebe8a7">rbegin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_feats.rbegin(); }
<a name="l00293"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#accd5dab737f75a6667351afa7448d8d0">00293</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a56f07e5ecb033082f0bf40d1113def3a">const_reverse_iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#accd5dab737f75a6667351afa7448d8d0">rend</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_feats.rend(); }
<a name="l00294"></a>00294 
<a name="l00295"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a2cce2b3afbe1a94fa31754f45f729ed7">00295</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a76ce4dd9b8a0d1d002c94381d46fc4c1">iterator</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a2cce2b3afbe1a94fa31754f45f729ed7">erase</a>(<span class="keyword">const</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a76ce4dd9b8a0d1d002c94381d46fc4c1">iterator</a> it)  { mark_kdtree_as_outdated(); <span class="keywordflow">return</span> m_feats.erase(it); }
<a name="l00296"></a>00296 
<a name="l00297"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a118556b83dd11ee57c8baee42949a699">00297</a>                         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a118556b83dd11ee57c8baee42949a699">empty</a>()<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> m_feats.empty(); }
<a name="l00298"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a642057e017f87b01ae71fca3efbd8527">00298</a>                         <span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a642057e017f87b01ae71fca3efbd8527">size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_feats.size(); }
<a name="l00299"></a>00299 
<a name="l00300"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ae66587d1f0e356f422328b6f0a0b90d6">00300</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ae66587d1f0e356f422328b6f0a0b90d6">clear</a>() { m_feats.clear(); mark_kdtree_as_outdated(); }
<a name="l00301"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a8b303b4d3faa7e1bb7bd67d4feda4d21">00301</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a8b303b4d3faa7e1bb7bd67d4feda4d21">resize</a>(<span class="keywordtype">size_t</span> N) { m_feats.resize(N); mark_kdtree_as_outdated(); }
<a name="l00302"></a>00302 
<a name="l00303"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a29c1449887c7a214099abd8f4dcfd310">00303</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a29c1449887c7a214099abd8f4dcfd310">push_back</a>(<span class="keyword">const</span> <a class="code" href="structmrpt_1_1vision_1_1_c_feature_ptr.html">CFeaturePtr</a> &amp;f) { mark_kdtree_as_outdated();  m_feats.push_back(f); }
<a name="l00304"></a>00304 
<a name="l00305"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a9ecac8909a45f24c3d946ff754f02ecd">00305</a>                         <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_c_feature_ptr.html">CFeaturePtr</a> &amp; operator [](<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index) { <span class="keywordflow">return</span> m_feats[index]; }
<a name="l00306"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#aa0e7a7e474715a3274e8fc671678618c">00306</a>                         <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="structmrpt_1_1vision_1_1_c_feature_ptr.html">CFeaturePtr</a> &amp; operator [](<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index)<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> m_feats[index]; }
<a name="l00307"></a>00307 <span class="comment"></span>
<a name="l00308"></a>00308 <span class="comment">                        /** @} */</span>
<a name="l00309"></a>00309 
<a name="l00310"></a>00310 <span class="comment"></span>
<a name="l00311"></a>00311 <span class="comment">                        /** @name Methods that MUST be implemented by children classes of KDTreeCapable</span>
<a name="l00312"></a>00312 <span class="comment">                                @{ */</span>
<a name="l00313"></a>00313 <span class="comment"></span>
<a name="l00314"></a>00314 <span class="comment">                        /// Must return the number of data points </span>
<a name="l00315"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a97a0ca986d97de26d5cf3f035c8749ca">00315</a> <span class="comment"></span>                        <span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a97a0ca986d97de26d5cf3f035c8749ca" title="Must return the number of data points.">kdtree_get_point_count</a>()<span class="keyword"> const </span>{  <span class="keywordflow">return</span> this-&gt;<a class="code" href="namespacemrpt_1_1math.html#a632ae0aecf78103f87f18f9ac33f7170">size</a>(); }
<a name="l00316"></a>00316 <span class="comment"></span>
<a name="l00317"></a>00317 <span class="comment">                        /// Returns the dim&#39;th component of the idx&#39;th point in the class:</span>
<a name="l00318"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#aea0217ce0039a4cb93e066ecd7a903b2">00318</a> <span class="comment"></span>                        <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#aea0217ce0039a4cb93e066ecd7a903b2" title="Returns the dim&#39;th component of the idx&#39;th point in the class:">kdtree_get_pt</a>(<span class="keyword">const</span> <span class="keywordtype">size_t</span> idx, <span class="keywordtype">int</span> dim)<span class="keyword"> const </span>{ 
<a name="l00319"></a>00319                                 <a class="code" href="mrpt__macros_8h.html#a5ad4d8d68e2f6664f247407bf89aac55" title="Defines an assertion mechanism - only when compiled in debug.">ASSERTDEB_</a>(dim==0 || dim==1)
<a name="l00320"></a>00320                                 <span class="keywordflow">if</span> (dim==0) <span class="keywordflow">return</span> m_feats[idx]-&gt;x;
<a name="l00321"></a>00321                                 <span class="keywordflow">else</span> <span class="keywordflow">return</span> m_feats[idx]-&gt;y;
<a name="l00322"></a>00322                         }
<a name="l00323"></a>00323 <span class="comment"></span>
<a name="l00324"></a>00324 <span class="comment">                        /// Returns the distance between the vector &quot;p1[0:size-1]&quot; and the data point with index &quot;idx_p2&quot; stored in the class:</span>
<a name="l00325"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#acd65d5fb0cd684fb303ed2b4a2b66770">00325</a> <span class="comment"></span>                        <span class="keyword">inline</span> <span class="keywordtype">float</span> kdtree_distance(<span class="keyword">const</span> <span class="keywordtype">float</span> *p1, <span class="keyword">const</span> <span class="keywordtype">size_t</span> idx_p2,<span class="keywordtype">size_t</span> <a class="code" href="namespacemrpt_1_1math.html#a632ae0aecf78103f87f18f9ac33f7170">size</a>)<span class="keyword"> const</span>
<a name="l00326"></a>00326 <span class="keyword">                        </span>{
<a name="l00327"></a>00327                                 <a class="code" href="mrpt__macros_8h.html#a5ad4d8d68e2f6664f247407bf89aac55" title="Defines an assertion mechanism - only when compiled in debug.">ASSERTDEB_</a>(size==2)
<a name="l00328"></a>00328 
<a name="l00329"></a>00329                                 <span class="keyword">const</span> <span class="keywordtype">float</span> d0 = p1[0] - m_feats[idx_p2]-&gt;x; 
<a name="l00330"></a>00330                                 <span class="keyword">const</span> <span class="keywordtype">float</span> d1 = p1[1] - m_feats[idx_p2]-&gt;y; 
<a name="l00331"></a>00331                                 <span class="keywordflow">return</span> d0*d0+d1*d1;
<a name="l00332"></a>00332                         }
<a name="l00333"></a>00333 
<a name="l00334"></a>00334                         <span class="comment">// Optional bounding-box computation: return false to default to a standard bbox computation loop. </span>
<a name="l00335"></a>00335                         <span class="comment">//   Return true if the BBOX was already computed by the class and returned in &quot;bb&quot; so it can be avoided to redo it again.</span>
<a name="l00336"></a>00336                         <span class="comment">//   Look at bb.size() to find out the expected dimensionality (e.g. 2 or 3 for point clouds)</span>
<a name="l00337"></a>00337                         <span class="keyword">template</span> &lt;<span class="keyword">typename</span> BBOX&gt;
<a name="l00338"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a4d44595b2a8928b309b4b89596fcbfcf">00338</a>                         <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a4d44595b2a8928b309b4b89596fcbfcf">kdtree_get_bbox</a>(BBOX &amp;bb)<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; }
<a name="l00339"></a>00339 <span class="comment"></span>
<a name="l00340"></a>00340 <span class="comment">                        /** @} */</span>
<a name="l00341"></a>00341 
<a name="l00342"></a>00342 <span class="comment"></span>
<a name="l00343"></a>00343 <span class="comment">                        /** @name getFeature*() methods for template-based access to feature list</span>
<a name="l00344"></a>00344 <span class="comment">                            @{ */</span>
<a name="l00345"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a7cb301d74fb033a13a25dfbb4a7b9d47">00345</a>                         <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a7cb301d74fb033a13a25dfbb4a7b9d47">getFeatureX</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_feats[i]-&gt;x; }
<a name="l00346"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a9e7e7010f5ba9319c33b6383737fa3e5">00346</a>                         <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a9e7e7010f5ba9319c33b6383737fa3e5">getFeatureY</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_feats[i]-&gt;y; }
<a name="l00347"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ac9eb99ed542cb83a9abb84bfc8a41a3f">00347</a>                         <span class="keyword">inline</span> <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ac9eb99ed542cb83a9abb84bfc8a41a3f">getFeatureID</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_feats[i]-&gt;ID; }
<a name="l00348"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a7a012f3532ef37d1b99802f56a6f4cf5">00348</a>                         <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a7a012f3532ef37d1b99802f56a6f4cf5">getFeatureResponse</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_feats[i]-&gt;response; }
<a name="l00349"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a000059862a6f422921c4f562b3e3ff73">00349</a>                         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a000059862a6f422921c4f562b3e3ff73">isPointFeature</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_feats[i]-&gt;isPointFeature(); }
<a name="l00350"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a88c5315e5a788af7e2f34b2ce2d6adc6">00350</a>                         <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a88c5315e5a788af7e2f34b2ce2d6adc6">getScale</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_feats[i]-&gt;scale; }
<a name="l00351"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a5c8e32f910077355e84a88bb86d066a4">00351</a>                         <span class="keyword">inline</span> <a class="code" href="group__mrpt__vision__grp.html#ga0437f34e59ac06cddc3a490e2605bb71">TFeatureTrackStatus</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a5c8e32f910077355e84a88bb86d066a4">getTrackStatus</a>(<span class="keywordtype">size_t</span> i) { <span class="keywordflow">return</span> m_feats[i]-&gt;track_status; }
<a name="l00352"></a>00352 
<a name="l00353"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a7e0c45ba19c5e7254de1fa079a33f0e3">00353</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a7e0c45ba19c5e7254de1fa079a33f0e3">setFeatureX</a>(<span class="keywordtype">size_t</span> i,<span class="keywordtype">float</span> x) { m_feats[i]-&gt;x=x; }
<a name="l00354"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a5ab4e8b09d7372b3e24e8efaaad48477">00354</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a5ab4e8b09d7372b3e24e8efaaad48477">setFeatureXf</a>(<span class="keywordtype">size_t</span> i,<span class="keywordtype">float</span> x) { m_feats[i]-&gt;x=x; }
<a name="l00355"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ab982d598a6c5933ced076b2c08f00500">00355</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ab982d598a6c5933ced076b2c08f00500">setFeatureY</a>(<span class="keywordtype">size_t</span> i,<span class="keywordtype">float</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) { m_feats[i]-&gt;y=<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>; }
<a name="l00356"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a006a483585d3da67eb7ef37f14f12fcc">00356</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a006a483585d3da67eb7ef37f14f12fcc">setFeatureYf</a>(<span class="keywordtype">size_t</span> i,<span class="keywordtype">float</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) { m_feats[i]-&gt;y=<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>; }
<a name="l00357"></a>00357 
<a name="l00358"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#abc516d209bb5673c5834cebdda258d6c">00358</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#abc516d209bb5673c5834cebdda258d6c">setFeatureID</a>(<span class="keywordtype">size_t</span> i,<a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> <span class="keywordtype">id</span>) { m_feats[i]-&gt;ID=id; }
<a name="l00359"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a33a06b89aa25be88bdb297bc342452c6">00359</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a33a06b89aa25be88bdb297bc342452c6">setFeatureResponse</a>(<span class="keywordtype">size_t</span> i,<span class="keywordtype">float</span> r) { m_feats[i]-&gt;response=r; }
<a name="l00360"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ad314373d9d4f0f09a39ec6ec80cf309a">00360</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#ad314373d9d4f0f09a39ec6ec80cf309a">setScale</a>(<span class="keywordtype">size_t</span> i,<span class="keywordtype">float</span> s) { m_feats[i]-&gt;scale=s; }
<a name="l00361"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a28b27bfb0e11998a0e839fa08763b272">00361</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#a28b27bfb0e11998a0e839fa08763b272">setTrackStatus</a>(<span class="keywordtype">size_t</span> i,<a class="code" href="group__mrpt__vision__grp.html#ga0437f34e59ac06cddc3a490e2605bb71">TFeatureTrackStatus</a> s) { m_feats[i]-&gt;track_status=s; }
<a name="l00362"></a>00362 
<a name="l00363"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#af48155a949a3f39bce127928c9607dcf">00363</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html#af48155a949a3f39bce127928c9607dcf">mark_as_outdated</a>()<span class="keyword"> const </span>{ kdtree_mark_as_outdated(); }
<a name="l00364"></a>00364 <span class="comment"></span>
<a name="l00365"></a>00365 <span class="comment">                        /** @} */</span>
<a name="l00366"></a>00366 
<a name="l00367"></a>00367 
<a name="l00368"></a>00368                 }; <span class="comment">// end of class</span>
<a name="l00369"></a>00369 
<a name="l00370"></a>00370                 <span class="comment">/****************************************************</span>
<a name="l00371"></a>00371 <span class="comment">                                        Class CMATCHEDFEATURELIST</span>
<a name="l00372"></a>00372 <span class="comment">                *****************************************************/</span><span class="comment"></span>
<a name="l00373"></a>00373 <span class="comment">                /** A list of features</span>
<a name="l00374"></a>00374 <span class="comment">                */</span>
<a name="l00375"></a>00375                 <span class="keyword">class </span><a class="code" href="vision_2include_2mrpt_2vision_2link__pragmas_8h.html#aa4a17fb846aac61f4e57b17b6f784559">VISION_IMPEXP</a> CMatchedFeatureList : <span class="keyword">public</span> std::<a class="code" href="classstd_1_1deque.html" title="STL class.">deque</a>&lt; std::pair&lt;CFeaturePtr,CFeaturePtr&gt; &gt;
<a name="l00376"></a>00376                 {
<a name="l00377"></a>00377                 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00378"></a>00378 <span class="comment">                        /** The type of the first feature in the list */</span>
<a name="l00379"></a><a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html#ac556cfe4ed3b17bb373ed18421c3dc0e">00379</a>                         <span class="keyword">inline</span> <a class="code" href="group__mrpt__vision__grp.html#ga3a5b54ab814bafc8bb108e37bbee4e19" title="Types of features - This means that the point has been detected with this algorithm, which is independent of additional descriptors a feature may also have.">TFeatureType</a> <a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html#ac556cfe4ed3b17bb373ed18421c3dc0e" title="The type of the first feature in the list.">get_type</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="eigen__plugins_8h.html#a05ed04d61c4f7d75d93908c25a09d8c4">empty</a>() ? <a class="code" href="group__mrpt__vision__grp.html#gga3a5b54ab814bafc8bb108e37bbee4e19a9a6d1ea2a8c8957c81147e2ce5e9f3f1" title="Non-defined feature (also used for Occupancy features)">featNotDefined</a> : (<a class="code" href="eigen__plugins_8h.html#ab295fd8164bf1b1acecbcb29520d62b7">begin</a>()-&gt;first)-&gt;<a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html#ac556cfe4ed3b17bb373ed18421c3dc0e" title="The type of the first feature in the list.">get_type</a>(); }
<a name="l00380"></a>00380 <span class="comment"></span>
<a name="l00381"></a>00381 <span class="comment">                        /** Save list of matched features to a text file */</span>
<a name="l00382"></a>00382                         <span class="keywordtype">void</span> <a class="code" href="eigen__plugins_8h.html#abea6659e38ab7a50b625ea1a4af3ec72" title="Save matrix to a text file, compatible with MATLAB text format (see also the methods of matrix classe...">saveToTextFile</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;fileName);
<a name="l00383"></a>00383 <span class="comment"></span>
<a name="l00384"></a>00384 <span class="comment">            /** Returns the matching features as two separate CFeatureLists */</span>
<a name="l00385"></a>00385                         <span class="keywordtype">void</span> getBothFeatureLists( <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html" title="A list of visual features, to be used as output by detectors, as input/output by trackers, etc.">CFeatureList</a> &amp;list1, <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list.html" title="A list of visual features, to be used as output by detectors, as input/output by trackers, etc.">CFeatureList</a> &amp;list2 );
<a name="l00386"></a>00386 <span class="comment"></span>
<a name="l00387"></a>00387 <span class="comment">                        /** Returns a smart pointer to the feature with the provided ID or a empty one if not found */</span>
<a name="l00388"></a>00388                         <a class="code" href="structmrpt_1_1vision_1_1_c_feature_ptr.html">CFeaturePtr</a> getByID( <span class="keyword">const</span> <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> &amp; ID, <span class="keyword">const</span> <a class="code" href="namespacemrpt_1_1vision.html#a134cb9579c5bea92ba1cb60857b9cd88">TListIdx</a> &amp;idx );
<a name="l00389"></a>00389 <span class="comment"></span>
<a name="l00390"></a>00390 <span class="comment">                        /** Returns the maximum ID of the features in the list. If the max ID has been already set up, this method just returns it.</span>
<a name="l00391"></a>00391 <span class="comment">                            Otherwise, this method finds, stores and returns it.*/</span>
<a name="l00392"></a>00392                         <span class="keywordtype">void</span> getMaxID( <span class="keyword">const</span> <a class="code" href="namespacemrpt_1_1vision.html#a134cb9579c5bea92ba1cb60857b9cd88">TListIdx</a> &amp;idx, <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> &amp; firstListID, <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> &amp; secondListID );
<a name="l00393"></a>00393 <span class="comment"></span>
<a name="l00394"></a>00394 <span class="comment">                        /** Updates the value of the maximum ID of the features in the matched list, i.e. it explicitly searches for the max ID and updates the member variables. */</span>
<a name="l00395"></a>00395                         <span class="keywordtype">void</span> updateMaxID( <span class="keyword">const</span> <a class="code" href="namespacemrpt_1_1vision.html#a134cb9579c5bea92ba1cb60857b9cd88">TListIdx</a> &amp;idx );
<a name="l00396"></a>00396 <span class="comment"></span>
<a name="l00397"></a>00397 <span class="comment">            /** Explicitly set the max IDs values to certain values */</span>
<a name="l00398"></a><a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html#ab92d385961c41a595b4cc6456fbeca15">00398</a>             <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html#ab92d385961c41a595b4cc6456fbeca15" title="Explicitly set the max IDs values to certain values.">setLeftMaxID</a>( <span class="keyword">const</span> <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> &amp;leftID ){ m_leftMaxID = leftID; }
<a name="l00399"></a><a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html#a378f28297f0277a3688f3fc5c5955738">00399</a>             <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html#a378f28297f0277a3688f3fc5c5955738">setRightMaxID</a>( <span class="keyword">const</span> <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> &amp;rightID ){ m_rightMaxID = rightID; }
<a name="l00400"></a><a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html#a6cb012f9a3c192c31149c65a423b2cf4">00400</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> setMaxIDs( <span class="keyword">const</span> <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> &amp;leftID, <span class="keyword">const</span> <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> &amp;rightID )
<a name="l00401"></a>00401             {
<a name="l00402"></a>00402                 setLeftMaxID(leftID);
<a name="l00403"></a>00403                 setRightMaxID(rightID);
<a name="l00404"></a>00404             };
<a name="l00405"></a>00405 <span class="comment"></span>
<a name="l00406"></a>00406 <span class="comment">                        /** Constructor */</span>
<a name="l00407"></a>00407                         <a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html" title="A list of features.">CMatchedFeatureList</a>();
<a name="l00408"></a>00408 <span class="comment"></span>
<a name="l00409"></a>00409 <span class="comment">                        /** Virtual destructor */</span>
<a name="l00410"></a>00410                         <span class="keyword">virtual</span> ~<a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html" title="A list of features.">CMatchedFeatureList</a>();
<a name="l00411"></a>00411         <span class="keyword">protected</span>:
<a name="l00412"></a><a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html#af5288fbcffdf0f7fa86111e765bf92e0">00412</a>             <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> m_leftMaxID, <a class="code" href="classmrpt_1_1vision_1_1_c_matched_feature_list.html#af5288fbcffdf0f7fa86111e765bf92e0">m_rightMaxID</a>;
<a name="l00413"></a>00413                 }; <span class="comment">// end of class</span>
<a name="l00414"></a>00414 
<a name="l00415"></a>00415 <span class="comment"></span>
<a name="l00416"></a>00416 <span class="comment">                /** @} */</span> <span class="comment">// End of add to module: mrptvision_features</span>
<a name="l00417"></a>00417 
<a name="l00418"></a>00418         } <span class="comment">// end of namespace</span>
<a name="l00419"></a>00419 
<a name="l00420"></a>00420 
<a name="l00421"></a>00421         <span class="keyword">namespace </span>utils
<a name="l00422"></a>00422         {
<a name="l00423"></a>00423                 <span class="keyword">using namespace </span>::mrpt::vision;
<a name="l00424"></a>00424                 <span class="comment">// Specialization must occur in the same namespace</span>
<a name="l00425"></a>00425                 <a class="code" href="_c_serializable_8h.html#a81695246461c7c04018786a6b6e75b6d">MRPT_DECLARE_TTYPENAME_PTR</a>(CFeature)
<a name="l00426"></a>00426         }
<a name="l00427"></a>00427 } <span class="comment">// end of namespace</span>
<a name="l00428"></a>00428 
<a name="l00429"></a>00429 <span class="preprocessor">#endif</span>
<a name="l00430"></a>00430 <span class="preprocessor"></span>
</pre></div></div>
</div>
<br><hr><br> <table border="0" width="100%"> <tr> <td> Page generated by <a href="http://www.doxygen.org" target="_blank">Doxygen 1.7.5</a> for MRPT 0.9.5 SVN: at Sun Sep 25 17:20:18 UTC 2011</td><td></td> <td width="100"> </td> <td width="150">  </td></tr> </table>  </body></html>