forked from bkarwoski/pnp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathp4p.h
executable file
·51 lines (43 loc) · 1.28 KB
/
p4p.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
/* ********************************* FILE ************************************/
/** \file p4p.h
*
* \brief This header contains a wrapper for kneips p3p solver
*
* \remark
* - c++11
* - no dependencies
* - can fail, returns identity pose if the data is degenerate, or asserts on incorrect data
* - no throw
*
*
*
*
* \author Mikael Persson
* \date 2016-04-01
* \note MIT licence
*
******************************************************************************/
#include <set>
#include <vector>
#include "utils/cvl/pose.h"
namespace cvl{
/**
* @brief p4p 3 points for the solution and a 4th to distinguish
* @param xs, at least 4
* @param yns, size equal to xs
* @param indexes, elements in xs, yns
* @return the Pose which best fits all four.
* y=project(P*xs)
*
* this is the simplest imaginable version of this,
* the pose will fit the first 3 perfectly and the last if it feels like it.
* if the measurements are colinear or otherwise degenerate a identity pose is returned.
*
* This is suitable for low outlieratios, <50%, and low noise.
* the use of std::vector is convenient not fast.
*/
PoseD p4p(const std::vector<cvl::Vector3D>& xs,
const std::vector<cvl::Vector2D>& yns,
Vector4<uint> indexes);
}// end namespace cvl