Harrison Crettol
Sheet 06 · May 2026 · Python / OpenCV / Wildlife

Python
Groundhog Tracker

A toolkit of Python scripts that automatically records, edits, and tracks Goober, a groundhog living under my porch. Instead of scrubbing hours of blank video, it only records when he moves, trims the clips, tracks him with OpenCV, and formats the output for social media.

Goober demo video [ Tracking ]
Subject: Goober [ Active ]
Goober the groundhog eating grass

The pipeline

Catching Goober

A live motion-detection camera made from an old laptop and a USB webcam. It watches the feed constantly but only hits record when something moves.

python spy_cam.py

Cutting dead air

A command-line tool that chops each video down to the good parts, dropping the empty frames before and after he appears.

python trim_vid.py -i Videos/test1.mp4 -o Videos/tmp/trimmed.mp4 -s 2 -e 10

Tracking the action

The core logic: draw an initial bounding box, then OpenCV's MOG2 background subtraction follows him frame by frame.

python post_process_tracking.py -i Videos/tmp/trimmed.mp4 -o Videos/tmp/tracked.mp4

Phone-friendly formatting

Slices the widescreen feed into a 1080×1920 vertical video, ready for YouTube Shorts or TikTok.

python crop_vid.py -i Videos/tmp/tracked.mp4 -o FINAL_OUTPUT.mp4

Field recon

Surveillance view of the yard with Goober's routes marked
Recon 01 — the territory
Camera view of Goober near the porch
Recon 02 — the subject, unaware