Z
Z
zpal2020-01-29 11:03:07
Algorithms
zpal, 2020-01-29 11:03:07

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

1 answer(s)
S
Sergey Sokolov, 2020-01-29
@sergiks

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 question

Ask a Question

731 491 924 answers to any question