Color-related special effects
1.1
Grayscale)A grayscale image converts a color image to a black-and-white image.
1.2
TheoryTheoretically, In the YUV space, the UV component is discarded, and only the Y component is retained, so that black and white images can be obtained. This is also the principle that the color electro-mechanical signal can be compatible with the black and white TV sets. In theory, the color is the same as the Y value (the effect of converting ACDSee to a grayscale image on the right side). In grayscale mode, the color is the same.
In theory, we should change the UV value to a gray value. However, the specific code varies depending on the software algorithm and hardware structure.
1.3
Take a platform as an ExampleThe core two lines of code are as follows: set_hue_u_gain (0); set_hue_v_gain (0); Set UV gain to 0 here. If UV offset is set to 128, the final UV result will be 128, this is in line with the theory.
1.4
Sepia/sepiagreen/sepiablueThe so-called retro (green, blue) is based on the gray scale, an additional offset is made for the UV value, the grayscale map is converted into a gradient map of a certain color. Theoretically, in order to obtain the blue effect, the blue difference signal should be added to reduce the red difference signal. That is, increase u and decrease v. Take the effect of sepiablue as an example. Here, the byte MSB indicates the symbol bit, so 88 is 88,158-30. Set_hue_u_gain (0); set_hue_v_gain (0); set_hue_u_offset (88); set_hue_v_offset (158 );
1.5
NegativeThe so-called negative effect is to reverse the color of the image, it looks like the effect of the film. In theory, this is easy to understand and process, that is, in the RGB space, take its complementary color. The specific operation is to subtract RGB from 255 to obtain a new RGB value. This function is usually implemented in the ISP.
2
SummaryAfter understanding the principle, it is easy to make the effect of the others color transformation. Basically, in terms of color correction and processing, the relevant parameters to be considered include: the upper and lower limits of automatic WB, the target range of Automatic white balance, RGB gain, UV gain, UV offset, color correction. some also have settings related to saturation and hue. In terms of the sensor or ISP hardware processing process, the usual direction is to first perform RGB gain, then color correction, and finally perform YUV space processing. To reduce the interaction between parameters, you can adjust the parameters in this order.
Reprinted link address: http://blog.csdn.net/colorant/