I would like to find the gradient at each element of a 2D Matrix of doubles. I think there are many ways to do that, the most simple one is probably to apply a 3x3 Kernel matrix looking like that:
0, 1, 0,
1, -4, 1,
0, 1, 0,
Is there a way in Eigen to do such a thing or should I do this manualy with a double for-loop ?
There are other more sophisticated ways to compute the gradiant of an matrix, like the Sobel Operator, but I can't find anything about it in the Eigen lib's documentation, but I might just lack the proper mathematical knowledge to type the correct keywords. I would greatly appreciate someone pointing me in the right direction.
Thank you