Bu proje, OpenCV, YOLOv8 ve EasyOCR teknolojilerini kullanarak video görüntüleri üzerinden gerçek zamanlı trafik analizi yapar. Araçları tespit eder, hızlarını hesaplar ve plakalarını okur. "Hayalet Mod (Ghost Mode)" sayesinde ekranda gereksiz çerçeveler (bounding box) oluşturmadan sadece verileri görselleştirir.
- Nesne Tespiti ve Takibi: YOLOv8 (Nano) modeli ile araçları (Araba, Kamyon, Otobüs, Motosiklet) yüksek doğrulukla tespit eder ve takip eder.
- Hız Hesaplama: Piksel/Metre kalibrasyonu ve FPS tabanlı zaman ölçümü ile aracın tahmini hızını (km/h) hesaplar.
- Plaka Okuma (LPR): Haar Cascade ile plaka konumunu bulur, görüntü işleme ile netleştirir ve EasyOCR ile metne dönüştürür.
- Hayalet Mod (Ghost UI): Araçların etrafında kaba kutular çizmek yerine, sadece verileri (Hız ve Plaka) araç üzerinde süzülen bir yazı olarak gösterir.
- Dinamik Kalibrasyon: Video çözünürlüğüne ve kamera açısına göre ayarlanabilir mesafe parametreleri.
Projeyi bilgisayarınıza klonlayın ve gerekli kütüphaneleri yükleyin.
-
Projeyi İndirin:
git clone https://github.com/onurilaslan/YOLO-Speed-LPR-System.git cd GhostRadar-AI -
Gerekli Kütüphaneleri Yükleyin:
pip install opencv-python ultralytics easyocr numpy
(Not: EasyOCR için PyTorch gereklidir, otomatik yüklenir.)
-
Gerekli Dosyalar:
main.py: Ana proje dosyası.haarcascade_russian_plate_number.xml: Plaka tespiti için gerekli XML dosyası (Proje klasöründe olmalı).video.mp4: Test edilecek video dosyası.
main.py dosyasını çalıştırın:
python main.pyLanguage: 🇺🇸 English | 🇹🇷 Türkçe
GhostRadar-AI is a real-time traffic analysis system powered by YOLOv8, OpenCV, and EasyOCR. It detects vehicles, calculates their speed based on pixel-to-meter calibration, and recognizes license plates. The project features a "Ghost Mode" UI, which displays data floating over vehicles without cluttering the screen with bounding boxes.
- Object Detection: Detects cars, trucks, buses, and motorcycles using YOLOv8.
- Speed Estimation: Calculates speed (km/h) by measuring the time taken to travel between two virtual lines.
- License Plate Recognition (LPR): Uses Haar Cascade to locate plates and EasyOCR to read text.
- Ghost Mode UI: A clean visualization that shows only speed and license plate data without obstructive rectangles.
- Robust Tracking: Uses BoT-SORT for object tracking to handle frame drops.
-
Clone the repository:
git clone https://github.com/onurilaslan/YOLO-Speed-LPR-System.git cd GhostRadar-AI -
Install dependencies:
pip install opencv-python ultralytics easyocr numpy
-
Required Files:
- Ensure
haarcascade_russian_plate_number.xmlis in the project folder (used for plate localization). - Place your test video as
video3.mp4or update the code source.
- Ensure
Run the main script:
python main.py