JeVois
1.17
JeVois Smart Embedded Machine Vision Toolkit
|
Share this page: |
|
|
|
 |
 |
|
Go to the documentation of this file.
22 #include <boost/python.hpp>
153 void sendCv1(cv::Mat
const & img,
int quality)
const;
164 void sendCv(cv::Mat
const & img)
const;
167 void sendCvGRAY1(cv::Mat
const & img,
int quality)
const;
173 void sendCvBGR1(cv::Mat
const & img,
int quality)
const;
176 void sendCvBGR(cv::Mat
const & img)
const;
179 void sendCvRGB1(cv::Mat
const & img,
int quality)
const;
182 void sendCvRGB(cv::Mat
const & img)
const;
185 void sendCvRGBA1(cv::Mat
const & img,
int quality)
const;
241 bool noalias =
false,
bool isoverlay =
false);
244 boost::python::tuple
drawImage1(
char const * name, cv::Mat
const & img,
bool rgb,
245 bool noalias =
false,
bool isoverlay =
false);
249 bool noalias =
false,
bool casync =
false);
253 bool noalias =
false,
bool casync =
false);
256 ImVec2
i2d(ImVec2 p,
char const * name =
nullptr);
259 ImVec2
i2d1(
float x,
float y,
char const * name =
nullptr);
262 ImVec2
i2ds(ImVec2 p,
char const * name =
nullptr);
265 ImVec2
i2ds1(
float x,
float y,
char const * name =
nullptr);
268 void drawLine(
float x1,
float y1,
float x2,
float y2, ImU32 col = IM_COL32(128,255,128,255));
271 void drawRect(
float x1,
float y1,
float x2,
float y2, ImU32 col = IM_COL32(128,255,128,255),
bool filled =
true);
274 void drawPoly(std::vector<cv::Point>
const & pts, ImU32 col = IM_COL32(128,255,128,255),
bool filled =
true);
277 void drawPoly1(std::vector<cv::Point2f>
const & pts, ImU32 col = IM_COL32(128,255,128,255),
bool filled =
true);
280 void drawPoly2(cv::Mat
const & pts, ImU32 col = IM_COL32(128,255,128,255),
bool filled =
true);
283 void drawCircle(
float x,
float y,
float r, ImU32 col = IM_COL32(128,255,128,255),
bool filled =
true);
286 void drawText(
float x,
float y,
char const * txt, ImU32 col = IM_COL32(128,255,128,255));
289 ImVec2
iline(
int line = -1,
char const * name =
nullptr);
292 void itext(
char const * txt, ImU32
const & col = IM_COL32_BLACK_TRANS,
int line = -1);
296 unsigned short winw = 0,
unsigned short winh = 0);
349 virtual void parseSerial(std::string
const & str, std::shared_ptr<UserInterface> s)
override;
358 boost::python::object itsMainModule, itsMainNamespace;
359 boost::python::object itsInstance;
360 std::string itsConstructionError;
void sendScaledCvGRAY(cv::Mat const &img) const
Shorthand to send a GRAY cv::Mat after scaling/converting it to the current output format.
Exception-safe wrapper around a raw image to be sent over USB.
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.
void sendCv1(cv::Mat const &img, int quality) const
Shorthand to send a cv::Mat after scaling/converting it to the current output format.
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.
const RawImage & get() const
Get the next captured camera image.
void drawPoly(std::vector< cv::Point > const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
Draw polygon over an image.
Wrapper module to allow users to develop new modules written in Python.
void itext(char const *txt, ImU32 const &col=IM_COL32_BLACK_TRANS, int line=-1)
Draw some overlay text on top of an image.
virtual void process(InputFrame &&inframe, OutputFrame &&outframe) override
Processing function, version that receives a frame from camera and sends a frame out over USB.
void send() const
Indicate that user processing is done with the image previously obtained via get()
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.
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
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 drawPoly1(std::vector< cv::Point2f > const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
Draw polygon over an image.
bool frameStarted() const
Helper to indicate that startFrame() was called, and thus endFrame() should be called.
void endFrame()
Finish current frame and render it.
Wrapper around GUIhelper to be used by Python.
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.
virtual ~PythonModule()
Virtual destructor for safe inheritance.
Helper class to assist modules in creating graphical and GUI elements.
void drawText(float x, float y, char const *txt, ImU32 col=IM_COL32(128, 255, 128, 255))
Draw text over an image.
GUIhelperPython()=default
Default constructor to keep boost::python happy, object is not operational.
void postUninit() override
Optionally call uninit() python module function, if implemented.
void releaseImage2(char const *name)
Release an image, second video stream.
boost::python::tuple startFrame()
Start a new rendering frame.
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 sendCvRGBA(cv::Mat const &img) const
Shorthand to send a RGBA cv::Mat after converting it to the current output format.
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 reportAndIgnoreException(std::string const &prefix="")
Report current exception in a modal dialog, then ignore it.
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.
ImVec2 i2ds1(float x, float y, char const *name=nullptr)
Convert a 2D size from within a rendered image to on-screen.
void drawPoly2(cv::Mat const &pts, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
Draw polygon over an image.
virtual void supportedCommands(std::ostream &os) override
Human-readable description of this Module's supported custom commands.
ImVec2 i2d1(float x, float y, char const *name=nullptr)
Convert coordinates of a point from within a rendered image to on-screen.
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.
PythonModule(VideoMapping const &m)
Constructor needs the full path to a Python source code file.
void sendScaledCvRGBA(cv::Mat const &img) const
Shorthand to send a RGBA cv::Mat after scaling/converting it to the current output format.
Wrapper around OutputFrame to be used by Python.
Virtual base class for a vision processing module.
ImVec2 i2ds(ImVec2 p, char const *name=nullptr)
Convert a 2D size from within a rendered image to on-screen.
void sendScaledCvRGB(cv::Mat const &img) const
Shorthand to send a RGB 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 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.
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 releaseImage(char const *name)
Release an image.
void sendCvRGBA1(cv::Mat const &img, int quality) const
Shorthand to send a RGBA cv::Mat after converting it to the current output format.
OutputFramePython()=default
Default constructor to keep boost::python happy, object is not operational.
void sendCvBGR(cv::Mat const &img) const
Shorthand to send a BGR cv::Mat after converting it to the current output format.
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 drawInputFrame(char const *name, InputFramePython const &frame, bool noalias=false, bool casync=false)
Draw the input video frame from the camera using zero-copy.
ImVec2 i2d(ImVec2 p, char const *name=nullptr)
Convert coordinates of a point from within a rendered image to on-screen.
void drawCircle(float x, float y, float r, ImU32 col=IM_COL32(128, 255, 128, 255), bool filled=true)
Draw circle over an 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.
virtual void parseSerial(std::string const &str, std::shared_ptr< UserInterface > s) override
Receive a string from a serial port which contains a user command.
void sendCv(cv::Mat const &img) const
Shorthand to send a cv::Mat after scaling/converting it to the current output format.
void reportAndRethrowException(std::string const &prefix="")
Report current exception in a modal dialog, then re-throw it.
void reportError(std::string const &err)
Report an error in an overlay window.
void sendCvGRAY(cv::Mat const &img) const
Shorthand to send a GRAY cv::Mat after converting it to the current output format.
void sendScaledCvBGR(cv::Mat const &img) const
Shorthand to send a BGR cv::Mat after scaling/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.