GRIP icon indicating copy to clipboard operation
GRIP copied to clipboard

Cannot use "Find Contours" as input to "CV Rectangle"?

Open gartaud opened this issue 9 years ago • 14 comments
trafficstars

Hi Working on the FRC 2016 challenge, we are trying to highlight the targets found by GRIP in our smart dashboard. One would think that a combination of "Find Contours", "CV Rectangle" and "Publish Video" would do the trick but it does not for a few reasons:

  1. It appears that there is no operation that can take contours as an input except "Publish Contours"
  2. "CV Rectangle" requires a scalar as input for the color... and it seems that there is no operation that outputs a scalar acceptable as input to "CV Rectangle". At the minimum could you make the color a user-defined value so that one can draw static rectangles on images before publishing them to the smart dashboard? Thanks!

gartaud avatar Feb 07 '16 01:02 gartaud

This is probably a good use of the GRIP SmartDashboard plugin

As a note, "Convex Hulls" and "Filter Contours" also take contours as an input.

ThomasJClark avatar Feb 07 '16 01:02 ThomasJClark

Thank you! It seems that the GRIP SmartDashboard Extension should work for us.

However, I still think that GRIP itself should support doing what the extensions do...

And regardless, how does one specify the color parameter for CV Rectangle? What step in GRIP produces a scalar value that is suitable as input to CV Rectangle?

Thank you in advance for your reply

gartaud avatar Feb 07 '16 01:02 gartaud

@ThomasJClark any idea about how to specify the color for the "CV Rectangle" operation? Thanks!

gartaud avatar Feb 07 '16 02:02 gartaud

I don't think you can. CV Rectangle is pretty useless, but @JLLeitschuh wanted to include it.

ThomasJClark avatar Feb 07 '16 02:02 ThomasJClark

Hi @JLLeitschuh If one cannot specify the color that is a mandatory parameter to "CV Rectangle", then the step is indeed totally useless but I suppose that either I am missing something... or that the color parameter is supposed to be a user-defined parameter (and that somehow it does not show as so because of a bug in GRIP) isn't it?

gartaud avatar Feb 07 '16 02:02 gartaud

We originally wanted to be able to specify color. #51 However, its broken on Linux. Perhaps its been fixed in the newer release of javafx

JLLeitschuh avatar Feb 07 '16 23:02 JLLeitschuh

A color picker would be great, but if not possible simply specifying the color as r,g,b would do too imho. Thanks.

gartaud avatar Feb 08 '16 00:02 gartaud

I just reopened #51 It was very, very out of date. That should fix this problem.

JLLeitschuh avatar Feb 08 '16 01:02 JLLeitschuh

Great. So we should get CV Rectangle usable in the next release of GRIP? In a matter of weeks? Thanks!

gartaud avatar Feb 08 '16 02:02 gartaud

What is the use case that you hope to achieve using the color picker?

JLLeitschuh avatar Feb 08 '16 05:02 JLLeitschuh

Initially we wanted to draw contours. But because it seems we won't be able to pass the contours to cv rectangle we just want to be able to draw lines using rectangles with one size being zero. We don't really care too much about being able to pick a particular color, but cv rectangle requires that a color be passed as input... Thanks!

gartaud avatar Feb 08 '16 11:02 gartaud

While you work on the color picker, I think you should assume a default color for the time being. That way we can at least use the rectangle without the color picker. I'm assuming that's an easy task. I tried to do the same and also noticed there was no way to output contour data. The closest is printContoursReport, but it doesn't have output nodes to plug into the Rectangle.

npetrangelo avatar May 16 '16 11:05 npetrangelo

I have a solution for this that is being worked on with @SamCarlberg

JLLeitschuh avatar May 16 '16 15:05 JLLeitschuh

Hi @JLLeitschuh @SamCarlberg Was the solution ever implemented? Thanks!

gartaud avatar Mar 30 '17 13:03 gartaud