ISP BLOCK
Figure 1 shows a simplified block schematic of a conventional ISP. The input is sensor data in a raw format (one color per pixel), and the output is interpolated RGB or YCbCr data (three colors per pixel).
Figure 1. This block diagram provides a simplified view inside a conventional ISP (image signal processor).
Table 1 briefly summarizes the function of each block. The list is not intended to be exhaustive: an ISP design team will frequently also implement other modules.
Module | Function |
---|---|
Raw data correction | Set black point, remove defective pixels. |
Lens correction | Correct for geometric and luminance/color distortions. |
Noise reduction | Apply temporal and/or spatial averaging to increase SNR (signal to noise ratio). |
Dynamic range compression | Reduce dynamic range from sensor to standard output without loss of information. |
Demosaic | Reconstruct three colors per pixel via interpolation with pixel neighbors. |
3A | Calculate correct exposure, white balance and focal position. |
Color correction | Obtain correct colors in different lighting conditions. |
Gamma | Encode video for standard output. |
Sharpen | Edge enhancement. |
Digital image stabilization | Remove global motion due to camera shake/vibration. |
Color space conversion | RGB to YCbCr. |
BLC
黑电位校正是由于CMOS sensor 本身由于暗电流的存在,导致在没有光线照射的时候,像素单位也有一定的输出电压。需要把这个电位减去,让输出的数据呈现出随亮度线性变化的规律。一般的Sensor都有BLC参数,sensor厂商会给出已经调校好的参数,在ISP中也还有进一步的BLC存在。但ISP的BLC 一般只是微调数据,有些sensor在不同色温或者环境亮度条件下需要调整。如下图:
(左)Normal (中)Disable sensor BLC 右)BLC 参数异常
右侧的图像在一定环境下,呈现偏红色,因此需要对R分量减去一个较小的幅度。同时为了对整幅图像数据不造成大的影响,R分量还要保持0~255的取值范围,所以BLC 计算公式如下:
f(x, Δ)=(x-Δ)*255/(255-Δ)
其中Δ为BLC校正的数值, x可以是R/G/B中的任意一个分量,取值范围在0~255. BLC的映射关系图如下,水平方向表示物体亮度,垂直方向表示Sensor像素的输出值,蓝色为BLC之前的数据,红色为BLC之后的数据。
BLC 映射关系图
BLC参数Δ不宜设置过大,Δ越大,则感光动态范围越小。一般要求在图像效果可接受的范围内,Δ越小越好。判断Δ设置是否到位的一个简单方法是把sensor完全遮黑,看看输出数据是否逼近0值。