Public Function UnsharpMask(Optional Radius As Long = 10, Optional Amount As Long = 2, Optional Threshold As Long = 0) As Boolean首先对图像进行 GaussianBlur ,模糊的半径就是radius然后对像素值做如下处理:Diff = PixelG -Pixel If Abs(2 * Diff) < Threshold Then Diff = 0 End If Value = PixelG + Amount * Diff Value = ((Value And (Value >= 0) Or (Value >= 256)) And &HFF) Pixel = Value其中PixelG 是值高斯模糊后的图像,Pixel是原始的图像
If Abs(2 * Diff) < Threshold Then
Diff = 0
End If
Value = PixelG + Amount * Diff
Value = ((Value And (Value >= 0) Or (Value >= 256)) And &HFF)
Pixel = Value其中PixelG 是值高斯模糊后的图像,Pixel是原始的图像