JeVoisBase
1.17
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
|
Detect and recognize multiple objects in scenes using OpenCV, NPU, TPU, or VPU Deep Neural Nets. More...
Public Member Functions | |
DNN (std::string const &instance) | |
Constructor. More... | |
virtual | ~DNN () |
Virtual destructor for safe inheritance. More... | |
void | doprocess (jevois::InputFrame const &inframe, jevois::RawImage *outimg, jevois::OptGUIhelper *helper, bool idle) |
Processing function implementation. More... | |
virtual void | process (jevois::InputFrame &&inframe) override |
Processing function, no video output. More... | |
virtual void | process (jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override |
Processing function with video output to USB. More... | |
![]() | |
StdModule (std::string const &instance) | |
virtual | ~StdModule () |
void | sendSerialImg1Dx (unsigned int camw, float x, float size=0.0F, std::string const &id="", std::string const &extra="") |
void | sendSerialStd1Dx (float x, float size=0.0F, std::string const &id="", std::string const &extra="") |
void | sendSerialImg1Dy (unsigned int camh, float y, float size=0.0F, std::string const &id="", std::string const &extra="") |
void | sendSerialStd1Dy (float y, float size=0.0F, std::string const &id="", std::string const &extra="") |
void | sendSerialImg2D (unsigned int camw, unsigned int camh, float x, float y, float w=0.0F, float h=0.0F, std::string const &id="", std::string const &extra="") |
void | sendSerialStd2D (float x, float y, float w=0.0F, float h=0.0F, std::string const &id="", std::string const &extra="") |
void | sendSerialContour2D (unsigned int camw, unsigned int camh, std::vector< cv::Point_< T > > points, std::string const &id="", std::string const &extra="") |
void | sendSerialStd3D (float x, float y, float z, float w=0.0F, float h=0.0F, float d=0.0F, float q1=0.0F, float q2=0.0F, float q3=0.0f, float q4=0.0F, std::string const &id="", std::string const &extra="") |
void | sendSerialStd3D (std::vector< cv::Point3f > points, std::string const &id="", std::string const &extra="") |
void | sendSerialObjReco (std::vector< ObjReco > const &res) |
void | sendSerialObjDetImg2D (unsigned int camw, unsigned int camh, float x, float y, float w, float h, std::vector< ObjReco > const &res) |
void | sendSerialObjDetImg2D (unsigned int camw, unsigned int camh, ObjDetect const &det) |
JEVOIS_DEFINE_ENUM_CLASS (SerStyle,(Terse)(Normal)(Detail)(Fine)) JEVOIS_DECLARE_PARAMETER(serstyle | |
JEVOIS_DECLARE_PARAMETER (serprec, unsigned int, "Number of decimal points in standardized serial messages as " "defined in http://jevois.org/doc/UserSerialStyle.html", 0U, jevois::Range< unsigned int >(0U, 10U), ParamCateg) | |
JEVOIS_DEFINE_ENUM_CLASS (SerStamp,(None)(Frame)(Time)(FrameTime)(FrameDateTime)) JEVOIS_DECLARE_PARAMETER(serstamp | |
JEVOIS_DEFINE_ENUM_CLASS (SerMark,(None)(Start)(Stop)(Both)) JEVOIS_DECLARE_PARAMETER(sermark | |
![]() | |
Module (std::string const &instance) | |
virtual | ~Module () |
virtual void | process (InputFrame &&inframe, GUIhelper &helper) |
virtual void | sendSerial (std::string const &str) |
virtual void | parseSerial (std::string const &str, std::shared_ptr< UserInterface > s) |
virtual void | supportedCommands (std::ostream &os) |
size_t | frameNum () const |
![]() | |
Component (std::string const &instance) | |
virtual | ~Component () |
std::shared_ptr< Comp > | addSubComponent (std::string const &instance, Args &&...args) |
void | removeSubComponent (std::shared_ptr< Comp > &component) |
void | removeSubComponent (std::string const &instance, bool warnIfNotFound=true) |
std::shared_ptr< Comp > | getSubComponent (std::string const &instance) const |
bool | isTopLevel () const |
Engine * | engine () const |
bool | initialized () const |
const std::string & | className () const |
const std::string & | instanceName () const |
std::vector< std::string > | setParamVal (std::string const ¶mdescriptor, T const &val) |
void | setParamValUnique (std::string const ¶mdescriptor, T const &val) |
std::vector< std::pair< std::string, T > > | getParamVal (std::string const ¶mdescriptor) const |
T | getParamValUnique (std::string const ¶mdescriptor) const |
std::vector< std::string > | setParamString (std::string const ¶mdescriptor, std::string const &val) |
void | setParamStringUnique (std::string const ¶mdescriptor, std::string const &val) |
std::vector< std::pair< std::string, std::string > > | getParamString (std::string const ¶mdescriptor) const |
std::string | getParamStringUnique (std::string const ¶mdescriptor) const |
void | freezeParam (std::string const ¶mdescriptor) |
void | unFreezeParam (std::string const ¶mdescriptor) |
void | freezeAllParams () |
void | unFreezeAllParams () |
std::string | descriptor () const |
void | setParamsFromFile (std::string const &filename) |
std::istream & | setParamsFromStream (std::istream &is, std::string const &absfile) |
virtual void | paramInfo (std::shared_ptr< UserInterface > s, std::map< std::string, std::string > &categs, bool skipFrozen, std::string const &cname="", std::string const &pfx="") |
void | foreachParam (std::function< void(std::string const &compname, ParameterBase *p)> func, std::string const &cname="") |
void | setPath (std::string const &path) |
std::string | absolutePath (std::string const &path="") |
std::shared_ptr< Comp > | addSubComponent (std::string const &instance, Args &&...args) |
void | removeSubComponent (std::shared_ptr< Comp > &component) |
void | removeSubComponent (std::string const &instance, bool warnIfNotFound=true) |
std::shared_ptr< Comp > | getSubComponent (std::string const &instance) const |
bool | isTopLevel () const |
Engine * | engine () const |
bool | initialized () const |
const std::string & | className () const |
const std::string & | instanceName () const |
std::vector< std::string > | setParamVal (std::string const ¶mdescriptor, T const &val) |
void | setParamValUnique (std::string const ¶mdescriptor, T const &val) |
std::vector< std::pair< std::string, T > > | getParamVal (std::string const ¶mdescriptor) const |
T | getParamValUnique (std::string const ¶mdescriptor) const |
std::vector< std::string > | setParamString (std::string const ¶mdescriptor, std::string const &val) |
void | setParamStringUnique (std::string const ¶mdescriptor, std::string const &val) |
std::vector< std::pair< std::string, std::string > > | getParamString (std::string const ¶mdescriptor) const |
std::string | getParamStringUnique (std::string const ¶mdescriptor) const |
void | freezeParam (std::string const ¶mdescriptor) |
void | unFreezeParam (std::string const ¶mdescriptor) |
void | freezeAllParams () |
void | unFreezeAllParams () |
std::string | descriptor () const |
void | setParamsFromFile (std::string const &filename) |
std::istream & | setParamsFromStream (std::istream &is, std::string const &absfile) |
virtual void | paramInfo (std::shared_ptr< UserInterface > s, std::map< std::string, std::string > &categs, bool skipFrozen, std::string const &cname="", std::string const &pfx="") |
void | foreachParam (std::function< void(std::string const &compname, ParameterBase *p)> func, std::string const &cname="") |
void | setPath (std::string const &path) |
std::string | absolutePath (std::string const &path="") |
![]() | |
virtual | ~ParameterRegistry () |
Protected Attributes | |
std::shared_ptr< jevois::dnn::Pipeline > | itsPipeline |
Additional Inherited Members | |
![]() | |
void | sendSerialMarkStart () |
void | sendSerialMarkStop () |
std::string | getStamp () const |
![]() | |
virtual void | preInit () |
virtual void | postInit () |
virtual void | preUninit () |
virtual void | postUninit () |
virtual void | preInit () |
virtual void | postInit () |
virtual void | preUninit () |
virtual void | postUninit () |
![]() | |
void | addParameter (ParameterBase *const param) |
void | removeParameter (ParameterBase *const param) |
void | callbackInitCall () |
Detect and recognize multiple objects in scenes using OpenCV, NPU, TPU, or VPU Deep Neural Nets.
This module runs a deep neural network using the OpenCV DNN library. Classification networks try to identify the whole object or scene in the field of view, and return the top scoring object classes. Detection networks analyze a scene and produce a number of bounding boxes around detected objects, together with identity labels and confidence scores for each detected box. Semantic segmentation networks create a pixel-by-pixel mask which assigns a class label to every location in the camera view.
To select a network, see parameter pipe
of component Pipeline.
For classification networks, when object classes are found with confidence scores above thresh
, a message containing up to top
category:score pairs will be sent per video frame. Exact message format depends on the current serstyle
setting and is described in Standardized serial messages formatting. For example, when serstyle
is Detail, this module sends:
DO category:score category:score ... category:score
where category is a category name (from namefile
) and score is the confidence score from 0.0 to 100.0 that this category was recognized. The pairs are in order of decreasing score.
See Standardized serial messages formatting for more on standardized serial messages, and Helper functions to convert coordinates from camera resolution to standardized for more info on standardized coordinates.
For object detection networks, when detections are found which are above threshold, one message will be sent for each detected object (i.e., for each box that gets drawn when USB outputs are used), using a standardized 2D message:
id
: the category of the recognized object, followed by ':' and the confidence score in percentx
, y
, or vertices: standardized 2D coordinates of object center or cornersw
, h
: standardized object sizeextra
: any number of additional category:score pairs which had an above-threshold score for that boxSee Standardized serial messages formatting for more on standardized serial messages, and Helper functions to convert coordinates from camera resolution to standardized for more info on standardized coordinates.
|
inline |
|
inlinevirtual |
|
inline |
Processing function implementation.
Definition at line 99 of file DNN.C.
References jevois::InputFrame::getp(), and itsPipeline.
Referenced by process().
|
inlineoverridevirtual |
Processing function, no video output.
Reimplemented from jevois::Module.
Definition at line 112 of file DNN.C.
References doprocess().
|
inlineoverridevirtual |
Processing function with video output to USB.
Reimplemented from jevois::Module.
Definition at line 120 of file DNN.C.
References doprocess(), jevois::RawImage::fmt, h, jevois::RawImage::height, jevois::rawimage::paste(), jevois::RawImage::require(), and jevois::RawImage::width.
|
protected |
Definition at line 175 of file DNN.C.
Referenced by DNN(), and doprocess().