GRIP Overlaying Contours Onto Images

I was wondering if it is possible to overlay contours detected in GRIP back over the original image feed :confused: . Thanks for your replies :wink: ::ouch:: ::rtm::

Using the vision algorithm from the ā€œUsing GRIP for the 2016 gameā€ tutorial I was able to do this by adding a Mask operator and hooking the output of the original or resized image to the mask input and the output of the HVL Threshold to the mask input of the mask operator. For whatever reason I couldnā€™t set the output of Find or Filter Contours to the mask input of the Mask operator.

David

Assuming youā€™re trying to look at contours on the driver station while GRIP is deployed, Iā€™m working on a SmartDashboard plugin for GRIP that should do something similar to this.

It gets feature data from NetworkTables and images from GRIPā€™s ā€œPublish Videoā€ operation. Unlike SmartDashboardā€™s built-in USB Camera viewer, it should work if GRIP is running on either the roboRIO or a coprocessor, since thereā€™s an option to set the address.

It doesnā€™t have support for rendering contours yet, but itā€™s on the way.

Thomas,
What is the status on this? Weā€™d love to give it a try.
Thanks,
Martin Haeberli
(de-)mentor, FRC 3045 Gear Gremlins (formerly SWAT)

It now supports rendering contours.

thx!

One more question - where on my Mac would I find SmartDashboard/extensions ā€¦ ?

Ok, found that - ~/SmartDashboard/extensions/ - of course!

Next question - does it / can it work with SFX - SFX 2014?

Probably not, unless someone writes an SFX port of the extension

Any suggestions on debugging wuth the current SmartDashboard extension if overlays arenā€™t showing up?

Also, is there a way to overlay, say a number (e.g., size) from GRIP, or, more generally, from NetworkTables, via GRIPā€™s video out? That would be very cool!

Thanks,

Martin Haeberli
(de-)mentor, FRC 3045 Gear Gremlins (formerly SWAT)

Simplest way is to add a call into the disabledPeriodic(), autonomousPeriodic() and teleopPeriodic() that calls a method for updating your GRIP information. Inside this method, you just read the parameters from the GRIP table and put them on the smart dashboard. Not as nice as an overlay, but works quite well.

I also have a boolean configured as a box (so it shows red/green) for ā€œIs Image processing runningā€ I do this by looking at the frame rate. If itā€™s zero, itā€™s not running, if itā€™s non-zero, it is running. I always set the value to zero at the beginning of the robot code - sometimes values get stuck in the network tables - this makes sure that the tables have a zero if the image processing isnā€™t running.

nice!