Vision Targeting with Lights in the Background

With the reflective tape being on the upper goal, I anticipate the potential for lights on the ceiling of the venue to possibly cause problems with the targeting. Are teams able to find a setting on the Limelight that is able to filter out those lights, or do you just avoid certain areas of the field knowing that the targeting may be inaccurate from those spots?

2 Likes

It will require a good solid thresholding setup so you’re only using the reflection from the green LED ring, but it will certainly be challenging.

Not as challenging as dealing with the green reflections in Deep Space, but challenging.

1 Like

We haven’t done anything with the vision target this year, but I can speak to our experiences from previous years.

Bright white lights have always been tough since they’re either picked up by your camera as the target or can wash out part of your image. Plus it’s hard to say what the lightning will be like at every competition, so tuning your HSV/RGB values can only get you so far.

A better option is to use some context to help inform your target. You’re looking for a specific string of targets, not just the presence of lights. Both Limelight and PhotonVision have included “targets” in the past to help match the pattern. I think they use OpenCV’s solvepnp, but in the world of computer vision there are other options like template matching or something like hough lines. Or you could really go into the deep end and train a ML model. Kudos to any team who goes there.

I’d be interested to see if Limelight or PhotonVision come out with targets this year. That would probably help without a ton of effort. The other option I can think of (that doesn’t require a ton of vision code) would be to do some light “localization”. AKA, keep track of the general direction of the goal and trust targets that are in that general direction. Not perfect, but a thought.

1 Like

In my experience with vision (not a lot in the FRC space mind you) I was able to deal with oversaturation issue with thresholding by converting to a ratio-based colorspace (rg chromaticity - Wikipedia) this made it easier to pick up on pixels close to saturation.

Having said that, the former was dealing with objects that were surrounding/embedded in a oversaturated image, which is not really the case here.

3 Likes

Limelight filtering has lots of different tools that can get the job done, despite having lights in the background. Last year we competed in the Alamo dome at Texas cup, and there were ceiling lights, dozens of screens surrounding the stadium that looked like lights, etc. Really hard conditions, yet with the correct limelight settings, we saw none of it!

A few items to consider in the settings when tuning:

  • Aspect ratio - this one is in my opinion the easiest way to eliminate unwanted sources. For each target on the top of the upper hub, we know the length and width of the retroflective tape. By taking the ratio of the width to height of the tape, we can get an expected ratio of the blobs of pixels in the limelight. Add maybe 10% on either side of that target to get a range which will accommodate a slight rotation of each tape mark. Now long overhead lights won’t get picked up, and neither will small bulbs.
  • Fill percentage (referred to as convex hull) - this won’t matter as much this year, but last year did wonders. What this means is it takes the bounding box of the pixels (which will be a rectangle) and calculate the percentage of pixels the limelight sees vs the pixels of the bounding rectangle. For not rectangle targets this does incredible things. This year our targets are rectangles, therefore we want to look at targets that are greater than 90%. This should eliminate oddly shaped light sources like screens and stuff.
  • Size filtering - this one is straightforward: only take targets that are within the expected size. Put your robot on the field, and go to your close shooting range and find the area of the vision target. Then go to your furthest shooting range and record the area. That delta (plus maybe 10% on each end) now dictates the minimum and maximum size of your targets. Doing this will eliminate light sources off in the distance, as well as large windows or things in your shop

By setting just these 3 parameters, you’ll be able to remove tons of unwanted light sources and can get around most vision challenges.

One thing id like to stress: when initially tuning the Hue, Saturation, and Luminance, I’d fully expect to see extra light sources. Don’t try and tune HSL to remove unwanted sources! Tune as best as you can, THEN go to the parameters I mentioned above - that should finish off your tuning and remove the rest of the targets the limelight is detecting from the raw HSL tuning

7 Likes

A really cool upgrade on the Limelight would be to flash the LEDs, perhaps as often every other frame. Retroreflectors would flash synchronously, everything else would not. This would -radically- improve the selectivity!
I think a team did this… but it would be sweet if the Limelight crew would make this an option in the firmware!

7 Likes

Depending on the frequency and such, this might be a problem for photosensitive people.

5 Likes

Getting solid tuning is really important.

I recommend following the system broken down in this video from FRC 254 in 2016: https://youtu.be/rLwOkAJqImo

1 Like

So, how to use the settings in Limelight to prevent the misrecognition of the lights in the field?

I’d recommend reading this thread:

There are a few posts in there that answer your question…

1 Like

Emmm, l am just in this post…

Yes that was intentional.

The question you asked was the same question the OP asked, and the same question people in this thread (including myself) were trying to answer.

If you scroll up and read the posts, you’ll probably find the answers you are looking for.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.