cli: grl-snam material-raster — segment satellite imagery into the material palette - #99
Merged
Merged
Conversation
…terial palette Promote the ad-hoc satellite->material generator into a first-class, reusable grl-snam command so any scene's satellite orthophoto can be turned into the material input the nav-stats scorecard + drive need (otherwise the grip/material columns are all-zero because a scene carries no material data). - material_palette: add GRIP_MU + TERRAIN_RISK (per-material dry grip mu + mobility risk) with grip_mu()/terrain_risk() accessors — the physical reading of the shared palette, keyed by id, so the segmenter and any consumer pull ONE table. open_air (roads/pavement/developed hard ground) is the full-grip / no-risk surface; the risk-bearing ids (mu<1) are exactly RISK_MATERIAL_IDS. - grl_snam.tools.material_raster: classify(), to_material_json(), generate(), from_bundle() — a deterministic color/index land-cover classifier (excess-green vegetation, warm-tan soil, dark-blue water, bright warm-gray rock, else the neutral open_air surface), oriented to the sim grid (row 0 == world min_y, matching nav_samplers/sim_world occupancy — the orthophoto is north-up so it flips y). Writes the cvc-scene-material/1 material.json (id grid + palette-sourced mu/risk). Reuses imageio (already a dep), not a new one. NOTE it never emits building materials: reinforced_concrete is a building-WALL RF class (not pavement), buildings are obstacles tagged from scene metadata. - cli: `grl-snam material-raster BUNDLE` (grid+bounds+image from terrain.json/satellite.png) or `--satellite + --rows + --cols + --bounds` for any other orthophoto; -o/--out, --preview. Tests (5): classifier tags + the y-flip, palette-sourced mu/risk in material.json, grip/risk defaults + RISK_MATERIAL_IDS consistency, generate + preview, from_bundle. Verified byte-identical to the prototype on the Austin bundle (open_air 58% / foliage 31% / soil 9% / water 1.3% / rock 0.6%).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promote the satellite→material segmenter (used to generate the Austin scene's material raster) into a first-class, reusable
grl-snamcommand, so any scene's satellite orthophoto can be turned into the material input the nav-stats scorecard + drive need. A scene that carries no material data leaves gripmu=1 /mrisk=0 and thematerial_time_sharebuckets empty; this generates the raster that fixes that.What
material_palette:GRIP_MU+TERRAIN_RISK(per-material dry grip + mobility risk) +grip_mu()/terrain_risk()accessors — the physical reading of the shared palette, keyed by id, so the segmenter and any consumer read one table.open_air(roads/pavement/developed hard ground) is the full-grip/no-risk surface; the risk-bearing ids are exactlyRISK_MATERIAL_IDS.grl_snam.tools.material_raster:classify/to_material_json/generate/from_bundle— a deterministic color/index land-cover classifier (excess-green vegetation, warm-tan soil, dark-blue water, bright warm-gray rock, else the neutralopen_airsurface), oriented to the sim grid (row 0 == worldmin_y, matchingnav_samplers/sim_worldoccupancy — the orthophoto is north-up so it flips y). Writescvc-scene-material/1material.json. Reusesimageio(already a dep).grl-snam material-raster BUNDLE(grid+bounds+image fromterrain.json/satellite.png), or--satellite + --rows + --cols + --boundsfor any other orthophoto;-o/--out,--preview.Palette note: the segmenter never emits building materials —
reinforced_concreteis a building-wall RF class (penetration-loss dB inMATERIAL_TABLE), not pavement, and buildings are obstacles tagged from scene metadata, so the ground classifier only emitsopen_air/foliage/soil/water/rock.Tests
5 tests: classifier tagging + the y-flip, palette-sourced mu/risk in
material.json, grip/risk defaults +RISK_MATERIAL_IDSconsistency,generate+preview,from_bundle. Verified byte-identical to the prototype on the Austin bundle (open_air 58% / foliage 31% / soil 9% / water 1.3% / rock 0.6%).Feeds the item-2 material-aware scoring chain: cvcdbg PR-2 (the Austin data) now comes from this command; the cvcdbg harness (PR-3a, #135) + demo3 load the
material.jsonit writes.