How to handle the saturated areas in 8-bit stereo images

3 views
Skip to first unread message

Haruki Hagiwara

unread,
Mar 20, 2026, 6:39:21 AM (6 days ago) Mar 20
to Ames Stereo Pipeline Support
Dear ASP community,

I have a question regarding ASP’s internal processing of saturated regions (typically on ice) in SPOT5, which is an 8-bit stereo image. As shown in the your example, I am converting SPOT5 stereo images into a point cloud using `bundle_adjust`, `add_spot_rpc`, `mapproject`, and `parallel_stereo`. I have two questions regarding this.

When converting an 8-bit image using `mapproject` with camera information and a reference DEM, can we trust the output values represented as `float32`? Currently, since the default is `float32`, values greater than 255 (e.g., 259.3) are inserted into the output in areas where the original image contained the saturated value of 255.

Next, regarding areas where values are saturated at 255 or higher, I often see that elevations are restored in the results calculated using `parallel_stereo`. Should these areas be thoroughly excluded from the DEM results since their values are originally saturated?

Kind regards,
Haruki

Oleg Alexandrov

unread,
Mar 20, 2026, 11:21:11 AM (6 days ago) Mar 20
to Haruki Hagiwara, Ames Stereo Pipeline Support
When converting an 8-bit image using `mapproject` with camera information and a reference DEM, can we trust the output values represented as `float32`? Currently, since the default is `float32`, values greater than 255 (e.g., 259.3) are inserted into the output in areas where the original image contained the saturated value of 255.

Yes, from that point on, everything should be float32. Looks like a quirk of bicubic interpolation that you get values above 255. You could carefully examine the resulting mapprojected images to see if there is any spike. Likely not. Then, float images with values a little about 255 should be fine.
 
Next, regarding areas where values are saturated at 255 or higher, I often see that elevations are restored in the results calculated using `parallel_stereo`. Should these areas be thoroughly excluded from the DEM results since their values are originally saturated?

Yes that is suggested. Our asp_mgm algorithm can be overly optimistic in those areas and produced imagined terrain. You can try the asp_bm algorithm, which will likely wipe more such data (but can have other artifacts). Then, there is the parameter --xcorr-threshold that can be made smaller to be more strict about consistency during correlation and which will also wipe more saturated areas. See https://stereopipeline.readthedocs.io/en/latest/stereodefault.html#correlation and also from there the pointer to --save-left-right-disparity-difference which produces a measure of confidence in saturated areas. Lastly, for excluding later saturated areas one can form a mask with a threshold for the mapprojected image and then apply that mask with image_calc (which can make a mask too).


Reply all
Reply to author
Forward
0 new messages