expose findEssentialMat, decomposeEssentialMat and recoverPose to Python

This commit is contained in:
Alexander Mordvintsev
2013-09-09 13:55:35 +04:00
parent 77a2529eb7
commit 79d51c3398
2 changed files with 20 additions and 3 deletions

View File

@@ -688,6 +688,23 @@ bool pyopencv_to(PyObject* obj, Point2f& p, const char* name)
return PyArg_ParseTuple(obj, "ff", &p.x, &p.y) > 0;
}
template<>
bool pyopencv_to(PyObject* obj, Point2d& p, const char* name)
{
(void)name;
if(!obj || obj == Py_None)
return true;
if(!!PyComplex_CheckExact(obj))
{
Py_complex c = PyComplex_AsCComplex(obj);
p.x = saturate_cast<double>(c.real);
p.y = saturate_cast<double>(c.imag);
return true;
}
return PyArg_ParseTuple(obj, "dd", &p.x, &p.y) > 0;
}
template<>
PyObject* pyopencv_from(const Point& p)
{