In the last article, we already know the structure and imaging principle of the Sensor. But there’s a lot of work to be done from optical signals to images, and OBC is one of them.

As we’ve seen in previous articles, each pixel is controlled by a photodiode that converts electrical signals into digital signals.

So, we know that the pixel value of the image is related to the intensity of the electrical signal. However, we need to know that each photodiode must have a certain voltage in order to work. Even when there is no external light, the Sensor will have a certain voltage.

Wouldn’t that be superimposed on the electrical signals during imaging?

That’s not going to happen, Bao You!

That’s why Optical Black Correct(OBC) exists.

OBC stands for optical dark area correction, which subtracts a portion of the dark current, also known as the black level, during imaging.

So how do you get the black level?

As shown in the figure above, some totally unexposed pixels are reserved on the Sensor. By reading the size of these pixel values, the optical black level can be obtained in real time. At this point, the Sensor’s output RAW = Sensor input-Optical black level.

Although the OB differences of different columns have been fully taken into account by these black lines, the OB deduction may still be inaccurate because the black lines at the edge of the sensor will be affected by PCB layout, power ripple, module structure design and other factors. As a result, some camera manufacturers do not use this function, but in security or vehicle cameras, some manufacturers still enable OBC function.

The sensor will then base its output on a pedestal based on sensor input – optical black level + pedestal because of the sensor’s SNR. For chip processing, this is what you typically get, and you need to subtract the base at the beginning of the ISP process. Inside the chip, it is commonly called BLC, which stands for Black Level Correct.

 

Again and OB distribution

Simply from Again, the distribution of OB meets the following rules:

As the gain increases, the mean value of OB may not change, but the variance will increase. The main reason is that OB deduction in the sensor is done after Again, so with the increase of Again, the influence of noise increases, resulting in the increase of variance of OB.

At this time, if the mean value of OB is still deducted, there may be color deviation in the dark of the picture. As shown below:

It can be seen in the picture on the right that there is a serious purple problem in the dark after being forcibly brightened. The main reason is that the variance of OB increases. If ISP deducts according to the average value of OB, there may be more black level residual, which is affected by the white balance (Rgain and Bgain), so the dark part of the picture will be purple.

The solution is as follows:

1. If you deduct OB a little more, the disadvantage is that more noise points will be introduced if the noise form is destroyed.

2. Deduct OB by channel. The disadvantage is that the off-color will be affected by the environmental color temperature.

In addition, OB will change with the change of temperature. If the deduction of OB does not follow the change of temperature, the color deviation problem will also occur.

OB deduction can be performed at two time nodes before or after RAW domain formation, which also has advantages and disadvantages:

1. OB has better definition after deducting the RAW domain image

1. OB is better when deducted after RAW domain image is formed

 

In ISP processing, OB is usually the first module, but can also be placed after RAW domain denoising.

The easiest way to subtract OB is to subtract the mean and then stretch the G channel linearly, for example, Goutput = Ginput*255/(255-black Level). The reason for linear stretching is that all RGB channels are unsaturated after deducting OB, while R and B channels can reach saturation due to the presence of white balance gain (Rgain and Bgain). The gain of Ggain is generally 1, so the picture will be purple where it is close to overexposure.

In addition to subtracting the mean, OB can be subtracted using maximum, median, local mean, and so on.

In addition, because OB is related to gain, different OB can be deducted according to different gain.

 

The reason why I want to talk about OB today is mainly because in my work, the night scene algorithm encountered the problem of brightening in dark places with a purple bias. I learned that OB deduction has a great relationship with color bias, so I want to talk about it and record it. Thank you for giving me a small cooking ~

Welcome to pay attention to my personal public number [image processing these things], there are more good health oh ~