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
478 stars 168 forks source link

pc_align, add flag to skip initial alignment #416

Closed jlaura closed 7 months ago

jlaura commented 7 months ago

Is your feature request related to a problem? Please describe.

Runtimes for pc_align can be long. This is not a big deal and is expected as the size of the point cloud increases. When one is attempting an exceptionally large alignment, (over 1/2 the planet in extent) pc_align will spend hours attempting to compute the intersection of the bounding boxes for the reference and source point clouds. It will then fail because of the large size.

2023-11-20 12:23:40 {0} [ console ] : Will use datum (for CSV files): Geodetic Datum --> Name: D_MARS  Spheroid: MARS  Semi-major axis: 3396190  Semi-minor axis: 3396190  Meridian: Reference Meridian at 0  Proj4 Str: +a=3396190 +b=3396190
2023-11-20 12:23:40 {0} [ console ] : Computing the intersection of the bounding boxes of the reference and source points using 9000000 sample points.
2023-11-21 06:52:01 {0} [ console ] : Warning: Your input point clouds are spread over more than half the planet. It is suggested that they be cropped, to get more accurate results. Giving up on estimating their bounding boxes and filtering outliers based on them.
2023-11-21 06:52:02 {0} [ console ] : Reference box: (Origin: (1.79769e+308, 1.79769e+308) width: 0 height: 0)
2023-11-21 06:52:02 {0} [ console ] : Source box:    (Origin: (1.79769e+308, 1.79769e+308) width: 0 height: 0)
2023-11-21 06:52:02 {0} [ console ] : Intersection reference box:  (Origin: (1.79769e+308, 1.79769e+308) width: 0 height: 0)
2023-11-21 06:52:02 {0} [ console ] : Intersection source    box:  (Origin: (1.79769e+308, 1.79769e+308) width: 0 height: 0)
2023-11-21 06:52:02 {0} [ console ] : Intersection of bounding boxes took 66501.8 [s]

Looking at the time stamps, one can see that this step ran for hours (and hours and hours - 18 in all I believe 😆). The result is that pc_align gives up.

Describe the solution you'd like I would love to have a flag to simply disable this intersection check. I know that the point cloud and the DTMs align and so, outlier removal based on a bbox check is not needed.

Describe alternatives you've considered The most logical alternative is to leave the program as is, and just accept that a fair bit of the processing time will require checking (and failing) the bbox check.

Additional context None.

oleg-alexandrov commented 7 months ago

Jay, people who try to align half of the Moon are called Lunatics. :) For Mars, no such word was invented yet. :)

I added the option --skip-shared-box-estimation to pc_align (also to the doc). This should be in tomorrow's build.

jlaura commented 7 months ago

@oleg-alexandrov Many, many thanks! 2 day wall times can now be 12 hour wall times! 🚀

oleg-alexandrov commented 7 months ago

I made a small adjustment here, by ensuring the shared box of the two point clouds is not printed when --skip-shared-box-estimation is on, as it will just print an empty box which looks confusing.