JeVois  1.22
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Loading...
Searching...
No Matches
jevois::python Namespace Reference

Python-related helpers and functions.

Classes

class  PyParHelper
 Typed class to allow creation of Parameter in Python. More...
 
class  PyParHelperBase
 Base helper class to allow creation of Parameter in python. More...
 

Enumerations

enum  YUYV {
  Black = 0x8000 , DarkGrey = 0x8050 , MedGrey = 0x8080 , LightGrey = 0x80a0 ,
  White = 0x80ff , DarkGreen = 0x0000 , MedGreen = 0x0040 , LightGreen = 0x00ff ,
  DarkTeal = 0x7070 , MedTeal = 0x7090 , LightTeal = 0x70b0 , DarkPurple = 0xa030 ,
  MedPurple = 0xa050 , LightPurple = 0xa080 , DarkPink = 0xff00 , MedPink = 0xff80 ,
  LightPink = 0xffff
}
 

Functions

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.
 
template<class T >
boost::python::list pyVecToList (std::vector< T > const &v)
 Helper to convert std::vector<T> to python list.
 
template<class T >
std::vector< T > pyListToVec (boost::python::object const &lst)
 Helper to convert python list (or any iterable) to std::vector<T>
 
template<typename T , size_t N>
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.
 
template<typename T , size_t N>
void 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.
 
template<typename T >
pyextract (boost::python::object const &o)
 Generic value extraction, pass-through to boost::python::extract() for types that python knows how to extract.
 
template<>
cv::Scalar_< float > pyextract< cv::Scalar_< float > > (boost::python::object const &o)
 Specialization for cv::Scalar_<float>, extract from tuple of 1..4 float values.
 
template<>
cv::Scalar_< int > pyextract< cv::Scalar_< int > > (boost::python::object const &o)
 Specialization for cv::Scalar_<int>, extract from tuple of 1..4 int values.
 
template<>
cv::Point_< float > pyextract< cv::Point_< float > > (boost::python::object const &o)
 Specialization for cv::Point_<float>, extract from tuple of 2 float values.
 
template<>
cv::Point_< int > pyextract< cv::Point_< int > > (boost::python::object const &o)
 Specialization for cv::Point_<int>, extract from tuple of 2 int values.
 
template<>
cv::Size_< float > pyextract< cv::Size_< float > > (boost::python::object const &o)
 Specialization for cv::Size_<float>, extract from tuple of 2 float values.
 
template<>
cv::Size_< int > pyextract< cv::Size_< int > > (boost::python::object const &o)
 Specialization for cv::Size_<int>, extract from tuple of 2 int values.
 
template<>
ImColor pyextract< ImColor > (boost::python::object const &o)
 Specialization for ImColor, extract from tuple of 3..4 int values (if 3 then, alpha=255)
 
template<typename T >
boost::python::object topyobj (T const &val)
 Convert value to python, pass-through to python::object(val)
 
template<>
boost::python::object topyobj (cv::Scalar_< float > const &val)
 Specialization for cv::Scalar<float>, returns a tuple with 4 float elements.
 
template<>
boost::python::object topyobj (cv::Scalar_< int > const &val)
 Specialization for cv::Scalar<int>, returns a tuple with 4 int elements.
 
template<>
boost::python::object topyobj (cv::Point_< float > const &val)
 Specialization for cv::Point<float>, returns a tuple with 2 float elements.
 
template<>
boost::python::object topyobj (cv::Point_< int > const &val)
 Specialization for cv::Point<int>, returns a tuple with 2 int elements.
 
template<>
boost::python::object topyobj (cv::Size_< float > const &val)
 Specialization for cv::Size<float>, returns a tuple with 2 float elements.
 
template<>
boost::python::object topyobj (cv::Size_< int > const &val)
 Specialization for cv::Size<int>, returns a tuple with 2 int elements.
 
template<>
boost::python::object topyobj (ImColor const &val)
 Specialization for ImColor, returns a tuple with 4 int elements.
 

Variables

EngineengineForPythonModule = nullptr
 

Enumeration Type Documentation

◆ YUYV

Enumerator
Black 
DarkGrey 
MedGrey 
LightGrey 
White 
DarkGreen 
MedGreen 
LightGreen 
DarkTeal 
MedTeal 
LightTeal 
DarkPurple 
MedPurple 
LightPurple 
DarkPink 
MedPink 
LightPink 

Definition at line 213 of file PythonSupport.C.

Variable Documentation

◆ engineForPythonModule

Engine* jevois::python::engineForPythonModule = nullptr

Definition at line 70 of file PythonSupport.C.

Referenced by setEngine().