1

Is there a (preferably simple) algorithm for finding topographic prominence of peaks in a 2D heightmap? I'd like to find how prominent each local maximum is. I'm toying with good old terrain generation and I'd like the generator to identify prominent mountains/peaks. Trying to implement this in C++.

Here's a screenshot for clarity White ticks mark the peaks (found by brute force). I want to determine the prominence for each of them.

nj16
  • 63
  • 5
  • Not sure if this would work, but maybe you could use binary search on different intervals to find the first point where `f(x) >= f(x+1)` (the peaks), then from each peak scan to the left/right to find the prominence? – Telescope Dec 09 '20 at 23:29
  • You probably have a brute force approach. Please show it as a [mre] as a clarification of input and desired result. – Yunnosch Dec 09 '20 at 23:30
  • I'm using brute force to find actual peaks, just iterating through all points and checking if all 8 neighbours are lower. But that's not the problem, I'm fine with brute force here. The question is how to calculate prominence (as defined in linked wiki page) of such peaks. – nj16 Dec 10 '20 at 00:05
  • Added an image to question, hope that makes things a bit clearer. – nj16 Dec 10 '20 at 00:30

0 Answers0