AI & Computer Vision, lesson 15 of 52
Field Trip Prep: Your Data Collection Plan
Introduction
In lesson 28 you'll take a laptop to a real football field and collect a dataset. A film crew never turns up and "sees what happens": they bring a shot list. Today you'll write yours: where the camera goes, how many frames of each class you need, the settings for bright sunlight, who does which job, and what you'll do when things go wrong.
By the end of this lesson you'll be able to:
- Turn the data-quality lessons from lesson 10 to lesson 14 into concrete field capture decisions
- Design a camera position plan that maximises variety and reduces bias
- Set a target count for each class, and explain why the numbers differ
- Configure
capture.py(blur threshold, interval, class) for outdoor sport - Assign team roles for the field trip
- Write a 1-page Field Collection Brief that a teacher can review and approve
- Anticipate field-specific failure modes and write down what the team will do about each
Working principle
Why plan first?
Sessions 10 to 14 taught what makes data good, how to capture it, label it, split it, and how to treat the people in it. Now you turn that into a plan. Without a plan, teams capture whatever is in front of them, miss whole classes, and come back with unusable footage. A pre-approved brief prevents that.
Every rule in the brief must trace back to a lesson:
| Earlier lesson | Becomes a field rule |
|---|---|
| lesson 10: "Frames from one video are near-identical, so counting them is misleading" | "Capture from 3 different camera positions, and start a new session at each one" |
| lesson 11: "A background class teaches the model what nothing looks like" | "Capture at least 40 empty-pitch frames" |
| lesson 13: "Split by session, so we need several sessions per class" | "At least 10 sessions per class: rotate position every 20 minutes" |
| lesson 14: "Ask first, collect little, delete it" | "Signed forms for every child in frame. Camera points at the pitch, not the stands." |
If you can't trace a rule back to a lesson, go back to that lesson before the trip.
Field Trip 1: overview
| Trip number | Field Trip 1 of 3 (lesson 28, lesson 39 and lesson 50) |
| Session | lesson 28: Football field data capture |
| Location | Football field (arrange access with the school administration) |
| Duration | 2 hours on site, plus travel |
| Team size | 3 to 4 students per team, 2 to 4 teams per class |
| Hardware | 1 laptop and 1 webcam per team (no GPU needed) |
| Target output | 200+ usable frames per team across all 4 classes |
| Quality bar | Accept rate 60% or more, all classes at 40 or more usable frames |
Anticipated field failure modes and what to do
Each team must address all of these in its brief.
| Failure mode | Why it happens | Mitigation |
|---|---|---|
| Webcam too far from the action | Objects too small: the ball can be under 5 pixels wide | Place the webcam within about 15 m of the play area. Use a closer angle for ball-specific capture. |
| All frames from one camera angle | Distribution bias: the model fails at other angles | Plan 3 positions (sideline, behind goal, elevated). Rotate every 20 minutes. Press N for a new session each time. |
| Ball class badly under-represented | The ball is visible only briefly, so most frames show players | Give one team member the job of ball-only sessions during set pieces. |
| Motion-blur rejection above 80% | Webcam auto-exposure reacts slowly outdoors | Fix the webcam exposure by hand if the driver allows. Lower BLUR_THRESHOLD from 80 to about 50 for outdoors. |
| Laptop overheats, script crashes | Direct sun, CPU load and battery heat | Work in shade. Plug in if possible. Restart capture.py every 30 minutes (counts are rebuilt from the files). |
Someone forgets to switch CLASS_NAME | Every frame saved in the wrong class | One person is the Class Manager and owns all class changes. |
| Roboflow mobile upload fails on site | Poor mobile data at the field | Create the Roboflow project beforehand. Annotate after returning, from the downloaded images. |
| Frames captured during dead-ball time | Players are not in position, so the frames are irrelevant | Pause auto-capture during stoppages (P). Use manual capture (SPACE) in active play. |
| A parent has not signed, or a bystander objects | Consent gaps (lesson 14) | Keep the signed-forms list at the field. Stop and delete frames for anyone who objects. |
capture.py field configuration
Open your capture.py from lesson 11 and change the constants at the top for outdoor football. Write each setting in your brief, with a reason.
# ---------------- FIELD TRIP CONFIGURATION (lesson 15 review, lesson 28 deployment) ----------------
CLASS_NAME = "player" # change per session: player | ball | goal | background
DATASET_ROOT = "field_trip_1" # a separate root folder for field data
BLUR_THRESHOLD = 50.0 # classroom default was 80. Lower outdoors (speed, wind, distance)
CAPTURE_INTERVAL = 0.0 # 0 = SPACE only. Switch to 0.8 for passive capture
MIN_DIFF = 800 # higher than the classroom 500: the pitch background is static
CAMERA_INDEX = 0 # test before leaving. Use 1 or 2 if it fails
SAVE_QUALITY = 92 # keep high. Compress later if storage is short
MOTION_ONLY = False # True: only try to save when something moves
TARGET_COUNTS = {
"player": 80, # majority class, easy to collect
"ball": 80, # priority: a small object seen briefly, so it needs the same effort
"goal": 40, # static object: capture first, then move on
"background": 40, # empty pitch sections as null examples
}
# Total target: 240 frames captured, about 150 after the filters (at about 60% accept rate)Question: why is the ball target as high as the player target even though a ball is a tiny part of every image?
Team roles for Field Trip 1
Each team of 3 or 4 assigns these roles before arriving at the field. Roles rotate every 30 minutes.
| Role | Duties |
|---|---|
| Operator | Controls the laptop and runs capture.py. Watches the blur score in the preview. Presses SPACE at key moments. Announces when a class target is reached. |
| Class Manager | Owns every CLASS_NAME change. Tracks the count per class from the CSV log. Calls the switch when a target is reached. Prevents the most common field error: the wrong class folder. |
| Spotter | Watches the play and calls moments worth capturing ("corner kick, get the ball!", "both goalkeepers are in view!"). Guides the operator without touching the laptop. |
| Logger and Reviewer | Watches the log CSV on a second device. Flags any drop in accept rate. Photographs the camera positions for the trip report. Notes technical problems and keeps the consent list. |
In a team of three, the Logger and the Spotter share a role.
Your Field Collection Brief
Share as a Google Doc, one per team. Maximum 1 page when printed. It must be approved before Field Trip 1 (lesson 28).
| Team name | |
| Team members | |
| Field trip date |
Section 1: Class capture targets
| Class | Target frames | Minimum acceptable | Justification (link to a lesson) |
|---|---|---|---|
| player | 40 | ||
| ball | 40 | ||
| goal | 20 | ||
| background | 20 |
Section 2: Camera positions
| Pos | Location description | Classes to capture | Duration |
|---|---|---|---|
| A | |||
| B | |||
| C |
Section 3: capture.py configuration
| Setting | Value we will use | Justification |
|---|---|---|
| BLUR_THRESHOLD | ||
| CAPTURE_INTERVAL | ||
| MIN_DIFF | ||
| SAVE_QUALITY | ||
| CAMERA_INDEX |
Section 4: Team role assignment
| Role | Name | Specific duty at the field |
|---|---|---|
| Operator | ||
| Class Manager | ||
| Spotter | ||
| Logger and Reviewer |
Section 5: Our 5 non-negotiable quality rules
Write 5 rules your team will enforce. Each must trace back to a lesson from lesson 10 to lesson 14. Example: "We will capture at least 80 ball frames, because the ball is small and seen briefly, so it needs the same effort as the players."
| 1 | |
|---|---|
| 2 | |
| 3 | |
| 4 | |
| 5 |
Section 6: Consent and privacy (from lesson 14)
| Question | Our answer |
|---|---|
| Who signs the forms and where is the list kept at the field? | |
| What do we do if someone refuses or objects? | |
| Where does the camera point? Where won't it point? | |
| Where is the data stored and when is it deleted? |
Section 7: Contingency plans
What will you do if each of these happens at the field?
| Scenario | Our response |
|---|---|
| Accept rate drops below 30% | |
| Ball count is still below 30 after 45 minutes | |
| Laptop battery dies at 60 minutes | |
The webcam is not recognised (cap.isOpened() is False) |
What you'll need
- Your
capture.pyfrom lesson 11 - Your team (3 or 4 people)
- The Field Collection Brief template below
Build it
A planning calculator
You check whether their targets fit in the time they have. It's a small script that turns the plan into minutes.
def plan(targets, accept_rate=0.6, tries_per_minute=6, minutes_available=90, switch_minutes=2):
"""
targets: frames you want KEPT per class, e.g. {"player": 80, "ball": 80}
accept_rate: share of tries that pass the blur and duplicate filters (0 to 1)
tries_per_minute: how many times a minute you can realistically try a capture by hand (SPACE)
"""
kept_per_minute = accept_rate * tries_per_minute
rows = []
total_minutes = 0.0
for cls, n in targets.items():
minutes = n / kept_per_minute + switch_minutes
total_minutes += minutes
rows.append((cls, n, round(n / accept_rate), round(minutes, 1)))
print(f"{'class':<12}{'keep':>6}{'try':>6}{'minutes':>9}")
for cls, keep, tries, minutes in rows:
print(f"{cls:<12}{keep:>6}{tries:>6}{minutes:>9}")
print(f"Total: {round(total_minutes, 1)} minutes of {minutes_available} available")
if total_minutes > minutes_available:
print("Too much for the time. Lower a target, or find a way to raise the accept rate.")
else:
spare = round(minutes_available - total_minutes, 1)
print(f"Fits, with {spare} minutes to spare for moving between positions and surprises.")
return total_minutes
plan({"player": 80, "ball": 80, "goal": 40, "background": 40})
print()
plan({"player": 80, "ball": 80, "goal": 40, "background": 40}, accept_rate=0.3)Question: what happens to the plan if the accept rate falls from 60% to 30%? Which section of the brief tells you what to do?
If it goes wrong
| Error | Cause | Fix |
|---|---|---|
| Targets are "as many as possible" | No plan | Give a number and a reason |
| All three positions are on the same sideline | Convenience | Different angle and distance for each |
| Settings copied from the classroom unchanged | Not thinking about outdoors | Ask "what is different outside?" |
| Class Manager and Operator are the same person | Short on people | The Class Manager can be the Logger, but never the Operator |
| Contingency says "ask the teacher" | Avoiding the problem | The teacher can't fix a flat battery. Ask for a spare charger, power bank, or paper log. |
| Consent section left blank | Treating lesson 14 as a separate topic | Return the brief: no consent plan, no trip |
Try it
- Work out the shutter time needed to keep a ball travelling at 50 km/h within 5 pixels of blur at 10 m distance
- Draw a pitch diagram with the camera positions, field of view, and distance to the near and far players
- Write a step-by-step "capture protocol" for the Class Manager
Check what you learnt
Why move the camera to a new position every 20 minutes?
Why capture at least 40 empty-pitch frames?
Who makes sure frames go in the right class folder?
In bright sun, what should you check most in the preview?
Where should the camera point?
Conclusion
A field trip without a plan brings back unusable footage. Your Field Collection Brief sets camera positions, per-class targets, capture settings, team roles and backup plans, and every rule in it traces back to a lesson from Unit 3.
What next?
Next: How neural networks learn. Unit 4 starts: how neural networks actually learn.

