OpenCV and Unsharp Masking Like Adobe Photoshop

前端 未结 3 1982
挽巷
挽巷 2021-02-06 19:11

I am trying to implement unsharp masking like it\'s done in Adobe Photoshop. I gathered a lot of information on the interent but I\'m not sure if I\'m missing something. Here\'s

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-06 19:26

    According to docs:

    C++: void GaussianBlur(InputArray src, OutputArray dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT )

    4th parameter is not "radius" it is "sigma" - gaussian kernel standard deviation. Radius is rather "ksize". Anyway Photoshop is not open source, hence we can not be sure they use the same way as OpenCV to calculate radius from sigma.

    Channels

    Yes you should apply sharp to any or to all channels, it depends on your purpose. Sure you can use any space: if you want sharp only brightness-component and don't want to increase color noise you can covert it to HSL or Lab-space and sharp L-channel only (Photoshop has all this options too).

提交回复
热议问题