cgv
Loading...
Searching...
No Matches
ransac.h
1#pragma once
2#include <cmath>
3#include <cgv/math/functions.h>
4#include <vector>
5
6
7namespace cgv{
8 namespace math{
9
14template <typename T>
15unsigned num_ransac_iterations(unsigned n_min, const T p_out, const T p_surety = 0.99)
16{
17 unsigned int iter = (unsigned) ::ceil(log(1.0-p_surety)/log(1.0-pow(1.0-p_out,(T)n_min)));
18 if (iter == 0)
19 iter = 1;
20 return iter;
21}
22
23
24
25
26
27
28
29 }
30}
31
the cgv namespace
Definition print.h:11