dkogan / mrcal

Next-generation camera-modeling toolkit
http://mrcal.secretsauce.net
Apache License 2.0
190 stars 15 forks source link

expand_intrinsics does not decrease higher order distortion coefficient magnitude #14

Closed mcm001 closed 7 months ago

mcm001 commented 7 months ago

Here, you try to reduce the magnitude of elements 5:8 of the seed distortions. But at least with mrcal 2.4.1-1jammy1, this does not change the distortion array (ie, it stays as array([[-2.99872679e-07, 2.76209510e-07, 4.95254637e-07, 3.46701237e-07, 3.11457662e-07, -1.01066852e-08, -2.02589460e-07, -5.68497143e-07]])) for an OPENCV8 model. Under debugger, you can see newDistortions.shape is actually (1, 8) and not (,8), so newDistortions[5:8] is an empty array. Did you mean newDistortions[:,5:8]?

image

dkogan commented 7 months ago

Thanks much for finding this. I looked through version control, and apparently this has never worked as intended. I pushed the fix to git, but obviously it has never actually been tested. If you cherry-pick this and see any problems, let me know. I'll run experiments before the next release at the latest, but it may not be for a while.