JeVois  1.16
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Module.H
Go to the documentation of this file.
1 // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 //
3 // JeVois Smart Embedded Machine Vision Toolkit - Copyright (C) 2016 by Laurent Itti, the University of Southern
4 // California (USC), and iLab at USC. See http://iLab.usc.edu and http://jevois.org for information about this project.
5 //
6 // This file is part of the JeVois Smart Embedded Machine Vision Toolkit. This program is free software; you can
7 // redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
8 // Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
10 // License for more details. You should have received a copy of the GNU General Public License along with this program;
11 // if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
12 //
13 // Contact information: Laurent Itti - 3641 Watt Way, HNB-07A - Los Angeles, CA 90089-2520 - USA.
14 // Tel: +1 213 740 3527 - itti@pollux.usc.edu - http://iLab.usc.edu - http://jevois.org
15 // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
16 /*! \file */
17 
18 #pragma once
19 
20 #include <jevois/Image/RawImage.H>
21 #include <jevois/Core/InputFrame.H>
23 #include <jevois/Core/VideoBuf.H>
24 #include <jevois/Core/UserInterface.H> // not strictly needed but derived classes will want to use it
26 #include <jevois/Types/ObjReco.H>
27 #include <jevois/Types/ObjDetect.H>
28 #include <jevois/Types/Enum.H>
29 #include <opencv2/core/core.hpp>
30 #include <memory>
31 #include <ostream>
32 
33 #ifdef JEVOIS_PRO
34 #include <jevois/GPU/GUIhelper.H> // not strictly required but derived classes may want to use it
35 #include <glm/gtc/matrix_transform.hpp> // glm::translate, glm::rotate, glm::scale, glm::perspective
36 #endif
37 
38 namespace jevois
39 {
40  class VideoOutput;
41  class Engine;
42 
43  //! Virtual base class for a vision processing module
44  /*! Module is the base class to implement camera-to-USB frame-by-frame video processing. The Engine instantiates one
45  class derived from Module, according to the current VideoMapping selected by the end user (e.g., current image
46  resolution, format, and frame rate setected by a webcam viewing program on a host computer). The Module is loaded
47  as shared object (.so) file according to the VideoMapping definitions in videomappings.cfg and the current
48  VideoMapping selected by the user.
49 
50  Module derives from Component and as such can contain:
51 
52  - any number of Parameter settings
53 
54  - any arbitrarily complex sub-hierarchy of Component objects to implement various functionality. Parameter
55  settings from all the sub-components are available to the Module and to users connected over Serial ports of the
56  Engine.
57 
58  This allows one to implement complex vision processing pipelines efficiently and with substantial code re-use. For
59  example, one may first want to implement an EdgeDetector or Saliency component, with Parameter settings for
60  various thresholds, features, etc. One can then create any number of top-level objects that derive from Module and
61  that may contain one or more EdgeDetector, Saliency, etc components in their hierarchy of sub-components, with the
62  implementation in the module simply routing images from one Component to another to create a processing pipeline.
63 
64  Classes that derive from Module should implement up to four functions:
65 
66  - process(InputFrame && inframe, OutputFrame && outframe) is called once per iteration of the Engine main loop
67  when the current VideoMapping specifies both a particular Camera resolution and format, and a USB resolution and
68  format. This function should process the received input frame and fill the pixel buffer of the output frame with
69  results. Memory has already been allocated for both the input and output images before process() is
70  called. Because the output image is actually allocated by the USB Gadget driver (and, ultimately, by the Linux
71  kernel), its pixel memory location cannot be moved (hence, do not attempt to copy the output image or replace it
72  by another image, etc; just write pixel data into the output image's pixel array). There is no restriction on
73  video modes or frame rates, except as suported by the Camera hardware, and as limited by USB bandwidth. For most
74  implementations, matching the input and output frame rate is easiest, and means that each invocation of
75  process() would access and use both of the provided InputFrame and OutputFrame (one-input-to-one-output
76  processing pipeline). But this is not mandatory. For example, a motion flow computation Module for use in a
77  flying drone may have 320x240 YUYV 53.0fps inputs and 100x142 GREY 10.6fps output (since output frame rate is 5x
78  lower than input in this example, the process() function would here get, fill, and send the OutputFrame only
79  once every 5 times it is called; implementation of the process() function should keep track of that, e.g.,
80  through a member variable that gets incremented each time process() is called). In addition to filling the pixel
81  data of the OutputFrame, process() may also send results over the serial ports (e.g., for use by an Arduino
82  connected to the JeVois platform hardware) using sendSerial().
83 
84  - process(InputFrame && inframe) is called once per Camera frame when the current VideoMapping specifies a
85  particular Camera resolution and format, and NONE as USB output format. This function should process the
86  received input frame and would typicaly then send results to serial ports (e.g., for use by an Arduino connected
87  to the JeVois platform hardware) using sendSerial(). There is no restriction on video modes or frame rates,
88  except as suported by the Camera hardware.
89 
90  - parseSerial(std::string const & str, std::shared_ptr<UserInterface> s) allows the Module to support custom user
91  commands. Engine will forward to this function any command received over Serial or other UserInterface that it
92  does not understand. You should use this for things that go beyond Parameter settings (which is already natively
93  supported by Engine) or built-in commands of Engine (see \ref UserCli). For example, one could implement here a
94  command called "start" to allow users to start some specific thing.
95 
96  - supportedCommands(std::ostream & os) should stream out a human-readable description of any custom commands
97  supported by parseSerial(). These will be shown to users when they type "help" over a Serial port.
98 
99  \note Every module implementation file should contain a call to #JEVOIS_REGISTER_MODULE(MODULENAME) for the
100  module's class. This creates some plain-C entry points that will be used when the module is loaded from a dynamic
101  library (.so) file to instantiate the module. See \ref ModuleTutorial for examples.
102 
103  \ingroup core */
104  class Module : public Component
105  {
106  public:
107  //! Constructor
108  /*! the instance is a user-defined string that may be used to differentiate between several instances of the
109  same module. */
110  Module(std::string const & instance);
111 
112  //! Virtual destructor for safe inheritance
113  virtual ~Module();
114 
115  //! Processing function, version that receives a frame from camera and sends a frame out over USB
116  /*! This function is called once for each grabbed video frame from the camera, and it should complete within the
117  camera's frame period in order to avoid dropping frames. The InputFrame and OutputFrame objects are simple
118  wrappers to ensure that the low-level video buffers will always be returned to the low-level camera and USB
119  drivers even if the process function throws at any point during the processing. If any error occurs, it is
120  hence ok to throw from within process() at any time, just make sure your locally allocated resources will be
121  freed, which is usually best achieved by using shared_ptr and similar wrappers around them. The Engine (which
122  calls process() on your module for every frame) will catch any exception an proceed to the next frame.
123 
124  Default implementation in the base class just throws. Derived classes should override it. */
125  virtual void process(InputFrame && inframe, OutputFrame && outframe);
126 
127  //! Processing function, version that receives a frame from camera and does not use USB
128  /*! This function is called once for each grabbed video frame from the camera, and it should complete within the
129  camera's frame period in order to avoid dropping frames. The InputFrame object is a simple wrapper to ensure
130  that the low-level video buffers will always be returned to the low-level camera driver even if the process
131  function throws at any point during the processing. If any error occurs, it is hence ok to throw from within
132  process() at any time, just make sure your locally allocated resources will be freed, which is usually best
133  achieved by using shared_ptr and similar wrappers around them. The Engine (which calls process() on your
134  module for every frame) will catch any exception an proceed to the next frame.
135 
136  Default implementation in the base class just throws. Derived classes should override it. */
137  virtual void process(InputFrame && inframe);
138 
139 #ifdef JEVOIS_PRO
140  //! Processing function, version that receives a frame from camera, no USB, but GUI output on JeVois-Pro
141  /*! This function is called once for each grabbed video frame from the camera, and it should complete within the
142  camera's frame period in order to avoid dropping frames. The InputFrame object is a simple wrapper to ensure
143  that the low-level video buffers will always be returned to the low-level camera driver even if the process
144  function throws at any point during the processing. If any error occurs, it is hence ok to throw from within
145  process() at any time, just make sure your locally allocated resources will be freed, which is usually best
146  achieved by using shared_ptr and similar wrappers around them. The Engine (which calls process() on your
147  module for every frame) will catch any exception an proceed to the next frame.
148 
149  Default implementation in the base class just throws. Derived classes should override it. */
150  virtual void process(InputFrame && inframe, GUIhelper & helper);
151 #endif
152 
153  //! Send a string over the 'serout' serial port
154  /*! The default implementation just sends the string to the serial port specified by the 'serout' Parameter in
155  Engine (which could be the hardware serial port, the serial-over-USB port, both, or none; see \ref UserCli for
156  information about \c serout). No need to override in most cases. Typically, you would use this function from
157  within process() to send out some results of your processing.
158 
159  Note that the default 'serout' Parameter setting in Engine is None. This is to allow users to configure
160  parameters, get parameter values, possibly read the help message, etc before the flow of serial outputs from
161  vision processing starts. Once ready to receive serial outputs, one would typically issue a command 'setpar
162  serout Hard' over the JeVois command line to enable serial outputs to the hardware serial port. An Arduino
163  would issue that setpar commands when it is ready to work. See ArduinoTutorial for an example. */
164  virtual void sendSerial(std::string const & str);
165 
166  //! Receive a string from a serial port which contains a user command
167  /*! This function may be called in between calls to process() with any received string from any of the serial
168  ports. Some commands are parsed upstream already (like "help", set param value, set camera control, etc; see
169  the Engine class) and will not be received here. Only the ones not recognized by the Engine will be received
170  (i.e., custom commands specific to your module).
171 
172  The default implementation just throws std::runtime_error("Unsupported command"), but some modules may want to
173  override this function to handle custom commands. If you successfully process the command, just return;
174  otherwise, throw, and if your exception derives from std::exception, the Engine will append its what() to the
175  error message issued to the user. When you support commands here, you should update the implementation of
176  supportedCommands() to provide some description of those commands to the users.
177 
178  The \c s parameter is the serial port that received the command. You can send any results back to that port
179  using writeString() on it. Note that the Engine will automatically add the 'OK' message upon success, so you
180  do not have to send that here. */
181  virtual void parseSerial(std::string const & str, std::shared_ptr<UserInterface> s);
182 
183  //! Human-readable description of this Module's supported custom commands
184  /*! The format here is free. Just use std::endl to demarcate lines, these will be converted to the appropriate
185  line endings by the serial ports. Default implementation writes "None" to os. */
186  virtual void supportedCommands(std::ostream & os);
187 
188  //! Get frame number from the Engine
189  /*! The Engine maintains a master frame counter that is incremented on each call to process(), whether or not the
190  call succeeds. The counter is not incremented when a module has not been loaded (e.g., failed to load). The
191  counter is reset to zero each time a new module is loaded. */
192  size_t frameNum() const;
193  };
194 
195  namespace module
196  {
197  static ParameterCategory const ParamCateg("Module Serial Message Options");
198 
199  //! Enum for Parameter \relates jevois::StdModule
200  JEVOIS_DEFINE_ENUM_CLASS(SerStyle, (Terse) (Normal) (Detail) (Fine) )
201 
202  //! Parameter \relates jevois::StdModule
203  JEVOIS_DECLARE_PARAMETER(serstyle, SerStyle, "Style for standardized serial messages as defined in "
204  "http://jevois.org/doc/UserSerialStyle.html",
205  SerStyle::Terse, SerStyle_Values, ParamCateg);
206 
207  //! Parameter \relates jevois::StdModule
208  JEVOIS_DECLARE_PARAMETER(serprec, unsigned int, "Number of decimal points in standardized serial messages as "
209  "defined in http://jevois.org/doc/UserSerialStyle.html",
210  0U, jevois::Range<unsigned int>(0U, 10U), ParamCateg);
211 
212  //! Enum for Parameter \relates jevois::StdModule
213  JEVOIS_DEFINE_ENUM_CLASS(SerStamp, (None) (Frame) (Time) (FrameTime) (FrameDateTime) )
214 
215  //! Parameter \relates jevois::StdModule
216  JEVOIS_DECLARE_PARAMETER(serstamp, SerStamp, "Prepend standardized serial messages with a frame number, "
217  "time, frame+time, or frame+date+time. See details in "
218  "http://jevois.org/doc/UserSerialStyle.html",
219  SerStamp::None, SerStamp_Values, ParamCateg);
220 
221  //! Enum for Parameter \relates jevois::StdModule
222  JEVOIS_DEFINE_ENUM_CLASS(SerMark, (None) (Start) (Stop) (Both) )
223 
224  //! Parameter \relates jevois::StdModule
225  JEVOIS_DECLARE_PARAMETER(sermark, SerMark, "Send serial message to mark the beginning (MARK START) of the "
226  "processing of a video frame from the camera sensor, the end (MARK STOP), or both. "
227  "Useful, among others, if one needs to know when no results were sent over serial "
228  "on a given frame. Combine with parameter serstamp if you need to know the frame number.",
229  SerMark::None, SerMark_Values, ParamCateg);
230  }
231 
232  //! Base class for a module that supports standardized serial messages
233  /*! Modules that can output standardized serial messages should derive from StdModule instead of Module. StdModule
234  brings in extra parameters to set serial message style and precision, and extra member functions to assemble,
235  format, and send standardized serial messages. The process(), sendSerial(), parseSerial(), supportedCommands(),
236  etc of StdModule functions are directly inherited from Module. See \ref UserSerialStyle for standardized serial
237  messages. \ingroup core */
238  class StdModule : public Module,
239  public Parameter<module::serprec, module::serstyle, module::serstamp, module::sermark>
240  {
241  public:
242  //! Constructor
243  /*! the instance is a user-defined string that may be used to differentiate between several instances of the
244  same module. */
245  StdModule(std::string const & instance);
246 
247  //! Virtual destructor for safe inheritance
248  virtual ~StdModule();
249 
250  //! Send standardized 1D message for an X image coordinate
251  /*! See \ref UserSerialStyle for more info. Coordinates should be in camera image pixels, this function will
252  convert them to standardized coordinates as per \ref coordhelpers. */
253  void sendSerialImg1Dx(unsigned int camw, float x, float size = 0.0F, std::string const & id = "",
254  std::string const & extra = "");
255 
256  //! Send standardized 1D message for a standardized X coordinate
257  /*! See \ref UserSerialStyle for more info. Coordinates should be in camera image pixels, this function will
258  convert them to standardized coordinates as per \ref coordhelpers. */
259  void sendSerialStd1Dx(float x, float size = 0.0F, std::string const & id = "", std::string const & extra = "");
260 
261  //! Send standardized 1D message for an Y image coordinate
262  /*! See \ref UserSerialStyle for more info. Coordinates should be in camera image pixels, this function will
263  convert them to standardized coordinates as per \ref coordhelpers. */
264  void sendSerialImg1Dy(unsigned int camh, float y, float size = 0.0F, std::string const & id = "",
265  std::string const & extra = "");
266 
267  //! Send standardized 1D message for a standardized Y coordinate
268  /*! See \ref UserSerialStyle for more info. Coordinates should be in camera image pixels, this function will
269  convert them to standardized coordinates as per \ref coordhelpers. */
270  void sendSerialStd1Dy(float y, float size = 0.0F, std::string const & id = "", std::string const & extra = "");
271 
272  //! Send standardized 2D message for image coordinates
273  /*! Use this function if you only know location and optionally size. Use the other variants if you have the
274  corners. An upright rectangular shape will be assumed here. See \ref UserSerialStyle for more
275  info. Coordinates should be in camera image pixels, this function will convert them to standardized
276  coordinates as per \ref coordhelpers. */
277  void sendSerialImg2D(unsigned int camw, unsigned int camh, float x, float y, float w = 0.0F, float h = 0.0F,
278  std::string const & id = "", std::string const & extra = "");
279 
280  //! Send standardized 2D message for standardized coordinates
281  /*! Use this function if you only know location and optionally size. Use the other variants if you have the
282  corners. An upright rectangular shape will be assumed here. See \ref UserSerialStyle for more
283  info. Coordinates should be in camera image pixels, this function will convert them to standardized
284  coordinates as per \ref coordhelpers. */
285  void sendSerialStd2D(float x, float y, float w = 0.0F, float h = 0.0F,
286  std::string const & id = "", std::string const & extra = "");
287 
288  //! Send standardized 2D message for polygons in image coordinates
289  /*! Use this function if you have a polygon around your object, for example, one of the contours found with
290  cv::findContours(), or if you have the 4 corners of a rectangular object. See \ref UserSerialStyle for more
291  info. Coordinates should be in camera image pixels, this function will convert them to standardized
292  coordinates as per \ref coordhelpers. For \b Terse serial style, the center of gravity of the points will be
293  computed and output; for \b Normal, an upright bounding rectangle will be computed and output; for \b
294  Detailed, a rotated bounding rectangle will be computed and output; for \b Fine, all the given points will
295  be output. Make sure you try to reduce the number of points so the message is not too long; for example see
296  OpenCV approxPolyDP() or similar. */
297  template <typename T = int>
298  void sendSerialContour2D(unsigned int camw, unsigned int camh, std::vector<cv::Point_<T> > points,
299  std::string const & id = "", std::string const & extra = "");
300 
301  //! Send standardized 3D message
302  /*! Use this function if you only know location and optionally size and an orientation quaternion. Use the other
303  variants if you have a bunch of vertices. See \ref UserSerialStyle for more info. Coordinates should be in
304  millimeters. */
305  void sendSerialStd3D(float x, float y, float z, float w = 0.0F, float h = 0.0F, float d = 0.0F,
306  float q1 = 0.0F, float q2 = 0.0F, float q3 = 0.0f, float q4 = 0.0F,
307  std::string const & id = "", std::string const & extra = "");
308 
309  //! Send standardized 3D message
310  /*! Use this function if you only know location and optionally size and an orientation quaternion. Use the other
311  variants if you have a bunch of vertices. See \ref UserSerialStyle for more info. Coordinates should be in
312  millimeters. */
313  void sendSerialStd3D(std::vector<cv::Point3f> points, std::string const & id = "",
314  std::string const & extra = "");
315 
316  //! Send a standardized object recognition message
317  /*! \param res should be a list of scores and category names, in descending order of scores. Note that no message
318  is sent if the vector is empty. */
319  void sendSerialObjReco(std::vector<ObjReco> const & res);
320 
321  //! Send a standardized object detection + recognition message
322  /*! \param res should be a list of scores and category names, in descending order of scores. Note that no message
323  is sent if the vector is empty. See sendSerialImg2D() for info about the object box. */
324  void sendSerialObjDetImg2D(unsigned int camw, unsigned int camh, float x, float y, float w, float h,
325  std::vector<ObjReco> const & res);
326 
327  //! Send a standardized object detection + recognition message
328  /*! \param res should be a list of scores and category names, in descending order of scores. Note that no message
329  is sent if the vector is empty. See sendSerialImg2D() for info about the object box. */
330  void sendSerialObjDetImg2D(unsigned int camw, unsigned int camh, ObjDetect const & det);
331 
332  protected:
333  friend class jevois::Engine;
334 
335  //! Send a message <b>MARK START</b> to indicate the beginning of processing
336  /*! A stamp may be prepended depending on param \p serstamp. Engine calls this automatically so users would
337  normally not use this function. Note that this function may not send anything depending on the current
338  value of parameter \p sermark. */
339  void sendSerialMarkStart();
340 
341  //! Send a message <b>MARK STOP</b> to indicate the end of processing
342  /*! A stamp may be prepended depending on param \p serstamp. Engine calls this automatically so users would
343  normally not use this function. Note that this function may not send anything depending on the current
344  value of parameter \p sermark. */
345  void sendSerialMarkStop();
346 
347  //! Get a string with the frame/date/time stamp in it, depending on serstamp parameter
348  std::string getStamp() const;
349  };
350 }
351 
352 //! Register a module, allowing it to be dynamically loaded from a .so file
353 /* \def JEVOIS_REGISTER_MODULE(MODULENAME)
354  \hideinitializer
355 
356  Every module implementation file should contain a call to JEVOIS_REGISTER_MODULE for the module's class. This creates
357  some plain-C entry points that will be used when the module is loaded from a dynamic library (.so) file to
358  instantiate the module. \relates Module */
359 #define JEVOIS_REGISTER_MODULE(MODULENAME) \
360  extern "C" std::shared_ptr<jevois::Module> MODULENAME##_create(std::string const & instanceid) \
361  { return std::shared_ptr<jevois::Module>(new MODULENAME(instanceid)); } \
362  extern "C" int MODULENAME##_version_major() { return JEVOIS_VERSION_MAJOR; } \
363  extern "C" int MODULENAME##_version_minor() { return JEVOIS_VERSION_MINOR; } \
364 
365 //! Create and register a disabled module, allowing it to be dynamically loaded from a .so file
366 /* \def JEVOIS_DISABLED_MODULE(MODULENAME)
367  \hideinitializer
368 
369  Use this macro when creating modules that only work on a given host/platform A33/Pro configuration. For example,
370  modules using the A311D NPU can only be compiled on jevois-pro platform. Typically, you would then do:
371  \code
372 #include <jevois/Core/Module.H>
373 
374 #ifdef JEVOIS_PLATFORM_PRO
375  class MyModule { ... };
376 
377  JEVOIS_REGISTER_MODULE(MyModule);
378 #else
379  JEVOIS_DISABLED_MODULE(MyModule);
380 #endif
381  \endcode
382  \relates Module */
383 #define JEVOIS_DISABLED_MODULE(MODULENAME) \
384  class MODULENAME : public jevois::Module { \
385  public: \
386  MODULENAME(std::string const & instancename) : jevois::Module(instancename) \
387  { throw std::runtime_error("This module is disabled on your hardware configuration"); } \
388  }; \
389  extern "C" std::shared_ptr<jevois::Module> MODULENAME##_create(std::string const & instanceid) \
390  { return std::shared_ptr<jevois::Module>(new MODULENAME(instanceid)); } \
391  extern "C" int MODULENAME##_version_major() { return JEVOIS_VERSION_MAJOR; } \
392  extern "C" int MODULENAME##_version_minor() { return JEVOIS_VERSION_MINOR; } \
393 
jevois::module::SerStyle
SerStyle
Definition: Module.H:203
jevois::Range
A generic range class.
Definition: Range.H:80
jevois::OutputFrame
Exception-safe wrapper around a raw image to be sent over USB.
Definition: OutputFrame.H:52
jevois::module::SerStamp
SerStamp
Definition: Module.H:216
JEVOIS_DECLARE_PARAMETER
JEVOIS_DECLARE_PARAMETER(thresh1, double, "First threshold for hysteresis", 50.0, ParamCateg)
jevois::module::SerMark
SerMark
Definition: Module.H:225
jevois::module::end
Send serial message to mark the the end(MARK STOP)
jevois::JEVOIS_DEFINE_ENUM_CLASS
JEVOIS_DEFINE_ENUM_CLASS(CameraSensor,(any)(ov9650)(ov2640)(ov7725)(ar0135)(imx290))
Enum for different sensor models.
RawImage.H
jevois::Component
A component of a model hierarchy.
Definition: Component.H:180
VideoBuf.H
jevois::Module::parseSerial
virtual void parseSerial(std::string const &str, std::shared_ptr< UserInterface > s)
Receive a string from a serial port which contains a user command.
Definition: Module.C:63
jevois::module::others
Send serial message to mark the the or both among others
Definition: Module.H:227
UserInterface.H
ObjDetect.H
jevois::ParameterCategory
A category to which multiple ParameterDef definitions can belong.
Definition: ParameterDef.H:33
jevois::Module::~Module
virtual ~Module()
Virtual destructor for safe inheritance.
Definition: Module.C:36
jevois::module::time
Prepend standardized serial messages with a frame time
Definition: Module.H:217
jevois::GUIhelper
Helper class to assist modules in creating graphical and GUI elements.
Definition: GUIhelper.H:108
jevois::module::http
Style for standardized serial messages as defined in http
Definition: Module.H:205
jevois
Definition: Concepts.dox:1
F
float F
Definition: GUIhelper.C:2150
Component.H
jevois::module::SerMark_Values
Send serial message to mark the the or both among if one needs to know when no results were sent over serial on a given frame Combine with parameter serstamp if you need to know the frame SerMark_Values
Definition: Module.H:229
jevois::module::SerStamp_Values
Prepend standardized serial messages with a frame frame or frame date time See details in SerStamp_Values
Definition: Module.H:219
jevois::ObjDetect
A trivial struct to store object detection results.
Definition: ObjDetect.H:26
jevois::Module::frameNum
size_t frameNum() const
Get frame number from the Engine.
Definition: Module.C:72
jevois::module::Useful
Send serial message to mark the the or both Useful
Definition: Module.H:227
jevois::Engine
JeVois processing engine - gets images from camera sensor, processes them, and sends results over USB...
Definition: Engine.H:381
jevois::Module
Virtual base class for a vision processing module.
Definition: Module.H:104
jevois::module::SerStyle_Values
Style for standardized serial messages as defined in SerStyle_Values
Definition: Module.H:205
InputFrame.H
jevois::InputFrame
Exception-safe wrapper around a raw camera input frame.
Definition: InputFrame.H:50
ObjReco.H
h
int h
Definition: GUIhelper.C:2150
jevois::module::beginning
Send serial message to mark the beginning(MARK START) of the " "processing of a video frame from the camera sensor
jevois::Module::sendSerial
virtual void sendSerial(std::string const &str)
Send a string over the 'serout' serial port.
Definition: Module.C:54
jevois::module::number
Prepend standardized serial messages with a frame number
Definition: Module.H:216
jevois::StdModule
Base class for a module that supports standardized serial messages.
Definition: Module.H:238
OutputFrame.H
GUIhelper.H
jevois::Module::supportedCommands
virtual void supportedCommands(std::ostream &os)
Human-readable description of this Module's supported custom commands.
Definition: Module.C:68
jevois::Component::Module
friend class Module
Definition: Component.H:487
jevois::Module::process
virtual void process(InputFrame &&inframe, OutputFrame &&outframe)
Processing function, version that receives a frame from camera and sends a frame out over USB.
Enum.H