<!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>TSimpleFeature.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> > <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 Page</span></a></li> <li><a href="pages.html"><span>Related 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 List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <div class="title">TSimpleFeature.h</div> </div> </div> <div class="contents"> <a href="_t_simple_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 <jlblanco@ctima.uma.es> |</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 <http://www.gnu.org/licenses/>. |</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 _mrpt_vision_TSimpleFeature_H</span> <a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define _mrpt_vision_TSimpleFeature_H</span> <a name="l00030"></a>00030 <span class="preprocessor"></span> <a name="l00031"></a>00031 <span class="preprocessor">#include <<a class="code" href="_t_pixel_coord_8h.html">mrpt/utils/TPixelCoord.h</a>></span> <a name="l00032"></a>00032 <span class="preprocessor">#include <<a class="code" href="_k_d_tree_capable_8h.html">mrpt/math/KDTreeCapable.h</a>></span> <a name="l00033"></a>00033 <span class="preprocessor">#include <<a class="code" href="_c_matrix_template_numeric_8h.html">mrpt/math/CMatrixTemplateNumeric.h</a>></span> <a name="l00034"></a>00034 <span class="preprocessor">#include <<a class="code" href="vision_2include_2mrpt_2vision_2types_8h.html">mrpt/vision/types.h</a>></span> <a name="l00035"></a>00035 <a name="l00036"></a>00036 <span class="preprocessor">#include <<a class="code" href="vision_2include_2mrpt_2vision_2link__pragmas_8h.html">mrpt/vision/link_pragmas.h</a>></span> <a name="l00037"></a>00037 <a name="l00038"></a>00038 <span class="keyword">namespace </span>mrpt <a name="l00039"></a>00039 { <a name="l00040"></a>00040 <span class="keyword">namespace </span>vision <a name="l00041"></a>00041 {<span class="comment"></span> <a name="l00042"></a>00042 <span class="comment"> /** \addtogroup mrptvision_features </span> <a name="l00043"></a>00043 <span class="comment"> @{ */</span> <a name="l00044"></a>00044 <span class="comment"></span> <a name="l00045"></a>00045 <span class="comment"> /** A simple structure for representing one image feature (without descriptor nor patch) - This is</span> <a name="l00046"></a>00046 <span class="comment"> * the template which allows you to select if pixels are represented as integers or floats.</span> <a name="l00047"></a>00047 <span class="comment"> * \sa TSimpleFeature, TSimpleFeaturef</span> <a name="l00048"></a>00048 <span class="comment"> */</span> <a name="l00049"></a>00049 <span class="keyword">template</span> <<span class="keyword">typename</span> PIXEL_COORD_TYPE> <a name="l00050"></a>00050 <span class="keyword">struct </span>TSimpleFeature_templ <a name="l00051"></a>00051 { <a name="l00052"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#a96a4445c8b4dae6f01f02e9abe08ebaf">00052</a> PIXEL_COORD_TYPE <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#a96a4445c8b4dae6f01f02e9abe08ebaf" title="Coordinates in the image.">pt</a>; <span class="comment">//!< Coordinates in the image</span> <a name="l00053"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#a778172e4d4a95d500c61383b72a383fe">00053</a> <span class="comment"></span> <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#a778172e4d4a95d500c61383b72a383fe" title="ID of the feature.">ID</a>; <span class="comment">//!< ID of the feature</span> <a name="l00054"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#a8787db4f8b37177f235b39e947ed8c3a">00054</a> <span class="comment"></span> <a class="code" href="group__mrpt__vision__grp.html#ga0437f34e59ac06cddc3a490e2605bb71">TFeatureTrackStatus</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#a8787db4f8b37177f235b39e947ed8c3a" title="Status of the feature tracking process.">track_status</a>; <span class="comment">//!< Status of the feature tracking process</span> <a name="l00055"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#abffa340bb82dcad33a0e7b9178327489">00055</a> <span class="comment"></span> <span class="keywordtype">float</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#abffa340bb82dcad33a0e7b9178327489" title="A measure of the "goodness" of the feature (typically, the KLT_response value)">response</a>; <span class="comment">//!< A measure of the "goodness" of the feature (typically, the KLT_response value)</span> <a name="l00056"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#a8c609336f4fd1086db31a1fceccfe4b1">00056</a> <span class="comment"></span> uint8_t <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#a8c609336f4fd1086db31a1fceccfe4b1" title="The image octave the image was found in: 0=original image, 1=1/2 image, 2=1/4 image, etc.">octave</a>; <span class="comment">//!< The image octave the image was found in: 0=original image, 1=1/2 image, 2=1/4 image, etc.</span> <a name="l00057"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#a49d2b191fef4935beec81eb6457beee1">00057</a> <span class="comment"></span> uint8_t <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#a49d2b191fef4935beec81eb6457beee1" title="A field for any other flags needed by the user (this has not a predefined meaning)">user_flags</a>; <span class="comment">//!< A field for any other flags needed by the user (this has not a predefined meaning)</span> <a name="l00058"></a>00058 <span class="comment"></span><span class="comment"></span> <a name="l00059"></a>00059 <span class="comment"> /** Constructor that only sets the pt.{x,y} values, leaving all other values to *undefined values*. */</span> <a name="l00060"></a>00060 <span class="keyword">template</span> <<span class="keyword">typename</span> COORD_TYPE> <a name="l00061"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#ab2987edae7f98771ba5f0ea9f74a67a1">00061</a> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#ab2987edae7f98771ba5f0ea9f74a67a1" title="Constructor that only sets the pt.">TSimpleFeature_templ</a>(<span class="keyword">const</span> COORD_TYPE x, <span class="keyword">const</span> COORD_TYPE <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) : <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#a96a4445c8b4dae6f01f02e9abe08ebaf" title="Coordinates in the image.">pt</a>(x,y) { } <a name="l00062"></a>00062 <span class="comment"></span> <a name="l00063"></a>00063 <span class="comment"> /** Default constructor, leaves all fields uninitialized */</span> <a name="l00064"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#ad21f8e58c0484b533dc5e95f2589b74f">00064</a> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html#ad21f8e58c0484b533dc5e95f2589b74f" title="Default constructor, leaves all fields uninitialized.">TSimpleFeature_templ</a>() {} <a name="l00065"></a>00065 }; <a name="l00066"></a>00066 <span class="comment"></span> <a name="l00067"></a>00067 <span class="comment"> /** A simple structure for representing one image feature (without descriptor nor patch).</span> <a name="l00068"></a>00068 <span class="comment"> * \sa TSimpleFeaturef, CFeature, TSimpleFeatureList</span> <a name="l00069"></a>00069 <span class="comment"> */</span> <a name="l00070"></a><a class="code" href="group__mrptvision__features.html#ga72f50e326eac6ef6efa51b6c26d8c2e6">00070</a> <span class="keyword">typedef</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html" title="A simple structure for representing one image feature (without descriptor nor patch) - This is the te...">TSimpleFeature_templ<mrpt::utils::TPixelCoord></a> <a class="code" href="group__mrptvision__features.html#ga72f50e326eac6ef6efa51b6c26d8c2e6" title="A simple structure for representing one image feature (without descriptor nor patch).">TSimpleFeature</a>; <a name="l00071"></a>00071 <span class="comment"></span> <a name="l00072"></a>00072 <span class="comment"> /** A version of TSimpleFeature with subpixel precision */</span> <a name="l00073"></a><a class="code" href="group__mrptvision__features.html#gabea9e05e2e7d0997e84d128d4db5ad14">00073</a> <span class="keyword">typedef</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html" title="A simple structure for representing one image feature (without descriptor nor patch) - This is the te...">TSimpleFeature_templ<mrpt::utils::TPixelCoordf></a> <a class="code" href="group__mrptvision__features.html#gabea9e05e2e7d0997e84d128d4db5ad14" title="A version of TSimpleFeature with subpixel precision.">TSimpleFeaturef</a>; <a name="l00074"></a>00074 <a name="l00075"></a>00075 <a name="l00076"></a>00076 <span class="keyword">template</span> <<span class="keyword">typename</span> FEATURE> <span class="keyword">struct </span>TSimpleFeatureTraits; <a name="l00077"></a>00077 <a name="l00078"></a>00078 <span class="keyword">template</span> <> <span class="keyword">struct </span>TSimpleFeatureTraits<<a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature__templ.html" title="A simple structure for representing one image feature (without descriptor nor patch) - This is the te...">TSimpleFeature</a>> { <a name="l00079"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_traits_3_01_t_simple_feature_01_4.html#adc807ea05b5512d4d258b83c0704270e">00079</a> <span class="keyword">typedef</span> <span class="keywordtype">int</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_traits_3_01_t_simple_feature_01_4.html#adc807ea05b5512d4d258b83c0704270e">coord_t</a>; <a name="l00080"></a>00080 <a name="l00081"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_traits_3_01_t_simple_feature_01_4.html#aa0235e4f1b3404ea29785589c5d9b9ed">00081</a> <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_traits_3_01_t_simple_feature_01_4.html#adc807ea05b5512d4d258b83c0704270e">coord_t</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_traits_3_01_t_simple_feature_01_4.html#aa0235e4f1b3404ea29785589c5d9b9ed">f2coord</a>(<span class="keywordtype">float</span> f) { <span class="keywordflow">return</span> <a class="code" href="namespacemrpt_1_1utils.html#ab7d9cdf7d271c2f41fc1c5c9fa7d0828" title="Returns the closer integer (int) to x.">mrpt::utils::round</a>(f); } <a name="l00082"></a>00082 }; <a name="l00083"></a>00083 <a name="l00084"></a>00084 <span class="keyword">template</span> <> <span class="keyword">struct </span>TSimpleFeatureTraits<<a class="code" href="group__mrptvision__features.html#gabea9e05e2e7d0997e84d128d4db5ad14" title="A version of TSimpleFeature with subpixel precision.">TSimpleFeaturef</a>> { <a name="l00085"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_traits_3_01_t_simple_featuref_01_4.html#ad4d9581b32b0ce4e6c8b5c82fe89644e">00085</a> <span class="keyword">typedef</span> <span class="keywordtype">float</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_traits_3_01_t_simple_featuref_01_4.html#ad4d9581b32b0ce4e6c8b5c82fe89644e">coord_t</a>; <a name="l00086"></a>00086 <a name="l00087"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_traits_3_01_t_simple_featuref_01_4.html#a421b39b3f11878c95ebd4c668e94c202">00087</a> <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_traits_3_01_t_simple_featuref_01_4.html#ad4d9581b32b0ce4e6c8b5c82fe89644e">coord_t</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_traits_3_01_t_simple_featuref_01_4.html#a421b39b3f11878c95ebd4c668e94c202">f2coord</a>(<span class="keywordtype">float</span> f) { <span class="keywordflow">return</span> f; } <a name="l00088"></a>00088 }; <a name="l00089"></a>00089 <a name="l00090"></a>00090 <a name="l00091"></a>00091 <span class="comment"></span> <a name="l00092"></a>00092 <span class="comment"> /** A list of image features using the structure TSimpleFeature for each feature - capable of KD-tree computations</span> <a name="l00093"></a>00093 <span class="comment"> * Users normally use directly the typedef's: TSimpleFeatureList & TSimpleFeaturefList</span> <a name="l00094"></a>00094 <span class="comment"> */</span> <a name="l00095"></a>00095 <span class="keyword">template</span> <<span class="keyword">typename</span> FEATURE> <a name="l00096"></a>00096 <span class="keyword">struct </span>TSimpleFeatureList_templ <a name="l00097"></a>00097 { <a name="l00098"></a>00098 <span class="keyword">public</span>: <a name="l00099"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ac24aa521fe1177f075ae97049fc2748a">00099</a> <span class="keyword">typedef</span> std<a class="code" href="classstd_1_1vector.html">::vector<FEATURE></a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ac24aa521fe1177f075ae97049fc2748a">TFeatureVector</a>; <a name="l00100"></a>00100 <span class="comment"></span> <a name="l00101"></a>00101 <span class="comment"> /** @name Utilities</span> <a name="l00102"></a>00102 <span class="comment"> @{ */</span> <a name="l00103"></a>00103 <span class="comment"></span> <a name="l00104"></a>00104 <span class="comment"> /** Returns a const ref to the actual std::vector<> container */</span> <a name="l00105"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a26f6cf9a9593834fcd1e8b4ce32c6ede">00105</a> <span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">TFeatureVector</a>& <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a26f6cf9a9593834fcd1e8b4ce32c6ede" title="Returns a const ref to the actual std::vector<> container.">getVector</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>; } <a name="l00106"></a>00106 <span class="comment"></span> <a name="l00107"></a>00107 <span class="comment"> /** Returns the maximum ID of all features in the list, or 0 if it's empty */</span> <a name="l00108"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a9a19733786db537de3793ac07d2abf2d">00108</a> <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a9a19733786db537de3793ac07d2abf2d" title="Returns the maximum ID of all features in the list, or 0 if it's empty.">getMaxID</a>()<span class="keyword"> const </span>{ <a name="l00109"></a>00109 <span class="keywordflow">if</span> (this-><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a130ec82015cd6a1bac802c3f8909765e">empty</a>()) <span class="keywordflow">return</span> 0; <a name="l00110"></a>00110 <a class="code" href="group__mrpt__vision__grp.html#ga5bfc93fce347933b63640f2de874ba26" title="Definition of a feature ID.">TFeatureID</a> maxID = <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[0].ID; <a name="l00111"></a>00111 <span class="keywordtype">size_t</span> N = <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.size()-1; <a name="l00112"></a>00112 <span class="keywordflow">for</span> ( ; N ; --N) <a class="code" href="namespacemrpt_1_1utils.html#a3aaae8d44cd44b2e3d93e42644454589" title="If the second argument is above the first one, set the first argument to this higher value...">mrpt::utils::keep_max</a>(maxID, <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[N].ID); <a name="l00113"></a>00113 <span class="keywordflow">return</span> maxID; <a name="l00114"></a>00114 } <a name="l00115"></a>00115 <span class="comment"></span> <a name="l00116"></a>00116 <span class="comment"> /** Returns a vector with a LUT of the first feature index per row, to efficiently look for neighbors, etc.</span> <a name="l00117"></a>00117 <span class="comment"> * By default this vector is empty, so if a feature detector is used that doesn't fill this out, it will remain empty and useless.</span> <a name="l00118"></a>00118 <span class="comment"> * \note FASTER detectors do fill this out. In general, a feature list that dynamically changes will not use this LUT.</span> <a name="l00119"></a>00119 <span class="comment"> */</span> <a name="l00120"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad42b8690eaa94185e941243a6e1335be">00120</a> <span class="keyword">const</span> std<a class="code" href="classstd_1_1vector.html">::vector<size_t></a> & <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad42b8690eaa94185e941243a6e1335be" title="Returns a vector with a LUT of the first feature index per row, to efficiently look for neighbors...">getFirstIndexPerRowLUT</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a92a2e6ec7a45ff1ecae362743961ec5d" title="A LUT of the first feature index per row, to efficiently look for neighbors, etc.">m_first_index_per_row</a>; }<span class="comment"></span> <a name="l00121"></a>00121 <span class="comment"> /// \overload</span> <a name="l00122"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a437d3004d1b837665cc43e20f30c6a96">00122</a> <span class="comment"></span> std<a class="code" href="classstd_1_1vector.html">::vector<size_t></a> & <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a437d3004d1b837665cc43e20f30c6a96">getFirstIndexPerRowLUT</a>() { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a92a2e6ec7a45ff1ecae362743961ec5d" title="A LUT of the first feature index per row, to efficiently look for neighbors, etc.">m_first_index_per_row</a>; } <a name="l00123"></a>00123 <span class="comment"></span> <a name="l00124"></a>00124 <span class="comment"> /** Get a ref to the occupation matrix: this is a user-defined matrix, which is not updated automatically by this class. */</span> <a name="l00125"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a11f6eaf89a334718768474b35a3c4b73">00125</a> <span class="keyword">inline</span> mrpt<a class="code" href="classmrpt_1_1math_1_1_c_matrix_template.html" title="This template class provides the basic functionality for a general 2D any-size, resizable container o...">::math::CMatrixBool</a> & <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a11f6eaf89a334718768474b35a3c4b73" title="Get a ref to the occupation matrix: this is a user-defined matrix, which is not updated automatically...">getOccupiedSectionsMatrix</a>() { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aabd2544d9f2ab33aff3779712e23d316">m_occupied_sections</a>; } <a name="l00126"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a39e3ff6cbc413e4b9010e471d8b955c0">00126</a> <span class="keyword">inline</span> <span class="keyword">const</span> mrpt<a class="code" href="classmrpt_1_1math_1_1_c_matrix_template.html" title="This template class provides the basic functionality for a general 2D any-size, resizable container o...">::math::CMatrixBool</a> & <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a39e3ff6cbc413e4b9010e471d8b955c0">getOccupiedSectionsMatrix</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aabd2544d9f2ab33aff3779712e23d316">m_occupied_sections</a>; } <a name="l00127"></a>00127 <span class="comment"></span> <a name="l00128"></a>00128 <span class="comment"> /** @} */</span> <a name="l00129"></a>00129 <span class="comment"></span> <a name="l00130"></a>00130 <span class="comment"> /** @name Method and datatypes to emulate a STL container</span> <a name="l00131"></a>00131 <span class="comment"> @{ */</span> <a name="l00132"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad243a2a64bd0f22b809b4b85173b8c22">00132</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classstd_1_1vector.html">TFeatureVector</a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad243a2a64bd0f22b809b4b85173b8c22">::iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad243a2a64bd0f22b809b4b85173b8c22">iterator</a>; <a name="l00133"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a450c753ce43553becd20250528c8aceb">00133</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classstd_1_1vector.html">TFeatureVector</a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a450c753ce43553becd20250528c8aceb">::const_iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a450c753ce43553becd20250528c8aceb">const_iterator</a>; <a name="l00134"></a>00134 <a name="l00135"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a4f557201ed03fbae76eacedc56bf73ea">00135</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classstd_1_1vector.html">TFeatureVector</a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a4f557201ed03fbae76eacedc56bf73ea">::reverse_iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a4f557201ed03fbae76eacedc56bf73ea">reverse_iterator</a>; <a name="l00136"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#add9f24ec15d5538fb548fad9adef8cb1">00136</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classstd_1_1vector.html">TFeatureVector</a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#add9f24ec15d5538fb548fad9adef8cb1">::const_reverse_iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#add9f24ec15d5538fb548fad9adef8cb1">const_reverse_iterator</a>; <a name="l00137"></a>00137 <a name="l00138"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aca8248d7fbeb70fa284f18c5c6108494">00138</a> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad243a2a64bd0f22b809b4b85173b8c22">iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aca8248d7fbeb70fa284f18c5c6108494">begin</a>() { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.begin(); } <a name="l00139"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a2877f1c416e1a3a65b25ba44b8fe09c6">00139</a> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad243a2a64bd0f22b809b4b85173b8c22">iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a2877f1c416e1a3a65b25ba44b8fe09c6">end</a>() { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.end(); } <a name="l00140"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a18495f91e34b65670afb92c19ed5786c">00140</a> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a450c753ce43553becd20250528c8aceb">const_iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a18495f91e34b65670afb92c19ed5786c">begin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.begin(); } <a name="l00141"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a7310a9808b3a039ba11a92bc395453b5">00141</a> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a450c753ce43553becd20250528c8aceb">const_iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a7310a9808b3a039ba11a92bc395453b5">end</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.end(); } <a name="l00142"></a>00142 <a name="l00143"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#adf2a53b8fada2da89c6a3defabe6a48c">00143</a> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a4f557201ed03fbae76eacedc56bf73ea">reverse_iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#adf2a53b8fada2da89c6a3defabe6a48c">rbegin</a>() { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.rbegin(); } <a name="l00144"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ae8df5823ca779fa4cee9280d5070a204">00144</a> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a4f557201ed03fbae76eacedc56bf73ea">reverse_iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ae8df5823ca779fa4cee9280d5070a204">rend</a>() { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.rend(); } <a name="l00145"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ae68942232e11d9a0679a1d5b170fb4d7">00145</a> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#add9f24ec15d5538fb548fad9adef8cb1">const_reverse_iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ae68942232e11d9a0679a1d5b170fb4d7">rbegin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.rbegin(); } <a name="l00146"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aeb5f335676b59b68cfd8b13eef3060a3">00146</a> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#add9f24ec15d5538fb548fad9adef8cb1">const_reverse_iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aeb5f335676b59b68cfd8b13eef3060a3">rend</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.rend(); } <a name="l00147"></a>00147 <a name="l00148"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a77fc8636c837aa18ccd6383058c044de">00148</a> <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad243a2a64bd0f22b809b4b85173b8c22">iterator</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a77fc8636c837aa18ccd6383058c044de">erase</a>(<span class="keyword">const</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad243a2a64bd0f22b809b4b85173b8c22">iterator</a> it) { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.erase(it); } <a name="l00149"></a>00149 <a name="l00150"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a130ec82015cd6a1bac802c3f8909765e">00150</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a130ec82015cd6a1bac802c3f8909765e">empty</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.empty(); } <a name="l00151"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a025f9b227d044e122ef919813bdbb20e">00151</a> <span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a025f9b227d044e122ef919813bdbb20e">size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.size(); } <a name="l00152"></a>00152 <a name="l00153"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a63d7e138f71429c49d818546f1e708c8">00153</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a63d7e138f71429c49d818546f1e708c8">clear</a>() { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.clear(); <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a92a2e6ec7a45ff1ecae362743961ec5d" title="A LUT of the first feature index per row, to efficiently look for neighbors, etc.">m_first_index_per_row</a>.clear(); } <a name="l00154"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad02d42898dc273789538b11bde4e5206">00154</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad02d42898dc273789538b11bde4e5206">resize</a>(<span class="keywordtype">size_t</span> N) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.resize(N); } <a name="l00155"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aa4425d736643b6ad665e07ff96f5d857">00155</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aa4425d736643b6ad665e07ff96f5d857">reserve</a>(<span class="keywordtype">size_t</span> N) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.reserve(N); } <a name="l00156"></a>00156 <a name="l00157"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a9988116f5e367423ef5ab0c642cb5805">00157</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a9988116f5e367423ef5ab0c642cb5805">push_back</a>(<span class="keyword">const</span> FEATURE &f) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.push_back(f); } <a name="l00158"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a20ec82161737d6f34838f5e2efb69117">00158</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a20ec82161737d6f34838f5e2efb69117">push_back_fast</a> (<span class="keyword">const</span> FEATURE &f) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.push_back(f); } <a name="l00159"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ab992c90407c8716c39a3feeedbbd3fb2">00159</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ab992c90407c8716c39a3feeedbbd3fb2">push_back_fast</a> (<span class="keyword">const</span> <span class="keywordtype">int</span> x, <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.push_back (FEATURE(x,y)); } <a name="l00160"></a>00160 <a name="l00161"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad2edf938a30f17885ec387ea6eaf8547">00161</a> <span class="keyword">inline</span> FEATURE & <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad2edf938a30f17885ec387ea6eaf8547">operator []</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index) { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[index]; } <a name="l00162"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a6989e4bff82be9ca030f052e91e62f48">00162</a> <span class="keyword">inline</span> <span class="keyword">const</span> FEATURE & <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad2edf938a30f17885ec387ea6eaf8547">operator []</a>(<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> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[index]; } <a name="l00163"></a>00163 <a name="l00164"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a71b78a826e2cdcc270bb5725dc75f5a5">00164</a> <span class="keyword">inline</span> FEATURE & <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a71b78a826e2cdcc270bb5725dc75f5a5">back</a>() { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.back(); } <a name="l00165"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a63a00f1f4aad85d5af0bed19f6eb3922">00165</a> <span class="keyword">inline</span> <span class="keyword">const</span> FEATURE & <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a63a00f1f4aad85d5af0bed19f6eb3922">back</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.back(); } <a name="l00166"></a>00166 <a name="l00167"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a80a73adf1635a2a0badd65501926c436">00167</a> <span class="keyword">inline</span> FEATURE & <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a80a73adf1635a2a0badd65501926c436">front</a>() { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.front(); } <a name="l00168"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ab798aee36b52b8c16e62dd64ea4b5937">00168</a> <span class="keyword">inline</span> <span class="keyword">const</span> FEATURE & <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ab798aee36b52b8c16e62dd64ea4b5937">front</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>.front(); } <a name="l00169"></a>00169 <span class="comment"></span> <a name="l00170"></a>00170 <span class="comment"> /** @} */</span> <a name="l00171"></a>00171 <span class="comment"></span> <a name="l00172"></a>00172 <span class="comment"> /** @name getFeature*() methods for template-based access to feature list</span> <a name="l00173"></a>00173 <span class="comment"> @{ */</span> <a name="l00174"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad8e9563cf03d81d6b38d2f4b56ef4538">00174</a> <span class="keyword">inline</span> <span class="keyword">typename</span> TSimpleFeatureTraits<FEATURE>::coord_t <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#ad8e9563cf03d81d6b38d2f4b56ef4538">getFeatureX</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i].pt.x; } <a name="l00175"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aa84cb5a58273f200410bf570ef15cdb8">00175</a> <span class="keyword">inline</span> <span class="keyword">typename</span> TSimpleFeatureTraits<FEATURE>::coord_t <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aa84cb5a58273f200410bf570ef15cdb8">getFeatureY</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i].pt.y; } <a name="l00176"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a8d7a1c38daf8171df5ba1299ab56b239">00176</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="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a8d7a1c38daf8171df5ba1299ab56b239">getFeatureID</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i].ID; } <a name="l00177"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a86fb0da41615c401843b13c63d184e4f">00177</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a86fb0da41615c401843b13c63d184e4f">getFeatureResponse</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i].response; } <a name="l00178"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#af09e450c587c91e89d626b7d17459ffa">00178</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#af09e450c587c91e89d626b7d17459ffa">isPointFeature</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">true</span>; } <a name="l00179"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a9c34bd3988f75ca8b67855f8dad46f27">00179</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a9c34bd3988f75ca8b67855f8dad46f27">getScale</a>(<span class="keywordtype">size_t</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">float</span><span class="keyword">></span>(1<<<a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i].octave); } <a name="l00180"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a13e2914b092eb617c91b343e416ad5a9">00180</a> <span class="keyword">inline</span> <a class="code" href="group__mrpt__vision__grp.html#ga0437f34e59ac06cddc3a490e2605bb71">TFeatureTrackStatus</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a13e2914b092eb617c91b343e416ad5a9">getTrackStatus</a>(<span class="keywordtype">size_t</span> i) { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i].track_status; } <a name="l00181"></a>00181 <a name="l00182"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a8099506bd7025001815323df476c490a">00182</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a8099506bd7025001815323df476c490a">setFeatureX</a>(<span class="keywordtype">size_t</span> i,<span class="keyword">typename</span> TSimpleFeatureTraits<FEATURE>::coord_t x) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i].pt.x=x; } <a name="l00183"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a84be91401007610c9001b9db46514edd">00183</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a84be91401007610c9001b9db46514edd">setFeatureY</a>(<span class="keywordtype">size_t</span> i,<span class="keyword">typename</span> TSimpleFeatureTraits<FEATURE>::coord_t <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i].pt.y=<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>; } <a name="l00184"></a>00184 <a name="l00185"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#acb25e5bcf895585d37b0b6c102107c41">00185</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#acb25e5bcf895585d37b0b6c102107c41">setFeatureXf</a>(<span class="keywordtype">size_t</span> i,<span class="keywordtype">float</span> x) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i].pt.x=TSimpleFeatureTraits<FEATURE>::f2coord(x); } <a name="l00186"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aa48074c99aa7094959c6f8b126679f8c">00186</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aa48074c99aa7094959c6f8b126679f8c">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>) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i].pt.y=TSimpleFeatureTraits<FEATURE>::f2coord(y); } <a name="l00187"></a>00187 <a name="l00188"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a668432ba410c3e6dbb46e9079d0dc832">00188</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a668432ba410c3e6dbb46e9079d0dc832">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>) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i]->ID=id; } <a name="l00189"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a40dafe8f016b682318d84c02dadae2c9">00189</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a40dafe8f016b682318d84c02dadae2c9">setFeatureResponse</a>(<span class="keywordtype">size_t</span> i,<span class="keywordtype">float</span> r) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i]->response=r; } <a name="l00190"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a53abaa37818cd2ee918ed1be6d32dee7">00190</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a53abaa37818cd2ee918ed1be6d32dee7">setScale</a>(<span class="keywordtype">size_t</span> i,<span class="keywordtype">float</span> s) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i]->octave=<a class="code" href="namespacemrpt_1_1utils.html#ab7d9cdf7d271c2f41fc1c5c9fa7d0828" title="Returns the closer integer (int) to x.">mrpt::utils::round</a>(std::log(s)/std::log(2)); } <a name="l00191"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a83845f080a33de2b6f93b7950ace852e">00191</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a83845f080a33de2b6f93b7950ace852e">setTrackStatus</a>(<span class="keywordtype">size_t</span> i,<a class="code" href="group__mrpt__vision__grp.html#ga0437f34e59ac06cddc3a490e2605bb71">TFeatureTrackStatus</a> s) { <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>[i].track_status=s; } <a name="l00192"></a>00192 <a name="l00193"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a067b2861f51cfb7e3fecab11e46bc5ad">00193</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a067b2861f51cfb7e3fecab11e46bc5ad">mark_as_outdated</a>()<span class="keyword"> const </span>{ }<span class="comment"></span> <a name="l00194"></a>00194 <span class="comment"> /** @} */</span> <a name="l00195"></a>00195 <a name="l00196"></a>00196 <span class="keyword">private</span>: <a name="l00197"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd">00197</a> <a class="code" href="classstd_1_1vector.html">TFeatureVector</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a782f4313151788de0c1091b838e92ccd" title="The actual container with the list of features.">m_feats</a>; <span class="comment">//!< The actual container with the list of features</span> <a name="l00198"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a92a2e6ec7a45ff1ecae362743961ec5d">00198</a> <span class="comment"></span> std<a class="code" href="classstd_1_1vector.html">::vector<size_t></a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#a92a2e6ec7a45ff1ecae362743961ec5d" title="A LUT of the first feature index per row, to efficiently look for neighbors, etc.">m_first_index_per_row</a>; <span class="comment">//!< A LUT of the first feature index per row, to efficiently look for neighbors, etc.</span> <a name="l00199"></a><a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aabd2544d9f2ab33aff3779712e23d316">00199</a> <span class="comment"></span> mrpt<a class="code" href="classmrpt_1_1math_1_1_c_matrix_template.html" title="This template class provides the basic functionality for a general 2D any-size, resizable container o...">::math::CMatrixBool</a> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html#aabd2544d9f2ab33aff3779712e23d316">m_occupied_sections</a>; <a name="l00200"></a>00200 <a name="l00201"></a>00201 }; <span class="comment">// end of class</span> <a name="l00202"></a>00202 <span class="comment"></span> <a name="l00203"></a>00203 <span class="comment"> /** A list of image features using the structure TSimpleFeature for each feature - capable of KD-tree computations */</span> <a name="l00204"></a><a class="code" href="group__mrptvision__features.html#ga1a3cacefe1829fabd578ba8cc6fe6638">00204</a> <span class="keyword">typedef</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html">TSimpleFeatureList_templ<TSimpleFeature></a> <a class="code" href="group__mrptvision__features.html#ga1a3cacefe1829fabd578ba8cc6fe6638" title="A list of image features using the structure TSimpleFeature for each feature - capable of KD-tree com...">TSimpleFeatureList</a>; <a name="l00205"></a>00205 <span class="comment"></span> <a name="l00206"></a>00206 <span class="comment"> /** A list of image features using the structure TSimpleFeaturef for each feature - capable of KD-tree computations */</span> <a name="l00207"></a><a class="code" href="group__mrptvision__features.html#ga084ff91c2b6d61b13959eb8e34548b56">00207</a> <span class="keyword">typedef</span> <a class="code" href="structmrpt_1_1vision_1_1_t_simple_feature_list__templ.html" title="A list of image features using the structure TSimpleFeature for each feature - capable of KD-tree com...">TSimpleFeatureList_templ<TSimpleFeaturef></a> <a class="code" href="group__mrptvision__features.html#ga084ff91c2b6d61b13959eb8e34548b56" title="A list of image features using the structure TSimpleFeaturef for each feature - capable of KD-tree co...">TSimpleFeaturefList</a>; <a name="l00208"></a>00208 <a name="l00209"></a>00209 <span class="comment"></span> <a name="l00210"></a>00210 <span class="comment"> /** A helper struct to sort keypoints by their response: It can be used with these types:</span> <a name="l00211"></a>00211 <span class="comment"> * - std::vector<cv::KeyPoint></span> <a name="l00212"></a>00212 <span class="comment"> * - mrpt::vision::TSimpleFeatureList</span> <a name="l00213"></a>00213 <span class="comment"> */</span> <a name="l00214"></a>00214 <span class="keyword">template</span> <<span class="keyword">typename</span> FEATURE_LIST> <a name="l00215"></a>00215 <span class="keyword">struct </span><a class="code" href="structmrpt_1_1vision_1_1_keypoint_response_sorter.html" title="A helper struct to sort keypoints by their response: It can be used with these types:">KeypointResponseSorter</a> : <span class="keyword">public</span> std::binary_function<size_t,size_t,bool> <a name="l00216"></a>00216 { <a name="l00217"></a><a class="code" href="structmrpt_1_1vision_1_1_keypoint_response_sorter.html#a2839dd154f33ed9067a13c3835ccba50">00217</a> <span class="keyword">const</span> FEATURE_LIST &<a class="code" href="structmrpt_1_1vision_1_1_keypoint_response_sorter.html#a2839dd154f33ed9067a13c3835ccba50">m_data</a>; <a name="l00218"></a><a class="code" href="structmrpt_1_1vision_1_1_keypoint_response_sorter.html#aef1b0b9b65cc5ab9f4cad8c8b3125b24">00218</a> <a class="code" href="structmrpt_1_1vision_1_1_keypoint_response_sorter.html#aef1b0b9b65cc5ab9f4cad8c8b3125b24">KeypointResponseSorter</a>( <span class="keyword">const</span> FEATURE_LIST &data ) : <a class="code" href="structmrpt_1_1vision_1_1_keypoint_response_sorter.html#a2839dd154f33ed9067a13c3835ccba50">m_data</a>(data) { } <a name="l00219"></a><a class="code" href="structmrpt_1_1vision_1_1_keypoint_response_sorter.html#ac381b69bff066596d0d13900f471a469">00219</a> <span class="keywordtype">bool</span> <a class="code" href="structmrpt_1_1vision_1_1_keypoint_response_sorter.html#ac381b69bff066596d0d13900f471a469">operator() </a>(<span class="keywordtype">size_t</span> k1, <span class="keywordtype">size_t</span> k2 )<span class="keyword"> const </span>{ <a name="l00220"></a>00220 <span class="keywordflow">return</span> (<a class="code" href="structmrpt_1_1vision_1_1_keypoint_response_sorter.html#a2839dd154f33ed9067a13c3835ccba50">m_data</a>[k1].response > <a class="code" href="structmrpt_1_1vision_1_1_keypoint_response_sorter.html#a2839dd154f33ed9067a13c3835ccba50">m_data</a>[k2].response); <a name="l00221"></a>00221 } <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"> /** Helper class: KD-tree search class for vector<KeyPoint>:</span> <a name="l00226"></a>00226 <span class="comment"> * Call mark_as_outdated() to force rebuilding the kd-tree after modifying the linked feature list.</span> <a name="l00227"></a>00227 <span class="comment"> * \tparam FEAT Can be cv::KeyPoint or mrpt::vision::TSimpleFeature</span> <a name="l00228"></a>00228 <span class="comment"> */</span> <a name="l00229"></a>00229 <span class="keyword">template</span> <<span class="keyword">typename</span> FEAT> <a name="l00230"></a>00230 <span class="keyword">class </span>CFeatureListKDTree : <span class="keyword">public</span> mrpt::math::KDTreeCapable<CFeatureListKDTree<FEAT> > <a name="l00231"></a>00231 { <a name="l00232"></a>00232 <span class="keyword">public</span>: <a name="l00233"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a7af8b1c8c455e55055209a49b189398b">00233</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a7af8b1c8c455e55055209a49b189398b">mark_as_outdated</a>() { mrpt<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)...">::math::KDTreeCapable<CFeatureListKDTree<FEAT></a> ><a class="code" href="classmrpt_1_1math_1_1_k_d_tree_capable.html#a257dd22c1a52d1150117195aaf416f16" title="To be called by child classes when KD tree data changes.">::kdtree_mark_as_outdated</a>(); } <a name="l00234"></a>00234 <a name="l00235"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a5bd18ade3256fb64ecc5a82f836ae9c7">00235</a> <span class="keyword">const</span> std<a class="code" href="classstd_1_1vector.html">::vector<FEAT></a> & <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a5bd18ade3256fb64ecc5a82f836ae9c7">m_data</a>; <a name="l00236"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#ab0ef87ae15ec6544d53deb865dbcd53e">00236</a> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#ab0ef87ae15ec6544d53deb865dbcd53e">CFeatureListKDTree</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector<FEAT></a> & data) : <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a5bd18ade3256fb64ecc5a82f836ae9c7">m_data</a>(data) { } <a name="l00237"></a>00237 <a name="l00238"></a>00238 <span class="comment"></span> <a name="l00239"></a>00239 <span class="comment"> /** @name Methods that MUST be implemented by children classes of KDTreeCapable</span> <a name="l00240"></a>00240 <span class="comment"> @{ */</span> <a name="l00241"></a>00241 <span class="comment"></span> <a name="l00242"></a>00242 <span class="comment"> /// Must return the number of data points</span> <a name="l00243"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#ad5895533d0de345c9f9d76873d45b948">00243</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_k_d_tree.html#ad5895533d0de345c9f9d76873d45b948" title="Must return the number of data points.">kdtree_get_point_count</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a5bd18ade3256fb64ecc5a82f836ae9c7">m_data</a>.size(); } <a name="l00244"></a>00244 <span class="comment"></span> <a name="l00245"></a>00245 <span class="comment"> /// Returns the dim'th component of the idx'th point in the class:</span> <a name="l00246"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a337ffb74c8f18511c7b2727d3b808bd1">00246</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_k_d_tree.html#a337ffb74c8f18511c7b2727d3b808bd1" title="Returns the dim'th component of the idx'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="l00247"></a>00247 <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="l00248"></a>00248 <span class="keywordflow">if</span> (dim==0) <span class="keywordflow">return</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a5bd18ade3256fb64ecc5a82f836ae9c7">m_data</a>[idx].pt.x; <a name="l00249"></a>00249 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a5bd18ade3256fb64ecc5a82f836ae9c7">m_data</a>[idx].pt.y; <a name="l00250"></a>00250 } <a name="l00251"></a>00251 <span class="comment"></span> <a name="l00252"></a>00252 <span class="comment"> /// Returns the distance between the vector "p1[0:size-1]" and the data point with index "idx_p2" stored in the class:</span> <a name="l00253"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a43f6dc7854c74f00a7f6f072273df7e6">00253</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_k_d_tree.html#a43f6dc7854c74f00a7f6f072273df7e6" title="Returns the distance between the vector "p1[0:size-1]" and the data point with index "idx_p2" stored ...">kdtree_distance</a>(<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="l00254"></a>00254 <span class="keyword"> </span>{ <a name="l00255"></a>00255 <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="l00256"></a>00256 <a name="l00257"></a>00257 <span class="keyword">const</span> <span class="keywordtype">float</span> d0 = p1[0] - <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a5bd18ade3256fb64ecc5a82f836ae9c7">m_data</a>[idx_p2].pt.x; <a name="l00258"></a>00258 <span class="keyword">const</span> <span class="keywordtype">float</span> d1 = p1[1] - <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#a5bd18ade3256fb64ecc5a82f836ae9c7">m_data</a>[idx_p2].pt.y; <a name="l00259"></a>00259 <span class="keywordflow">return</span> d0*d0+d1*d1; <a name="l00260"></a>00260 } <a name="l00261"></a>00261 <a name="l00262"></a>00262 <span class="comment">// Optional bounding-box computation: return false to default to a standard bbox computation loop.</span> <a name="l00263"></a>00263 <span class="comment">// Return true if the BBOX was already computed by the class and returned in "bb" so it can be avoided to redo it again.</span> <a name="l00264"></a>00264 <span class="comment">// Look at bb.size() to find out the expected dimensionality (e.g. 2 or 3 for point clouds)</span> <a name="l00265"></a>00265 <span class="keyword">template</span> <<span class="keyword">typename</span> BBOX> <a name="l00266"></a><a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#ad183af2012533a8266171f5192ec6ac9">00266</a> <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1vision_1_1_c_feature_list_k_d_tree.html#ad183af2012533a8266171f5192ec6ac9">kdtree_get_bbox</a>(BBOX &bb)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; } <a name="l00267"></a>00267 <span class="comment"></span> <a name="l00268"></a>00268 <span class="comment"> /** @} */</span> <a name="l00269"></a>00269 <a name="l00270"></a>00270 }; <span class="comment">// end CFeatureListKDTree</span> <a name="l00271"></a>00271 <a name="l00272"></a>00272 <span class="comment"></span> <a name="l00273"></a>00273 <span class="comment"> /** @} */</span> <span class="comment">// End of add to module: mrptvision_features</span> <a name="l00274"></a>00274 <a name="l00275"></a>00275 } <span class="comment">// end of namespace</span> <a name="l00276"></a>00276 <a name="l00277"></a>00277 } <span class="comment">// end of namespace</span> <a name="l00278"></a>00278 <a name="l00279"></a>00279 <span class="preprocessor">#endif</span> <a name="l00280"></a>00280 <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>