NeoGeographyToolkit / StereoPipeline

The NASA Ames Stereo Pipeline is a suite of automated geodesy & stereogrammetry tools designed for processing planetary imagery captured from orbiting and landed robotic explorers on other planets.
Apache License 2.0
492 stars 173 forks source link

heights-from-dem and weighting by local slope #298

Closed jchollingsworth closed 2 years ago

jchollingsworth commented 4 years ago

Hi again... I was just thinking about --heights-from-dem in bundle_adjust.

In the situation when the reference dem is lower resolution than the imagery being adjusted (e.g. using srtm 30m with WV imagery), AND when there is both rough and flat topography in the area (e.g. mountains and basin), the cost will be dominated by residuals in the steep sided mountains (especially when using hfd without fixing the extrinsics). However, in the basin, which is flat, hfd will give a better constraint, and the error is more likely to be useful for optimizing the cameras... however, the cost changes are likely to be smaller than for the mountainous area.

I know that heights-from-dem-weight can help with this... However, I was wondering if a slope map, derived from the reference dem, could also be used as an additional weighing constraint, adapting the weighting to the local topographic roughness? Where it's flat, the hfd weight will be higher, and where it's steep, the weighting will be lower. One could also specify the approximate resolution difference between the raw images and reference DEM, which could also be used in the weighting (when there's a big difference, the topographically rougher areas should be weighted lower). Some effort would be needed to decide on how to weight these things though. This would involve some research I think! You won't want to hear that. Some day...

I also think this could help for bundle_adjusting lots of images together.

Just a thought.

oleg-alexandrov commented 2 years ago

This looks like a lot of work. For now indeed one can use --heights-from-dem-weight to give less weight to the DEM when it is less reliable, together with --heights-from-dem-robust-threshold, which decides what a reasonable discrepancy between the triangulated point and the DEM is, after being multiplied by the weight. So, if your image resolution is 1 m pixel, and the DEM uncertainty is 10 meters, likely making the weight 0.1 and the robust threshold maybe 1.0 should do the trick. Where the slopes are steep, the discrepancy will be big but kept in check by the robust threshold. I know that this is not what you are asking for, but this looks feasible at the current time.