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;
238 bool noalias =
false,
bool isoverlay =
false);
241 boost::python::tuple
drawImage1(
char const * name, cv::Mat
const & img,
bool rgb,
242 bool noalias =
false,
bool isoverlay =
false);
245 boost::python::tuple
drawImage2(
char const * name,
RawImage const & img,
int x,
int y,
int w,
int h,
246 bool noalias =
false,
bool isoverlay =
false);
249 boost::python::tuple
drawImage3(
char const * name, cv::Mat
const & img,
bool rgb,
int x,
int y,
int w,
int h,
250 bool noalias =
false,
bool isoverlay =
false);
254 bool noalias =
false,
bool casync =
false);
258 bool noalias =
false,
bool casync =
false);
261 ImVec2
i2d(ImVec2 p,
char const * name =
nullptr);
264 ImVec2
i2d1(
float x,
float y,
char const * name =
nullptr);
267 ImVec2
i2ds(ImVec2 p,
char const * name =
nullptr);
270 ImVec2
i2ds1(
float x,
float y,
char const * name =
nullptr);
273 void drawLine(
float x1,
float y1,
float x2,
float y2, ImU32 col = IM_COL32(128,255,128,255));
276 void drawRect(
float x1,
float y1,
float x2,
float y2, ImU32 col = IM_COL32(128,255,128,255),
bool filled =
true);
279 void drawPoly(std::vector<cv::Point>
const & pts, ImU32 col = IM_COL32(128,255,128,255),
bool filled =
true);
282 void drawPoly1(std::vector<cv::Point2f>
const & pts, ImU32 col = IM_COL32(128,255,128,255),
bool filled =
true);
285 void drawPoly2(cv::Mat
const & pts, ImU32 col = IM_COL32(128,255,128,255),
bool filled =
true);
288 void drawCircle(
float x,
float y,
float r, ImU32 col = IM_COL32(128,255,128,255),
bool filled =
true);
291 void drawEllipse(
float x,
float y,
float rx,
float ry,
float rot = 0.0F,
292 ImU32 col = IM_COL32(128,255,128,255),
bool filled =
true);
295 void drawText(
float x,
float y,
char const * txt, ImU32 col = IM_COL32(128,255,128,255));
298 ImVec2
iline(
int line = -1,
char const * name =
nullptr);
301 void itext(
char const * txt, ImU32
const & col = IM_COL32_BLACK_TRANS,
int line = -1);
304 void itext2(
char const * txt);
308 unsigned short winw = 0,
unsigned short winh = 0);
320 ImVec2
d2i(ImVec2 p,
char const * name =
nullptr);
323 ImVec2
d2i1(
float x,
float y,
char const * name =
nullptr);
326 ImVec2
d2is(ImVec2 p,
char const * name =
nullptr);
329 ImVec2
d2is1(
float x,
float y,
char const * name =
nullptr);
394 virtual void parseSerial(std::string
const & str, std::shared_ptr<UserInterface> s)
override;
403 std::string itsPyPath;
413 class PreProcessorForPython
418 PreProcessorForPython(PreProcessor * pp);
422 boost::python::tuple imagesize()
const;
425 boost::python::list blobs()
const;
429 boost::python::tuple blobsize(
size_t num)
const;
434 boost::python::tuple b2i(
float x,
float y,
size_t blobnum);
439 boost::python::tuple getUnscaledCropRect(
size_t blobnum);
445 boost::python::tuple i2b(
float x,
float y,
size_t blobnum);
448 PreProcessor * itsPP;
451 class PostProcessorDetectYOLO;
457 class PostProcessorDetectYOLOforPython
461 PostProcessorDetectYOLOforPython();
464 ~PostProcessorDetectYOLOforPython();
467 void freeze(
bool doit);
472 boost::python::tuple yolo(boost::python::list outs,
int nclass,
float boxThreshold,
473 float confThreshold,
int bw,
int bh,
int fudge,
int maxbox,
bool sigmo);
476 std::shared_ptr<PostProcessorDetectYOLO> itsYOLO;
Wrapper around GUIhelper to be used by Python.
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.
Helper class to assist modules in creating graphical and GUI elements.
Virtual base class for a vision processing module.
Wrapper around OutputFrame to be used by Python.
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.
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 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.
Exception-safe wrapper around a raw image to be sent over USB.
Wrapper module to allow users to develop new modules written in Python.
virtual void process(InputFrame &&inframe, OutputFrame &&outframe) override
Processing function, version that receives a frame from camera and sends a frame out over USB.
virtual void supportedCommands(std::ostream &os) override
Human-readable description of this Module's supported custom commands.
void postUninit() override
Optionally call uninit() python module function, if implemented.
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 preInit() override
Load python code and optionally call init() python module function, if implemented.
virtual ~PythonModule()
Virtual destructor for safe inheritance.
Helper class to run python code from C++.
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
Main namespace for all JeVois classes and functions.
Simple struct to hold video mapping definitions for the processing Engine.