Log in

View Full Version : GRIP Overlaying Contours Onto Images


Manusha4Lyfe
29-01-2016, 22:49
I was wondering if it is possible to overlay contours detected in GRIP back over the original image feed :confused: . Thanks for your replies ;) ::ouch:: ::rtm::

dszlucha
30-01-2016, 13:59
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

ThomasClark
31-01-2016, 17:40
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.

https://github.com/WPIRoboticsProjects/GRIP-SmartDashboard

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.

mhaeberli
08-03-2016, 20:02
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)

ThomasClark
08-03-2016, 20:04
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.

https://github.com/WPIRoboticsProjects/GRIP-SmartDashboard/releases

mhaeberli
08-03-2016, 21:02
thx!

mhaeberli
08-03-2016, 21:10
One more question - where on my Mac would I find SmartDashboard/extensions ... ?

mhaeberli
08-03-2016, 21:38
Ok, found that - ~/SmartDashboard/extensions/ - of course!

mhaeberli
08-03-2016, 23:42
Next question - does it / can it work with SFX - SFX 2014?

ThomasClark
10-03-2016, 13:24
Next question - does it / can it work with SFX - SFX 2014?

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

mhaeberli
13-03-2016, 00:21
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)

robert1356
14-03-2016, 14:39
Any suggestions on debugging wuth the current SmartDashboard extension if overlays aren't showing up?


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.

mhaeberli
14-03-2016, 20:55
nice!