Commit b43befa8 authored by 王鑫(21软)'s avatar 王鑫(21软)

Upload New File

parent 3dcb82e7
%function:Calculate the error of the nearest spot check
% - Params:
% - A: Initial sparse point cloud [n,3]
% - B: Target model point cloud [m,3]
% - Mdl: kdtree model of B
% - Return:
% - cost:the error(Distance sum)
function cost = calculateCost( A, B, Mdl)
idx = knnsearch(Mdl,A);
NN = B(idx,:);
cost = sum(sqrt(sum((NN-A).^2,2)))/length(A);
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment