In this work, we present a software to automatically correct radial distortion from sports video sequences. These sequences have been captured by using cameras provided with wide-angle lenses in order to cover the whole playing field.
For the purpose of correcting the distortion, the presented software estimates the lens distortion model from a single frame. Afterward, the whole sequence is corrected by applying the obtained model. For the extraction of the frames and the later reconstruction of the video sequence, we use the well-known software FFmpeg.
For a more detailed information about the application of this technique see reference  quoted below, in which the method is applied to futsal videos acquired with a GoPro camera. In this way, the technique is used to correct the input video and then perform a tracking of the players on the corrected sequence. The results are compared with a standard setup composed of three cameras. In references  and , a detailed description of the method applied to obtain the lens distortion model, as well as about the implementation, can be found. Please, cite references ,  and  in your own research works if you use any of the results, data or software included here.
With the software we provide a single frame and a short video sequence, just as examples to show how the program performs. Both data belongs to a Brazilian professional team, captured during the quarter-final round of the 2013 São Paulo futsal league.
At top of Table 1, we include the result of applying the software to a single frame. From left to right we include the originally distorted image, the primitives detected and the output of applying the technique. As observed in the second image, the technique is able to properly detect the distorted primitives (lines drawn with the same color) and then provide an appropriated correction of the distortion present in the image. At the bottom, an example of a video sequence is included. On the left, the distorted version of the video is shown, while on the right the corrected version is depicted.
Table 1: results of the proposed technique for a single frame and for a video sequence (see ,  and  for further explanations). From left to right: the original distorted image, primitives detection, and output undistorted image. Video sequence at the bottom
An executable of the proposed technique (for Ubuntu Linux platform) is available as a compressed file. Using it, you can reproduce the examples presented in section Example dataset and results. The compressed file includes:
The executable file.
The static version of FFmpeg.
Example files for testing purposes (frame_1.png and test.avi).
A png image of a calibration pattern.
Example scripts for processing a single image (run_example1_image) or a video (run_example2_video).
A readme file with a description of the content and instructions of use.
Related to the outcomes, the executable provides:
In case of processing a video sequence:
The collection of extracted frames from the input video ("_original_frames" folder), and the corrected ones ("_corrected_frames" folder).
An output file called "output.avi" with the corrected video sequence (this name can be modified by editing the associated script).
In case of processing a single image:
A png image with the output name finished in "_undistorted".
A file with the ".ldm" extension, which contains the estimated lens distortion model.
The program is able to estimate the lens distortion model if in the first frame there are primitives (distorted straight lines). If there are not straight lines in the sequence, the lens distortion model can be obtained by printing the calibration pattern provided and starting the recording using such pattern. In this way, we provide to the program the first frame with primitives.
The lens distortion model is zoom dependent. Therefore, if during the camera recording the lens zoom changes, the program would not work properly.
The system has been designed to work with cameras provided with wide-angle lenses. It doest not work for extreme distortions like the one produced by fish-eye lenses.
The research associated with this software was partially supported by the MICINN project reference MTM2010-17615 (Ministerio de Ciencia e Innovación, Spain). The example frame and video sequence have been provided by the LaBioCoM laboratory.
Along with the software we provide a static version of FFmpeg software. For the licensing details of FFmpeg, please see the Copyright section.