Closed jchollingsworth closed 1 year ago
Could you post the input camera models and command line calls where you see this happening?
I have uploaded the files here: https://drive.google.com/open?id=0B9agI6whXP-oczJvLWYwRFZMYm8 (I also sent you a separate link to directly download the tarball).
If you download everything there, you should be able to run launch_ba.sh directly from the download folder and reproduce the problem I had.
The launch script simply contains 2 parts:
Hopefully everything should make sense.
Finally, I add a directory: b1_bad_output This contains the camera outputs following bundle_adjust when I ran it. The RPC distortion coefficients look reasonable... but the undistortion coefficients are wrong.
Just a small additional... ... I get the same problem with the failure of bundle_adjust to solve the undistortion coeffs even when I let it run to convergence (I suddenly wondered if that could have been a problem, but it isn't).
Here's a snippet of the output from ba... you can see the error is high with the undistortion approximation: RPC undistortion approximation mean pixel error is 11.5888 and max pixel error is 43.0923. Writing output model: Pinhole camera: Camera Center: Vector3(-2.34099e+06,-4.68511e+06,3.6364e+06) Rotation Matrix: Q Intrinsics: focal: Vector2(4950,4950) offset: Vector2(2972,2311) pixel pitch: 1 u direction: Vector3(1,0,0) v direction: Vector3(0,1,0) w direction: Vector3(0,0,1) Distortion Model: RPC rpc_degree = 3 image_size = 5944 4622 distortion_num_x = 1e-25 1.00606 1e-25 1e-25 1e-25 1e-25 1e-25 1e-25 1e-25 1e-25 distortion_den_x = 1 1e-25 1e-25 1e-25 1e-25 1e-25 -8.23979e-14 3.60032e-14 -1.44859e-13 9.40226e-14 distortion_num_y = 1e-25 1e-25 1.00536 1e-25 1e-25 1e-25 1e-25 1e-25 1e-25 1e-25 distortion_den_y = 1 1e-25 1e-25 1e-25 1e-25 1e-25 -1.13802e-13 6.62899e-14 -6.82518e-14 3.20568e-14 undistortion_num_x = 0 1 0 0 0 0 0 0 0 0 undistortion_den_x = 1 0 0 0 0 0 0 0 0 0 undistortion_num_y = 0 0 1 0 0 0 0 0 0 0 undistortion_den_y = 1 0 0 0 0 0 0 0 0 0
I think this got fixed as it was reported separately at some point.
When converting tsai distortion camera to rpc with convert_pinhole_model, the RPC output coefficients were all 1's or 0's, which means they won't float unless their precision is manually updated. Not a big deal, but thought I'd point it out, as it's not necessarily useful to output these to values which won't float.
In addition, I noticed that my tsai distortions all defaulted to a 1's and o's in my RPC distortion model. I'm not sure if this is because convert_pinhole_model rounds to whole numbers, an so decimal values of k1, k2, p1, p2 are rounded to 0...? Not sure.... maybe you could check this.
Also, it would be good to be able to include an option like --penalty-weight (from cam2rpc), whereby we can suppress higher-order RPC coefficients.
Cheers, J