## 2 Materials and Methods
The following dependencies were used: OpenCV 4.9.0.80 for image processing and feature extraction; YOLOv7 for pose estimation; and NumPy 1.23.5, pandas 2.2.0, and Statsmodels 0.14.1 for statistical analysis. All code was run on a Mac Studio with an M2 Ultra chipset and 192 GB of RAM. The collected footage was filmed from a consistent vantage point, but the camera was not static. Therefore, we had to account for the pan, tilt, and zoom present in each video clip to properly track the pose estimation data's real-world coordinates from frame to frame. Because the goalposts are fixed dimensions, we were able to identify the corners of the goalposts and use these pixel coordinates to scale goalkeeper pose appropriately in each frame. Although there are \"off-the-shelf\" computer vision solutions to identify soccer field markings from broadcast footage, these models were not trained on the angles used in this research [25]. Therefore, we opted to identify the goalposts through a more traditional color isolation method by identifying green pixels to mask the grass and white pixels to identify the goal. The color of each pixel in the collected footage was in RGB format, which identifies the red, green, and blue values for each pixel. We chose the RGB values (100, 150, 50) and (220, 220, 220) to represent the grass and goalpost colors, respectively [26]. The RGB format presents problems in isolating colors because the time of day and weather can influence the perceived color of a given object. To account for this, we converted each frame to CIELUV color space to ensure that the perceived color of objects remained consistent across varying lighting conditions, thereby enhancing the accuracy of color-based object identification [27]. We subtracted the green from the frame and isolated the goalposts. The frame was then blurred and OpenCV's contour function was used to identify large shapes within the frame. We assumed that the largest contour represents the goal area and used that assumption to create a bounding box, as shown in Figure 1. We then used a Hough line transformation to identify all lines within the bounding box. These lines were then filtered into horizontal and vertical lists based on their angles [26]. The endpoints of these lines were then clustered, and the centroid of the identified cluster was used to create raw values for the goal corners. Because the broadcast footage contained camera movement, the estimated goal corners needed to be mapped in each frame. We did so by using homography. Homography is a transformation between two planes whereby a given point can be mapped from one image to another [28]. To do so, a homography matrix must be calculated. \[ \begin{bmatrix}x\\ y\\ 1\end{bmatrix} =H \begin{bmatrix}X\\ Y\\ 1\end{bmatrix} = \begin{bmatrix}h_{11}&h_{12}&h_{13}\\ h_{21}&h_{22}&h_{23}\\ h_{31}&h_{32}&h_{33}\end{bmatrix}\begin{bmatrix}X\\ Y\\ 1\end{bmatrix} , \tag{1}\]  
Prior to creating the homography matrix, we smoothed the points using local polynomial fitting and overlayed them on the video to do a visual check, as shown in Figures 2 and 3. The FIFA rulebook stipulates that a regulation soccer goal must measure 732 cm in width and 244 cm in height. Using these dimensions, we defined a new image with a width of 732 px and a height of 244 px. The dimensions were chosen to have a 1:1 relationship between the goal dimensions in centimeters and pixels. The smoothed goalpost corners were then used to compute the homography matrix using OpenCV by mapping the upper goalpost corners in the original image to the upper corners of the new image and the bottom goalpost corners in the original image to the bottom corners of the new image. We  
Figure 1: Estimates of goalpost bounding box. After creating the isolated goal area videos, we applied the YOLOv7 pose estimation algorithm to each video [29]. We chose YOLOv7 because it is open-source, general-purpose, and does not have licensing restrictions. Pose estimation must be applied at the frame level.