Answer the question
In order to leave comments, you need to log in
How to find all local minima in a matrix?
Hello!
There is a matrix of real non-negative numbers approximately 1000*1000 in size. Essentially, these are the values of some more or less smooth function of two variables. The task is to find all local minima of this function. Minima can also be located on the boundaries of the matrix.
Answer the question
In order to leave comments, you need to log in
Check each element by comparing with 8 or 5 (at the wall) or 3 (in the corner) neighbors.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question