JeVoisBase  1.20
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
ColorFiltering Class Reference

Image filtering using OpenCV. More...

Inheritance diagram for ColorFiltering:
Collaboration diagram for ColorFiltering:

Public Member Functions

virtual ~ColorFiltering ()
 Virtual destructor for safe inheritance. More...
 
virtual void process (jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override
 Processing function with video output to USB. More...
 
- 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
 
Engineengine () const
 
bool initialized () const
 
const std::string & className () const
 
const std::string & 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)
 
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)
 
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
 
Engineengine () const
 
bool initialized () const
 
const std::string & className () const
 
const std::string & 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)
 
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)
 
void setPath (std::string const &path)
 
std::filesystem::path absolutePath (std::filesystem::path const &path="")
 
- Public Member Functions inherited from jevois::ParameterRegistry
virtual ~ParameterRegistry ()
 

Protected Member Functions

void onParamChange (effect const &, Effect const &val) override
 Parameter callback: set the selected filter algo. More...
 
- Protected Member Functions inherited from jevois::Component
virtual void preInit ()
 
virtual void postInit ()
 
virtual void preUninit ()
 
virtual void postUninit ()
 
virtual void preInit ()
 
virtual void postInit ()
 
virtual void preUninit ()
 
virtual void postUninit ()
 
- Protected Member Functions inherited from jevois::ParameterRegistry
void addParameter (ParameterBase *const param)
 
void removeParameter (ParameterBase *const param)
 
void callbackInitCall ()
 

Related Functions

(Note that these are not member functions.)

 JEVOIS_DEFINE_ENUM_CLASS (Effect,(NoEffect)(Blur)(Median)(Morpho)(Laplacian)(Bilateral))
 Enum. More...
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (effect, Effect, "Image processing effect to apply", Effect::Morpho, Effect_Values, ParamCateg)
 Parameter. More...
 

Detailed Description

Image filtering using OpenCV.

This module is to learn about basic image filtering. It was developed to allow students to instantly observe the effects of different filters and their parameters on live video. The module implements a variety of filters using OpenCV. Each filter exposes some paremeters (e.g., kernel size) that can be set interactively to understand their effects onto the filter behavior.

Available filters:

How to use this module

  • On JeVois-Pro, select the effect and set its parameters in the Parameters tab of the GUI. You can also drag the cyan handles left and right on screen to change which portion of the image is shown as original vs processed.
  • On JeVois-A33, either try it with JeVois Inventor using YUYV 640x240 @ 30 fps. Note that each time you select a new effect, this will affect the set of parameters that are available for that effect, but currently JeVois Inventor has no way of being notified of that change. So just click to another tab (e.g., the Info tab), and then back to the Parameters tab each time you change the effect. This will refresh the parameter list.
  • Or, open a video viewer on your host computer and select YUYV 640x240 @ 30 fps (see JeVois-A33 Quickstart user guide)
  • Open a serial communication to JeVois (see Command-line interface user guide)
  • Type help and observe the available parameter called effect
  • Start by setting the effect parameter to a given effect type. For example: setpar effect Median or setpar effect Morpho (commands are case-sensitive).
  • Then type help to see what additional parameters are available for each effect. For example, for Median, you can adjust the kernel size (parameter ksize). For Morpho, you can select the type of morphological operation (parameter op), structuring element shape (parameter kshape) and size (parameter ksize), etc.

    Complete example:

setpar effect Morpho
setpar op Open
setpar ksize 7 7

With JeVois v1.5 and above, you may want to use help2 instead of help, which is a shorter and more compact help message that shows parameters and commands of the running machine vision module only (and no general parameters related to the JeVois core).

Author
Laurent Itti
Videomapping:
YUYV 640 240 30.0 YUYV 320 240 30.0 JeVois ColorFiltering
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 121 of file ColorFiltering.C.

Constructor & Destructor Documentation

◆ ~ColorFiltering()

virtual ColorFiltering::~ColorFiltering ( )
inlinevirtual

Virtual destructor for safe inheritance.

Definition at line 133 of file ColorFiltering.C.

Member Function Documentation

◆ onParamChange()

void ColorFiltering::onParamChange ( effect const &  ,
Effect const &  val 
)
inlineoverrideprotected

Parameter callback: set the selected filter algo.

Definition at line 284 of file ColorFiltering.C.

References jevois::Component::removeSubComponent().

◆ process()

Friends And Related Function Documentation

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK()

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( effect  ,
Effect  ,
"Image processing effect to apply"  ,
Effect::Morpho  ,
Effect_Values  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DEFINE_ENUM_CLASS()

JEVOIS_DEFINE_ENUM_CLASS ( Effect  ,
(NoEffect)(Blur)(Median)(Morpho)(Laplacian)(Bilateral)   
)
related

Enum.


The documentation for this class was generated from the following file:
benchmark.help
help
Definition: benchmark.py:13