1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| """ Glasgow AI 路侧摄像头系统技术分析 基于公开报道推断的技术架构
关键信息: - 部署位置:路边固定杆 - 检测目标:手机使用 + 安全带违规 - 技术路线:AI视觉 + 多帧验证 - 来源:Traffic Scotland Seatbelt and Driver Distraction Survey """
import numpy as np
class RoadsideAICamera: """路侧 AI 摄像头系统""" def __init__(self): self.detection_range = 15 self.camera_height = 5.5 self.mounting_type = "roadside_pole" self.fov_h = 40 self.fov_v = 30 self.resolution = (4096, 2160) self.models = { "phone_detection": { "model": "YOLOv8-m", "classes": ["phone_hand", "phone_ear"], "min_confidence": 0.85, "frames_needed": 3, }, "seatbelt_detection": { "model": "ResNet-50", "classes": ["belt_on", "belt_off", "belt_misuse"], "min_confidence": 0.90, "frames_needed": 5, }, } def analyze_detection_accuracy(self, vehicle_speed: float) -> dict: """ 分析不同车速下的检测能力 Args: vehicle_speed: 车速 km/h """ detection_window = (self.detection_range * 2) / (vehicle_speed / 3.6) frames_captured = int(detection_window * 30) phone_frames_needed = self.models["phone_detection"]["frames_needed"] belt_frames_needed = self.models["seatbelt_detection"]["frames_needed"] phone_feasible = frames_captured >= phone_frames_needed belt_feasible = frames_captured >= belt_frames_needed return { "speed_kmh": vehicle_speed, "detection_window_s": round(detection_window, 2), "frames_captured": frames_captured, "phone_detection": "✅" if phone_feasible else "❌", "seatbelt_detection": "✅" if belt_feasible else "❌", "resolution_sufficient": "phone:✅ belt:⚠️", }
camera = RoadsideAICamera()
print("=== Glasgow AI 摄像头检测能力分析 ===") print(f"{'车速(km/h)':<15} {'检测时间(s)':<15} {'捕获帧数':<10} {'手机':<10} {'安全带':<10}") print("-" * 60) for speed in [30, 50, 70, 90, 110, 130]: r = camera.analyze_detection_accuracy(speed) print(f"{r['speed_kmh']:<15} {r['detection_window_s']:<15} {r['frames_captured']:<10} {r['phone_detection']:<10} {r['seatbelt_detection']:<10}")
print("\n⚠️ 高速时检测窗口不足,需多摄像头接力或更高帧率")
|