TransWikia.com

Any Ideas for Extracting the lines on a Football Pitch?

Signal Processing Asked by Jonah F on October 24, 2021

Ok, so my goal is to extract the pitch bounding lines (not the vertical ones down the center or the semicircle) from an image such as:

source

With the goal of speed, id like to avoid an ML approach, and focus on image processing.

So far, i’ve been using morphological operations to attempt to achieve my result, the algorithm is as follows:

-> greyscale

-> canny algorithm

-> morphological close (square 3×3 structuring element )

-> morphological open (line 1 x 10 structuring element)

-> morphological dilate x4 (line 1 x 30 structuring element)

I then find the contours of the resulting image, fit a line to each set of contours, and chose the two lines of greatest length to be the pitch lines, and generate a mask accordingly to isolate the pitch.

For this example the results are pretty good : RESULT

But the problem is that it works fairly inconsistently, e.g for the other example image I linked above, here is the RESULT + FINAL IMAGE BEFORE FINDING CONTOURS … completely misses the pitch. I can alter a few parameters to get it to work for this image, but I’m looking for a solution which can work consistently such that it can be used to process a video, extracting only the pitch each frame.

I think the biggest problem is the crow, lots of noise, lines and colours, leading to miss-classifications or objects as pitch lines.

If anyone has any ideas for a way to consistently detect these pitch lines (morphologically or otherwise) i’d love to hear it.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP