20#include <boost/python.hpp>
21#include <opencv2/core/core.hpp>
51 bool hasattr(boost::python::object &
o,
char const * name);
59 std::vector<T>
pyListToVec(boost::python::object
const & lst);
62 template <
typename T,
size_t N>
70 template <
typename T,
size_t N>
71 void tupleToArray(boost::python::object
const &
o, std::array<T, N> & arr,
size_t minN = N);
79 cv::Scalar_<float> pyextract<cv::Scalar_<float>>(boost::python::object
const &
o);
83 cv::Scalar_<int> pyextract<cv::Scalar_<int>>(boost::python::object
const &
o);
87 cv::Point_<float> pyextract<cv::Point_<float>>(boost::python::object
const &
o);
91 cv::Point_<int> pyextract<cv::Point_<int>>(boost::python::object
const &
o);
95 cv::Size_<float> pyextract<cv::Size_<float>>(boost::python::object
const &
o);
99 cv::Size_<int> pyextract<cv::Size_<int>>(boost::python::object
const &
o);
108 template <
typename T>
113 boost::python::object
topyobj(cv::Scalar_<float>
const & val);
117 boost::python::object
topyobj(cv::Scalar_<int>
const & val);
121 boost::python::object
topyobj(cv::Point_<float>
const & val);
125 boost::python::object
topyobj(cv::Point_<int>
const & val);
129 boost::python::object
topyobj(cv::Size_<float>
const & val);
133 boost::python::object
topyobj(cv::Size_<int>
const & val);
138 boost::python::object
topyobj(ImColor
const & val);
146#include <jevois/Core/details/PythonSupportImpl.H>
JeVois processing engine - gets images from camera sensor, processes them, and sends results over USB...
T pyextract(boost::python::object const &o)
Generic value extraction, pass-through to boost::python::extract() for types that python knows how to...
ImColor pyextract< ImColor >(boost::python::object const &o)
Specialization for ImColor, extract from tuple of 3..4 int values (if 3 then, alpha=255)
boost::python::object topyobj(T const &val)
Convert value to python, pass-through to python::object(val)
boost::python::list pyVecToList(std::vector< T > const &v)
Helper to convert std::vector<T> to python list.
std::array< T, N > tupleToArray(boost::python::object const &o)
Helper to extract a tuple with elements of uniform type T into an std::array.
void setEngine(jevois::Engine *e)
Initialize Python, numpy, and allow python modules to send serial outputs through the JeVois Engine.
bool hasattr(boost::python::object &o, char const *name)
Check whether a boost::python::object has an attribute.
std::vector< T > pyListToVec(boost::python::object const &lst)
Helper to convert python list (or any iterable) to std::vector<T>
Main namespace for all JeVois classes and functions.