ADAS 摄像头硬件原理和传输协议概述


  

项目Value
芯片MAX 96712 MAX 96717

术语和描述

GMSL: (Gigabit Multimedia Serial Links) It is a high-speed serial link protocol for transmitting signals such as video, audio, and data.
MIPI CSI : (Mobile Industry Processor Interface - Camera Serial Interface) MIPI is a high speed protocol which transmits video and image data between a camera and the host processor. They are widely used in mobile devices. MIPI CSI-2 – one of the MIPI interface variants – offers a maximum bandwidth of 6 Gb per second, with an attainable bandwidth of roughly 5 Gb per second. MIPI CSI-2 connects an image sensor with an embedded board to control and process the image data. This helps the sensor and embedded board to act together as a camera system to capture images.
PHY: (Physical Layer) is the physical layer, which is responsible for the physical realization of the transmitted data.
PIPE :(PHY Interface for PCI Express) is an interface standard for connecting PHYs to hosts.Lane refers to a single transmission channel, and generally a GMSL chip will have multiple Lane.
ISP: (Image Signal Processor). the main role is to do post-processing of the digital signal output from the front-end image sensor, so that the final image quality can be generated as expected by human beings.
DPC:(Defective Pixel Correction) Due to the photoreceptor chip’s own process technology defects, light collection there are defective factors, resulting in some pixel points can not work properly. the role of the DPC is to correct these bad points, so that the picture back to normal.

BLC:(Black Level Correction) By the Sensor side of the dark current and the AD conversion before adding a reference value of these two factors, will make the lens into a full-black environment, even if there is no light exposure, the Sensor output of the raw data is not 0, the output image will be gray; and we actually hope that the full-black environment of the raw data is 0, that is, black is black.BLC is to make this correction for the image image BLC is to correct the image image in such a way that black is black.
LSC:(Lens Shading Correction) The lens can be simply understood as a convex lens, there is to the role of the center of the spotlight, which will cause Luma shading and color shading. Luma shading is the center and four corners of the brightness inconsistency (the middle of the amount of brighter than the surrounding area a lot); color shading is the center and the surrounding color inconsistency, reflecting the general for the center or surrounding color shading is the inconsistency between the center and the surrounding color, which is generally reflected in the center or surrounding color. So the essence of lens shading is the optical center to the edge of the attenuation, so the essence of the LSC correction is to find a gain value, with the pixel value of the point multiplied by the value of the gain, so that it is restored to the attenuation of the state before.

一、RAW格式简介

  
在这里插入图片描述
  RAW数据是图像传感器(CMOS或CCD)将捕获的光源信号转换为数字信号后的原始数据,其中包含图像的原始颜色信息等。

Bayer

  • RAW数据格式一般采用拜耳排列,传感器的像素上覆盖着CFA (Color Filter Array),因此传感器上的每个像素只采集特定颜色光的强度,因此传感器上的每个像素只能记录R或G或b的信息。因此,传感器接收到的各类光的强度在RAW数据中表示出来。传感器接收到的各种颜色的光的强度。考虑到人眼对绿色波段的颜色更敏感,因此绿色分量权重最大,Bayer分量的分量为 R\G\B。

  • 通用BAYER格式分为GBRG、GRBG、BGGR和RGGB四种模式。由于这种具有分量的分量为排列的RAW图像看起来像马赛克,所以它也常被称为马赛克图像。例如,如上所示的RGGB排列。

  • 一般有RAW8、RAW10、RAW12等,分别表示一个像素点有8bit数据、10bit数据、12bit数据。这是Sensor输出的最原始的数据,无论最终转换成什么格式的视频,都需要先从RAW格式转换。

二、YUV格式简介

  YUV是一种颜色表示模型,它分离了图像的亮度和色度成分。YUV分为三个分量,Y表示亮度(luminance或Luma)即灰度值,U和V表示色度,描述图像的色调和饱和度,用于指定像素的颜色,每个像素由一组(Y,U,V)值表示。
YUV 444

  • A group is [yuv],Each Y corresponds to a set of UVs, a YUV accounts for 24bits 3 bytes.
    在这里插入图片描述
    YUV 422
  • A group is [yu][yv], That is, 2 Y’s share a UV, and a YUV takes up 8+4+4=16bits 2 bytes;

在这里插入图片描述

YUV 420

  • 4 Y’s share a common set of UV’s, each YUV takes up 8+2+2=12bits, 1.5 bytes
    在这里插入图片描述

三、RGB格式简介

  每个像素由三种原色R(红色)、G(绿色)和B(蓝色)组成。通过混合这三种颜色,你基本上可以混合人类视觉所能感知的所有颜色

RGB常见的几种格式和描述:

  • RGB565: Each pixel is represented by 16 bits, and the RGB components use 5, 6, and 5 bits each;
    在这里插入图片描述

  • RGB555: Each pixel is represented by 16 bits, and all RGB components use 5 bits (the remaining 1 bit is not used);
    在这里插入图片描述

  • RGB24 :Each pixel is represented by 24 bits, and 8 bits are used for each of the RGB components;
    在这里插入图片描述

  • RGB32 :Each pixel is represented by 32 bits, with 8 bits used for each of the RGB components (the remaining 8 bits are not used);

  • ARGB32 Each pixel is represented in 32 bits, with 8 bits used for each of the RGB components (the remaining 8 bits are used to represent the Alpha (transparency) channel value);

四、摄像机传输过程

  在反序列化芯片中,GMSL MIPI CSI PHY PIPE Controller Lane的作用是将来自相机或其他传感器的数据经过序列化和编码处理后,通过GMSL协议传输到反序列化芯片。PHY负责将串行数据流转换为电信号,并进行时钟恢复、信号恢复等处理;PIPE坐标,转换PHY与PIPE坐标之间的数据,转换PHY与主机之间的数据;控制器负责控制整个传输过程;Lane是复用数据传输的基本单位,一般每个Lane传输不同的数据。通过这些组件的协同作用,GMSL MIPI CSI PHY PIPE Controller Lane可以实现高速、稳定、可靠的数据传输,从而保证图像质量和系统的稳定性。
在这里插入图片描述

五、D-PHY的两种工作模式

  最初版本的D- phy的设计目标是500mbps, D是罗马数字500,D- phy的名字由此而来。D-PHY是一种高速、低功耗的源同步物理层,由于其高效率的设计,非常适合电池供电的设备,并且包含高速模块和低功耗模块,有助于其高效率。D-PHY包含高速和低功耗模块,有助于提高效率。高速模块用于负载数据(图像数据),低功耗模块(利用低频信号)用于发送控制和状态信息(在相机/显示器和应用处理器之间)。它具有在单个包脉冲中发送高速和低功耗数据的特殊能力。低功耗模块可以节省功耗,高速模块可以实现高清晰度照片质量数据信号所需的更高带宽。

  D-PHY的物理层支持HS (High Speed)和LP (Low Power)两种传输模式,采用不同的传输级别和传输机制。

  • HS模式:使用源同步传输,其中DDR时钟从主设备提供到从设备。使用差分信号传输。

  • LS模式:用于差分传输的信道被分成两条独立的信号线,采用单端信号。

六、一般的Lane 结构

  
Lane: 我们可以把它理解为两个不同模块之间完成信息传递的通道。

  两个D-PHY连接芯片,中间采用差分信令对进行连接,发送端和接收端各有一个Lane模块,完成数据的发送和接收,Lane模块和中间导线一起构成了一个完整的数据传输通道,是整个协议物理层的核心。下图展示了一个完整的双向数据传输Lane模块(MIPI中称为Universal Lane),它是D-PHY的基本信息传输单元。
  通用Lane由一对高速收发器(HS-TX、HS-RX)、一对低功耗收发器(LP-TX、LP-RX)、一个低功耗争用检测器(LP-CD)和Lane的控制逻辑组成。所有收发模块共用同一对差分线Dp、Dn(在LP模式下,两条独立的信号线)。整个Lane通过一个PPI接口(PHY协议接口)连接到系统的其余部分。

在这里插入图片描述

七、数据通道的三种运作模式

  
1.Burst mode
  高速模式,即在HS状态下的一种模式,用于传输图像。在高速模式下,通道状态为差分0或1,即当对内Dp大于Dn时定义为1,当Dp小于Dn时定义为0。此时,线路上的典型电压差为200 MV。

在这里插入图片描述

2.Control mode

  控制模式是一种处于LP状态的模式。当Dp和Dn上的信号不是差分信号而是相互独立时,高电平的典型幅值为1.2V。当Dp = 1.2V, Dn = 1.2V时,MIPI协议将状态定义为LP11;当Dp为1.2V, Dn为0V时,将状态定义为LP10,以此类推,控制模式可由LP11、LP10、LP01、LP00四种不同的状态组成。

  1. Escape mode

  逃逸模式是数据通道在LP状态下的一种特殊操作。在这种模式下,可以访问一些附加功能:低功耗数据传输模式(LPDT)、超低功耗模式(ULPS)、触发器。一旦进入Escape模式,发送器必须发送18位命令以响应请求的操作。

Data Lane通过LP-11→LP-10→LP-00→LP-01→LP-00进入Escape模式

通过LP-10→LP-11退出Escape mode

八、CSI-2 协议

  CSI-2大致分为三层:应用层、协议层和物理层。协议层被细分为三个层:the pixel/byte group packet/decapsulation layer, the underlying protocol layer, and the channel management layer.

在这里插入图片描述

8.1 Pixel/Byte Packing/Unpacking Layer

  • 支持多种像素格式的图像传输。发送方将来自应用层的像素数据打包成字节流并传递给底层协议层,接收方将来自底层协议层的字节解包并发送给应用层。

  • 以RAW10格式的图像数据为例,一个像素占10bit,打包过程为:每个像素提取2bit,剩余8bit作为一个字节传输;每4个像素提取2位合并成一个字节传输。因此,4个像素使用5个字节进行传输,这是将像素流转换为字节流的过程。

在这里插入图片描述
在这里插入图片描述

8.2 Low Level Protocol, LLP

   LLP层通常以两种格式处理数据包:长数据包和短数据包。无论哪种报文,LLP层都按照CSI-2协议为其添加包头PH (Packet Header)和包脚PF (Packet Footer),作为有效数据以HS方式传输。同时,LLP层将在每次从LP退出后添加一个SoT (Start of Transmission)序列作为开始进入HS模式的标志,并在进入LP模式之前添加一个EoT (End of Transmission)序列作为退出HS模式的标志。如下图所示。像素使用5个字节进行传输,这是将像素流转换为字节流的过程。
在这里插入图片描述

8.3 channel management layer

  

  • CSI-2是一种可扩展的通道协议,与仅使用一个数据通道相比,它允许使用多个数据通道以相对较低的时钟频率传输更多数据。高级数据流映射到多车道的方式需要严格定义,以便在使用这种多车道传输方法时,不同类型的主机设备和外设能够兼容。

  • pass-through管理层用于处理多通道配置。如下图所示,无论物理层选择C-PHY还是D-PHY,在CSI-2发送端,使用Lane Distribution Function (LDF)将从LLP层接收的一系列数据包分发到N个Lane(s),每个Lane(s)是一个单独的物理层逻辑单元加上传输电路。LDF表示D-PHY

在这里插入图片描述

  • 27
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
实现ADAS HIL(Hardware-in-the-Loop)硬件在环测试需要以下步骤: 1. 硬件选择:选择适合ADAS系统测试的硬件设备,包括传感器(如摄像头、雷达、激光雷达)、执行器(如制动器、转向器)、ECU(电子控制单元)等。 2. 建立仿真环境:根据ADAS系统的需求,建立一个仿真环境,包括道路模型、车辆模型、交通流模型等。可以使用专业的仿真软件,如CarSim、Simulink等。 3. 开发接口和通信:开发ADAS系统与仿真环境之间的接口和通信协议,确保能够实时交换数据和控制信号。这可以通过使用CAN总线、Ethernet、USB等方式进行数据传输和通信。 4. 编写测试用例:根据ADAS系统的功能和性能要求,编写一系列测试用例,涵盖不同的驾驶场景和情况。这些测试用例应该包括车辆行为、传感器输入、控制信号以及期望的输出结果。 5. 运行测试:将ADAS系统与HIL仿真环境进行连接,并执行编写好的测试用例。通过监测传感器数据、控制信号和仿真环境的反馈,来评估ADAS系统的性能和功能是否满足要求。 6. 数据分析和改进:根据测试结果进行数据分析,评估ADAS系统的表现,并根据需要进行改进和优化。 需要注意的是,实现ADAS HIL硬件在环测试需要具备相关的硬件设备和软件平台,以及对ADAS系统和仿真环境的深入理解。这通常需要一支专业的团队来完成,并且需要不断地进行测试和改进,以确保ADAS系统的可靠性和安全性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

老灰╮(╯-╰)╭

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值