White Balance Principle(3)
In the previous article, we talked about the theory of gray world and the theory of total reflection. The following is a brief introduction to the general principles of several white balance algorithms, but the specific gain calculation and mathematical modeling process will not be described.
1. Gray World Assumption
The principle of this algorithm is very simple, that is, according to the gray world theory mentioned above, the RGB average value of the original image is adjusted to R=G=B. The imperfection is that this algorithm is generally sensitive to images that are not rich in color, and the processing effect will not be ideal and the limitations are large.
2. Standard Deviation Weighted Gray World Assumption
The standard deviation weighted gray world algorithm is an improvement on the previous algorithm. Its principle is to divide the image into several pieces, and then use each of the blocks to analyze the richness of the color, and the color is more weighted. If the color is too small, the weight is reduced, and finally the sum is summed to obtain an average. The correction of the RGB values is performed based on this relatively accurate value.
3. Total Reflector Assumption
This is an algorithm based on the total reflection theory introduced earlier. It is not difficult to understand. It thinks that the brightest point must be white. If the brightest point in the original image is not, then it is against white. The value is inversely corrected. The disadvantage is that if the color of the image is complex or there is no highlight, its correction effect will be weak.
The above three algorithms are relatively simple, and the amount of calculation is not large, but each has its own advantages and disadvantages, and further more efficient hybrid algorithms are generated, such as: Quadratic Combining Luminance Weighted Gray World & Prefect Reflector Assumption. Look at such a long name, the algorithm is very complicated, the white balance correction effect is quite good, and it is convergent, it will not bring too much loss when processing the image, but unfortunately the amount of calculation is huge. The requirements for hardware resources are too high.
The conclusion I can give is that the better the final algorithm, the higher the complexity, the larger the computation, and the higher the hardware requirements. The specific implementation also needs to balance the three aspects of white balance correction ability, algorithm execution efficiency, and processor hardware performance.