I want to create custom filters using filter2d function but most of the examples I see use custom methods like ones,zeros and eye but I want to create a 3x3 matrix which contains the values I want.
Like for e.g, [ 1 4 6 -1 3 5 -1 -2 2 ]
How do I make such a kernel using filter2d function?