-2 -1 0 -1 1 1 0 1 2
This is 3×3 emboss kernel. How should I write this in 5×5?
Answer
As I understand, these filters take directional differences (see the wikipidea page).
We can decompose you filter into directions
0 -1 0 0 0 0 -2 0 0 0 0 0 -1 0 1 0 0 0 0 1 0 0 0 0 0 0 2
So, I think you can expand it over these 3 directions giving emphasis
0 0 -1 0 0 0 0 0 0 0 -2 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 -2 0 0 0 0 0 0 0 0 -1 -1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2
So, the final kernel would be
-2 0 -1 0 0 0 -2 -1 0 0 -1 -1 1 1 1 0 0 1 2 0 0 0 1 0 2
May be you can also try interpolating filter coefficients marked as x
-2 x -1 0 0 x -2 -1 0 0 -1 -1 1 1 1 0 0 1 2 x 0 0 1 x 2