JeVois  1.18
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
PythonSupport.H File Reference
#include <boost/python.hpp>
#include <opencv2/core/core.hpp>
#include <array>
#include <imgui.h>
#include <jevois/Core/details/PythonSupportImpl.H>
Include dependency graph for PythonSupport.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 jevois
 
 jevois::python
 

Functions

void jevois::python::setEngine (jevois::Engine *e)
 Initialize Python, numpy, and allow python modules to send serial outputs through the JeVois Engine. More...
 
bool jevois::python::hasattr (boost::python::object &o, char const *name)
 Check whether a boost::python::object has an attribute. More...
 
template<class T >
boost::python::list jevois::python::pyVecToList (std::vector< T > const &v)
 Helper to convert std::vector<T> to python list. More...
 
template<class T >
std::vector< T > jevois::python::pyListToVec (boost::python::object const &lst)
 Helper to convert python list (or any iterable) to std::vector<T> More...
 
template<typename T , size_t N>
std::array< T, N > jevois::python::tupleToArray (boost::python::object const &o)
 Helper to extract a tuple with elements of uniform type T into an std::array. More...
 
template<typename T , size_t N>
void jevois::python::tupleToArray (boost::python::object const &o, std::array< T, N > &arr, size_t minN=N)
 Helper to extract a tuple with elements of uniform type T into an std::array. More...
 
template<typename T >
jevois::python::pyextract (boost::python::object const &o)
 Generic value extraction, pass-through to boost::python::extract() for types that python knows how to extract. More...
 
template<>
cv::Scalar_< float > jevois::python::pyextract< cv::Scalar_< float > > (boost::python::object const &o)
 Specialization for cv::Scalar_<float>, extract from tuple of 1..4 float values. More...
 
template<>
cv::Scalar_< int > jevois::python::pyextract< cv::Scalar_< int > > (boost::python::object const &o)
 Specialization for cv::Scalar_<int>, extract from tuple of 1..4 int values. More...
 
template<>
cv::Point_< float > jevois::python::pyextract< cv::Point_< float > > (boost::python::object const &o)
 Specialization for cv::Point_<float>, extract from tuple of 2 float values. More...
 
template<>
cv::Point_< int > jevois::python::pyextract< cv::Point_< int > > (boost::python::object const &o)
 Specialization for cv::Point_<int>, extract from tuple of 2 int values. More...
 
template<>
cv::Size_< float > jevois::python::pyextract< cv::Size_< float > > (boost::python::object const &o)
 Specialization for cv::Size_<float>, extract from tuple of 2 float values. More...
 
template<>
cv::Size_< int > jevois::python::pyextract< cv::Size_< int > > (boost::python::object const &o)
 Specialization for cv::Size_<int>, extract from tuple of 2 int values. More...
 
template<>
ImColor jevois::python::pyextract< ImColor > (boost::python::object const &o)
 Specialization for ImColor, extract from tuple of 3..4 int values (if 3 then, alpha=255) More...
 
template<typename T >
boost::python::object jevois::python::topyobj (T const &val)
 Convert value to python, pass-through to python::object(val) More...
 
template<>
boost::python::object jevois::python::topyobj (cv::Scalar_< float > const &val)
 Specialization for cv::Scalar<float>, returns a tuple with 4 float elements. More...
 
template<>
boost::python::object jevois::python::topyobj (cv::Scalar_< int > const &val)
 Specialization for cv::Scalar<int>, returns a tuple with 4 int elements. More...
 
template<>
boost::python::object jevois::python::topyobj (cv::Point_< float > const &val)
 Specialization for cv::Point<float>, returns a tuple with 2 float elements. More...
 
template<>
boost::python::object jevois::python::topyobj (cv::Point_< int > const &val)
 Specialization for cv::Point<int>, returns a tuple with 2 int elements. More...
 
template<>
boost::python::object jevois::python::topyobj (cv::Size_< float > const &val)
 Specialization for cv::Size<float>, returns a tuple with 2 float elements. More...
 
template<>
boost::python::object jevois::python::topyobj (cv::Size_< int > const &val)
 Specialization for cv::Size<int>, returns a tuple with 2 int elements. More...
 
template<>
boost::python::object jevois::python::topyobj (ImColor const &val)
 Specialization for ImColor, returns a tuple with 4 int elements. More...