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
479 stars 169 forks source link

Ray to DEM intersection #267

Closed oleg-alexandrov closed 10 months ago

oleg-alexandrov commented 5 years ago

The function for intersecting a ray with a DEM minimizes the distance from a point on the ray to its vertical projection onto the DEM. I managed to find a situation where it was stuck in a local minimum, presumably on a high hill the closest local distance from the ray to the DEM was achieved, though if one keeps on traveling on the ray, for a while the distance from the ray to the DEM will increase again, and then it will decrease to 0 when the ray intersects it. Need to use here an algorithm for solving f(x) = 0 rather than for minimizing f(x)^2.

oleg-alexandrov commented 3 years ago

Also note that tweaked version in cam_gen.cc, which is an improvement but not enough. Once the main code is fixed, the fork in cam_gen.cc needs to be removed and the main code should be used instead.

oleg-alexandrov commented 10 months ago

This algorithm got replaced by a root-finding algorithm (secant method). The new method is also faster.