Powerline Detection¶
occulus.segmentation.powerlines
¶
Powerline detection — wire and pylon extraction from point clouds.
Detects power transmission and distribution lines from classified LiDAR point clouds by combining height-above-ground filtering with geometric feature analysis (linearity, planarity, verticality). Wire candidates exhibit high linearity while pylon candidates exhibit high verticality and spatial clustering. Optionally fits catenary curves to wire segments and checks minimum ground clearance.
CatenarySegment
dataclass
¶
A single fitted catenary curve representing one wire span.
Attributes:
| Name | Type | Description |
|---|---|---|
indices |
NDArray[intp]
|
Indices into the original point cloud for points in this segment. |
a |
float
|
Catenary shape parameter (lower = more sag). |
x0 |
float
|
Horizontal offset of the catenary vertex. |
z0 |
float
|
Vertical offset of the catenary vertex. |
rmse |
float
|
Root-mean-square error of the catenary fit in coordinate units. |
Source code in src/occulus/segmentation/powerlines.py
ClearanceViolation
dataclass
¶
A location where a wire segment is below the minimum clearance.
Attributes:
| Name | Type | Description |
|---|---|---|
point_index |
int
|
Index into the original point cloud. |
height_above_ground |
float
|
Actual height above ground at this point (coordinate units). |
min_clearance |
float
|
Required minimum clearance that was violated. |
Source code in src/occulus/segmentation/powerlines.py
PowerlineResult
dataclass
¶
Result of powerline detection.
Attributes:
| Name | Type | Description |
|---|---|---|
wire_mask |
NDArray[bool_]
|
Per-point boolean mask identifying wire points. |
pylon_mask |
NDArray[bool_]
|
Per-point boolean mask identifying pylon/tower points. |
wire_segments |
list[CatenarySegment]
|
List of detected wire segments with optional catenary fits. |
pylon_positions |
NDArray[float64]
|
Centroid positions of detected pylons as (M, 3) array. |
clearance_violations |
list[ClearanceViolation]
|
Locations where wires are below the minimum clearance threshold. |
Source code in src/occulus/segmentation/powerlines.py
detect_powerlines(cloud, *, min_height_above_ground=3.0, max_height_above_ground=50.0, linearity_threshold=0.7, ground_class=2, catenary_fit=True, min_clearance=None, strict=True, min_wire_span=50.0, max_pylon_xy_extent=5.0, min_pylon_z_extent=8.0, max_wire_height_std=3.0, pylon_association_radius=10.0)
¶
Detect powerline wires and pylons in a classified point cloud.
The algorithm:
- Separate ground (
ground_class) from non-ground using the cloud'sclassificationattribute. - Interpolate a ground surface and compute height-above-ground (HAG) for every non-ground point.
- Filter candidates by the HAG height band.
- Compute per-point geometric features (linearity, planarity, verticality) via PCA on local KDTree neighbourhoods.
- Classify wire candidates (high linearity) and pylon candidates (high verticality, low linearity, spatially clustered).
- Cluster wire candidates with DBSCAN into individual wire segments.
- Optionally fit catenary curves to each wire segment.
- Optionally flag clearance violations where wires are below
min_clearance.
When strict=True (the default), additional false-positive
reduction filters are applied:
- Wire segment length: DBSCAN clusters whose 3D extent is
shorter than
min_wire_spanare rejected (building edges, fences). - Pylon geometry: Pylon clusters whose XY bounding box exceeds
max_pylon_xy_extentor whose Z extent is less thanmin_pylon_z_extentare rejected (buildings, tree crowns). - Height band consistency: Wire clusters whose height standard
deviation exceeds
max_wire_height_stdare rejected (tree crowns with scattered points). - Wire–pylon association: Wire segments whose endpoints are
not within
pylon_association_radiusof a detected pylon are downgraded (removed from the confirmed wire mask but retained as segments withrmse=inf).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cloud
|
PointCloud
|
Input point cloud. Must have a |
required |
min_height_above_ground
|
float
|
Minimum height above the interpolated ground surface for a point to be considered a powerline candidate, by default 3.0. |
3.0
|
max_height_above_ground
|
float
|
Maximum height above ground, by default 50.0. |
50.0
|
linearity_threshold
|
float
|
Minimum linearity value (0--1) for a point to be classified as a wire candidate, by default 0.7. |
0.7
|
ground_class
|
int
|
ASPRS classification code for ground points, by default 2. |
2
|
catenary_fit
|
bool
|
If |
True
|
min_clearance
|
float | None
|
If provided, flag wire points whose HAG is below this value as
clearance violations, by default |
None
|
strict
|
bool
|
If |
True
|
min_wire_span
|
float
|
Minimum horizontal extent (metres) for a wire DBSCAN cluster to
be accepted. Only used when |
50.0
|
max_pylon_xy_extent
|
float
|
Maximum XY bounding box size (metres) for a pylon cluster.
Clusters wider than this are rejected as buildings. Only used
when |
5.0
|
min_pylon_z_extent
|
float
|
Minimum Z extent (metres) for a pylon cluster. Clusters shorter
than this are rejected. Only used when |
8.0
|
max_wire_height_std
|
float
|
Maximum standard deviation (metres) of Z values within a wire
cluster. Clusters exceeding this are rejected. Only used when
|
3.0
|
pylon_association_radius
|
float
|
Maximum distance (metres) from a wire segment endpoint to the
nearest pylon centroid for the segment to be considered
connected. Only used when |
10.0
|
Returns:
| Type | Description |
|---|---|
PowerlineResult
|
Detection results including wire/pylon masks, segments, pylon positions, and optional clearance violations. |
Raises:
| Type | Description |
|---|---|
OcculusSegmentationError
|
If the cloud has no classification array, too few ground points for interpolation, or no powerline candidates are found. |
Source code in src/occulus/segmentation/powerlines.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 | |