Automatic Camera Calibration for Image Sequences of a Football Match Flávio Szenberg (PUC-Rio) Paulo Cezar P. Carvalho (IMPA) Marcelo Gattass (PUC-Rio)
reference points object points Juiz Virtual
reference points object points Juiz Virtual
Proposed algorithm Computation of the planar projective transformation Camera Calibration Filtering to enhance lines Next image in the sequence Detection of long straight-line segments First image of the sequence Line recognition Line readjustment Computation of the initial planar projective transformation
Filtering to enhance lines The Laplacian of Gaussian (LoG) filter is applied to the image with threshold. Gaussian filter Laplacian filter
Detection of long straight line segments Segmentation is done in the image to locate long straight line segments candidate to be field lines. This procedure is divided in two steps: Eliminating pixels that are not in a straight line. Determining straight lines segments.
Eliminating pixels that are not in a straight line The image is divided, by a regular grid, in rectangular cells.
For each of theses cells, the eigenvalues, 1 2 of the covariance matrix, given below, are computed. If 2 = 0 or 1 / 2 > M (given) then eigenvector of 1 is the predominant direction else the cell does not have a predominant direction Eliminating pixels that are not in a straight line
Cells with pixels forming straight line segments: Eliminating pixels that are not in a straight line
Determining straight line segments The cells are traversed in such a way that columns are processed from left to right and the cells in each column are processed bottom-up. Each cell is given a label: If there is no predominant direction in a cell, discard it. Otherwise check the three neighbors to the left and the neighbor below the given cell. If any has a predominant direction similar to that of the current cell, then it receives the label of that cell; otherwise, a new label is used for the current cell.
Determining straight line segments Group the cells with the same label Merge the groups that correspond to segments that lie on the same line. At the end of the process, each group provides a straight line segment.
Field lines recognition From the set of segments, the field lines are detected and the field is recognized. Model-based recognition method [Grimson90] Set of restrictions F1F1 F7F7 F6F6 F5F5 F4F4 F3F3 F2F2 f1:f1: f2:f2: Interpretation Tree F1F1 F6F6 F2F2 F3F3 F4F4 F5F5 F7F7 Model f1f1 f2f2 f3f3 f4f4 f5f5 Visualization f6f6 f7f7 F1F1 F7F7 F6F6 F5F5 F4F4 F3F3 F2F2 F1F1 F7F7 F6F6 F5F5 F4F4 F3F3 F2F2 F1F1 F7F7 F6F6 F5F5 F4F4 F3F3 F2F2 F1F1 F7F7 F6F6 F5F5 F4F4 F3F3 F2F2 F1F1 F7F7 F6F6 F5F5 F4F4 F3F3 F2F2 F1F1 F7F7 F6F6 F5F5 F4F4 F3F3 F2F2 F1F1 F7F7 F6F6 F5F5 F4F4 F3F3 F2F2 F1F1 F7F7 F6F6 F5F5 F4F4 F3F3 F2F2
The node {f 1 : F 1, f 2 :F 6, f 3 :F 3 } is discarded because it violates the restriction: The line representing F 6 must be between the lines representing F 1 and F 3. Field lines recognition Discarding nodes F1F1 F6F6 F2F2 F3F3 F4F4 F5F5 F7F7 Model f1f1 f2f2 f3f3 f4f4 f5f5 Visualization f6f6 f7f7
Field lines recognition Choosing the best solution F1F1 F6F6 F2F2 F3F3 F4F4 F5F5 F7F7 Model f1f1 f2f2 f3f3 f4f4 f5f5 Visualization f6f6 f7f7 In general, there are several feasible interpretations; We choose the one where the sum of the length of the matched segments is maximum. f 1 : f 2 : F 3 f 3 : f 4 : F 1 f 5 : F 6 f 6 : F 4 f 7 : F 7 f 1 : f 2 : f 3 : F 3 f 4 : F 1 f 5 : F 6 f 6 : F 4 f 7 : F 7 WINNER
F7F7 f1f1 f2f2 f3f3 f4f4 f5f5 Visualization f6f6 f7f7 F1F1 F6F6 F2F2 F3F3 F4F4 F5F5 F7F7 Model Field lines recognition Final result f 1 : f 2 : F 3 f 3 : f 4 : F 1 f 5 : F 6 f 6 : F 4 f 7 : F 7 f1f1 f2f2 f3f3 f4f4 f5f5 Visualization f6f6 f7f7 F1F1 F6F6 F2F2 F3F3 F4F4 F5F5 Model f 1 : f 2 : F 3 f 3 : f 4 : F 1 f 5 : F 6 f 6 : F 2 f 7 : F 5 or
Computation of the initial planar projective transformation A planar projective transformation corresponding to the recognized lines is found (using points of intersection and vanishing points as reference points). points of intersection vanishing points
Line readjustment tolerance of the line readjustment
Line readjustment reconstructed line tolerance image points new located line The new located line is obtained by a least square method
Computation of the final planar projective transformation After relocating the field lines, a better reconstruction of the field can be obtained.
Camera calibration Camera is calibrated using Tsai’s method for reconstruction of elements not on the plane of the field.
For the first image, we apply the camera calibration process proposed. In order to optimize the process from the second image on, we take advantage of the previous image calibration. The final planar projective transformation for the previous image is used as a initial transformation for the current image. Working with a sequence of images Computation of the planar projective transformation Camera Calibration Next image in the sequence Line readjustment
Result s First scene Last scene The artificial sequence First scene Last scene The real sequence
Result s Computer: Pentium III 600MHz The sequence of test has 27 frames The time of processing: 380 milliseconds (< 900 milliseconds needed to real-time)
Results (accuracy) Field’s Points Correct Coordinates Reconstructed Coordinates Error xyzuvuv Average Error Tab. 1 - Comparison between the correct and reconstructed coordinates for the first scene.
Results (accuracy) Field’s Points Correct Coordinates Reconstructed Coordinates Error xyzuvuv Average Error Tab. 2 - Comparison between the correct and reconstructed coordinates for the last scene.
Conclusions The algorithm presented here has generated good results even when applied to noisy images extracted from TV. The algorithm can be used in widely available computers (no specialized hardware is necessary). Processing time is well below the time needed for real-time processing. Extra time can be used, for example, to draw ads and logos on the field.
Future work Investigate processes for smoothing the sequence of cameras by applying Kalman filtering. Develop techniques to track other objects moving on the field, such as the ball and the players. Draw objects on the field behind the players, to give the impression that the players are walking on them.