JeVoisBase  1.5
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 sendSerial (std::string const &str)
 
virtual void parseSerial (std::string const &str, std::shared_ptr< UserInterface > s)
 
virtual void supportedCommands (std::ostream &os)
 
 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, ParamCateg)
 
- 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 ()
 

Protected Member Functions

void onParamChange (effect const &param, Effect const &val)
 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

  • Open a video viewer on your host computer and select YUYV 640x240 @ 30 fps (see 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
    help
    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 111 of file ColorFiltering.C.

Constructor & Destructor Documentation

◆ ~ColorFiltering()

virtual ColorFiltering::~ColorFiltering ( )
inlinevirtual

Virtual destructor for safe inheritance.

Definition at line 119 of file ColorFiltering.C.

Member Function Documentation

◆ onParamChange()

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

Parameter callback: set the selected filter algo.

Definition at line 174 of file ColorFiltering.C.

References JEVOIS_REGISTER_MODULE(), and jevois::Component::removeSubComponent().

◆ process()

virtual void ColorFiltering::process ( jevois::InputFrame &&  inframe,
jevois::OutputFrame &&  outframe 
)
inlineoverridevirtual

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: