Thursday, April 21, 2016

Homography of soccer field

Leave a Comment

Okay so i am trying to find homography of a soccer match. What i have till now is

  1. Read images from a folder which is basically many cropped images of a template soccer field. Basically this has images for center circle and penalty lines etc.
  2. Read video stream from a file and crop it into many smaller segments.
  3. Loop inside the images in video stream and inside that another loop for images that i read from folder.
  4. Now in the two images that i get through iteration , i applied a green filter because of my assumption that field is green
  5. Use orb to find points and then find matches.

Now the Problem is that because of players and some noise from croud, i am unable to find proper matches for homography. Also removing them is a problem because that also tends to hide the soccer field lines that i need to calculate the homography on.

Any suggestions on this is greatly appreciated. Also below are some sample code and images that i am using.

"Code being used"

Sample images

Output that i am getting

The image on right of output is a frame from video and that on left is the same sample image that i uploaded after filterGreen function as can be seen from the code.

Finally what i want is for the image to properly map to center circle so i can draw a cube in center, Somewhat similar to "This example" . Thanks in advance for helping me out.

1 Answers

Answers 1

An interesting technique to throw at this problem is RASL. It computes homographies that align stacks of related images. It does not require that you specify corresponding points on the images, but operates directly on the image pixels. It is robust against image occlusions (eg, players moving in the foreground).

I've just released a Python implementation here: https://github.com/welch/rasl (there are also links there to the original RASL paper, MATLAB implementation, and data).

I am unsure if you'd want to crop the input images to that center circle, or if the entire frames can be aligned. Try both and see.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment