| Image sharpening algorithm is often used in image processing of the basic algorithm, in Photoshop, using the Unsharp mask, but this sharpening speed is relatively slow, today, introduced a very simple sharpening algorithm: Based on the mean filter sharpening algorithm. The algorithm introduced in this paper derives from the paper "Digital image enhancement and noise fitering by using local statistics". The algorithm process is as follows: 1, calculates the mean value in the window range: The formula (1) is the mean formula, the formula (2) is the variance formula, the formula (2) is not used temporarily. 2, Sharpening formula: 2.1 Sharpening Algorithm (1): The formula X (I,J) represents the sharpening value of the (i,j) position pixel, and M (i,j) represents the mean. When K=0 is used, the algorithm represents mean-value filtering. When 0<k<1, the algorithm represents low-pass filtering. When k = 1 o'clock, the algorithm indicates that the original image is unchanged; When K>1, the algorithm represents high-pass filtering, namely sharpening algorithm; 2.2 Sharpening Algorithm (2): where g (x) represents a linear transformation, such as a=0.9,b=13, which represents a contrast enhancement. When K=0 is used, the algorithm represents mean-value filtering. When 0<k<1, the algorithm represents low-pass filtering. When k = 1 o'clock, the algorithm indicates that the original image is unchanged; When K>1, the algorithm represents high-pass filtering, namely sharpening algorithm; The above is the algorithm based on mean filter sharpening, the algorithm is quite simple, easy to implement, here are: Original Window radius radius=10,k=0.5 Window radius radius=10,k=2 Finally, a simple demo is given: The sharpening algorithm based on mean filter demo.zip share with you! |