Using disparity maps for quality assessment

45 views
Skip to first unread message

Ananya Pandey

unread,
Jun 1, 2023, 10:39:01 AM6/1/23
to Ames Stereo Pipeline Support
Hi everyone,

I have a bunch of DEMs that I have created using the Ames Stereo Pipeline. I am trying to assess the quality of the DEMs created and have been thinking to use the horizontal and vertical components of disparity values as one of the metrics for this purpose. 

I would like to have normalized values of disparities for which I am trying to use the "--normalized" command within the "disparitydebug" tool. Is there a way to figure out what could be the best min/max values to use in this case? I would need this to produce colored normalized vertical and horizontal disparity maps for quality assessment.

Looking forward to the responses!

Oleg Alexandrov

unread,
Jun 1, 2023, 12:07:46 PM6/1/23
to Ames Stereo Pipeline Support
There is no simple way of estimating disparity bounds because the disparity measures the displacement from one image to another. If not using mapprojected images, that one can be large for a hilltop, for example, in proportion to its height.

So I guess the first step may be to get an intuition about the variability in your dataset by examining some of the output products. One can avoid disparitydebug altogether, and pull the horizontal and vertical disparity with gdal_translate -b 1, for example, and those could be plotted separately in stereo_gui (also colorized with --min and --max, if desired, per https://stereopipeline.readthedocs.io/en/latest/tools/stereo_gui.html#displaying-colorized-images-with-a-colorbar-and-axes).

The gdalinfo -stats tool can be used to find the stats for each band of your disparity, such as mean and stddev. Then one could perhaps use as bounds mean - 2 *stddev, mean + 2 *stddev or something along those lines.

David Shean

unread,
Jun 1, 2023, 12:45:23 PM6/1/23
to Oleg Alexandrov, Ames Stereo Pipeline Support
Hi Ananya,
If you are familiar with Python and matplotlib, you could consider some of the plotting utilities we’re assembling to standardize ASP output visualization for diagnostic purposes and figure preparation: https://github.com/uw-cryo/asp_plot.

See https://github.com/uw-cryo/asp_plot/blob/main/disparity_plot.ipynb.  Just substitute your disparity file (*-F.tif or *-D.tif or *-RD.tif).

By default, this approach computes the 2nd and 98th percentile of the combined disparity magnitude, then computes symmetrical bounds about 0, and uses those  bounds for the colorbar of the x and y disparities.  This could be modified to compute percentiles for individual bands.

We’re hoping to expand and improve these utilities over the summer, and welcome contributions.  Potentially even considering coordinating a sprint, so reach out if interested!
-David




--
David Shean
Civil and Environmental Engineering
University of Washington
https://www.ce.washington.edu/facultyfinder/david-shean 

201 More Hall, Box 352700
3760 E. Stevens Way NE
Seattle, WA 98195-2700
Office: (206) 543-3105, Wilcox Hall 265
Pronouns: he, him, his

--
You received this message because you are subscribed to the Google Groups "Ames Stereo Pipeline Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ames-stereo-pipeline...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ames-stereo-pipeline-support/4bf44990-f138-4311-a8b2-6882bc83ba77n%40googlegroups.com.

Ananya Pandey

unread,
Jun 5, 2023, 3:32:33 PM6/5/23
to Ames Stereo Pipeline Support
Thanks, Oleg and David!

This was very useful. The "disparity_plot.ipynb" has helped me understand and visualize this better. But, in my case, I guess computing symmetrical bounds about 0 has not worked very well. The histogram of my horizontal disparity shows only negative values along with places showing no (zero) disparity and my vertical disparity histogram, on the other hand, shows only positive values along with some places displaying zero vertical disparity. I had to modify the colorbar of x and y disparities based on these values. 

It would be nice to join in to help expand these utilities. Let me know how I can reach out to you!



Oleg Alexandrov

unread,
Jun 8, 2023, 12:15:03 PM6/8/23
to Ames Stereo Pipeline Support
>  The histogram of my horizontal disparity shows only negative values along with places showing no (zero) disparity and my vertical disparity histogram, on the other hand, shows only positive values along with some places displaying zero vertical disparity

This is all very data-dependent. And if the two images are swapped some of these will flip. Also depends on if you do alignment or not. The smallest disparities are obtained with mapprojected inputs, as that eliminate the large difference between left and right images.
Reply all
Reply to author
Forward
0 new messages