JeVois
1.20
JeVois Smart Embedded Machine Vision Toolkit
|
Share this page: |
|
|
|
 |
 |
|
Go to the documentation of this file.
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 drawText(
float x,
float y,
char const * txt, ImU32 col = IM_COL32(128,255,128,255));
294 ImVec2
iline(
int line = -1,
char const * name =
nullptr);
297 void itext(
char const * txt, ImU32
const & col = IM_COL32_BLACK_TRANS,
int line = -1);
301 unsigned short winw = 0,
unsigned short winh = 0);
313 ImVec2
d2i(ImVec2 p,
char const * name =
nullptr);
316 ImVec2
d2i1(
float x,
float y,
char const * name =
nullptr);
319 ImVec2
d2is(ImVec2 p,
char const * name =
nullptr);
322 ImVec2
d2is1(
float x,
float y,
char const * name =
nullptr);
387 virtual void parseSerial(std::string
const & str, std::shared_ptr<UserInterface> s)
override;
396 std::string itsPyPath;
418 boost::python::list
blobs()
const;
422 boost::python::tuple
blobsize(
size_t num)
const;
427 boost::python::tuple
b2i(
float x,
float y,
size_t blobnum);
438 boost::python::tuple
i2b(
float x,
float y,
size_t blobnum);
465 boost::python::tuple
yolo(boost::python::list outs,
int nclass,
float boxThreshold,
466 float confThreshold,
int bw,
int bh,
int fudge,
int maxbox);
469 std::shared_ptr<PostProcessorDetectYOLO> itsYOLO;
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.
Post-Processor sub-component for raw YOLO decoding.
bool isMouseReleased(int button_num)
ImGui helper: check if mouse button released.
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.
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.
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.
bool isMouseDown(int button_num)
ImGui helper: check if mouse button pressed.
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.
Pre-Processor interface exposed to the python side.
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.
boost::python::tuple imagesize() const
Access the last processed image size.
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.
bool isMouseDragging(int button_num)
ImGui helper: check if mouse button dragged.
ImVec2 d2i1(float x, float y, char const *name=nullptr)
Convert coordinates of a point from on-screen to within a rendered image.
void postUninit() override
Optionally call uninit() python module function, if implemented.
void freeze(bool doit)
Freeze/unfreeze parameters that users should not change while running.
void releaseImage2(char const *name)
Release an image, second video stream.
ImVec2 d2is1(float x, float y, char const *name=nullptr)
Convert a 2D size from on-screen to within a rendered image.
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.
Pre-Processor for neural network pipeline.
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 i2b(float x, float y, size_t blobnum)
Convert coordinates from image to blob.
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.
bool isMouseDoubleClicked(int button_num)
ImGui helper: check if mouse button double-clicked.
ImVec2 i2ds1(float x, float y, char const *name=nullptr)
Convert a 2D size from within a rendered image to on-screen.
void preInit() override
Load python code and optionally call init() python module function, if implemented.
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.
~PostProcessorDetectYOLOforPython()
Destructor removes itsYOLO from current module.
PreProcessorForPython(PreProcessor *pp)
Construct from an existing PreProcessor.
ImVec2 i2d1(float x, float y, char const *name=nullptr)
Convert coordinates of a point from within a rendered image to on-screen.
YOLO post-processor exposed to python.
boost::python::list blobs() const
Access the last computed blobs (or empty if process() has not yet been called)
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.
ImVec2 d2i(ImVec2 p, char const *name=nullptr)
Convert coordinates of a point from on-screen to within a rendered image.
ImVec2 getMousePos()
ImGui helper: get mouse position.
Wrapper around OutputFrame to be used by Python.
Virtual base class for a vision processing module.
bool isMouseClicked(int button_num)
ImGui helper: check if mouse button clicked.
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.
boost::python::tuple getUnscaledCropRect(size_t blobnum)
Get unscaled crop rectangle in image coordinates.
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.
boost::python::tuple blobsize(size_t num) const
Access the width and height of a given blob, accounting for NCHW or NHWC.
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.
PostProcessorDetectYOLOforPython()
Constructor constructs itsYOLO and adds it to current module.
void drawLine(float x1, float y1, float x2, float y2, ImU32 col=IM_COL32(128, 255, 128, 255))
Draw line over an image.
GUIhelperPython(GUIhelper *src)
Construct from a regular GUIhelper that should be be coming from Engine.
Helper class to run python code from C++.
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.
boost::python::tuple yolo(boost::python::list outs, int nclass, float boxThreshold, float confThreshold, int bw, int bh, int fudge, int maxbox)
Generic raw YOLO processing.
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.
boost::python::tuple b2i(float x, float y, size_t blobnum)
Convert coordinates from blob back to original image.
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.
ImVec2 d2is(ImVec2 p, char const *name=nullptr)
Convert a 2D size from on-screen to within a rendered image.
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.