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

aster2asp error? #353

Closed gyp-1991-gq closed 2 years ago

gyp-1991-gq commented 2 years ago

Why do I keep getting errors when I run aster2asp? 15f0100800c12fdd87e2c4c4a9fa713

oleg-alexandrov commented 2 years ago

Our own nightly build runs aster2asp just fine. I am not sure how you set up your environment. The libcspice.so.66 is being shipped, and in your case should be in lib/, if your aster2asp is in bin/. As a fallback measure, you can do export LD_LIBRARY_PATH=/path/to/your/lib:$LD_LIBRARY_PATH, but normally this should not be necessary.

If all fails, you can try getting a new tarball from https://github.com/NeoGeographyToolkit/StereoPipeline/releases, untar it somewhere, and use it from that location.

gyp-1991-gq commented 2 years ago

Thank you very much! Does this have to be PYTHon3.6 with conda?

oleg-alexandrov commented 2 years ago

Yes, I think only Python 3.6 will work. That is a restriction of some of our dependencies, and I don't know the details.

I don't think that should be a problem, as coda allows each env to have its own python version, if I recall.

If this becomes a pain I will suggest as before you fetch a tarball. Note that that one includes a python 3.6 runtime, but is self-contained so should not mess up your own system.

gyp-1991-gq commented 2 years ago

ok! Thank you very much!

gyp-1991-gq commented 2 years ago

I have successfully installed ASP. The error as shown in the figure appeared when I was processing ASTER remote sensing image. Why is that? 12f3207c86d2bc1d234c6a5fd7a7fe2

oleg-alexandrov commented 2 years ago

Nice self-portrait in your screenshot. :)

Your log does not provide enough information. Try to execute that failing command on the last, line, so

/home/gyp/StereoPipeline/libexec/stereo_parse -t aster ...

It failed quite badly with no output at all.

You can also execute the same way

/home/gyp/StereoPipeline/bin/stereo_pprc -t aster ...

This will avoid parallel_stereo and stereo_parse, but will call the wrapper around stereo_pprc while setting up all the right env variables, which the libexec/stereo_parse call does not.

Among these two maybe some error message can be discerned.

xinluo2018 commented 2 years ago

I have successfully installed ASP. The error as shown in the figure appeared when I was processing ASTER remote sensing image. Why is that? 12f3207c86d2bc1d234c6a5fd7a7fe2

I also encountered this problem, does anyone have resolved it?

gyp-1991-gq commented 2 years ago

yes,you keyijiawoqq 984975164

oleg-alexandrov commented 2 years ago

I don't know based on the information I get. I will suggest executing the stereo_parse command which fails, as above:

/your/path/libeexec/stereo_parse -t aster ... 

and see if a fuller error message gets encountered, which perhaps you can share. 

It is likely a system issue. You can also share what Linux distribution you are running.

One can also run ASP from the tarball, as obtained from the GitHub release site, and not with conda.

xinluo2018 commented 2 years ago

thanks for responding. when i run /your/path/libeexec/stereo_parse -t aster ... , the error still exist as:

Screen Shot 2022-01-18 at 9 04 42 AM

and my computer operation system is Mac OS version 12.1. moreover, I also try running the paralle_stereo command from the traball, the same error occurs.

oleg-alexandrov commented 2 years ago

Ah. Our Mac version is 11.6.2. Normally it should run on yours as well. Maybe you have the non-Intel CPU, then yeah, ASP was not ported to that yet.

xinluo2018 commented 2 years ago

Actually, i used the intel CPU, and my computer processer is Intel Core i5.

oleg-alexandrov commented 2 years ago

Thank you for letting me know. I honestly don't know what to say. I see from your prompt that you are in the "asp" conda env, which is how it should be.

I wonder if other tools are crashing. You can try to "cd" into your miniconda3/envs/asp/bin directory and then do:

./zstd --help

./map2map --help

./gdal_translate --help

./hillshade --help

./stereo_pprc --help

Some of these tools are not even compiled by us. I am trying to understand if something is very wrong with conda on your system, or our own tools are built badly. The last two tools above are ours.

If no luck whatsoever, maybe you have a Linux box lying around, at least as a VM. I know it is not a great solution, I am just running out of ideas.

xinluo2018 commented 2 years ago

Thanks for replying. when I check the commands as you mentioned, the outputs are:

Screen Shot 2022-01-20 at 11 14 33 AM Screen Shot 2022-01-20 at 11 15 04 AM Screen Shot 2022-01-20 at 11 15 16 AM Screen Shot 2022-01-20 at 11 15 33 AM Screen Shot 2022-01-20 at 11 15 54 AM

I have re-installed the the isis and isisdata, and still could't resolve this problem.

oleg-alexandrov commented 2 years ago

This is all very good. Now you can "cd" to your data dir and do

~/miniconda3/envs/asp/bin/stereo_pprc --help

(This is the same command as the last one you had, but run from your data dir.) If this goes well, then you can do also in your data dir:

~/miniconda3/envs/asp/bin/stereo_pprc -t aster --subpixel-mode 3 out-band3N.tif ....

so basically your previous command you ran some time earlier, but with stereo_pprc instead of stereo_parse.

I am starting to guess that maybe the --help command will work and the -t aster command will fail, which will mean your conda installation is good but our code has a bug. Then I would have to fetch a dataset and run it myself. It has been a while since we worked with ASTER data.

I did try to get one dataset, following the instructions at https://stereopipeline.readthedocs.io/en/latest/examples.html#aster, but that fetched archive lacks VNIR data, rather it has TIR data, whatever these may mean.

Anyhow, waiting to hear if any of those two commands above running in your data dir would crash or not.

xinluo2018 commented 2 years ago

thank you for your kind reply. a new bug exists when i use: ~/miniconda3/envs/asp/bin/stereo_pprc -t aster --subpixel-mode 3 out-band3N.tif .... if you need an aster data for trying the parallel_stereo function, I can send my data to you through email. it is noticeable that according to the asp document, the command line: parallel_stereo -t rpc --subplixe-mode 3 ... could run successfully. however, the command line: parallel_stereo -t aster --subplixe-mode 3 ... always fails.

Screen Shot 2022-01-20 at 2 11 14 PM
xinluo2018 commented 2 years ago

i also try the command line on my ubuntu 18 computer, the same bug occurs.

oleg-alexandrov commented 2 years ago

I appreciate your patience. This was actually a serious bug. We also did not run any ASTER dataset in our nightly tests, which I fixed now. (We had only a testcase for aster2asp, and not for stereo with the resulting images.)

I put a fix. It will be in build 2022-01-21 at https://github.com/NeoGeographyToolkit/StereoPipeline/releases in maybe 12 hours from now.

The results of of running stereo with -t aster and -t rpc are quite similar now. Some small shift is seen among the DEMs but that is expected.

xinluo2018 commented 2 years ago

Thank you for your patience too. I will follow the latest version of asp tool. The asp document says with -r aster is more accurate in DEM generation, thus I insist on performing the DEM processing with -r aster even though I don't know what's the difference between these two methods.

oleg-alexandrov commented 2 years ago

You should also try --stereo-algorithm asp_mgm. This is a newer option (and I put a mention now in the aster manual page), and with it the ASP DEM shows more detail.

xinluo2018 commented 2 years ago

hi, I updated the latest asp version by using conda install..., however, the same bug still exists when i use parallel_stereo -t aster..., are you sure that the bug has been fully fixed, or any mistake in my implementation.

oleg-alexandrov commented 2 years ago

The conda build did not change. Sorry that was not clear. You should fetch a build from https://github.com/NeoGeographyToolkit/StereoPipeline/releases

This does not use conda, it has the build in an archive. It needs to be unzipped, and run from that location without installation. There is more info here: https://stereopipeline.readthedocs.io/en/latest/installation.html

xinluo2018 commented 2 years ago

The new asp version may be should be notarized thus my mac os could open some of the programs. when i run the parallel_stereo -t aster, the warning exits: “stereo_parse” cannot be opened because the developer cannot be verified. macOS cannot verify that this app is free from malware.

oleg-alexandrov commented 2 years ago

Uh. I did not see this one before. Our software, according to its license, is a "use at your own risk" kind of thing (https://github.com/NeoGeographyToolkit/StereoPipeline/blob/master/LICENSE#L153). So not sure about the "notarization" part. :)

Maybe you need to ask your system administrator for advice and/or permission to run it.

xinluo2018 commented 2 years ago

hi, i have tried the code in my Ubuntu 18.4 computer, a new bug exits as.

Screen Shot 2022-01-24 at 11 06 31 AM
oleg-alexandrov commented 2 years ago

Congratulations. You found another bug. Sorry about that. The reason I did not catch it on my side since the nightly test I set up runs on a clip, and I was not aware a certain camera loading gets done differently for full images.

I put a fix. You can do one of three things:

This will cut a clip out of your images with just the first column removed. You will get a correct DEM, just a tiny bit smaller. I am very sure this will work with your build, and maybe it is good enough till the real fix arrives.

mkdir -p ba echo 0 0 0 > ba/run-out-Band3N.adjust echo 1 0 0 0 >> ba/run-out-Band3N.adjust echo 0 0 0 > ba/run-out-Band3B.adjust echo 1 0 0 0 >> ba/run-out-Band3B.adjust

Then run stereo as:

parallel_stereo -t aster --subpixel-mode 3 out-Band3N.tif out-Band3B.tif out-Band3N.xml out-Band3B.xml out_stereo/run --bundle-adjust-prefix ba/run

All this does is to pretend that bundle adjust happened and the adjustment is the 0 0 0 translation and 1 0 0 0 quaternion.