Skip to content
This repository
tree: f94890f8d7
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 37 lines (31 sloc) 0.599 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
function [q num den]= get_q_RANSAC(N, N_I, k)

% [q num den] = get_q_RANSAC(N, N_I, k)
%
% DESC:
% calculates the probability q
%
% AUTHOR
% Marco Zuliani - marco.zuliani@gmail.com
%
% VERSION:
% 1.0
%
% INPUT:
% N = number of elements
% N_I = number of inliers
% k = cardinality of the MSS
%
% OUTPUT:
% q = probability
% num, den = q = num / den

if (k > N_I)
    error('k should be less or equal than N_I')
end;

if (N == N_I)
    q = 1;
    return;
end;

num = N_I:-1:N_I-k+1;
den = N:-1:N-k+1;
q = prod(num./den);

return
Something went wrong with that request. Please try again.