|Video Mapping: YUYV 320 254 60.0 YUYV 320 240 60.0 JeVois ObjectTracker|
This modules isolates pixels within a given HSV range, does some cleanups, and extract object contrours. It sends information about object centers over serial. This module usually works best with the camera sensor set to manual exposure, gain, color balance, etc so that HSV color values are reliable. See the cript.cfg file in this module's directory for an example of how to set the camera settigs each time this module is loaded.
This code was loosely inspired by: https://raw.githubusercontent.com/kylehounslow/opencv-tuts/master/object-tracking-tut/objectTrackingTut.cpp written by Kyle Hounslow, 2013.
You should adjust parameters hrange, srange, and vrange to isolate the range of Hue, Saturation, and Value (respectively) that correspond to the objects you want to detect. Note that there is a params.cfg file in this module's directory that provides a range tuned to a lighgt blue object, as shown in the demo screenshot.
Tuning the parameters is best done interactively by connecting to your JeVois camera while it is looking at some object of the desired color. Once you have achieved a tuning, you may want to set the hrange, srange, and vrange parameters in your script.cfg file for this module on the microSD card (see below).
Typically, you would start by narrowing down on the hue, then the value, and finally the saturation. Make sure you also move your camera around and show it typical background clutter so check for false positives (detections of things which you are not interested, which can happen if your ranges are too wide).
JeVois allows you to store parameter settings and commands in a file named