<trclass="memdesc:a88ddfe63de9e9f574ac804ade460f010"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The index structure built by <aclass="el"href="classrtabmap_1_1FlannIndex.html#aad2f29314c6b021d1c53217a7a041521"title="Build the index over the given features, releasing any previous one.">buildIndex()</a><ahref="classrtabmap_1_1FlannIndex.html#a88ddfe63de9e9f574ac804ade460f010">More...</a><br/></td></tr>
<trclass="memdesc:a6eb4692afb561932aa6a20f7ebdee6c4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Drop the index and everything it holds, back to the state of a new one. <br/></td></tr>
<trclass="memdesc:a1f2bf8718a75aa0b5dded8c287293c23"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Serialize the index, to be given back to <aclass="el"href="classrtabmap_1_1FlannIndex.html#a826b3a33e22f455f04688df9d0d25b0b"title="Load an index serialized by serializeIndex(), releasing any previous one.">loadIndex()</a><br/></td></tr>
<trclass="memdesc:aad2f29314c6b021d1c53217a7a041521"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Build the index over the given features, releasing any previous one. <br/></td></tr>
<trclass="memdesc:a826b3a33e22f455f04688df9d0d25b0b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Load an index serialized by <aclass="el"href="classrtabmap_1_1FlannIndex.html#a1f2bf8718a75aa0b5dded8c287293c23"title="Serialize the index, to be given back to loadIndex()">serializeIndex()</a>, releasing any previous one. <br/></td></tr>
<trclass="memdesc:a028eac4aeef64d62b9edea1f7b38a71e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Load an index from a raw buffer, see the overload above. <br/></td></tr>
<trclass="memitem:a7d78d049ac4afb9f90fc0705506a6ce0"id="r_a7d78d049ac4afb9f90fc0705506a6ce0"><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classrtabmap_1_1FlannIndex.html#a7d78d049ac4afb9f90fc0705506a6ce0">removePoint</a> (unsigned int index)</td></tr>
<trclass="memdesc:a7d78d049ac4afb9f90fc0705506a6ce0"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Remove an indexed feature, by the index <aclass="el"href="classrtabmap_1_1FlannIndex.html#a8bd8312e92376d6bf2885907f5d93c68"title="Add features to the index.">addPoints()</a> gave for it. <br/></td></tr>
<trclass="memitem:accf263b21aaacf3d00e6e73ccef5cc75"id="r_accf263b21aaacf3d00e6e73ccef5cc75"><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classrtabmap_1_1FlannIndex.html#accf263b21aaacf3d00e6e73ccef5cc75">knnSearch</a> (const cv::Mat &query, cv::Mat &indices, cv::Mat &dists, int knn, int checks=32, float eps=0.0, bool sorted=true) const</td></tr>
<trclass="memdesc:accf263b21aaacf3d00e6e73ccef5cc75"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Search the k nearest neighbors of each query. <br/></td></tr>
<trclass="memdesc:a37bb608ab9ae1e7db35c2681a0c17eb5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Search the neighbors of each query within a radius. <br/></td></tr>
<divclass="textblock"><p>Nearest neighbor index over a set of features. </p>
<p>Wraps the search structures of the vendored rtflann and nanoflann libraries behind one interface, the structure being chosen with flann_algorithm_t at build time. Used for the visual word dictionary (<aclass="el"href="classrtabmap_1_1VWDictionary.html"title="Manages a dictionary of visual words for visual place recognition and loop closure detection.">VWDictionary</a>) and for the 2D point searches of visual registration (<aclass="el"href="classrtabmap_1_1RegistrationVis.html"title="Visual registration between two signatures using features and geometry.">RegistrationVis</a>).</p>
<p>The features are not copied: the index refers to the matrices it is given and keeps them alive, cv::Mat data being reference counted, so they must not be modified in place while it is in use. Every point it holds is designated by an index, assigned in the order the points were added and stable for the lifetime of the index: <aclass="el"href="classrtabmap_1_1FlannIndex.html#a7d78d049ac4afb9f90fc0705506a6ce0"title="Remove an indexed feature, by the index addPoints() gave for it.">removePoint()</a> leaves a hole rather than renumbering the points after it. </p>
<pclass="definition">Definition at line <aclass="el"href="FlannIndex_8h_source.html#l00055">55</a> of file <aclass="el"href="FlannIndex_8h_source.html">FlannIndex.h</a>.</p>
<p>The index structure built by <aclass="el"href="classrtabmap_1_1FlannIndex.html#aad2f29314c6b021d1c53217a7a041521"title="Build the index over the given features, releasing any previous one.">buildIndex()</a></p>
<p>The values under 8 are forwarded from rtflann's own enum and have to match it (see src/rtflann/defines.h); the nanoflann ones are rtabmap-specific and kept outside its range (0-7, 254, 255). A value is written in the serialized index header and checked back on load, so none of them may be renumbered.</p>
<p>The nanoflann structures take float features only (nanoflann has no Hamming metric) and search exactly, ignoring "checks". That makes them the fastest ones for 2D and 3D points, and the wrong ones for descriptors: an exact search visits more and more of the tree as the dimension grows, down to being as slow as an exhaustive search. Prefer the approximate rtflann kd-trees for those. </p>
<tr><tdclass="fieldname"><aid="a88ddfe63de9e9f574ac804ade460f010a4132d1ad7d7b3717b83f71aa60fa39e3"name="a88ddfe63de9e9f574ac804ade460f010a4132d1ad7d7b3717b83f71aa60fa39e3"></a>NANOFLANN_INDEX_KDTREE_SINGLE </td><tdclass="fielddoc"><p>nanoflann kd-tree. With a rebalancing factor of 1 it is built once, which is the cheapest to build and to search; over 1 it is the weight-balanced tree accepting <aclass="el"href="classrtabmap_1_1FlannIndex.html#a8bd8312e92376d6bf2885907f5d93c68"title="Add features to the index.">addPoints()</a>/removePoint(), which cannot be serialized while some of its points are removed. </p>
</td></tr>
</table>
<pclass="definition">Definition at line <aclass="el"href="FlannIndex_8h_source.html#l00075">75</a> of file <aclass="el"href="FlannIndex_8h_source.html">FlannIndex.h</a>.</p>
<p>Serialize the index, to be given back to <aclass="el"href="classrtabmap_1_1FlannIndex.html#a826b3a33e22f455f04688df9d0d25b0b"title="Load an index serialized by serializeIndex(), releasing any previous one.">loadIndex()</a></p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">computeChecksum</td><td>Add a checksum of the indexed features to the data, which <aclass="el"href="classrtabmap_1_1FlannIndex.html#a826b3a33e22f455f04688df9d0d25b0b"title="Load an index serialized by serializeIndex(), releasing any previous one.">loadIndex()</a> compares against the features it is given </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The serialized index, empty when there is nothing to serialize or when the structure in use cannot be</dd></dl>
<p>The format depends on the architecture and on the versions of the vendored libraries: <aclass="el"href="classrtabmap_1_1FlannIndex.html#a826b3a33e22f455f04688df9d0d25b0b"title="Load an index serialized by serializeIndex(), releasing any previous one.">loadIndex()</a> refuses an index it cannot read, leaving it to be rebuilt. </p>
<p>Build the index over the given features, releasing any previous one. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">algorithm</td><td>The structure to build </td></tr>
<tr><tdclass="paramname">features</td><td>One feature per row, CV_32FC1 or, for the rtflann structures only, CV_8UC1 for binary descriptors (Hamming distance) </td></tr>
<tr><tdclass="paramname">useDistanceL1</td><td>Search with the L1 distance instead of L2, ignored by LSH and by the binary descriptors </td></tr>
<tr><tdclass="paramname">rebalancingFactor</td><td>Fraction (factor-1)/factor of the index that can be left removed before it is rebuilt, e.g. half of it for 2. Set to 1 to never rebuild it. </td></tr>
<p>Load an index serialized by <aclass="el"href="classrtabmap_1_1FlannIndex.html#a1f2bf8718a75aa0b5dded8c287293c23"title="Serialize the index, to be given back to loadIndex()">serializeIndex()</a>, releasing any previous one. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">indexData</td><td>The serialized index </td></tr>
<tr><tdclass="paramname">algorithm</td><td>The structure it was built with </td></tr>
<tr><tdclass="paramname">features</td><td>The very same features it was built with, in the same order: the index refers to them by their row </td></tr>
<tr><tdclass="paramname">useDistanceL1</td><td>The distance it was built with </td></tr>
<tr><tdclass="paramname">rebalancingFactor</td><td>See <aclass="el"href="classrtabmap_1_1FlannIndex.html#aad2f29314c6b021d1c53217a7a041521"title="Build the index over the given features, releasing any previous one.">buildIndex()</a>. The serialized data carries the one the index was built with, which is deprecated and ignored: this one is used instead. </td></tr>
<tr><tdclass="paramname">errorMsg</td><td>Filled with what didn't match when the index is refused </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>False if the data doesn't correspond to the given features and parameters, in which case the index is left released </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="FlannIndex_8h_source.html#l00169">169</a> of file <aclass="el"href="FlannIndex_8h_source.html">FlannIndex.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="FlannIndex_8h_source.html#l00171">171</a> of file <aclass="el"href="FlannIndex_8h_source.html">FlannIndex.h</a>.</p>
<tr><tdclass="paramname">features</td><td>One feature per row, of the type and dimension the index was built with </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The index assigned to each of them, empty when the structure doesn't accept points after it is built </dd></dl>
<p>Remove an indexed feature, by the index <aclass="el"href="classrtabmap_1_1FlannIndex.html#a8bd8312e92376d6bf2885907f5d93c68"title="Add features to the index.">addPoints()</a> gave for it. </p>
<p>The feature is only marked as removed: it is skipped by the searches, but keeps taking memory until the index is rebuilt (see the rebalancing factor of <aclass="el"href="classrtabmap_1_1FlannIndex.html#aad2f29314c6b021d1c53217a7a041521"title="Build the index over the given features, releasing any previous one.">buildIndex()</a>). Not supported by every structure. </p>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.9.8 </li>