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 84 85 86 87 88 89 90 91 92 93 94 95 96
| import numpy as np from dataclasses import dataclass from typing import List, Tuple
@dataclass class LightingCondition: """光照条件""" name: str illuminance: float sun_position: Tuple[float, float] shadows: bool reflections: bool
def generate_lighting_conditions() -> List[LightingCondition]: """生成 Euro NCAP 要求的光照条件""" conditions = [ LightingCondition( name='bright_daylight', illuminance=50000, sun_position=(45, 60), shadows=True, reflections=True ), LightingCondition( name='overcast', illuminance=10000, sun_position=(180, 30), shadows=False, reflections=False ), LightingCondition( name='dawn_dusk', illuminance=1000, sun_position=(90, 5), shadows=True, reflections=True ), LightingCondition( name='night_urban', illuminance=50, sun_position=(0, -10), shadows=False, reflections=True ), LightingCondition( name='night_rural', illuminance=5, sun_position=(0, -10), shadows=False, reflections=False ), LightingCondition( name='day_to_night_transition', illuminance=5000, sun_position=(135, 15), shadows=True, reflections=True ) ] return conditions
def generate_sunglasses_scenarios(): """生成太阳镜场景""" return [ { 'type': 'clear_sunglasses', 'transmittance': 0.75, 'color': 'transparent', 'reflection': 'minimal' }, { 'type': 'dark_sunglasses', 'transmittance': 0.10, 'color': 'dark_gray', 'reflection': 'high' }, { 'type': 'mirrored_sunglasses', 'transmittance': 0.30, 'color': 'mirrored', 'reflection': 'very_high' } ]
|