I need an operation I’d call “soft dilation”.
If standard OpenCV dilation, using a binary kernel, works something like this:
dst(x, y) = max src(x + i, y + j) for i, j if kernel[i, j]
Then “soft dilation” would work like so:
dst(x, y) = max src(x + i, y + j) * kernel(i, j)
So, it would be like using a 2D filter, but with a max
aggregator instead of sum
.
I’d need the solution to work with large (e.g. 40×40) Gaussian kernels.
Looking through OpenCV API I don’t see anything supporting this. Dilation treats every kernel as binary. I don’t see other filters that use min/max aggregations…
I might be able to implement this using Cython and numpy, but I was hoping to find something already made, tested and optimized.