![]() |
SearchInTreePURPOSE
Search nearest-neighbours using a Btree
SYNOPSIS
function rs=SearchInTree(T,F,matchArea,s,c)
DESCRIPTION
Search nearest-neighbours using a Btree Searches nearest-neighbours using a balanced tree of poses as described in Section VI-C of the paper. Input parameters - T The BTree to search. - F The Filter to use in the search - matchArea The area around the previous pose where the new pose should be to be considered a neighbour (this is vector 'v' in the papers). - s The probability threshold. - c The BTree node from where to start the search. This must be the root node for the initial call. See also SearchInTree, BTree, TreeDetectLoops. CROSS-REFERENCE INFORMATION
This function calls:
SOURCE CODE
0001 function rs=SearchInTree(T,F,matchArea,s,c) 0002 % Search nearest-neighbours using a Btree 0003 % 0004 % Searches nearest-neighbours using a balanced tree of poses as described 0005 % in Section VI-C of the paper. 0006 % 0007 % Input parameters 0008 % - T The BTree to search. 0009 % - F The Filter to use in the search 0010 % - matchArea The area around the previous pose where the new pose should 0011 % be to be considered a neighbour (this is vector 'v' in the 0012 % papers). 0013 % - s The probability threshold. 0014 % - c The BTree node from where to start the search. This must be the 0015 % root node for the initial call. 0016 % 0017 % See also SearchInTree, BTree, TreeDetectLoops. 0018 0019 [pMin pMax]=ProbDistance2PoseDataAboveThreshold(T.data{c}.element,F,matchArea,s); 0020 0021 if pMax<s 0022 rs={}; 0023 else 0024 if pMin>s 0025 ids=get(T.data{c}.element,'id'); 0026 nIds=size(ids,2); 0027 rs=cell(1,nIds); 0028 for i=1:nIds 0029 rs{i}=T.data{T.leaves(ids(i))}.element; 0030 end 0031 else 0032 if T.data{c}.heigth>1 0033 rsl=SearchInTree(T,F,matchArea,s,T.data{c}.left); 0034 rsr=SearchInTree(T,F,matchArea,s,T.data{c}.right); 0035 rs=[rsl rsr]; 0036 else 0037 rs={T.data{c}.element}; 0038 end 0039 end 0040 end 0041 |