feat(perception): terrain roughness estimator via Gabor + LBP (Issue #296) #305
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "sl-perception/issue-296-terrain-rough"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
_terrain_roughness.py:RoughnessResultNamedTuple;gabor_energy()with 4-orientation × 2-wavelength (5px, 10px) quadrature Gabor bank — DC removal via image mean subtraction prevents false energy on uniform surfaces;lbp_variance()using 8-point radius-1 LBP in vectorised NumPy slice comparisons (no sklearn dep);estimate_roughness()crops to bottomroi_fracof frame, blends normalised Gabor energy and LBP variance to a [0, 1] roughness scoreterrain_rough_node.py: subscribes/camera/color/image_raw(BEST_EFFORT), publishesFloat32 /saltybot/terrain_roughnessat 2 Hz (configurable viapublish_hz);roi_fracparam default 0.40 (bottom 40% = floor region)terrain_roughnessconsole script insetup.pyImplementation note
Standard Gabor filters (ψ=0) are not zero-mean when truncated at a finite kernel size, so they produce non-zero responses on constant images. DC removal (
img -= img.mean()before filtering) is the standard fix used in texture analysis literature, and is applied here.Test plan
python3 -m pytest test/test_terrain_roughness.py -v→ 37 passedros2 run saltybot_bringup terrain_roughness/saltybot/terrain_roughness≈ 0.0 on a smooth tile floor/saltybot/terrain_roughness> 0.5 on gravel/carpetroi_fraclimits analysis to bottom portion of frame🤖 Generated with Claude Code