-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bundle_adjust pinhole cameras with GCPs seen in multiple images #320
Comments
The idea behind GCP initialization of pinhole cameras is that pinhole cameras would be less likely to have good nav data available than the other types of cameras we process and that GCPs, if available, would probably be the most accurate source of position information. In the case where your nav data is good hopefully the GCP are consistent with your camera information. I am not sure what is going on in this case. Probably the best place to start investigating is why that warning appears. Can you post your GCP files and also the output files when you run with --disable-pinhole-gcp-init and --num-passes 0 ? |
The output files are 30-80 MB compressed. The log file is huge due to ~181k triangulation warnings like above. I'll look into getting the files posted to a URL you can access. |
In this case we are working with SkySat cameras flying at 400-450km, which should have pretty good positional data. The GCP data tends to be on the order of 4 meters RMSE, while the pixel size is 0.8 meters. |
Ok, I've assembled the input gcp file and all output here: Let me know if you have trouble with the link or you'd like additional data. |
There is probably some inconsistency between GCP and the cameras. While the GCP data may have 4 meters of RMSE, the very large focal length may amply some issues. It would be useful to run indeed bundle adjustment with --disable-pinhole-gcp-init, to not use the GCP for initialization of cameras, and then, when looking at the initial_residual_pointmap_log.csv to also look at the very last lines in this file, which have the reprojection errors for your GCP. Those lines should have the comment "# GCP" at their ends, in any recent software. It will be interesting to see what reprojection errors (column 4) and triangulated heights are (column 3), and how those compare to the heights from the gCP. |
I've added the initial* files to the above shared folder. You should be able to download them and inspect them yourself. As a preview however, this looks reasonable for the 4 meter RMSE:
|
Our logic for initiating the cameras from GCP likely needs to be made more robust by using some kind of RANSAC-based method with outlier filtering. As it is, it is a least-squares fit. You have a very bad GCP there: 131.02209948814766, -25.2627184316647586, 509.999999999894442, 615.098370341909117, 2 # GCP Look at the last number. Here's another one: 131.018006248468964, -25.2661551028768017, 509.999999999686622, 298.306044629161136, 2 # GCP And there's more. Here are more numbers from that file: 130.829177790193313, -25.6693053174450334, 71039.2515870268981, 14861.296234854779, 4 In short, this seems to be a combination for some unreliability in GCP, initial cameras, and our insufficiently robust logic. |
Likely this line: will need changing, while using a new code to fit a 3D transform to two set of points while robust to outliers. I hope to get to it at some point, but I don't know when. But one would need to verify first that removing the outliers in the GCP or at least using a very small set of most reliable GCP bypasses the problem. |
Oh wow. I don't know where those GCPs came from. I had only put a check in for horizontal distance. I'll investigate further. In the future, would it be possible to get more information in the warning messages that would help me debug? As it is, they are frustratingly vague when it comes to bad GCPs. |
Describe the bug
When using bundle_adjust for pinhole cameras with GCPs which are seen in 2+ images, the input camera models are not honoured to triangulate points for the control network, and the gcps are used to initiate the pinhole cameras. This results in initial triangulated points with very high reprojection errors and awkward height values. When the same set of cameras are used without GCPs, the initially triangulated points are way better. The resultant camera obtained bundle_adjustment is not very good. The behaviour was suppressed when using
--disable-pinhole-gcp-init
, and the triangulated points returned back to normalcy. However, should not this be the default ? Why should we be initialising cameras from gcps by default, until we are doing some camera resection problem?I am not sure if this happens with other pinhole sensors though, so maybe we can check with already available gcp file which are seen in multiple images and pinhole cameras to confirm them.
To Reproduce
--disable-pinhole-gcp-init
): Run `bundle_adjust img1.tif img2.tif img1.tsai img2.tsai gcp.gcp --num-passes 1 --max-iterations 0 --disable-pinhole-gcp-init --datum WGS84 -o ba_gcp/run'. Look at the initial_residual_pointmap_log.csv.Expected behavior
Case 2 pointmap screenshot:
Case 1 pointmap screenshot:
Case 3 pointmap screenshot:
Error Logs, Terminal Captures, Screenshots
If applicable, please give us as much information as you can to help explain your problem.
Your Environment (please complete the following information):
Additional context
One more point of concern is the that the GCPs are 100s of km away from the other triangulated points, are your Lat/lon value swapped warning message. We checked that this is not the case and the GCPs and triangulated points are reasonably close, but still this warning appears. Log screenshot for context:
When should we be paying attention to this warning, and should we make it more meaningful ?
The experiments were primarly conducted by Seth Price, please chime in if I missed something. Hopefully the cameras produced with
--disable-pinhole-gcp-init
flag are good for stereo for now.The text was updated successfully, but these errors were encountered: