Hello fellow programmers,
I am currently doing this years advent of code. On day 9 I need to find out wether a pixel in an image has the smallest value of the adjacent pixels.
I first solved this very intuitively and crudely, but now after looking at it for a while was wondering if there was a way to define a convolution kernel for opencv's filter2D
-function or another appropriate library I could try where I can define the kernel as a function, such that I can not only perform linear transformations, but also others.
In this specific example I was thinking about a kernel, that can tell if the middle pixel has the lowest value. Maybe there even is a way to do this using linear transformations, however i am not able to find it.
Any help is appreciated.