JeVoisBase  1.0
JeVois Smart Embedded Machine Vision Toolkit Base Modules
SaliencySURF Class Reference

Simple salient region detection and identification using keypoint matching. More...

Inheritance diagram for SaliencySURF:
Collaboration diagram for SaliencySURF:

Public Member Functions

 SaliencySURF (std::string const &instance)
 Constructor. More...
 
virtual ~SaliencySURF ()
 Virtual destructor for safe inheritance. More...
 
void postInit () override
 Get started. More...
 
void postUninit () override
 Get stopped. More...
 
virtual void process (jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override
 Processing function. More...
 
- Public Member Functions inherited from jevois::Module
 Module (std::string const &instance)
 
virtual ~Module ()
 
virtual void process (InputFrame &&inframe)
 
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< ComponentgetSubComponent (std::string const &instance) const
 
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 &paramdescriptor, T const &val)
 
void setParamValUnique (std::string const &paramdescriptor, T const &val)
 
std::vector< std::pair< std::string, T > > getParamVal (std::string const &paramdescriptor) const
 
getParamValUnique (std::string const &paramdescriptor) const
 
std::vector< std::string > setParamString (std::string const &paramdescriptor, std::string const &val)
 
void setParamStringUnique (std::string const &paramdescriptor, std::string const &val)
 
std::vector< std::pair< std::string, std::string > > getParamString (std::string const &paramdescriptor) const
 
std::string getParamStringUnique (std::string const &paramdescriptor) const
 
void freezeParam (std::string const &paramdescriptor)
 
void unFreezeParam (std::string const &paramdescriptor)
 
void freezeAllParams ()
 
void unFreezeAllParams ()
 
std::string descriptor () const
 
void setParamsFromFile (std::string const &filename)
 
std::istream & setParamsFromStream (std::istream &is, std::string const &absfile)
 
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
 
bool initialized () const
 
std::string const & className () const
 
std::string const & instanceName () const
 
std::vector< std::string > setParamVal (std::string const &paramdescriptor, T const &val)
 
void setParamValUnique (std::string const &paramdescriptor, T const &val)
 
std::vector< std::pair< std::string, T > > getParamVal (std::string const &paramdescriptor) const
 
getParamValUnique (std::string const &paramdescriptor) const
 
std::vector< std::string > setParamString (std::string const &paramdescriptor, std::string const &val)
 
void setParamStringUnique (std::string const &paramdescriptor, std::string const &val)
 
std::vector< std::pair< std::string, std::string > > getParamString (std::string const &paramdescriptor) const
 
std::string getParamStringUnique (std::string const &paramdescriptor) const
 
void freezeParam (std::string const &paramdescriptor)
 
void unFreezeParam (std::string const &paramdescriptor)
 
void freezeAllParams ()
 
void unFreezeAllParams ()
 
std::string descriptor () const
 
void setParamsFromFile (std::string const &filename)
 
std::istream & setParamsFromStream (std::istream &is, std::string const &absfile)
 
void setPath (std::string const &path)
 
std::string absolutePath (std::string const &path="")
 
- Public Member Functions inherited from jevois::ParameterRegistry
virtual ~ParameterRegistry ()
 

Related Functions

(Note that these are not member functions.)

 JEVOIS_DECLARE_PARAMETER (inhsigma, float,"Sigma (pixels) used for inhibition of return", 32.0F, ParamCateg)
 Parameter. More...
 
 JEVOIS_DECLARE_PARAMETER (regions, size_t,"Number of salient regions", 2, ParamCateg)
 Parameter. More...
 
 JEVOIS_DECLARE_PARAMETER (rsiz, size_t,"Width and height (pixels) of salient regions", 64, ParamCateg)
 Parameter. More...
 
 JEVOIS_DECLARE_PARAMETER (save, bool,"Save regions when true, useful to create a training set. They will be saved to "PATHPREFIX, false, ParamCateg)
 Parameter. More...
 

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 ()
 

Detailed Description

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: detect keypoint locations, compute keypoint descriptors, and match descriptors from current image to training image descriptors. 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(). The itsKPfut future is our handle to that thread, and we also use it to alternate between detection and matching on alternating frames.

Also see the ObjectDetect module for a related algorithm (without attention).

Training: Simply add images of the objects you want to detect in 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 trainign 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.

Author
Laurent Itti
Display Name:
Saliency SURF
Videomapping:
YUYV 320 288 30.0 YUYV 320 240 30.0 JeVois SaliencySURF
Email:
itti@usc.edu
Address:
University of Southern California, HNB-07A, 3641 Watt Way, Los Angeles, CA 90089-2520, USA
Main URL:
http://jevois.org
Support URL:
http://jevois.org/doc
Other URL:
http://iLab.usc.edu
License:
GPL v3
Distribution:
Unrestricted
Restrictions:
None

Definition at line 82 of file SaliencySURF.C.

Constructor & Destructor Documentation

SaliencySURF::SaliencySURF ( std::string const &  instance)
inline

Constructor.

Definition at line 88 of file SaliencySURF.C.

virtual SaliencySURF::~SaliencySURF ( )
inlinevirtual

Virtual destructor for safe inheritance.

Definition at line 97 of file SaliencySURF.C.

Member Function Documentation

void SaliencySURF::postInit ( )
inlineoverridevirtual

Get started.

Reimplemented from jevois::Component.

Definition at line 103 of file SaliencySURF.C.

References LINFO.

void SaliencySURF::postUninit ( )
inlineoverridevirtual

Friends And Related Function Documentation

JEVOIS_DECLARE_PARAMETER ( inhsigma  ,
float  ,
"Sigma (pixels) used for inhibition of return"  ,
32.  0F,
ParamCateg   
)
related

Parameter.

JEVOIS_DECLARE_PARAMETER ( regions  ,
size_t  ,
"Number of salient regions"  ,
,
ParamCateg   
)
related

Parameter.

JEVOIS_DECLARE_PARAMETER ( rsiz  ,
size_t  ,
"Width and height (pixels) of salient regions"  ,
64  ,
ParamCateg   
)
related

Parameter.

JEVOIS_DECLARE_PARAMETER ( save  ,
bool  ,
"Save regions when  true,
useful to create a training set.They will be saved to"  PATHPREFIX,
false  ,
ParamCateg   
)
related

Parameter.


The documentation for this class was generated from the following file: