v.lidar.edgedetection(1grass)

πŸ’… NAME πŸ’…

okay bestie, gather round, because v.lidar.edgedetection is the girl who looks at your LIDAR dataset and goes "I see the edges of everything in here" β€” literally. It detects the object's edges from a LIDAR data set. That's the whole job. Iconic behavior honestly.

πŸŽ€ KEYWORDS πŸŽ€

vector, LIDAR, edges

✨ SYNOPSIS ✨

v.lidar.edgedetection
v.lidar.edgedetection --help
v.lidar.edgedetection [-e] input=name output=name  [ew_step=float]
[ns_step=float]   [lambda_g=float]   [tgh=float]   [tgl=float]
[theta_g=float]   [lambda_r=float]   [--overwrite]  [--help]
[--verbose]  [--quiet]  [--ui]

🫢 Flags 🫢

  • -e β€” Estimate point density and distance and quit. Like, it peeks at the input vector points within the current region extents, figures out the point density and the distance in map units, and then dips. No output, no drama, just vibes.
  • --overwrite β€” Allow output files to overwrite existing files. yes queen, replace the old one, we don't need her.
  • --help β€” Print usage summary. when u forget how anything works.
  • --verbose β€” Verbose module output. give me ALL the narration.
  • --quiet β€” Quiet module output. shhh. no thoughts.
  • --ui β€” Force launching GUI dialog. for the girlies who prefer clicking πŸ’…

🌸 Parameters 🌸

  • input=name [required] β€” Name of input vector map. Or a data source for direct OGR access, if that's ur thing.
  • output=name [required] β€” Name for output vector map. name her something cute.
  • ew_step=float β€” Length of each spline step in the east-west direction. Default: 4 * east-west resolution.
  • ns_step=float β€” Length of each spline step in the north-south direction. Default: 4 * north-south resolution.
  • lambda_g=float β€” Regularization weight in gradient evaluation. Default: 0.01.
  • tgh=float β€” High gradient threshold for edge classification. Default: 6.
  • tgl=float β€” Low gradient threshold for edge classification. Default: 3.
  • theta_g=float β€” Angle range for same direction detection. Default: 0.26.
  • lambda_r=float β€” Regularization weight in residual evaluation. Default: 2.

🌈 DESCRIPTION 🌈

okay so. v.lidar.edgedetection is step one of three in the whole LiDAR data filtering saga. The filter's whole goal is to recognize and extract attached and detached objects β€” think buildings, bridges, power lines, trees, all of it β€” so u can eventually build a Digital Terrain Model. main character energy.

Specifically? This module detects the edge of every single feature sitting on top of the terrain surface of a LIDAR point surface. And the way it does it is a whole journey:

First, a bilinear spline interpolation with a Tychonov regularization parameter is performed. The gradient gets minimized, and that low Tychonov regularization parameter pulls the interpolated functions as close as possible to the observations. Then, bicubic spline interpolation with Tychonov regularization happens. But now the curvature is minimized instead, and the regularization parameter is set to a high value. so she switches up mid-process, love that for her.

For each point, an interpolated value gets computed from the bicubic surface, and an interpolated gradient gets computed from the bilinear surface. At every point, the gradient magnitude and the direction of the edge vector are calculated, and the residual between interpolated and observed values gets computed too.

Then come the thresholds. Two of them, on the gradient: a high one, tgh, and a low one, tgl. Here's the tea:

  • A point gets labeled as an EDGE point if its gradient magnitude is greater than or equal to the high threshold AND its residual is greater than or equal to zero.
  • Similarly, a point is labeled as an EDGE point if its gradient magnitude is greater than or equal to the low threshold, its residual is greater than or equal to zero, AND the gradient to two of eight neighboring points is greater than the high threshold.
  • Everything else? Classified as TERRAIN. not special enough, sorry babe.

The length (in mapping units) of each spline step is defined by ew_step for the east-west direction and ns_step for the north-south direction.

The output is a vector map where points have been classified as TERRAIN, EDGE or UNKNOWN. And bestie, listen β€” this vector map should be the input of the v.lidar.growing module. don't skip ahead. it's a pipeline. respect the pipeline.


πŸ“ NOTES πŸ“

In this module, an external table will be created, which will be useful for the next module in the LiDAR data filtering procedure. In this table, the interpolated height values of each point will be recorded.

Also, points in the output vector map get classified as:

TERRAIN (cat = 1, layer = 1)

EDGE (cat = 2, layer = 1)

UNKNOWN (cat = 3, layer = 1)

And the final result of the whole procedure (v.lidar.edgedetection, v.lidar.growing, v.lidar.correction) will be a point classification in four categories:

TERRAIN SINGLE PULSE (cat = 1, layer = 2)

TERRAIN DOUBLE PULSE (cat = 2, layer = 2)

OBJECT SINGLE PULSE (cat = 3, layer = 2)

OBJECT DOUBLE PULSE (cat = 4, layer = 2)

like, the glow-up from three categories to four?? we love a character arc.


πŸ”₯ EXAMPLES πŸ”₯

Basic edge detection

last return points, let's go:

# last return points
v.lidar.edgedetection input=vector_last output=edge ew_step=8 ns_step=8 lambda_g=0.5

Complete workflow

the whole saga, start to finish:

# region settings (using an existing raster)
g.region raster=elev_lid792_1m
# import
v.in.pdal -r input=points.las output=points
v.in.pdal -r input=points.las output=points_first return_filter=first
# detection
v.lidar.edgedetection input=points output=edge ew_step=8 ns_step=8 lambda_g=0.5
v.lidar.growing input=edge output=growing first=points_first
v.lidar.correction input=growing output=correction terrain=only_terrain
# visualization of selected points
# zoom somewhere first, to make it faster
d.rast map=orthophoto
d.vect map=correction layer=2 cats=2,3,4 color=red size=0.25
d.vect map=correction layer=2 cats=1 color=0:128:0 size=0.5
# interpolation (this may take some time)
v.surf.rst input=only_terrain elevation=terrain
# get object points for 3D visualization
v.extract input=correction layer=2 cats=2,3,4 output=objects
Figure 1: Example output from complete workflow (red: objects, green: terrain)
Figure 2: 3D visualization of filtered object points (red) and terrain created from terrain points (gray)

not the red-and-green color coding being lowkey festive πŸŽ€


πŸ‘‘ REFERENCES πŸ‘‘

  • Antolin, R. et al., 2006. Digital terrain models determination by LiDAR technology: Po basin experimentation. Bolletino di Geodesia e Scienze Affini, anno LXV, n. 2, pp. 69-89.
  • Brovelli M. A., Cannata M., Longoni U.M., 2004. LIDAR Data Filtering and DTM Interpolation Within GRASS, Transactions in GIS, April 2004, vol. 8, iss. 2, pp. 155-174(20), Blackwell Publishing Ltd.
  • Brovelli M. A., Cannata M., 2004. Digital Terrain model reconstruction in urban areas from airborne laser scanning data: the method and an example for Pavia (Northern Italy). Computers and Geosciences 30 (2004) pp.325-331
  • Brovelli M. A. and Longoni U.M., 2003. Software per il filtraggio di dati LIDAR, Rivista dell'Agenzia del Territorio, n. 3-2003, pp. 11-22 (ISSN 1593-2192).
  • Brovelli M. A., Cannata M. and Longoni U.M., 2002. DTM LIDAR in area urbana, Bollettino SIFET N.2, pp. 7-26.
  • Performances of the filter can be seen in the ISPRS WG III/3 Comparison of Filters report by Sithole, G. and Vosselman, G., 2003.

πŸ¦‹ SEE ALSO πŸ¦‹

v.lidar.growing, v.lidar.correction, v.surf.bspline, v.surf.rst, v.in.pdal, v.in.ascii


πŸ’– AUTHORS πŸ’–

Original version of program in GRASS 5.4:

Maria Antonia Brovelli, Massimiliano Cannata, Ulisse Longoni and Mirko Reguzzoni

Update for GRASS 6.X:

Roberto Antolin and Gonzalo Moreno


⭐ SOURCE CODE ⭐

Available at: v.lidar.edgedetection source code (history)

Latest change: Friday May 09 14:33:40 2025 in commit: b356c7e108fcbeca77474c8e83ebec8f1e7b3e4a

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index


and that's the whole manual bestie, we ate and left no crumbs 🫢✨ the docs live at GRASS 8.5.0 Reference Manual, Β© 2003-2026 GRASS Development Team, and this little love letter to edge detection is running on GRASS 8.5.0. go classify some pulses for me. periodt. πŸ’…πŸŒˆ

πŸ“¦ where this page comes from