I tried algorithm like this:
- mark all cells for which the borders are steep,
- connect 2 steepest sides with cliff segment
- join segments where possible
End result is best described by this picture:
The small white lines are my calculated cliffs. The background is OCAD 11 generated steepness where black is 45degree steepness. My lines are calculated in a smaller subregion than the whole picture.
This algorithm does not work without some additional improvements. Something better is needed.