JeVois Tutorials  1.22
JeVois Smart Embedded Machine Vision Tutorials
 
Share this page:
Loading...
Searching...
No Matches
Introduction to image processing with JeVois

In this tutorial we use the ColorFiltering module of JeVois to interactively explore how different image filters may affect an image, using a live video stream and live processing inside the JeVois smart camera.

This tutorial is intended as a fun, interactive introduction to image processing for K-12 / STEM (kindergarten to high-school, science, technology, engineering and maths) students or anyone interested in learning more about computer vision and image or video processing.

JeVois v1.3.2

Setting up

Operation

The ColorFiltering module implements an number of image filters. The original video captured by JeVois is shown to the left of the display, and the results of applying the selected filter is shown to the right. The parameter settings of the currently running filter are shown as an overlay on top of the filter results at right.

The module has one main parameter that determines which filter to use: effect with values: NoEffect, Blur, Median, Morpho, Laplacian, and Bilateral.

When a given effect is selected, the corresponding image filter is implemented. Different image filters may have additional parameters. For example, the Median filter has a parameter ksize to set the kernel size; the Morpho filter has a parameter op to select the morphological operation (erosion, dilation, opening, closing, top hat, etc).

Thus, the typical way to use this module is:

  • set an effect with setpar effect Blur, setpar effect Median, etc
  • type help to see what additional parameters have become available that are specific to the currently selected effect (those ara slso displayed as an overlay on top of the processed image at right)
  • further set these parameters using additional setpar commands.

In what follows we explore the different filters and their settings.

Effect: Blur

This filter replaces each pixel's value by the average of all pixel values in a rectangular box around the pixel of interest. This leads to a blur effect on the image, more pronounced with bigger box sizes.

See http://docs.opencv.org/3.2.0/d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37

setpar effect Blur
Blur filter with default settings
setpar ksize 11 3
Blur filter with kernel size 11x3
setpar ksize 3 11
Blur filter with kernel size 3x11
setpar ksize 11 11
Blur filter with kernel size 11x11

Effect: Median

This filter replaces each pixel by the median value within a square box around that pixel. Tends to blur and remove salt-and-peper noise from the image.

See http://docs.opencv.org/3.2.0/d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9

setpar effect Median
Median filter with default settings
setpar ksize 7
Median filter with kernel size 7x7 smoothes out the image
Median filter with kernel size 7x7 smoothes out a texture
setpar ksize 13
Median filter with kernel size 13x13 smoothes out the image

Effect: Morpho

This filter applies mathematical morphology operations, which aer operations in which every pixel value is replaced by the result of some operation applied within a shaped neighborhood (the morphological structuring element) shifted to the location of the pixel of interest.

See http://docs.opencv.org/3.2.0/d9/d61/tutorial_py_morphological_ops.html for an introduction, and http://docs.opencv.org/3.2.0/d4/d86/group__imgproc__filter.html

setpar effect Morpho
Morphological filter with default settings
setpar ksize 11 11
Morphological filter with a 11x11 rectangular structuring element, Close operation.
setpar op Erode
Morphological filter with 11x11, Erode operation.
setpar op Dilate
Morphological filter with 11x11, Dilate.
setpar op Open
Morphological filter with 11x11, Open.
setpar op Gradient
Morphological filter with 11x11, Gradient.
setpar op TopHat
Morphological filter with 11x11, TopHat.
setpar op BlackHat
Morphological filter with 11x11, BlackHat.

Effect: Laplacian

This filter computes the second spatial derivative of the image. Tends to amplify edges and noise.

See http://docs.opencv.org/3.2.0/d4/d86/group__imgproc__filter.html#gad78703e4c8fe703d479c1860d76429e6

setpar effect Laplacian
Laplacian filter with default settings
setpar ksize 5
Laplacian filter with kernel size changed to 5x5
jevois-cmd setpar scale 0.5
Laplacian filter with kernel size changed to 5x5 and scale changed to 0.5

Effect: Bilateral filter

This a more complex bi-lateral filter that attempts to smooth out an image without making it overly blurry. It is quite slow. See http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html and http://docs.opencv.org/3.2.0/d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed

setpar effect Bilateral
Bilateral filter with default settings
setpar sigmaSpace 5
setpar sigmaColor 5
Bilateral filter with sigma space 5 and sigma color 5