Image Filter art-image lighting effect filter, filter ---
Image lighting filter image lighting lifting filter is mainly used to simulate the effect of the image under the sunlight, usually used in the photo taken in the dark light environment, or in the Sun Scene Photo without the sun. The adjustable parameters mainly include the light source position, light radius, and light intensity. By adjusting these parameters, we can achieve the desired sunny effect. The algorithm process is as follows:
The illumination effect of an image is to add a solar light source to the image to imitate the illumination conditions. The main algorithms include: 1 light source selection; 2 light pixel value acquisition.
1. Select the light source. We assume that the coordinates of the light source are S (X, Y), and the coordinates of the light source must be within the image size range. With the light source position, we can build a circular area to simulate the illumination. We set the radius of the light source to R. Then, the illumination range is the circle with S (X, Y) as the center and R as the radius.
According to the characteristics of the light source, the image shows that the center is the brightest near the center of the center, and the brightness gradually decreases around the radius. Therefore, we construct a linear transformation formula based on the Euclidean distance between pixels within the circular range of the light source and the circle center. If the Euclidean distance is D and the transformed pixel value is f, the formula is as follows:
2. Calculate the illumination pixel value. For pixels in the light source range, the illumination effect value is the superposition of the original pixel value and the illumination value. We calculate it according to the following formula:
Note: If the illumination value P is out of the range [0,255], correct it to the illumination range.
Below is our:
Source image
Illumination
Finally, put a complete C # program Demo download link: http://www.zealpixel.com/forum.php? Mod = viewthread & tid = 50 & page = 1 & extra = # pid51
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.