经典多层金字塔锐化(Multi-Level Pyramid Edge Enhancement)

锐化方法: 锐化图 = 输入图 + 高频 + 中频 + 低频

高频部分:

1
2
3
4
5
6
7
高频获取方式:   hf = gaussblur(input, sigma) - gaussblur(input, sigma * band1)
高频进一步增强: hf = apply_gamma(hf, gamma_power1)
输入图锐化: sharpened1 = input + hf * strength1
输入图与锐化图的blending:
res1 = sharpened1 * weight1 + input * (1 - weight1)
weight1 = clamp(std / stdthresh1 + blendbias1, 0, 1)

中频部分:

1
2
3
4
5
6
7
中频获取方式:   mf = gaussblur(input, sigma * band1) - gaussblur(input, sigma * band1 * band2)
中频进一步增强: mf = apply_gamma(mf, gamma_power2)
输入图锐化: sharpened2 = res1 + mf * strength2
输入图与锐化图的blending:
res2 = sharpene2 * weight2 + res1 * (1 - weight2)
weight = clamp(std / stdthresh2 + blendbias2, 0, 1)

低频部分:

1
2
3
4
5
6
低频获取方式:   lf = gaussblur(input, sigma * band1 * band2) - gaussblur(input, sigma * band1 * band2 * band3)
低频进一步增强: lf = apply_gamma(lf, gamma_power3)
输入图锐化: sharpened3 = res2 + lf * strength3
输入图与锐化图的blending:
res3 = sharpene3 * weight3 + res2 * (1 - weight3)
weight3 = clamp(std / stdthresh3 + blendbias3, 0, 1)