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

Missing bands in D.tif with parallel_stereo #369

Closed adehecq closed 2 years ago

adehecq commented 2 years ago

Describe the bug We discussed this Oleg, but since the latest release, D.tif files generated by parallel_stereo (that are actually a VRT file pointing to individual tile results) have gaps. See the example below:

image

To Reproduce This should work with any input image processed with parallel_stereo that has a size larger than the --corr-tile-size. In case this matters, I used nadirpinhole models with map-projected images.

Expected behavior There should not be any gaps in the D.tif file (see fix below).

Your Environment (please complete the following information):

Additional context I managed to fix the issue manually by editing the VRT file. The sizes of the individual sizes reported is always the same as corr-tile-size, but it ignores the buffer around each tile. For example, line \ Should be \ With a buffer of 512 pixels.

Here is the result with the fixed VRT file. image

I don't know if that can impact the rest of parallel_stereo? The RD.tif files seem complete.

I will send a link to download the example data as soon as I get a better internet connection.

dshean commented 2 years ago

This looks familiar, though I seem to remember seeing gaps in the D_sub.tif - is that true for your case @adehecq?

oleg-alexandrov commented 2 years ago

I think these are different issues and as I recall I fixed David's one. I will be back from vacation next week and will look at the D.tif problem. Note that F.tif should be fine though.

On Wed, Jul 6, 2022, 5:46 AM David Shean @.***> wrote:

This looks familiar, though I seem to remember seeing gaps in the D_sub.tif - is that true for your case @adehecq https://github.com/adehecq?

— Reply to this email directly, view it on GitHub https://github.com/NeoGeographyToolkit/StereoPipeline/issues/369#issuecomment-1176382928, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKDU3AAVRUY2QS5CM5MCATVSWS3ZANCNFSM522DX72Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

adehecq commented 2 years ago

Here's the link to download sample data set (valid until August 6).

Yes, I think it's only a visualization issue, but might be good to check. I don't know how the VRT file is created within ASP, but it looks like it's just an issue in the content of the file, so should be easy to fix.

adehecq commented 2 years ago

I quickly compared to a file created by version 3.0.0, and actually what changed since the update is the added lines: \

With these lines deleted, the band artifacts also disappear.

oleg-alexandrov commented 2 years ago

These lines were needed to solve the "too many open files" bug. All this is gdal vrt quirkiness. Maybe the solution is to rewrite D.tif from vrt format. Thank you for the test case.

adehecq commented 2 years ago

Oh ok. Then, as I suggested, try replacing the RasterXSize and RasterYsize with the actual tile size (with buffer) rather than the corr-tile-size value. This fixed the issue on my test case.

oleg-alexandrov commented 2 years ago

I put a fix. It will be in tomorrow's build. I verified that gdal_translate now extracts correctly the bands from D.tif.

I also took a look one more time at David's issue with D_sub and the code looks consistent with that unrelated problem being fixed.

dshean commented 2 years ago

Great! Thanks.

adehecq commented 2 years ago

Thanks a lot !