I would like to implement a somewhat smarter Laplacian edge enhancement convolution. Right now it is implemented as (generic 3x3 convolution):
sum = 0
for k = -1 to 1 do
for j = -1 to 1 do
sum = sum + h(j +1, k + 1)*f(x - j, y - k)
end for
end for
g(x, y) = sum
Looking for way to improve to implementation all I could find was separable filter optimizations (as Fast / Efficient Way to Decompose a Separable integer 2D Filter Coefficients without the SVD). However Laplacian edge enhancement is not separable:
octave:1> m = [-1 -1 -1 ; -1 8 -1 ; -1 -1 -1];
octave:2> rank(m)
ans = 2
Is there any literature I could be missing ? When looking at the coefficients it feels as if somewhat could be done for matrix of type (CENTER=8, EDGE=-1):
E E E
E C E
E E E