expose findEssentialMat, decomposeEssentialMat and recoverPose to Python
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user