首页/文章/ 详情

Carla中摄像头的属性获取,竟然这么多!

1年前浏览530

关于Carla中传感器(摄像头)的仿真,做个简单的记录:

获取摄像头属性的代码如下:












# 创建一个摄像头传感器,并将摄像头安装到车辆上的指定位置处    sensor_camera = world.spawn_actor(blueprint,                                       spawn_point,                                       attach_to=vehicle)    # 获得所有摄像头参数    attributes_camera = sensor_camera.attributes    # print("camera_attributes:", attributes_camera)    i = 1    for key, value in attributes_camera.items():        print("attribute_"+str(i), key, value)        i += 1


属性输出的结果如下:











































attribute_1 role_name frontattribute_2 chromatic_aberration_offset 0.0attribute_3 sensor_tick 0.0attribute_4 fstop 1.4attribute_5 image_size_x 800attribute_6 image_size_y 600attribute_7 fov 90.0attribute_8 lens_circle_falloff 5.0attribute_9 lens_circle_multiplier 0.0attribute_10 exposure_compensation 0.0attribute_11 lens_y_size 0.08attribute_12 lens_k -1.0attribute_13 exposure_mode histogramattribute_14 lens_kcube 0.0attribute_15 lens_x_size 0.08attribute_16 exposure_max_bright 12.0attribute_17 shutter_speed 200.0attribute_18 bloom_intensity 0.675attribute_19 iso 100.0attribute_20 enable_postprocess_effects trueattribute_21 gamma 2.2attribute_22 motion_blur_intensity 0.45attribute_23 motion_blur_max_distortion 0.35attribute_24 lens_flare_intensity 0.1attribute_25 motion_blur_min_object_screen_size 0.1attribute_26 exposure_min_bright 10.0attribute_27 exposure_speed_up 3.0attribute_28 exposure_speed_down 1.0attribute_29 tint 0.0attribute_30 calibration_constant 16.0attribute_31 focal_distance 1000.0attribute_32 min_fstop 1.2attribute_33 blade_count 5attribute_34 blur_amount 1.0attribute_35 blur_radius 0.0attribute_36 slope 0.88attribute_37 toe 0.55attribute_38 white_clip 0.04attribute_39 shoulder 0.26attribute_40 black_clip 0.0attribute_41 temp 6500.0attribute_42 chromatic_aberration_intensity 0.0

上述属性都是默认值。

如果想要自己设置摄像头的属性,结合上述的属性,参照如下的方法。







# 从蓝图库中筛选出来rgb摄像头蓝图blueprint = blueprint_library.find('sensor.camera.rgb')# 设置设摄像头蓝图的镜头参数blueprint.set_attribute('image_size_x', str(1024))blueprint.set_attribute('image_size_y', str(600))blueprint.set_attribute('fov', '110')

如上设置后,使用这个blueprint的摄像头的属性就会生效:


本文完。

来源:车路慢慢
理论通用
著作权归作者所有,欢迎分享,未经许可,不得转载
首次发布时间:2023-06-22
最近编辑:1年前
李慢慢
硕士 自动驾驶仿真工程师一枚
获赞 11粉丝 63文章 122课程 0
点赞
收藏
未登录
还没有评论
课程
培训
服务
行家
VIP会员 学习 福利任务 兑换礼品
下载APP
联系我们
帮助与反馈