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

Weird disparity map when stereo_corring images with SGM algorithm #293

Closed ghtao00 closed 10 months ago

ghtao00 commented 4 years ago

I am trying to stereo_corr two images(3m resolution) using SGM algorithms, but get weird disparity map, which is quite different from the image. I have no idea what's going wrong. The followings are the disparity map, L image and R image, stereo.default file. 1.Disparity map (Horizon, dark region means -50 pixel, and bright region is +50 pixel, but the region is very flat): Disparity map 2.L image: L 3.R image: R stereo-default.txt

ScottMcMichael commented 4 years ago

The disparity result looks like it failed to find the correct disparity range for the image, so something important is going wrong. Check through the stereo steps to see where things are going wrong, starting with the alignment results in the log file. Then you can look at the -L.tif and -R.tif aligned images, figure out a realistic disparity value, and see if that fits within the computed disparity range in the log file. Once you identify which step failed we can debug why it failed.

ghtao00 commented 4 years ago

Examined the -L.tif and -R.tif , and they had almost same y value (within +-3, alignment-methods is affineeppipolar) , which meant the pprc step was ok. Got realistic disparity range from the two tif, and set it by corr-search, and got similar shape disparity map but with different disparity value. I also tried census cost_type, and got different diaparity value. Wondering if some parameters were not set properly, such as p1/p2 or others.

ScottMcMichael commented 4 years ago

It should not be that sensitive to the p1/p2 values though I can check that later. Next I would try changing the following options:

prefilter-mode = comment out force-use-entire-range = comment out corr-kernel = 7 7 subpixel-mode = comment out

After you run with those check the disparity step outputs ( -D_sub.tif and -D.tif). If they still look bad can you send me the input files for me to test with?

ghtao00 commented 4 years ago

Thanks. I changed the options as suggested, but the disparity map changed little. I tested the census transform mode, and got better results in mountain region, but still not enough. Tried to upload the goodPixelMap.tif and disparitymap, but failed for network reason. You can tell or send me your email if possible, and I will send the related files to you to check in detail. My email is ghtao00@hotmail.com. Thank you.

ScottMcMichael commented 4 years ago

Is there somewhere you can host the input images/camera models for me to download? You can email them to scott.t.mcmichael@nasa.gov but that won't work unless they are relatively small.