扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
A B C D E F G H I J K L M N O P |
Delta= F - (A+B+C+E+G+I+J+K) / 8 (A+B+C+E+G+I+J+K) / 8就是F周围的像素的平均值, |
F=F + Delta * Alpha |
A B C D E F G H I J K L M N O P |
Delta= A - (B+E+F) / 3 F=F + Delta * Alpha |
Public Sub Sharp(Optional ByVal SharpDgree As Single = 0.3) Dim X As Long Dim Y As Long Dim Ix As Long Dim Iy As Long Dim Diff As Long Dim Diff1 As Long Dim Div1 As Single Dim Div2 As Single Dim Max As Long On Error GoTo ErrLine Max = 255 Done = False TimeFilter = timeGetTime TemplateSize = 1 Sensitivity = Sensitivity * 9 Div1 = 1 + SharpDgree Div2 = -SharpDgree / 3 For X = 0 To OutPutWid - 1 For Y = 0 To OutPutHei -1 RR = ColOut(0, X, Y) * Div1 GG = ColOut(1, X, Y) * Div1 BB = ColOut(2, X, Y) * Div1 Ix = X + 1 Iy = Y + 1 R = ColOut(0, Ix, Iy) R = R + ColOut(0, X, Iy) + ColOut(0, Ix, Y) G = ColOut(1, Ix, Iy) G = G + ColOut(1, X, Iy) + ColOut(1, Ix, Y) B = ColOut(2, Ix, Iy) B = B + ColOut(2, X, Iy) + ColOut(2, Ix, Y) R = R * Div2 G = G * Div2 B = B * Div2 RR = RR + R GG = GG + G BB = BB + B If RR < 0 Then RR = 0 If RR > Max Then RR = Max If GG < 0 Then GG = 0 If GG > Max Then GG = Max If BB < 0 Then BB = 0 If BB > Max Then BB = Max ColOut(0, X, Y) = RR ColOut(1, X, Y) = GG ColOut(2, X, Y) = BB Next Next Done = True TimeFilter = timeGetTime - TimeFilter Exit Sub ErrLine: Done = True MsgBox Err.Description End Sub |
Public TimeFilter As Long '用于记录滤镜处理所花费的时间 Dim RR As Long '用于保存红色分量 Dim GG As Long '用于保存绿色分量 Dim BB As Long '用于保存蓝色分量 |
![]() |
![]() |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。