Spaces:
Sleeping
Sleeping
Create lbw_logic.py
Browse files- lbw_logic.py +13 -0
lbw_logic.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def decide_lbw(analysis_data):
|
| 2 |
+
trajectory = analysis_data["trajectory"]
|
| 3 |
+
if not trajectory or len(trajectory) < 2:
|
| 4 |
+
return "Not Out (Insufficient data)"
|
| 5 |
+
|
| 6 |
+
# Simplified logic: check trajectory alignment
|
| 7 |
+
start_x = trajectory[0][0]
|
| 8 |
+
end_x = trajectory[-1][0]
|
| 9 |
+
|
| 10 |
+
if abs(end_x - start_x) < 30:
|
| 11 |
+
return "Out (Straight trajectory hitting stumps)"
|
| 12 |
+
else:
|
| 13 |
+
return "Not Out (Ball missing stumps)"
|