Watch the night sky automatically and capture every satellite and meteor that crosses your camera frame. The Jetson distinguishes between the two, saves the best frames, sends you a notification, and logs a timestamped catalogue of every event.
What you will learn
- How to detect moving streaks in long-exposure night sky frames
- How to classify satellites (slow, straight) vs meteors (fast, bright)
- How to use the Hough line transform to detect linear streaks
- How to cross-reference with Heavens-Above satellite pass predictions
- How to set up an all-night automated watch session with notifications
Step 1 — Run the night sky watcher
cd ~/tutorials/19-satellite-meteor-detection
python3 sky_watch.py --source 0 --exposure 2.0 --save-events ~/sky_events/ --notify email
Step 2 — Detect a streak using Hough transform
import cv2, numpy as np
def detect_streak(frame, prev_frame):
# Find what changed between frames
diff = cv2.absdiff(frame, prev_frame)
grey = cv2.cvtColor(diff, cv2.COLOR_BGR2GRAY)
_, thresh = cv2.threshold(grey, 30, 255, cv2.THRESH_BINARY)
# Look for straight lines (Hough transform)
lines = cv2.HoughLinesP(thresh, 1, np.pi/180,
threshold=40, minLineLength=50, maxLineGap=10)
return lines is not None and len(lines) > 0
Step 3 — Classify: satellite or meteor?
def classify_event(streak_length_px, brightness, duration_frames, fps):
speed_pxf = streak_length_px / duration_frames # pixels per frame
if speed_pxf < 5 and duration_frames > fps * 3:
return "satellite" # slow, sustained movement
elif brightness > 200 and duration_frames < 3:
return "meteor" # very bright, very fast
else:
return "unknown"
Step 4 — Email notification when an event is captured
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.image import MIMEImage
def send_event_email(event_type, image_path, timestamp):
msg = MIMEMultipart()
msg['Subject'] = f"Sky event captured: {event_type} at {timestamp}"
with open(image_path, 'rb') as f:
img = MIMEImage(f.read())
msg.attach(img)
# SMTP config in ~/tutorials/19-satellite-meteor-detection/config.yaml
✅ Next: Tutorial 20 — Custom Model Training Full Guide | Back to Jetson Kit