JeVois Tutorials
1.22
JeVois Smart Embedded Machine Vision Tutorials
|
|
Starting with JeVois v1.6.1, JeVois provides a simple demo module that can detect a U-shaped object and estimate its location and pose in 3D space. This module is provided for inspiration of FIRST Robotics teams. It has no pretension of actually solving the FIRST Robotics vision problem in a complete and reliable way. It is released in the hope that FRC teams will try it out and get inspired to develop something much better for their own robot.
The basic idea of this module is the classic FIRST robotics vision pipeline: first, select a range of pixels in HSV color pixel space likely to include the object. Then, detect contours of all blobs in range. Then apply some tests on the shape of the detected blobs, their size, fill ratio (ratio of object area compared to its convex hull's area), etc. Finally, estimate the location and pose of the object in the world.
In this module, we run up to 4 pipelines in parallel, using different settings for the range of HSV pixels considered:
Detections from all 4 pipelines are considered for overlap and quality (raggedness of their outlines), and only the cleanest of several overlapping detections is preserved. From those cleanest detections, pipelines 2-3 learn and adapt the HSV range for future video frames.
For more details, please see the documentation of FirstVision
This shape is 280mm wide by 175mm tall (outer dimensions of the white U)
Look for the parameter objsize in that config file and enter the measured size of your shape, in meters.
Point JeVois towards your shape. You will likely need to edit parameters for the HSV range selection, depending on your target exact color, on lighting conditions, etc. To edit those parameters, stop video streaming (quit your video capture software), export the microSD as virtual USB drive again, edit that config file again, and change the settings for parameters hcue, scue, and vcue.
You may also want to play with the controls of your video capture software (e.g., change exposure, red balance, blue balance, etc).
Eventually, you should be able to detect the shape!
The module has many parameters you can tune.
You can do that either interactively by communicating with JeVois over a serial communication while it is running (see Changing machine vision parameters), or you can edit the values in the script.cfg file as we have done above.
See the documentation of the FirstVision module for what the different parameters do.
Several users have contributed great mounts for the JeVois camera, some of which also include a mount for an LED ring. Search for jevois at http://thingiverse.com to download free models that you can print with a 3D printer.
Here is for example the very nice mount of NickFury at https://www.thingiverse.com/thing:2692328
Stay tuned, we will soon release two relevant pieces: