-
Notifications
You must be signed in to change notification settings - Fork 67
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
Calibrate delivering widely different results from the same detections #121
Comments
(Question: is the calibration file in degrees? If not, then I'm missing something and the above plots and code is wrong!) |
Ok, so I think it is in radians, not degrees. Using the code below I can now draw the calibration. Still, using the same detection I get widely different calibration files. Why is this?
|
Hey I'm in a similar situation where I'm noticing that each round of calibration I do with my current detections pickle file produces errors ranging from 2.75-2000. I used your code to verify the translations and rotations but I was wondering if you were able to investigate further on if this is a bug of anipose that gives different calibration errors or if its just a bad setup? |
Good to hear that it's not just me noticing this. I didn't explore this further because it would mean diving really deep into the code of Anipose (I've tried a bit, but couldn't really figure it out before getting to OpenCV code). What I think is going on is that there's some randomisation before starting the optimisation procedure to get the best calibration. My guess is that it is often ending up in some local minimum without a way to get out. I came to this idea when I noticed that long calibration files (Lots of detected boards, >1000 overlaps between camera pairs) suffer less from this it seems. I'm now sort of working around it by making long calibration files, running calibrations multiple times and checking the result via Matlab, and really tightly fixing the cameras (in case a calibration fails one day I can use the previous, or next day's calibration). Still, I would love to know what is going on to be sure that what we do is actually making full sense. |
Yea I'm realizing our set up might need more adjustments than I thought. While our 2D DLC model runs great, our calibration detects hardly any overlap between two pairs of our cameras and alot of overlap between one pair. Your matlab code has been a huge help in validating if this result of calibration makes sense. Im curious, for your matlab plot that is a good calibration, all cameras are pointing outwards of the center. Is that supposed to happen because intuitively shouldn't it be in the center? Also, for your videos, how do you ensure overlapping frames to take place? |
Hello, I have noticed this issue over the years as people try anipose on different setups. It's been hard to debug. What makes the calibration algorithm work so well on some setups and so poorly on others? How can it generalize? The randomness comes from the subsampling in the iterative bundle adjustment procedure. The relevant code is here: https://github.com/lambdaloop/aniposelib/blob/master/aniposelib/cameras.py#L700 I've had more time now so I've started to dive into this issue again, and can recommend a couple of things.
[calibration]
# ...board parameters and stuff...
calibration_init = "calibration_init.toml" In this case you would put a
|
@lambdaloop: This is really a great help! Many thanks for this reply!
Re 4&5: Really great to maybe get these features in anipose as well! Many thanks for the great software and continuing support! I'll start with the initial calibration since my cameras really should change not at all between sessions. @ebtanana: Concerning the Matlab code, please use the second post I made, in the first one was a silly mistake.... The cameras should be pointing inward and make sense. |
Not sure this is a bug or a feature.
I noticed that when calibrating the results can be widely different from run to run. I have tested running the same command on the same computer over and over from the same detections.pickle file.
(So, running 'anipose calibrate' once to get the detections and calibration, then renaming calibrations.toml ONLY and running again)
I get results with an error varying between basically 0 and several 1000, all from the same detections file. Also, the matrix, distortions, rotation and translation can be very different between files. I am completely at a loss whether this is the intended behaviour, or whether something is wrong. Also, how do I check which calibration is 'the correct one' (Of course eyeballing the resulting movies is one way, but something more quantitative would be nice).
Anipose 1.0.1
Aniposelib 0.4.3
The text was updated successfully, but these errors were encountered: