18#include <boost/python.hpp>
42#define PY_ARRAY_UNIQUE_SYMBOL pbcvt_ARRAY_API
47#define JEVOIS_PYTHON_FUNC(funcname) boost::python::def(#funcname, jevois::funcname)
50#define JEVOIS_PYTHON_RAWIMAGE_FUNC(funcname) boost::python::def(#funcname, jevois::rawimage::funcname)
53#define JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(val) value(#val, jevois::rawimage::val)
56#define JEVOIS_PYTHON_ENUM_VAL(val) value(#val, jevois::python::val)
59#define JEVOIS_PYTHON_CONSTANT(cst) boost::python::scope().attr(#cst) = cst;
62#define JEVOIS_PYTHON_DNN_FUNC(funcname) boost::python::def(#funcname, jevois::dnn::funcname)
79#if JEVOIS_PYTHON_MAJOR == 3 && JEVOIS_PYTHON_MINOR >= 10
80 PyConfig config; PyConfig_InitPythonConfig(&config);
82 PyStatus status = PyConfig_SetString(&config, &config.program_name, Py_DecodeLocale(
"",
nullptr));
83 if (PyStatus_Exception(status)) { PyConfig_Clear(&config);
LFATAL(
"Could not initialize Python"); }
85 status = Py_InitializeFromConfig(&config);
86 if (PyStatus_Exception(status)) { PyConfig_Clear(&config);
LFATAL(
"Could not initialize Python"); }
88 Py_SetProgramName(Py_DecodeLocale(
"",
nullptr));
118 return PyObject_HasAttrString(
o.ptr(), name);
126 void pythonSendSerial(std::string
const & str)
127 { jevois::python::engine()->sendSerial(str); }
129 size_t pythonFrameNum()
130 {
return jevois::frameNum(); }
132 boost::python::tuple pythonLoadCameraCalibration(std::string
const & stem,
bool throw_if_not_found)
138 void pythonWriteCamRegister(
unsigned short reg,
unsigned short val)
140 auto cam = jevois::python::engine()->camera();
141 if (!cam)
LFATAL(
"Not using a Camera for video input");
142 cam->writeRegister(reg, val);
145 unsigned short pythonReadCamRegister(
unsigned short reg)
147 auto cam = jevois::python::engine()->camera();
148 if (!cam)
LFATAL(
"Not using a Camera for video input");
149 return cam->readRegister(reg);
152 void pythonWriteIMUregister(
unsigned short reg,
unsigned short val)
154 auto imu = jevois::python::engine()->imu();
155 if (!imu)
LFATAL(
"No IMU driver loaded");
156 imu->writeRegister(reg, val);
159 unsigned short pythonReadIMUregister(
unsigned short reg)
161 auto imu = jevois::python::engine()->imu();
162 if (!imu)
LFATAL(
"No IMU driver loaded");
163 return imu->readRegister(reg);
166 void pythonWriteDMPregister(
unsigned short reg,
unsigned short val)
168 auto imu = jevois::python::engine()->imu();
169 if (!imu)
LFATAL(
"No IMU driver loaded");
170 imu->writeDMPregister(reg, val);
173 unsigned short pythonReadDMPregister(
unsigned short reg)
175 auto imu = jevois::python::engine()->imu();
176 if (!imu)
LFATAL(
"No IMU driver loaded");
177 return imu->readDMPregister(reg);
180#ifdef JEVOIS_LDEBUG_ENABLE
181 void pythonLDEBUG(std::string
const & logmsg) {
LDEBUG(logmsg); }
183 void pythonLDEBUG(std::string
const &) { }
185 void pythonLINFO(std::string
const & logmsg) {
LINFO(logmsg); }
186 void pythonLERROR(std::string
const & logmsg) {
LERROR(logmsg); }
187 void pythonLFATAL(std::string
const & logmsg) {
LFATAL(logmsg); }
192 std::string pythonGetParamStringUnique(boost::python::object & pyinst, std::string
const & descriptor)
194 jevois::Component * comp = jevois::python::engine()->getPythonComponent(pyinst.ptr()->ob_type);
198 void pythonSetParamStringUnique(boost::python::object & pyinst, std::string
const & descriptor,
199 std::string
const & val)
201 jevois::Component * comp = jevois::python::engine()->getPythonComponent(pyinst.ptr()->ob_type);
222BOOST_PYTHON_MODULE(libjevoispro)
224BOOST_PYTHON_MODULE(libjevois)
228 boost::python::to_python_converter<cv::Mat, pbcvt::matToNDArrayBoostConverter>();
229 pbcvt::matFromNDArrayBoostConverter();
234 boost::python::scope().attr(
"pro") =
true;
236 boost::python::scope().attr(
"pro") =
false;
240#ifdef JEVOIS_PLATFORM
241 boost::python::scope().attr(
"platform") =
true;
243 boost::python::scope().attr(
"platform") =
false;
256 boost::python::def(
"sendSerial", pythonSendSerial);
257 boost::python::def(
"frameNum", pythonFrameNum);
258 boost::python::def(
"writeCamRegister", pythonWriteCamRegister);
259 boost::python::def(
"readCamRegister", pythonReadCamRegister);
260 boost::python::def(
"writeIMUregister", pythonWriteIMUregister);
261 boost::python::def(
"readIMUregister", pythonReadIMUregister);
262 boost::python::def(
"writeDMPregister", pythonWriteDMPregister);
263 boost::python::def(
"readDMPregister", pythonReadDMPregister);
271 boost::python::def(
"LDEBUG", pythonLDEBUG);
272 boost::python::def(
"LINFO", pythonLINFO);
273 boost::python::def(
"LERROR", pythonLERROR);
274 boost::python::def(
"LFATAL", pythonLFATAL);
289 boost::python::def(
"loadCameraCalibration", pythonLoadCameraCalibration);
293 void (*
imgToStd2)(
float & x,
float & y,
unsigned int const width,
unsigned int const height,
float const eps) =
295 boost::python::def(
"imgToStd",
imgToStd1);
296 boost::python::def(
"imgToStd",
imgToStd2);
299 void (*
stdToImg2)(
float & x,
float & y,
unsigned int const width,
unsigned int const height,
float const eps) =
301 boost::python::def(
"stdToImg",
stdToImg1);
302 boost::python::def(
"stdToImg",
stdToImg2);
310 boost::python::class_<jevois::RawImage>(
"RawImage")
326 boost::python::enum_<jevois::python::YUYV>(
"YUYV")
327 .JEVOIS_PYTHON_ENUM_VAL(Black)
328 .JEVOIS_PYTHON_ENUM_VAL(DarkGrey)
329 .JEVOIS_PYTHON_ENUM_VAL(MedGrey)
330 .JEVOIS_PYTHON_ENUM_VAL(LightGrey)
331 .JEVOIS_PYTHON_ENUM_VAL(White)
332 .JEVOIS_PYTHON_ENUM_VAL(DarkGreen)
333 .JEVOIS_PYTHON_ENUM_VAL(MedGreen)
334 .JEVOIS_PYTHON_ENUM_VAL(LightGreen)
335 .JEVOIS_PYTHON_ENUM_VAL(DarkTeal)
336 .JEVOIS_PYTHON_ENUM_VAL(MedTeal)
337 .JEVOIS_PYTHON_ENUM_VAL(LightTeal)
338 .JEVOIS_PYTHON_ENUM_VAL(DarkPurple)
339 .JEVOIS_PYTHON_ENUM_VAL(MedPurple)
340 .JEVOIS_PYTHON_ENUM_VAL(LightPurple)
341 .JEVOIS_PYTHON_ENUM_VAL(DarkPink)
342 .JEVOIS_PYTHON_ENUM_VAL(MedPink)
343 .JEVOIS_PYTHON_ENUM_VAL(LightPink)
354 boost::python::class_<jevois::InputFramePython>(
"InputFrame")
356 boost::python::return_value_policy<boost::python::reference_existing_object>())
358 boost::python::return_value_policy<boost::python::reference_existing_object>())
361 boost::python::return_value_policy<boost::python::reference_existing_object>())
363 boost::python::return_value_policy<boost::python::reference_existing_object>())
365 boost::python::return_value_policy<boost::python::reference_existing_object>())
367 boost::python::return_value_policy<boost::python::reference_existing_object>())
385 boost::python::class_<jevois::OutputFramePython>(
"OutputFrame")
387 boost::python::return_value_policy<boost::python::reference_existing_object>())
428 void (*drawRect2)(
jevois::RawImage & img,
int x,
int y,
unsigned int w,
unsigned int h,
unsigned int col) =
430 boost::python::def(
"drawRect", drawRect1);
431 boost::python::def(
"drawRect", drawRect2);
434 boost::python::enum_<jevois::rawimage::Font>(
"Font")
435 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font5x7)
436 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font6x10)
437 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font7x13)
438 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font8x13bold)
439 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font9x15bold)
440 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font10x20)
441 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font11x22)
442 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font12x22)
443 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font14x26)
444 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font15x28)
445 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font16x29)
446 .JEVOIS_PYTHON_RAWIMAGE_ENUM_VAL(Font20x38);
448 void (*writeText1)(
jevois::RawImage & img, std::string
const & txt,
int x,
int y,
450 boost::python::def(
"writeText", writeText1);
468 boost::python::class_<jevois::Timer>(
"Timer", boost::python::init<char const *, size_t, int>())
470 .def(
"stop", timer_stop, boost::python::return_value_policy<boost::python::copy_const_reference>());
473 boost::python::class_<jevois::Profiler>(
"Profiler", boost::python::init<char const *, size_t, int>())
476 .def(
"stop", &
jevois::Profiler::stop, boost::python::return_value_policy<boost::python::copy_const_reference>());
490 boost::python::class_<ImVec2>(
"ImVec2", boost::python::init<float, float>())
491 .def_readwrite(
"x", &ImVec2::x)
492 .def_readwrite(
"y", &ImVec2::y);
494 boost::python::class_<ImVec4>(
"ImVec4", boost::python::init<float, float, float, float>())
495 .def_readwrite(
"x", &ImVec4::x)
496 .def_readwrite(
"y", &ImVec4::y)
497 .def_readwrite(
"z", &ImVec4::z)
498 .def_readwrite(
"w", &ImVec4::w);
500 boost::python::class_<ImColor>(
"ImColor", boost::python::init<int, int, int, int>())
501 .def(boost::python::init<float, float, float, float>())
502 .def(boost::python::init<ImU32>())
503 .def_readwrite(
"Value", &ImColor::Value);
505 boost::python::class_<jevois::GUIhelperPython>(
"GUIhelper", boost::python::init<jevois::GUIhelper *>())
549 boost::python::class_<jevois::ChatBox>(
"ChatBox", boost::python::init<std::string>())
559 boost::python::class_<jevois::ParameterCategory>(
"ParameterCategory", boost::python::init<std::string, std::string>())
565 boost::python::def(
"getParamStr", pythonGetParamStringUnique);
566 boost::python::def(
"setParamStr", pythonSetParamStringUnique);
569 boost::python::class_<jevois::PythonParameter>(
"Parameter", boost::python::init<boost::python::object &,
570 std::string
const &, std::string
const &, std::string
const &,
573 boost::python::return_value_policy<boost::python::reference_existing_object>())
587 boost::python::class_<jevois::dnn::PreProcessorForPython>(
"PreProcessor", boost::python::no_init)
588 .def(
"imagesize", &jevois::dnn::PreProcessorForPython::imagesize)
589 .def(
"blobs", &jevois::dnn::PreProcessorForPython::blobs)
590 .def(
"blobsize", &jevois::dnn::PreProcessorForPython::blobsize)
591 .def(
"b2i", &jevois::dnn::PreProcessorForPython::b2i)
592 .def(
"getUnscaledCropRect", &jevois::dnn::PreProcessorForPython::getUnscaledCropRect)
593 .def(
"i2b", &jevois::dnn::PreProcessorForPython::i2b)
597 boost::python::class_<jevois::dnn::PostProcessorDetectYOLOforPython>(
"PyPostYOLO")
598 .def(
"freeze", &jevois::dnn::PostProcessorDetectYOLOforPython::freeze)
599 .def(
"yolo", &jevois::dnn::PostProcessorDetectYOLOforPython::yolo)
605 boost::python::def(
"shapestr", shapestr1);
#define JEVOIS_VERSION_PATCH
#define JEVOIS_VERSION_MINOR
#define JEVOIS_SHARE_PATH
Base path for shared files (e.g., neural network weights, etc)
#define JEVOIS_VERSION_MAJOR
Variables set by CMake.
#define JEVOIS_PYDNN_PATH
Directory where python pre/net/post DNN processors are stored:
void(* stdToImg2)(float &x, float &y, unsigned int const width, unsigned int const height, float const eps)
void(* imgToStd1)(float &x, float &y, jevois::RawImage const &camimg, float const eps)
#define JEVOIS_PYTHON_RAWIMAGE_FUNC(funcname)
#define JEVOIS_PYTHON_FUNC(funcname)
#define JEVOIS_PYTHON_CONSTANT(cst)
void(* stdToImg1)(float &x, float &y, jevois::RawImage const &camimg, float const eps)
#define JEVOIS_PYTHON_DNN_FUNC(funcname)
void(* imgToStd2)(float &x, float &y, unsigned int const width, unsigned int const height, float const eps)
Helper class for camera calibration, which allows some modules to compute 3D locations of objects.
cv::Mat camMatrix
3x3 camera matrix
cv::Mat distCoeffs
5x1 distortion coefficients
void draw()
Render into an ImGui window.
std::string get()
Get input string from user, or empty if no new input.
void freeze(bool doit)
Freeze/unfreeze the input box, typically to prevent new inputs until current reply is done.
void writeString(std::string const &out)
Update text that is displayed above input box (output from the underlying chat bot)
void clear()
Clear all displayed text:
A component of a model hierarchy.
std::string getParamStringUnique(std::string const ¶mdescriptor) const
Get a parameter value by string, simple version assuming only one parameter match.
void setParamStringUnique(std::string const ¶mdescriptor, std::string const &val)
Set a parameter value by string, simple version assuming only one parameter match.
JeVois processing engine - gets images from camera sensor, processes them, and sends results over USB...
void itext2(char const *txt)
Draw some overlay text on top of an image, default color and line.
void iinfo(jevois::InputFramePython const &inframe, std::string const &fpscpu, unsigned short winw=0, unsigned short winh=0)
Display processing and video info at bottom of screen.
ImVec2 getMousePos()
ImGui helper: get mouse position.
void reportError(std::string const &err)
Report an error in an overlay window.
void releaseImage(char const *name)
Release an image.
ImVec2 d2is1(float x, float y, char const *name=nullptr)
Convert a 2D size from on-screen to within a rendered image.
void reportAndRethrowException(std::string const &prefix="")
Report current exception in a modal dialog, then re-throw it.
ImVec2 d2is(ImVec2 p, char const *name=nullptr)
Convert a 2D size from on-screen to within a rendered image.
ImVec2 d2i(ImVec2 p, char const *name=nullptr)
Convert coordinates of a point from on-screen to within a rendered image.
void reportAndIgnoreException(std::string const &prefix="")
Report current exception in a modal dialog, then ignore it.
void drawCircle(float x, float y, float r, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
Draw circle over an image.
ImVec2 d2i1(float x, float y, char const *name=nullptr)
Convert coordinates of a point from on-screen to within a rendered image.
boost::python::tuple drawInputFrame2(char const *name, InputFramePython const &frame, bool noalias=false, bool casync=false)
Draw the second (scaled) input video frame from the camera using zero-copy.
void drawPoly2(cv::Mat const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
Draw polygon over an image.
void drawPoly1(std::vector< cv::Point2f > const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
Draw polygon over an image.
ImVec2 i2d1(float x, float y, char const *name=nullptr)
Convert coordinates of a point from within a rendered image to on-screen.
void drawPoly(std::vector< cv::Point > const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
Draw polygon over an image.
void endFrame()
Finish current frame and render it.
bool isMouseDown(int button_num)
ImGui helper: check if mouse button pressed.
ImVec2 iline(int line=-1, char const *name=nullptr)
Get coordinates of the start of a given line of text to be drawn as overlay on top of an image.
void drawText(float x, float y, char const *txt, ImU32 col=IM_COL32(128, 255, 128, 255))
Draw text over an image.
boost::python::tuple drawImage(char const *name, RawImage const &img, bool noalias=false, bool isoverlay=false)
Draw a RawImage, copying pixel data to an OpenGL texture.
boost::python::tuple drawImage3(char const *name, cv::Mat const &img, bool rgb, int x, int y, int w, int h, bool noalias=false, bool isoverlay=false)
Draw an OpenCV image, copying pixel data to an OpenGL texture.
ImVec2 i2d(ImVec2 p, char const *name=nullptr)
Convert coordinates of a point from within a rendered image to on-screen.
void releaseImage2(char const *name)
Release an image, second video stream.
bool isMouseReleased(int button_num)
ImGui helper: check if mouse button released.
boost::python::tuple drawImage1(char const *name, cv::Mat const &img, bool rgb, bool noalias=false, bool isoverlay=false)
Draw an OpenCV image, copying pixel data to an OpenGL texture.
ImVec2 i2ds1(float x, float y, char const *name=nullptr)
Convert a 2D size from within a rendered image to on-screen.
bool frameStarted() const
Helper to indicate that startFrame() was called, and thus endFrame() should be called.
ImVec2 i2ds(ImVec2 p, char const *name=nullptr)
Convert a 2D size from within a rendered image to on-screen.
void itext(char const *txt, ImU32 const &col=IM_COL32_BLACK_TRANS, int line=-1)
Draw some overlay text on top of an image.
bool isMouseDragging(int button_num)
ImGui helper: check if mouse button dragged.
bool isMouseClicked(int button_num)
ImGui helper: check if mouse button clicked.
void drawRect(float x1, float y1, float x2, float y2, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
Draw rectangular box over an image.
boost::python::tuple startFrame()
Start a new rendering frame.
void drawEllipse(float x, float y, float rx, float ry, float rot=0.0F, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
Draw ellipse over an image.
void drawLine(float x1, float y1, float x2, float y2, ImU32 col=IM_COL32(128, 255, 128, 255))
Draw line over an image.
boost::python::tuple drawImage2(char const *name, RawImage const &img, int x, int y, int w, int h, bool noalias=false, bool isoverlay=false)
Draw an OpenCV image, copying pixel data to an OpenGL texture.
boost::python::tuple drawInputFrame(char const *name, InputFramePython const &frame, bool noalias=false, bool casync=false)
Draw the input video frame from the camera using zero-copy.
bool isMouseDoubleClicked(int button_num)
ImGui helper: check if mouse button double-clicked.
void sendScaledCvRGBA1(cv::Mat const &img, int quality) const
Shorthand to send a RGBA cv::Mat after scaling/converting it to the current output format.
void sendScaledCvBGR1(cv::Mat const &img, int quality) const
Shorthand to send a BGR cv::Mat after scaling/converting it to the current output format.
void sendScaledCvGRAY1(cv::Mat const &img, int quality) const
Shorthand to send a GRAY cv::Mat after scaling/converting it to the current output format.
RawImage const & get() const
Get the next captured camera image.
void sendCvRGB1(cv::Mat const &img, int quality) const
Shorthand to send a RGB cv::Mat after converting it to the current output format.
void sendScaledCvRGB1(cv::Mat const &img, int quality) const
Shorthand to send a RGB cv::Mat after scaling/converting it to the current output format.
void send() const
Indicate that user processing is done with the image previously obtained via get()
void sendScaledCvBGR(cv::Mat const &img) const
Shorthand to send a BGR cv::Mat after scaling/converting it to the current output format.
void sendCvGRAY1(cv::Mat const &img, int quality) const
Shorthand to send a GRAY cv::Mat after converting it to the current output format.
void sendCvBGR1(cv::Mat const &img, int quality) const
Shorthand to send a BGR cv::Mat after converting it to the current output format.
void sendCvBGR(cv::Mat const &img) const
Shorthand to send a BGR cv::Mat after converting it to the current output format.
void sendScaledCvRGB(cv::Mat const &img) const
Shorthand to send a RGB cv::Mat after scaling/converting it to the current output format.
void sendScaledCvRGBA(cv::Mat const &img) const
Shorthand to send a RGBA cv::Mat after scaling/converting it to the current output format.
void sendCv1(cv::Mat const &img, int quality) const
Shorthand to send a cv::Mat after scaling/converting it to the current output format.
void sendCvRGB(cv::Mat const &img) const
Shorthand to send a RGB cv::Mat after converting it to the current output format.
void sendScaledCvGRAY(cv::Mat const &img) const
Shorthand to send a GRAY cv::Mat after scaling/converting it to the current output format.
void sendCvRGBA(cv::Mat const &img) const
Shorthand to send a RGBA cv::Mat after converting it to the current output format.
void sendCv(cv::Mat const &img) const
Shorthand to send a cv::Mat after scaling/converting it to the current output format.
void sendCvRGBA1(cv::Mat const &img, int quality) const
Shorthand to send a RGBA cv::Mat after converting it to the current output format.
void sendCvGRAY(cv::Mat const &img) const
Shorthand to send a GRAY cv::Mat after converting it to the current output format.
void stop()
End a time measurement period, report time spent for each checkpoint if reporting interval is reached...
void start()
Start a time measurement period.
void checkpoint(char const *description)
Note the time for a particular event.
std::string const & name() const
Get the parameter name.
void set(boost::python::object const &newVal)
Set the value of this Parameter.
std::string const strget() const
Get the value as a string.
void strset(std::string const &valstring)
Set the value from a string representation of it.
void reset()
Reset this parameter to its default value.
bool frozen() const
Returns whether parameter is frozen.
boost::python::object get() const
Get the value of this Parameter.
void freeze(bool doit)
Freeze/unfreeze this parameter, it becomes read-only and will not show up in the help message.
void setCallback(boost::python::object const &cb)
Set the parameter's callback.
std::string descriptor() const
Get the parameter fully-qualified name, aka descriptor, including names of owning Component and all p...
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
float fps
Programmed frames/s as given by current video mapping, may not be actual.
bool coordsOk(int x, int y) const
Helper function to check that coords are within image bounds.
unsigned int fmt
Pixel format as a V4L2_PIX_FMT_XXX.
unsigned int bytesize() const
Helper function to get the total number of bytes in the RawImage, i.e., width * height * bytesperpix(...
void invalidate()
Invalidate the image by zero'ing out the pointer to pixel buffer and the dims and format.
unsigned int width
Image width in pixels.
unsigned int bytesperpix() const
Helper function to get the number of bytes/pixel given the RawImage pixel format.
unsigned int height
Image height in pixels.
void require(char const *info, unsigned int w, unsigned int h, unsigned int f) const
Require a particular image size and format, issue a fatal error message and throw if no match.
void clear()
Clear the pixels to all black.
bool valid() const
Check whether the image has a valid pixel buffer.
std::string const & stop()
Same as the other signature of stop() except does not provide seconds, for python bindings.
void start()
Start a time measurement period.
void imgToStdX(float &x, unsigned int const width, float const eps=0.1F)
Transform X coordinate in-place from camera to standardized, using given image width and height.
void stdToImg(float &x, float &y, RawImage const &camimg, float const eps=0.1F)
Transform coordinates in-place from standardized to image, using a RawImage to establish image size.
void imgToStdY(float &y, unsigned int const height, float const eps=0.1F)
Transform Y coordinate in-place from camera to standardized, using given image width and height.
void imgToStd(float &x, float &y, RawImage const &camimg, float const eps=0.1F)
Transform coordinates in-place from camera to standardized, using a RawImage to establish image size.
void imgToStdSize(float &w, float &h, unsigned int const width, unsigned int const height, float const eps=0.1F)
Transform size in-place from camera to standardized, using given image width and height.
void stdToImgSize(float &x, float &y, unsigned int const width, unsigned int const height, float const eps=0.1F)
Transform size in-place from standardized to image, using a RawImage to establish image size.
#define LFATAL(msg)
Convenience macro for users to print out console or syslog messages, FATAL level.
#define LDEBUG(msg)
Convenience macro for users to print out console or syslog messages, DEBUG level.
#define LERROR(msg)
Convenience macro for users to print out console or syslog messages, ERROR level.
#define LINFO(msg)
Convenience macro for users to print out console or syslog messages, INFO level.
std::string shapestr(cv::Mat const &m)
Get a string of the form: "nD AxBxC... TYPE" from an n-dimensional cv::Mat with data type TYPE.
void writeText(RawImage &img, std::string const &txt, int x, int y, unsigned int col, Font font=Font6x10)
Write some text in an image.
cv::Mat rescaleCv(cv::Mat const &img, cv::Size const &newdims)
Rescale an OpenCV image, choosing the right kind of interpolation.
Font
Available fonts for writeText()
void drawRect(RawImage &img, int x, int y, unsigned int w, unsigned int h, unsigned int thick, unsigned int col)
Draw a rectangle in a YUYV image.
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.
Engine * engineForPythonModule
Main namespace for all JeVois classes and functions.
A category to which multiple ParameterDef definitions can belong.
std::string name
The name of the category.
std::string description
An optional short description of the category.