JeVois Tutorials
1.22
JeVois Smart Embedded Machine Vision Tutorials
|
|
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
jevois-cmd
(see Connecting to JeVois using serial-over-USB: Linux host) to send the commands below to JeVois.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:
setpar effect Blur
, setpar effect Median
, etchelp
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)setpar
commands.In what follows we explore the different filters and their settings.
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
setpar ksize 11 3
setpar ksize 3 11
setpar ksize 11 11
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
setpar ksize 7
setpar ksize 13
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
setpar ksize 11 11
setpar op Erode
setpar op Dilate
setpar op Open
setpar op Gradient
setpar op TopHat
setpar op BlackHat
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
setpar ksize 5
jevois-cmd setpar scale 0.5
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
setpar sigmaSpace 5 setpar sigmaColor 5