StereoPipeline: `cam_gen` VW Error: OpticalBarModel::point_to_pixel: Unable to project point into camera.
I am trying to process the KH-9
satellite imagery by following the official tutorial here. I successfully mosaic
my images and now I am trying to generate the camera
file. I wrote my sample_kh9_for.tsai
file as below,
VERSION_4
OPTICAL_BAR
image_size = 68460 32409
image_center = 3430 16204.5
pitch = 7.0e-06
f = 1.5
scan_time = 0.7
forward_tilt = 0.174533
iC = -1053926.8825477704 5528294.6575468015 3343882.1925249361
iR = -0.96592328992496967 -0.16255393156297787 0.20141603042941184 -0.23867502833024612 0.25834753840712932 -0.93610404349651921 0.10013205696518604 -0.95227767417513032 -0.28834146846321851
speed = 8000
mean_earth_radius = 6371000
mean_surface_elevation = 928
motion_compensation_factor = 1
scan_dir = right
I am using SRTM
dem as a reference dem (WGS84 coordinate system). I run the command below to generate the cam_gen
file,
cam_gen --sample-file sample_for.tsai --camera-type opticalbar --lon-lat-values '40.817 44.938 42.329 44.752 41.804 42.608 40.339 42.784' for.tif --reference-dem srtm.tif --refine-camera -o for.tsai
When I run the above function it outputs the below information and terminate with an error,
--> Setting number of processing threads to: 4
Using nodata value: -3.4028234663852886e+38
The error between the projection of each ground corner point into the coarse camera and its pixel value:
Corner and error: (0 0) 31356.204888916091
Corner and error: (68574 0) 29532.270234978227
Corner and error: (68574 32544) 29629.527235721198
Corner and error: (0 32544) 27782.348147623663
VW Error: OpticalBarModel::point_to_pixel: Unable to project point into camera.
But when I change the focal length to 0.61000001430511475
(This is the focal length for KH4B
imagery), it runs successfully and creates a for.tsai
file. Is this the problem with focal length or I am missing something? Can anyone please help me?
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 19 (11 by maintainers)
I am not sure. I did not write this particular software. I know that we did a reasonable job at implementing the optical bar model, but I don’t think we figured out reliably how to find the correct parameters for it. What may have worked for the tutorial example may not work for a different dataset.
I added a disclaimer about that to https://stereopipeline.readthedocs.io/en/latest/examples/historical.html#declassified-satellite-images-kh-9 (it may take a while for the doc to be updated).
I don’t know either. You may want to read the paper describing the optical bar model, and see the documentation for your particular testcase.
In short, sorry. The support for this sensor is experimental. We played around a bit, figured out the model, but did not have enough time to go from a prototype to a functioning system.
Likely things can work if you play enough with numbers, but it may take time, and there’s no guarantee on final accuracy.