Gesture Duel: Two-Player Rock Paper Scissors With One Webcam
Rock Paper Scissors is the simplest game that two people can play with no equipment. I wanted to see if a single webcam could replace the verbal call by recognizing both gestures at once.
Gesture Duel splits the camera frame vertically. Player 1 uses the left half. Player 2 uses the right half. MediaPipe tracks both hands. A classification function decides which gesture each hand is showing. The winner appears at the bottom of the screen.
The Split
Each detected hand has a landmark at the base of the middle finger. The x-coordinate of that landmark determines which player the hand belongs to. Left of center is Player 1. Right of center is Player 2. The frame draws a white dividing line so players know where to stand.
This is the simplest assignment strategy that works. It assumes both players stay on their side and neither reaches across. In practice, it works as long as players respect the line.
The Classification
The gesture classifier compares fingertip y-coordinates to the corresponding joint y-coordinates. Fingertip above the joint means that finger is extended. Fingertip below means it is curled.
Paper is all five tips above their joints. Rock is all five below. Scissors is the index and middle tips above while the ring and pinky stay below. This approach uses geometry, not machine learning. It is fast, it requires no training data, and it works for the three shapes the game needs.
What I Would Change
The classifier rejects anything that does not match the three expected patterns. A relaxed hand or a slightly off gesture registers as unknown. Players have to be deliberate about their hand shape. I would add tolerance to the comparisons rather than strict above-or-below logic.
There is no score tracking. Each round is independent. The winner displays for one frame and then disappears when the next gesture is detected. A scoring system with round history would make it feel like a real game instead of a demo.
The hand assignment breaks if a player moves their hand across the center line or if one person occludes the other. Better spatial tracking or temporal consistency would help. I did not add either.
It is 116 lines and it does one thing. Two people face a webcam, show their hands, and the computer judges who wins. No buttons. No countdown. Just the split screen and the call.