%SampleCnt calculates number of samples needed to be done

function SampleCnt = nsamples(num_inliers, num_pts, sample_size, conf)
q  = prod ([(num_inliers-sample_size+1) : num_inliers] ./ [(num_pts-sample_size+1) : num_pts]);

if q < eps
   SampleCnt = Inf;
else  
   SampleCnt  = log(1 - conf) / log(1 - q);
end

if SampleCnt < 1
   SampleCnt = 1;
end
