显示HN:通过差分解卷积在激光雷达DEM中探索特征检测
Show HN: Feature detection exploration in Lidar DEMs via differential decomp

原始链接: https://github.com/bshepp/RESIDUALS

## 残差:用于DEM特征检测的框架 RESIDUALS是一个新颖的框架,通过系统分解和差异分析来识别数字高程模型(DEM)中的特征。它利用25种分解方法(高斯、小波、形态学等)和19种上采样技术的多样组合,以突出不同的地形特征。 核心思想是,每种方法组合都以独特的方式保留或消除特定特征。通过计算这些输出之间的差异,RESIDUALS创建了特征特定的“提取过滤器”。生成的网格可视化这些组合,揭示了方法之间的一致、不一致以及与实际情况的对齐程度,从而有助于为地形、基础设施和变化检测等任务选择最佳方法。 该软件在GitHub上可用,包括从LiDAR数据生成测试DEM和详尽探索参数组合的工具。输出包括残差数组、差异图和可视化结果。RESIDUALS的设计具有可扩展性,具有GPU加速和与GIS工作流程集成的潜力。

一位具有人工智能/机器学习背景的开发者创建了一个工具,用于探索激光雷达数字高程模型 (DEM) 中的特征检测。该项目在Hacker News上分享,系统地测试了数千种信号分解方法(如高斯、小波等)和上采样技术的组合。 核心概念是,每种方法组合会根据其“失效模式”揭示或隐藏特定的地形特征。通过比较输出结果,用户可以有效地过滤激光雷达数据中所需特征。 该框架使用Python库(如NumPy和OpenCV)构建,并提供了一个可视化网格以便于比较。开发者正在寻求地理空间专家的反馈,以完善该工具并识别潜在的疏漏,因为他们是这个领域的初学者。代码在GitHub上以Apache 2.0许可协议提供。
相关文章

原文

A framework for feature detection in Digital Elevation Models using systematic decomposition and differential analysis.

Sample Output

RESIDUALS systematically tests combinations of signal decomposition and upsampling methods to identify which combinations best reveal features in elevation data. The core insight:

Different method combinations have characteristic behaviors that selectively preserve or eliminate different feature types. By computing differentials between outputs, we create feature-specific extraction filters.

The 4-Level Differential Hierarchy

Level What It Shows Column
0 Ground truth (hillshade) DEM
1 Decomposition residuals bicubic, lanczos, bspline, fft
2 Residual vs ground truth Δbic, Δlan, Δbsp, Δfft
3 Divergence across methods Div
4 Meta-divergence (uncertainty of uncertainty) ΔDiv
# Clone and install
git clone https://github.com/bshepp/RESIDUALS.git
cd RESIDUALS
pip install -r requirements.txt

# Run with included test DEM
python run_experiment.py

# Or generate your own from LiDAR
python generate_test_dem.py --lidar-dir /path/to/las/files --grid-rows 4 --grid-cols 4
python run_experiment.py --dem data/test_dems/your_dem.npy
Method How It Works Good For
Gaussian Local blur → subtract Smooth gradients, valleys
Bilateral Edge-preserving blur Features with sharp boundaries
Wavelet Multi-scale frequency separation Scale-specific features
Morphological Shape-based opening/closing Peaks, ridges, depressions
Top-Hat Small feature extraction Small isolated features
Polynomial Global surface fitting Regional-scale variations

Extended methods include: anisotropic Gaussian, median, DoG, LoG, guided filter, anisotropic diffusion, rolling ball, and multiple structuring element shapes.

Method Characteristics
Bicubic Balanced baseline (order 3)
Lanczos Sharper edges, some ringing
B-Spline Smoother (order 2)
FFT Zero-pad Band-limited, Gibbs ringing at edges

Extended methods include: nearest, bilinear, quadratic, quartic, quintic, windowed sinc (Hamming, Blackman), Catmull-Rom, Mitchell-Netravali, and edge-directed interpolation.

Exhaustive Parameter Exploration

# Run all 39,731 parameter combinations
python run_exhaustive.py --output results/exhaustive

# Limited test run
python run_exhaustive.py --max-decomp 2 --max-upsamp 2

Generates comprehensive documentation of all method combinations with statistics and hashes.

The main output is a grid showing:

  • Rows: Decomposition methods
  • Columns: Upsampling methods + ground truth comparisons + divergence metrics

Each cell reveals different features. The Δ columns show where each method matches or misses ground truth features. The divergence columns show where methods disagree — useful for identifying features that are method-sensitive.

RESIDUALS/
├── src/
│   ├── decomposition/     # 25 decomposition algorithms
│   ├── upsampling/        # 19 upsampling methods  
│   ├── analysis/          # Differential computation, feature detection
│   └── utils/             # Visualization, I/O
├── data/test_dems/        # Sample DEMs
├── results/
│   ├── combinations/      # Raw residual arrays (.npy)
│   ├── differentials/     # Pairwise differences
│   ├── visualizations/    # Output images (timestamped)
│   └── debug_archive/     # Bug documentation
├── generate_test_dem.py   # Create DEM from LiDAR tiles
├── run_experiment.py      # Main experiment runner
└── run_exhaustive.py      # Full parameter space exploration

Feature detection in:

  • Terrain analysis — ridges, valleys, drainage patterns
  • Infrastructure — roads, embankments, foundations
  • Natural features — geological formations, vegetation patterns
  • Change detection — comparing DEMs over time
  • Quality assessment — identifying artifacts in elevation data

Different decomposition methods excel at different feature types — the grid visualization helps identify which combination works best for your specific use case.

  • Edge artifacts: Morphological methods show artifacts where terrain is cut off at image boundaries
  • Polynomial regional-scale: Polynomial decomposition captures regional trends, not local features
  • Memory usage: Large DEMs (>4000×4000) produce very large visualization files

See results/debug_archive/README.md for documented bugs and fixes.

Contributions welcome. Areas of interest:

  • Additional decomposition methods
  • GPU acceleration for large DEMs
  • Machine learning feature classifiers
  • Integration with GIS workflows

If you use RESIDUALS in research, please cite:

@software{residuals2025,
  title={RESIDUALS: Multi-Method Differential Feature Detection},
  author={bshepp},
  year={2025},
  url={https://github.com/bshepp/RESIDUALS}
}

Apache License 2.0

  • Sample LiDAR data: Connecticut Environmental Conditions Online (CT ECO)
  • Built in CUrsor with: Opus 4.5, NumPy, SciPy, scikit-image, PyWavelets, OpenCV, Matplotlib
联系我们 contact @ memedata.com