线性规划是最优化线性目标方程的技术,受限于线性等式个线性不等式:
openMVG提供LP容器,来配置线性规划;解决线性规划
openMVG linear program container
- 一般的容器
// Dense LP
LP_Constraints
// Sparse LP
LP_Constraints_Sparse
允许包含:1,目标函数c
和类型max or min
;2,限制A, sign, b
;3,关于x
的限制<=,=,>=
openMVG linear program solvers
包括但不限于
- OSI_CLP (COIN-OR) project,
- MOSEK commercial, free in a research context.
使用
可用于
- 经典的线性规划问题
- 测试线性问题的可行性
- 最优化可行问题的上界
// Setup the LP (fill A,b,c and the constraint over x)
LP_Constraints cstraint;
BuildLinearProblem(cstraint);
// Solve the LP with the solver of your choice
std::vector<double> vec_solution(2);
#if OPENMVG_HAVE_MOSEK
MOSEK_SolveWrapper solver(2);
#else
OSI_CLP_SolverWrapper solver(2);
#endif
// Send constraint to the LP solver
solver.setup(cstraint);
// If LP have a solution
if (solver.solve())
// Get back estimated parameters
solver.getSolution(vec_solution);
Require: gammaLow, gammUp (Low and upper bound of the parameter to optimize)
Require: the LP problem (cstraintBuilder)
Ensure: the optimal gamma value, or return infeasibility of the contraints set.
BisectionLP(
LP_Solver & solver,
ConstraintBuilder & cstraintBuilder,
double gammaUp = 1.0, // Upper bound
double gammaLow = 0.0, // lower bound
double eps = 1e-8, // precision that stop dichotomy
const int maxIteration = 20) // max number of iteration
{
ConstraintType constraint;
do
{
++k; // One more iteration
double gamma = (gammaLow + gammaUp) / 2.0;
//-- Setup constraint and solver
cstraintBuilder.Build(gamma, constraint);
solver.setup( constraint );
//-- Solving
bool bFeasible = solver.solve();
//-- According feasibility update the corresponding bound
//-> Feasible, update the upper bound
//-> Not feasible, update the lower bound
(bFeasible) ? gammaUp = gamma; : gammaLow = gamma;
} while (k < maxIteration && gammaUp - gammaLow > eps);
}
Multiple View Geometry solvers based on L-Infinity minimization
- 多视图三角重构 [LinfNorm],
- 估计P [LinfNorm],
- 估计T和X:
- the simple one [LinfNorm],
- the robust based on slack variables [OlssonDuality].
- Translation averaging: - Registration of relative translations to compute global translations [GlobalACSfM].