JeVoisBase
1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
|
Simple salient region detection and identification using keypoint matching. More...
Public Member Functions | |
SaliencySURF (std::string const &instance) | |
Constructor. | |
virtual | ~SaliencySURF () |
Virtual destructor for safe inheritance. | |
void | postInit () override |
Get started. | |
void | postUninit () override |
Get stopped. | |
virtual void | process (jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override |
Processing function. | |
Public Member Functions inherited from jevois::Module | |
Module (std::string const &instance) | |
virtual | ~Module () |
virtual void | process (InputFrame &&inframe) |
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) |
Public Member Functions inherited from jevois::Component | |
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 |
bool | initialized () const |
std::string const & | className () const |
std::string const & | 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, bool doit) |
void | freezeAllParams (bool doit) |
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="") |
std::shared_ptr< DynamicParameter< T > > | addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ParameterCategory const &category) |
std::shared_ptr< DynamicParameter< T > > | addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ValidValuesSpec< T > const &validValuesSpec, ParameterCategory const &category) |
void | setDynamicParameterCallback (std::string const &name, std::function< void(T const &)> cb, bool callnow=true) |
void | removeDynamicParameter (std::string const &name, bool throw_if_not_found=true) |
void | setPath (std::string const &path) |
std::filesystem::path | absolutePath (std::filesystem::path 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 |
bool | initialized () const |
std::string const & | className () const |
std::string const & | 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, bool doit) |
void | freezeAllParams (bool doit) |
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="") |
std::shared_ptr< DynamicParameter< T > > | addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ParameterCategory const &category) |
std::shared_ptr< DynamicParameter< T > > | addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ValidValuesSpec< T > const &validValuesSpec, ParameterCategory const &category) |
void | setDynamicParameterCallback (std::string const &name, std::function< void(T const &)> cb, bool callnow=true) |
void | removeDynamicParameter (std::string const &name, bool throw_if_not_found=true) |
void | setPath (std::string const &path) |
std::filesystem::path | absolutePath (std::filesystem::path const &path="") |
Public Member Functions inherited from jevois::ParameterRegistry | |
virtual | ~ParameterRegistry () |
Related Symbols | |
(Note that these are not member symbols.) | |
JEVOIS_DECLARE_PARAMETER (inhsigma, float, "Sigma (pixels) used for inhibition of return", 32.0F, ParamCateg) | |
Parameter. | |
JEVOIS_DECLARE_PARAMETER (regions, size_t, "Number of salient regions", 2, ParamCateg) | |
Parameter. | |
JEVOIS_DECLARE_PARAMETER (rsiz, size_t, "Width and height (pixels) of salient regions", 64, ParamCateg) | |
Parameter. | |
JEVOIS_DECLARE_PARAMETER (save, bool, "Save regions when true, useful to create a training set. They will be saved to " PATHPREFIX, false, ParamCateg) | |
Parameter. | |
Additional Inherited Members | |
Protected Member Functions inherited from jevois::Component | |
virtual void | preInit () |
virtual void | preUninit () |
virtual void | preInit () |
virtual void | preUninit () |
Protected Member Functions inherited from jevois::ParameterRegistry | |
void | addParameter (ParameterBase *const param) |
void | removeParameter (ParameterBase *const param) |
void | callbackInitCall () |
Simple salient region detection and identification using keypoint matching.
This module finds objects by matching keypoint descriptors between a current set of salient regions and a set of training images.
Here we use SURF keypoints and descriptors as provided by OpenCV. The algorithm is quite slow and consists of 3 phases:
Here, we alternate between computing keypoints and descriptors on one frame (or more, depending on how slow that gets), and doing the matching on the next frame. This module also provides an example of letting some computation happen even after we exit the process()
function. Here, we keep detecting keypoints and computing descriptors even outside process()
.
Also see the ObjectDetect module for a related algorithm (without attention).
Simply add images of the objects you want to detect into JEVOIS:/modules/JeVois/SaliencySURF/images/ on your JeVois microSD card.
Those will be processed when the module starts.
The names of recognized objects returned by this module are simply the file names of the pictures you have added in that directory. No additional training procedure is needed.
Beware that the more images you add, the slower the algorithm will run, and the higher your chances of confusions among several of your objects.
This module provides parameters that allow you to determine how strict a match should be. With stricter matching, you may sometimes miss an object (i.e., it was there, but was not detected by the algorithm). With looser matching, you may get more false alarms (i.e., there was something else in the camera's view, but it was matched as one of your objects). If you are experiencing difficulties getting any matches, try to loosen the settings, for example:
setpar goodpts 5 ... 100 setpar distthresh 0.5
Definition at line 105 of file SaliencySURF.C.
|
inline |
Constructor.
Definition at line 111 of file SaliencySURF.C.
|
inlinevirtual |
Virtual destructor for safe inheritance.
Definition at line 120 of file SaliencySURF.C.
|
inlineoverridevirtual |
Get started.
Reimplemented from jevois::Component.
Definition at line 126 of file SaliencySURF.C.
References jevois::async(), and LINFO.
|
inlineoverridevirtual |
Get stopped.
Reimplemented from jevois::Component.
Definition at line 137 of file SaliencySURF.C.
References jevois::BoundedBuffer< typename T, BlockingBehavior WhenFull, BlockingBehavior WhenEmpty >::filled_size(), LERROR, LINFO, jevois::BoundedBuffer< typename T, BlockingBehavior WhenFull, BlockingBehavior WhenEmpty >::push(), and jevois::warnAndIgnoreException().
|
inlineoverridevirtual |
Processing function.
Reimplemented from jevois::Module.
Definition at line 152 of file SaliencySURF.C.
References jevois::async(), jevois::rawimage::convertToCvGray(), jevois::rawimage::drawFilledRect(), jevois::rawimage::drawRect(), jevois::RawImage::fmt, h, jevois::RawImage::height, jevois::yuyv::LightGreen, jevois::rawimage::paste(), jevois::BoundedBuffer< typename T, BlockingBehavior WhenFull, BlockingBehavior WhenEmpty >::push(), jevois::RawImage::require(), jevois::Timer::start(), jevois::Timer::stop(), jevois::yuyv::White, jevois::RawImage::width, and jevois::rawimage::writeText().
|
related |
Parameter.
|
related |
Parameter.
|
related |
Parameter.
|
related |
Parameter.