LearningComputer Vision
Debugging Playbook
Playbook troubleshooting vision stack dari gejala ke tindakan perbaikan
Computer Vision Fundamentals
0 dari 11 halaman selesai
In Progress
Scroll sampai 80% untuk menandai halaman selesai.
Debugging Playbook
Halaman ini adalah panduan cepat saat vision bermasalah di simulasi atau lapangan. Fokusnya symptom-first: mulai dari gejala, lalu cek paling berdampak terlebih dahulu.
Symptom Flow
1) No Detections
- Cek apakah image masuk:
ros2 topic hz /camera/image_raw - Cek node vision hidup:
ros2 node list - Cek HSV/model parameter aktif:
ros2 param list /vision_detector - Lihat debug image:
rqt_image_view->/vision/debug_image
2) False Positives Meledak
- Tighten threshold (HSV confidence / detection confidence).
- Tambah ukuran minimum objek.
- Aktifkan filtering circularity/aspect ratio.
- Cek perubahan lighting dan white balance kamera.
3) Distance Estimate Tidak Stabil
- Verifikasi calibration file benar.
- Cek frame ID output dan TF tree.
- Validasi timestamp input-output sinkron.
- Gunakan smoothing/tracking sebelum proyeksi 3D.
4) FPS Rendah
- Turunkan resolusi input.
- Batasi ROI (region of interest).
- Kurangi publish debug image.
- Batasi rate inferensi.
Core Command Checklist
Purpose: Checklist cepat untuk memastikan pipeline vision hidup dan sinkron. Inputs: ROS 2 CLI tools pada robot atau simulasi. Outputs: informasi rate, message, dan TF. Steps:
- Cek daftar topic dan rate.
- Verifikasi message sekali.
- Cek node dan parameter aktif.
- Validasi TF antara base dan kamera.
Pitfalls: lupa
source install/setup.bashmembuatros2tidak menemukan node. Validation: semua command menghasilkan output tanpa error.
# Topics and rates
ros2 topic list
ros2 topic hz /camera/image_raw
ros2 topic hz /vision/ball
# Message validity
ros2 topic echo /vision/ball --once
# Node and params
ros2 node list
ros2 param list /vision_detector
ros2 param get /vision_detector publish_debug_image
# TF sanity
ros2 run tf2_ros tf2_echo base_link camera_optical_framePre-Match 10-Minute Checklist
- Bersihkan lensa kamera.
- Jalankan quick lighting calibration (HSV/awb check).
- Pastikan topic rate sesuai target (>= 25 FPS pipeline vision).
- Cek minimal 10 sampel detection di debug image.
- Cek fallback mode aktif (HSV baseline atau lightweight model).
Simpan parameter “known-good” per venue. Ini mempercepat recovery saat kondisi pencahayaan berubah drastis.
Lighting Calibration Routine
Langkah cepat:
- Ambil 30 frame awal arena.
- Hitung histogram channel V (HSV).
- Jika median V terlalu rendah, longgarkan
V lower bound. - Jika noise tinggi, naikkan
S lower boundatau tambah blur ringan.
def auto_adjust_hsv(v_median, s_lower, v_lower):
if v_median < 80:
v_lower = max(40, v_lower - 20)
elif v_median > 180:
v_lower = min(140, v_lower + 10)
s_lower = max(40, min(140, s_lower))
return s_lower, v_lowerSafe Fallback Strategy
Jika model utama gagal:
- Turunkan ke pipeline HSV baseline.
- Nonaktifkan class yang tidak kritikal.
- Prioritaskan hanya
balluntuk menjaga gameplay dasar. - Catat log issue untuk post-match analysis.
Contoh saklar mode:
ros2 param set /vision_detector mode hsv_baselineIncident Log Template
| Time | Symptom | Root Cause | Action | Outcome |
|---|---|---|---|---|
| 14:05 | Ball miss saat shadow | HSV range terlalu sempit | Turunkan V lower | Detection normal |
| 14:12 | FPS drop 18 | Debug image full-res | Disable debug publish | FPS naik 29 |
Next Steps
- Perbaiki kontrak ROS node: ROS 2 Integration
- Verifikasi efek tuning: Evaluation & Benchmarking