Color Filtering
Image filtering using OpenCV.
By Laurent Ittiitti@usc.eduhttp://jevois.orgGPL v3
 Language: C++Supports mappings with USB output: YesSupports mappings with NO USB output: Yes 
 Video Mapping:   YUYV 640 240 30.0 YUYV 320 240 30.0 JeVois ColorFiltering

Module Documentation

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

ParameterTypeDescriptionDefaultValid Values
(ColorFiltering) effectEffectImage processing effect to applyEffect::MorphoEffect_Values
(LaplacianFilter) ksizeunsigned intLaplacian kernel size1-
(LaplacianFilter) scaledoubleLaplacian scale factor applied to the computed values1.0-
(LaplacianFilter) deltadoubleLaplacian delta offset applied to the computed values0.0-
(MorphologyFilter) opMorphoOpMorphological operation to applyMorphoOp::GradientMorphoOp_Values
(MorphologyFilter) kshapeKernelShapeKernel shapeKernelShape::RectangleKernelShape_Values
(MorphologyFilter) ksizecv::SizeKernel width and heightcv::Size(7, 7)-
(MorphologyFilter) anchorcv::PointAnchor point x and y; default value [-1 -1] means that the anchor is at the kernel centercv::Point(-1, -1)-
(MorphologyFilter) iterunsigned intNumber of iterations of the filter to apply1U-
(MedianFilter) ksizeunsigned intMedian kernel size (must be an odd number >= 3)3boost::regex(^[3579]|\\\\d+[13579]$)
(BilateralFilter) dintDiameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace0-
(BilateralFilter) sigmaColordoubleFilter sigma in the color space. A larger value of the parameter means that farther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting in larger areas of semi-equal color. 2.0-
(BilateralFilter) sigmaSpacedoubleFilter sigma in the coordinate space. A larger value of the parameter means that farther pixels will influence each other as long as their colors are close enough (see sigmaColor). When d>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is proportional to sigmaSpace.2.0-
(BlurFilter) ksizecv::SizeBlur kernel width and heightcv::Size(3, 3)-
(BlurFilter) anchorcv::PointAnchor point x and y; default value [-1 -1] means that the anchor is at the kernel centercv::Point(-1, -1)-
Detailed docs:ColorFiltering
Copyright:Copyright (C) 2016 by Laurent Itti, iLab and the University of Southern California
License:GPL v3
Support URL:
Other URL:
Address:University of Southern California, HNB-07A, 3641 Watt Way, Los Angeles, CA 90089-2520, USA