Introducing "Intro to Computer Vision for FRC" a presentation by KING TeC 2169!

Recently I created a presentation that covers the basics of getting started with Computer Vision. The presentation is excellent for teams looking to create Vision systems for their robot or learn more about Computer Vision.

The point of this presentation is to dampen the large hurdles that come with beginning to program a vision system. The presentation is visual-based, so a deep understanding of programming is not required, and includes examples and sample code for C++ and Python. It covers, but is certainly not limited to:

[li]Acquiring Vision Data
[li]Elements of Computer Vision
[/li][li]Choosing a Camera
[/li][li]Choosing a Processor
[/li][li]Creating a Pipeline
[/li][li]Inputting Images
[/li][li]Manipulating Images
[li]Blurring Images
[/li][li]Converting Colorspaces
[li]Filtering Images
[li]Contour Filtering
[/li][li]Contour Detection
[/li][li]Geometric Filtering
[li]Running Calculations on Images
[li]Geometric Math on Contours[]
[/li][li]Image Comparisons[
[li]Moving Vision Data
[li]Moving Vision Data from Processor to RoboRIO
[/li][li]Serial Communication
[/li][li]Network Communication
[li]Using Vision Data
[li]Calculating yaw/pitch offset
[/li][li]Using Contour Height for distance
[/li][li]Relative Tuning
[/li][li]Sample PID Loop

With the introduction of premade vision packages such as Limelight, less and less teams are creating their own vision software. Limelight and other packages are undoubtedly great products, however teams that implement them aren’t learning as much about Computer Vision as teams that are. For this reason, I still highly recommend teams at least attempt to write their own software before using a kit like Limelight. This is not to say Limelight shouldn’t be used, but writing your own software or at least researching the software behind your kit will provide a learning experience (which is what FIRST is all about), in addition to giving you more control over your Vision system.

A video version of the presentation is coming soon.

Here is link to to presentation if you’re interested, and feel free to contact me with any questions.

Presentation Link

The presentation looks great! Just a few things I’d like to note:

Slide 12: It looks like some suggested edits made their way into the slide? If they’re talking points then they’re fine but it looks like they’re from the revision process while just reading through.

Slide 15: There’s a ton of different ways to smooth images; I’d recommend mentioning that at the least. In fact, your slide has the cv2.blur method, which does averaging, while a lot of people would use a Gaussian blur or median blur.

Slide 29: These issues can be very complex to work on. It might be a good idea to mention libraries that have tried tackling them, like Kauai Labs’ SF2.

Slide 31: In the end, yes, network communications require a radio port, but the use of a network switch easily mitigates this, at the cost of some extra space.

Slide 32: The image makes it look like the RoboRIO can not communicate backwards to the vision processor black box. I would just make sure to clarify this while speaking.

Again, all in all, I thought this presentation was great! Those were just a few pieces that I know would have probably helped me starting out in computer vision. One additional thing is to try and add some additional resources links. LimeLight’s docs are great, as are the Cheezy Poofs vision talk, and OpenCV tutorials. Good job!

Nice presentation. It is good to see the various pictures of the processing stages.

I think you should start the presentation with some more background, particularly outlines your assumptions. For instance, you appear to be using OpenCV “raw” for everything, but that is not the only choice (for instance, using the WPILib cscore as a framework).

You talk briefly about getting images to the driver’s station, but say nothing more about it.

Slide 15:

  • it would be nice if you could justify the statement that blurring helps. There are also lots of alternatives, such as morphologyEx in OpenCV

Slide 20:

  • the C++ has a lower threshold of (0,0,0), which is clearly useless. The Python thresholding is sensible.
  • not sure why you AND() the image and mask. The mask is what you use for the next step.

Slide 31,32:

  • there are more choices for talking between the vision computer and the RoboRio. For instance, you could use straight UDP packets.
  • you comment that network comm is slower than serial is not fundamentally true, although it probably is true about NetworkTables (since it generally does not send data immediately).

Again, nice presentation. Thanks for sharing it.

I look forward to fully reviewing the presentation.

The statement that suggest teams using CANNED tools like limelight are not leaning as much is true but not all teams have the support to even start using vision even in a simple form with out these. Having a little success using these to jumpstart a larger vision project is critical for the inspiration.
So i reverse the idea that teams should first attempt to write their own before using a CAN solution. I say us a CAN then try to reproduce some of the functions on a raw platform.

I’m not convinced this is strictly a true statement. Many times it turns into a true statement, but generally speaking, if a team can get over the time hurdle of implementing a robust and accurate vision system, they can focus much more of their time on some more complex control system software.

This is not at all saying teams shouldn’t try implementing their own vision at all, just to say that you can absolutely learn more in the end from using a ready-to-go solution if you get the most out of the opportunity.