> -----Original Message-----
> From: Klaus Hartmann [mailto:k_h...@os...]
>
> What I did is this:
> For each data point Pm,n in the height field compute the
> elevation-difference between Pm,n and its eight direct
> neighbors. Sum these
> differences up and average them, by dividing the sum by 8.
> The result is a single value R (for each data point).
>
That would provide you with finding a single bump or pit in a flat, level
surface. If it's on a mountain slope then the average may give you a flat
surface instead of a large outcropping or cave that may exist there. I
don't use height maps and don't know what Pm,n stands for, but you are on
the right track using the difference between the heights of each point.
In reality our eyes determine curvature and slope in kinda the following:
Spot three points X1, X2, X3 equidistant along the line of sight and judge
height H1, H2, H3 at each point. Visually check H3-H1 and then visually
check H2-H1 and H3-H2. In the general case if (H2-H1)/(X2-X1) is greater
than (H3-H1)/(X3-X1) then there's a bump (convex), if they are equal then
it's flat, if it's less then a pit (concave). Where (X2-X1) = (X3-X2) = 1/2
(X3-X1) then just compare (H2-H1) * 2 with (H3-H1). Note that we don't need
to check between X2 and X3.
Hope that helps...otherwise I might start saying stuff like the second
derivative is negative for bumps (convex) and positive for pits (concave).
;)
Steve
|