AI & Computer Vision, lesson 14 of 52
Consent, Privacy & Filming People
Introduction
Your next field trip films real people playing football. A photo of a person isn't just a picture: it's personal data, and the law and basic respect both say you must ask first, collect only what you need, and look after it. Today you'll learn what that means in practice, write your team's privacy rules, and build a script that blurs faces.
By the end of this lesson you'll be able to:
- Explain why an image of a person is personal data, not just "a picture"
- Describe what informed consent means, and why it differs for children
- Say, in plain words, what India's DPDP Act 2023 and the GDPR ask of anyone who collects images
- Decide when a venue permission letter is needed, and what it must say
- Apply data minimisation: collect only what the project needs, keep it only as long as needed
- Use a script to blur faces in stored images
- Write a one-page team privacy and consent charter
Working principle
Important: this lesson is a teaching summary, not legal advice. Laws change and depend on your school, state and country. Ask your school administration or a lawyer to check your letters before you use them.
A photo of a person is personal data
If a person can be recognised from an image (by their face, their jersey number, their voice in a video, or by the context), the image is personal data. It is not just pixels. That means someone is responsible for it: you.
The four questions before filming anyone
| Question | Why it matters |
|---|---|
| Who appears, and are they children? | Children need extra protection and a parent's or guardian's consent. |
| What do we collect (faces, jersey numbers, voices)? | Collect only what the model needs. |
| Why, and for how long? | The purpose must be stated up front. Delete when done. |
| Where does it go (cloud tool, shared drive, screenshot in a group chat)? | Every extra copy is a new risk. |
What "consent" has to look like
Good consent is:
- Informed: people are told what you collect, why, who sees it and how long you keep it
- Specific: one purpose, not "anything we like"
- Freely given: saying no must be easy and without penalty
- Clear: a signature, a ticked box or a spoken yes on record, not silence
- Withdrawable: a person can change their mind, and you delete their images
For children, the consent comes from a parent or guardian, and the child should still be told in words they understand and may say no.
Filming a crowd or a public place
| Situation | Safer practice |
|---|---|
| A football match with a public crowd in the background | Point the camera at the pitch, not the stands. Put up a notice at the entrance. Blur faces in any image you share. |
| A school sports day | Get written permission from the school and parents. Tell the class. Let students opt out. |
| A private club or ground | Written permission from the owner or manager first. |
| Someone says "please don't film me" | Stop. Delete their frames. Move the camera. |
"It was in a public place" doesn't mean "anything goes". Public place or not, think about purpose and harm.
The law, in plain words
India: Digital Personal Data Protection Act, 2023 (DPDP). The Act covers personal data processed digitally. In broad terms it asks the organisation that decides why and how data is used (the "data fiduciary") to process data for a lawful purpose, usually with consent, to give a clear notice, to keep data safe, and to delete it when no longer needed. For children (under 18) it requires verifiable parental consent, and it bars tracking or targeted advertising aimed at children. The Rules were notified on 13 November 2025 and switch on in phases: the first part immediately, consent managers about a year later (13 November 2026), and the substantive obligations, including those for children's data and the penalties, about 18 months after notification (13 May 2027). There are exemptions, including some for educational institutions when processing is limited to education, health or safety. Whether training an AI model counts as one of those purposes is not settled.
European Union: GDPR. If you ever collect images of people in the EU, the GDPR applies. It asks for a lawful basis (often consent), clear information, data minimisation, a limit on how long you store data, and the right to have data deleted. The age at which a child can consent alone is set by each country, between 13 and 16.
What we do: because the rules are still moving, we follow the stricter, simpler standard now: ask first, collect little, protect it, delete it, and never use it for something people didn't agree to. Check the latest position before you launch anything real.
Data minimisation: the best privacy tool
| Instead of | Do this |
|---|---|
| Recording faces | Film from a distance or angle where faces are small, or blur faces after capture |
| Keeping the raw video | Keep only the labelled frames you need, and delete the video |
| Naming files after people | Use anonymous ids (player_0007) |
| Sharing a folder with a public link | Share with named people only |
| Uploading to any free tool | Check the tool's terms and where it stores data |
| Keeping data "just in case" | Set a deletion date and write it down |
What you'll need
- Your
cv_courseenvironment, for the face-blurring script - A few test photos (of yourself, or ones you have permission to use)
Build it
Step 1: blur faces in a folder of images
OpenCV can find faces in two ways, depending on the version you installed (check with python -c "import cv2; print(cv2.__version__)"):
- OpenCV 4.x: the built-in Haar face detector (
cv2.CascadeClassifier). Nothing to download. - OpenCV 5.x: that classic detector was removed from the main package. Use the YuNet face model instead. Download
face_detection_yunet_2023mar.onnxfrom the OpenCV Zoo (github.com/opencv/opencv_zoo, foldermodels/face_detection_yunet) and put it next to your script.
The script below tries both. Neither is perfect: faces that are small, turned away or in shadow get missed. So this is a safety net, not a guarantee. Always check the output by eye.
import os
import cv2
YUNET_MODEL = "face_detection_yunet_2023mar.onnx" # needed for OpenCV 5.x only
def make_face_finder():
"""Return a function find_faces(image) -> list of (x, y, w, h)."""
if hasattr(cv2, "CascadeClassifier"): # OpenCV 4.x
cascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
def find_faces(image):
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
found = cascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=5, minSize=(24, 24))
return [tuple(int(v) for v in f) for f in found]
return find_faces
if not os.path.exists(YUNET_MODEL): # OpenCV 5.x
raise SystemExit(f"Download {YUNET_MODEL} from the OpenCV Zoo and put it in this folder.")
yunet = cv2.FaceDetectorYN_create(YUNET_MODEL, "", (320, 320), 0.6, 0.3, 5000)
def find_faces(image):
h, w = image.shape[:2]
yunet.setInputSize((w, h))
_, found = yunet.detect(image)
if found is None:
return []
return [tuple(int(v) for v in row[:4]) for row in found]
return find_faces
def blur_faces(image, find_faces):
"""Return (blurred copy, number of faces found)."""
faces = find_faces(image)
out = image.copy()
for (x, y, w, h) in faces:
pad = int(0.15 * w) # blur a bit beyond the face box
x1, y1 = max(0, x - pad), max(0, y - pad)
x2, y2 = min(image.shape[1], x + w + pad), min(image.shape[0], y + h + pad)
if x2 <= x1 or y2 <= y1:
continue
k = max(15, ((x2 - x1) // 3) | 1) # strong, odd kernel
out[y1:y2, x1:x2] = cv2.GaussianBlur(out[y1:y2, x1:x2], (k, k), 0)
return out, len(faces)
def blur_folder(src, dst):
find_faces = make_face_finder()
os.makedirs(dst, exist_ok=True)
total_faces = 0
for name in sorted(os.listdir(src)):
if not name.lower().endswith((".jpg", ".jpeg", ".png")):
continue
img = cv2.imread(os.path.join(src, name))
if img is None:
continue
blurred, n = blur_faces(img, find_faces)
cv2.imwrite(os.path.join(dst, name), blurred)
total_faces += n
if n:
print(f"{name}: blurred {n} face(s)")
print("Done. Faces blurred:", total_faces, "-> now CHECK the images by eye.")
if __name__ == "__main__":
blur_folder("dataset/player", "dataset_blurred/player")Question: these detectors find faces best when they look towards the camera. Which faces will it miss on a football pitch? What else could you do to protect those people?
Step 2: keep a consent log (no personal details in the file)
A tiny CSV that records that consent exists, without copying anyone's data around.
import csv
import os
from datetime import date
LOG = "consent_log.csv"
FIELDS = ["form_id", "group", "consent_given", "date_received", "delete_by", "notes"]
def add_entry(form_id, group, consent_given, delete_by, notes=""):
new = not os.path.exists(LOG)
with open(LOG, "a", newline="") as f:
w = csv.DictWriter(f, fieldnames=FIELDS)
if new:
w.writeheader()
w.writerow({"form_id": form_id, "group": group, "consent_given": consent_given,
"date_received": date.today().isoformat(), "delete_by": delete_by, "notes": notes})
def summary():
with open(LOG) as f:
rows = list(csv.DictReader(f))
yes = [r for r in rows if r["consent_given"] == "yes"]
no = [r for r in rows if r["consent_given"] != "yes"]
print(f"{len(yes)} consent(s) on file, {len(no)} refused or missing")
return rows
add_entry("F001", "U14 team A", "yes", "2027-03-31")
add_entry("F002", "U14 team A", "no", "2027-03-31", "do not film this child, keep out of frame")
summary()Question: why does the log use a form number and not the child's name?
Case study cards
Each is fictional and written for discussion.
| # | Story | Questions to ask |
|---|---|---|
| 1 | A team films a Sunday youth match from the stands with a webcam. 14 children are visible. The coach was told "it's for a school project". Later the team uploads all frames to a free online labelling tool. | Who consented? To what? Where did the images go? Which children could be recognised? |
| 2 | A student posts a screenshot of the annotated dataset, with faces, in a class group chat to ask for help. A parent finds their child's face there. | What was the real harm? What should the student have done before posting? |
| 3 | A team films a public park for crowd data. A man asks them to stop and delete his footage. The team says "it's public". | Is the team right to refuse? What's the right response? |
| 4 | A shop owner offers a free camera feed of his store if the you use it to train a model. The shoppers don't know. | What's missing? What notice would be needed? |
| 5 | Months after the project ends, the team still has the raw videos on three laptops and a cloud drive. A laptop is lost. | What principle did the team ignore? What should the plan have said? |
| 6 | The team trains a model on players' images and then sells the model to a company that tracks athletes for betting. | Was this the purpose consented to? What should the consent form have said? |
Templates
Consent form (parents or guardians): sample wording
Project: AI and Computer Vision course, football data collection What we will do: Students will film a football session with a laptop webcam to build a small image dataset, and label the players and ball in the images. What we collect: Images of players (including children under 18) from the pitch side. We will not record sound. We will not record names. Why: To teach students how to build and test an object-detection model. The images will not be used for advertising, tracking, selling, or any other purpose. Who sees it: The students on the team, their teacher, and, for labelling, the online tool
__________(stores data in__________). How long we keep it: Until__ / __ / ____, then we delete all raw images and labelled copies. Faces: We will blur faces before sharing images outside the team: Yes / No. Your rights: You may refuse without any consequence for your child. You may withdraw consent at any time and ask us to delete your child's images. Contact__________. Consent: I am the parent or guardian of__________. I agree to my child being filmed for this purpose. Signature__________Date__________
Venue permission letter: sample wording
To: The Manager or Owner,
__________(ground or club) From:__________(school), course teacher__________We request permission for
__students and__teacher(s) to set up a laptop and webcam at__________on__ / __ / ____between__:__and__:__to film football play for an educational data-collection exercise.We will keep to the venue's rules, avoid blocking any area, point the camera at the playing area and not at spectators, stop filming anyone who asks us to, and delete the raw footage after the project. We can share our consent form and privacy charter on request.
Please sign below to confirm permission. Name, position, signature, date.
Team Privacy and Consent Charter (one page)
| Section | Our answer |
|---|---|
| 1. Who might appear in our images? (age groups, bystanders) | |
| 2. What we collect, and what we won't (faces, names, audio) | |
| 3. Consent plan (who signs, when, who collects forms, what if someone refuses) | |
| 4. Permission (which venue letter, who signs) | |
| 5. Storage (where, who has access, naming) | |
| 6. Face policy (blur when? by whom?) | |
| 7. Tools (any online tool, and what it does with images) | |
| 8. Sharing (what may be posted or shown; what never) | |
| 9. Deletion (what, who, and the date) | |
| 10. If someone objects (what we do, in order) | |
| Team privacy lead | Name: |
If it goes wrong
| Error | Cause | Fix |
|---|---|---|
| "It's public, so it's fine" | Confusing legal access with ethical use | Ask the four questions: who, what, why, where |
| Charter says "we will be careful" | Vague rules | Ask "what exactly will you do?", and "who checks?" |
| Using a free online tool with no checking | Convenience | Read the tool's terms, or use a local tool such as LabelImg |
| Blurring the files you want to train on, then training a face detector | Mixed goals | Decide the purpose first. Our model detects players and balls, not identities. |
| No deletion date | "We might need it" | Write the date into the consent form and the log |
| Treating the face detector as perfect | Over-trust | Always check by eye. Use the camera angle to avoid faces. |
Try it
- Rewrite the parent consent form in language a 10-year-old can understand
- Research one more privacy law (for example the Californian CCPA or the UK GDPR) and compare it in 5 lines
- Extend
blur_folderto also blur jersey numbers in a marked region
Check what you learnt
Why is a photo of a person personal data?
What does informed consent mean?
Who gives consent for a child?
A bystander objects to being filmed. What do you do?
Why isn't blurring faces enough on its own?
Conclusion
Images of people are personal data. Before filming, know your purpose, get informed consent (from parents for children), handle bystanders and venues, and follow the law (India's DPDP Act, the GDPR). The best privacy tool is collecting less: film from a distance, blur faces, use ids instead of names, and delete what you don't need.
What next?
Next: Field trip prep: data collection plan. You'll plan the first field trip with everything from Unit 3.

