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
479 stars 169 forks source link

floating "other_instrinsics" #222

Closed jchollingsworth closed 5 years ago

jchollingsworth commented 5 years ago

Hi guys,

I just noticed something possibly odd (though could be user error). On several different aerial photo projects, I've been floating the distortion parameters... this always used to work fine, but since the change from "distortion_params" to "other_intrinsics", something funky seems to happen. Bundle_adjust runs ok, and outputs new tsai files. However, when I mapproject with these, something must be up with the distortion parameters because it either fails, or generally gives a mapprojected image with the extents of the image all wack, and the actual image occupying only a small region of the mapprojected image (and heavily downsampled). Does that make sense? I seem to have deleted all my examples, so when I next try floating distortion, I'll send you some examples. Cheers, J.

oleg-alexandrov commented 5 years ago

You can try an older build, for example, this:

http://byss.arc.nasa.gov/oalexan1/StereoPipeline-x86_64-centos6.9-2018-11-07_13-48-53573ca0a-dirty.tar.bz2

and see what changed. If it is an error on our side, I can try a fix.

It an also be a matter of how aggressively you float distortion parameters and which ones you float. I am suspecting maybe your focal length changed too much.

jchollingsworth commented 5 years ago

Hi Oleg, Scott,

Ok... so today I noticed that if I undistort the images using the tsai files I get from bundle_adjust (in which I floated distortion), then I get great looking undistorted images and updated tsai files. If I mapproject with those, everything looks perfect. However, if I mapproject directly using the tsai files from bundle_adjust (with the distortion coefficients), then the mapprojected result is wrong. And by wrong, I mean mapproject has not calculated the correct extents of the image... so I get an output image covering a much larger area than the photo (lots of empty black space surrounding the image), often with some weird squiggles around the edges, where something odd has gone on with resampling. Anyhow... this leads me to believe that bundle_adjust is working just fine, and perhaps mapproject (-t nadirpinhole) has a problem when using camera files which contain distortions(?). Even simple distortions. Maybe this will be easy for you to check to see if you get the same behavior. (I was using the build from 31st January 2019).

oleg-alexandrov commented 5 years ago

We've had problems with mapproject getting the extent of projection wrong in the past. And for models with distortion, the distortion formula will of course give very wrong results if it is used beyonds its domain. If you send us a testcase, including the image, the bad camera, the DEM to project onto, and your mapproject command, I will take a look.

jchollingsworth commented 5 years ago

Ok... Great. I'll send along tomorrow. Thanks!

jchollingsworth commented 5 years ago

Hi Oleg+Scott,

I've sent a link to donwload the test files... I also show the commands I used. (basically, mapprojecting with and without undistorted images... check out how different they look!)

ScottMcMichael commented 5 years ago

Thanks for posting the files, this should be fixed in the latest build.