BradLarson / GPUImage2

GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.
BSD 3-Clause "New" or "Revised" License
4.85k stars 605 forks source link

I use BilateralBlur no effect #229

Open chengkaizone opened 6 years ago

chengkaizone commented 6 years ago

I use BilateralFilter, but did not find the effect, GPUImage (OC) works well, I think it has a bug

chengkaizone commented 6 years ago

@BradLarson I use BilateralBlur to change parameters distanceNormalizationFactor did not change significantly, but I use GPUImage (OC) GPUImageBilateralFilter has changed significantly, I think it has some errors and hope to get fixes

Thank you!

ChernyshenkoTaras commented 5 years ago

As I can see problem is that the weight should get smaller as the colors become more different, but it seems like they're too different in nearby pixels, so often weight doesn't make any impact.

I solved it by auto-generating shaders as Gaussian blur does with using downsamplingFactor and it made it work, here is gist. Unfortunately downsamplingFactor pixelate images/videos a lot and produce weird effects.

In GPUImage we were using texelSpacingMultiplier to increase blur radius, so I think it can work here too, do we have it analog in current implementation of GPUImage2? Or maybe we have other ways do increase bilateral radius?

@BradLarson I would really appreciate if you would shed light where to go next to fix this issue