mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
* Adding GFTT and SIFT Cuda support * Working CudaSift * Disable cudasift option when not available * Added check to avoid re-allocating gpu memory everytime parseParameters is called. Added workaround of to detect/ignore invalid descriptors * Added SIFT/PreciseUpscale and SIFT/Upscale parameters. Adjusted max octave to behave more like opencv * Refactored how maximum features are thresholded, to be more similar to OpenCV version * Updated loop closure benchmark scripts * Cuda optical flow tmp commit * Added Stereo/Gpu Vis/CorFlowGpu parameters (optical flow gpu integration for F2F odom and stereo correspondences) * Fixed build without opencv cuda * Fixed build with Opencv 4.10 * ZED: updated parameters to match zed sdk 4 * MRPT requires C++17 * updated max octave limit CudaSift
29 lines
898 B
Matlab
29 lines
898 B
Matlab
function DU = updateDictionary(Dict, Sign)
|
|
%UPDATEDICTIONARY Update the dictionary with the new signature (place)
|
|
% DU = updateDictionary(Dict, Sign)
|
|
%
|
|
% DU = dictionary updated
|
|
% dictionary = [wordId1 SignRefIds...; wordId2 SignRefIds...; ...]
|
|
% sign = [signId WordRefIds...]
|
|
|
|
signId = Sign(1);
|
|
Sign = Sign(Sign~=0);
|
|
for i=2:length(Sign)
|
|
indexWord = [];
|
|
if isempty(Dict) ~= 1
|
|
indexWord = find(Dict(:,1) == Sign(i),1);
|
|
end
|
|
if isempty(indexWord) == 1
|
|
Dict(size(Dict,1)+1,1) = Sign(i); %Word id
|
|
Dict(size(Dict,1),2) = signId; %Signature id ref
|
|
else
|
|
ii = 1:length(Dict(indexWord,1:end));
|
|
indexesZero = ii(Dict(indexWord,1:end) == 0);
|
|
if isempty(indexesZero)
|
|
Dict(indexWord, size(Dict,2)+1) = signId;
|
|
else
|
|
Dict(indexWord, indexesZero(1)) = signId;
|
|
end
|
|
end
|
|
end
|
|
DU = Dict; |