diff --git a/python/handwritten/exportgtsam.cpp b/python/handwritten/exportgtsam.cpp index 84585adff..6afc1f85e 100644 --- a/python/handwritten/exportgtsam.cpp +++ b/python/handwritten/exportgtsam.cpp @@ -34,6 +34,7 @@ void exportRot2(); void exportRot3(); void exportPose2(); void exportPose3(); +void exportPinholeCamera(); // Linear void exportNoiseModels(); @@ -67,6 +68,7 @@ BOOST_PYTHON_MODULE(libgtsam_python){ exportRot3(); exportPose2(); exportPose3(); + exportPinholeCamera(); exportNoiseModels(); diff --git a/python/handwritten/geometry/PinholeCamera.cpp b/python/handwritten/geometry/PinholeCamera.cpp new file mode 100644 index 000000000..4123b520c --- /dev/null +++ b/python/handwritten/geometry/PinholeCamera.cpp @@ -0,0 +1,49 @@ +/* ---------------------------------------------------------------------------- + + * GTSAM Copyright 2010, Georgia Tech Research Corporation, + * Atlanta, Georgia 30332-0415 + * All Rights Reserved + * Authors: Frank Dellaert, et al. (see THANKS for the full author list) + + * See LICENSE for the license information + + * -------------------------------------------------------------------------- */ + +/** + * @brief wraps PinholeCamera classes to python + * @author Ellon Paiva Mendes (LAAS-CNRS) + **/ + +#include + +#define NO_IMPORT_ARRAY +#include + +#include "gtsam/geometry/PinholeCamera.h" +#include "gtsam/geometry/Cal3_S2.h" + + +using namespace boost::python; +using namespace gtsam; + +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(print_overloads, PinholeCamera::print, 0, 1) +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(equals_overloads, PinholeCamera::equals, 1, 2) +BOOST_PYTHON_FUNCTION_OVERLOADS(Lookat_overloads, PinholeCamera::Lookat, 3, 4) + +void exportPinholeCamera(){ + +class_ >("PinholeCameraCal3_S2") + .def(init<>()) + .def(init()) + .def(init()) + .def(init()) + .def(init()) + .def("print", &PinholeCamera::print, print_overloads(args("s"))) + .def("equals", &PinholeCamera::equals, equals_overloads(args("q","tol"))) + .def("pose", &PinholeCamera::pose, return_value_policy()) + .def("calibration", &PinholeCamera::calibration, return_value_policy()) + .def("Lookat", &PinholeCamera::Lookat, Lookat_overloads()) + .staticmethod("Lookat") +; + +} \ No newline at end of file