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
| from dataclasses import dataclass from typing import List
""" IMS 摄像头选型矩阵 参考: EDN Japan ADAS 传感器 8M 新标准 (2026-08) """
@dataclass class CameraConfig: """摄像头配置""" name: str resolution: str pixels: int sensor: str fov: int fps: int interface: str price_tier: str ims_role: str
IMS_CAMERAS = [ CameraConfig("DMS-IR-2MP", "1600×1200", 2, "OV2311", 60, 60, "MIPI CSI-2", "$", "疲劳+分心+眼动"), CameraConfig("DMS-IR-5MP", "2592×1944", 5, "AR0521", 60, 30, "MIPI CSI-2", "$$", "疲劳+分心+OOP"), CameraConfig("DMS-RGB-8MP", "3840×2160", 8, "OS08A10", 60, 30, "MIPI CSI-2", "$$$", "全功能+远距离"), CameraConfig("OMS-Wide-2MP", "1920×1080", 2, "OV2311", 120, 30, "MIPI CSI-2", "$", "乘员+CPD"), CameraConfig("OMS-Wide-5MP", "2592×1944", 5, "AR0521", 120, 30, "MIPI CSI-2", "$$", "乘员+CPD+OOP"), CameraConfig("OMS-Wide-8MP", "3840×2160", 8, "IMX390", 150, 30, "GMSL2", "$$$", "全景座舱"), CameraConfig("Surround-2MP", "1920×1080", 2, "OV2311", 180, 30, "GMSL2", "$", "基础环视"), CameraConfig("Surround-8MP", "3840×2160", 8, "IMX390", 190, 30, "GMSL2", "$$$", "高清全景"), ]
def recommend_camera(ims_function: str, budget: str = '$$') -> CameraConfig: """推荐摄像头""" candidates = [c for c in IMS_CAMERAS if ims_function.lower() in c.ims_role.lower()] if budget == '$': candidates = [c for c in candidates if c.price_tier == '$'] elif budget == '$$': candidates = [c for c in candidates if c.price_tier in ('$', '$$')] if not candidates: return IMS_CAMERAS[0] return max(candidates, key=lambda c: c.pixels)
if __name__ == "__main__": print("=" * 75) print("IMS 摄像头选型矩阵") print("=" * 75) print(f"\n{'型号':<18} {'分辨率':>12} {'传感器':>10} {'FOV':>5} {'FPS':>4} " f"{'接口':>12} {'价位':>5} {'IMS功能':>20}") print("-" * 90) for c in IMS_CAMERAS: print(f"{c.name:<18} {c.resolution:>12} {c.sensor:>10} " f"{c.fov:>4}° {c.fps:>3}fps {c.interface:>12} " f"{c.price_tier:>5} {c.ims_role:>20}") print(f"\n{'='*75}") print("推荐选型:") print(f"{'='*75}") funcs = ['疲劳', '分心', 'CPD', 'OOP', '乘员'] for func in funcs: for budget in ['$', '$$', '$$$']: cam = recommend_camera(func, budget) print(f" {func:<8} 预算{budget:>3}: {cam.name} ({cam.resolution})") print()
|