As part of my series to do quick proof of concepts of ideas in about 10 prompts to claude, and since we are in the middle of the world cup, I created a small utility to mimic the tools used by the VAR room to detect offsides.

Here’s what it does:
- Homography: The user uploads a picture of the frame to be evaluated for offside, and calibrates the field by locating the four corners of the goal area; which are used to calculate the complete pitch area and serve as ground reference for the players and the ball.
- Object placement: The program attempts to auto-detect the players and the ball by trying to find contrasting color blobs; then the user can finalize placing the players tokens and moving them as needed. At this point, a navigable 3D view is already available for the user to inspect.
- Assign teams: The program also has a routine to attempt to automatically assign players to teams, based on their jersey color. This is semi-automatic as it requires the user to select the jersey colors for both teams, and even so it will often miss. The user can then finalize assigning the teams manually.
- Offside detection: The program will place 3D models of soccer players facing either the ball or the goal, and will attempt to determine if the attackers are crossing the offside boundary with an offending limb.

Of course this is just a small toy, the players placement is very rough and we are not even trying to replicate their poses. Still amazing how quickly I was able to put this prototype together!
You can check it out online at https://slashie.net/offside