Skip to content
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

Faster intrinsics camera calibration ? #158

Open
ANaaim opened this issue Feb 4, 2025 · 4 comments
Open

Faster intrinsics camera calibration ? #158

ANaaim opened this issue Feb 4, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@ANaaim
Copy link
Contributor

ANaaim commented Feb 4, 2025

Hello,

For some cases i have VERY long intrinsics calculations.

https://github.com/perfanalytics/pose2sim/blob/51c88e6ebe09bee3a47ab6f68156c56d73cb6b18/Pose2Sim/calibration.py#L612C1-L613C109

        ret_cam, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, img.shape[1::-1], 
                                    None, None, flags=(cv2.CALIB_FIX_K3))# + cv2.CALIB_FIX_PRINCIPAL_POINT))

to accelerate it it could become :

        ret_cam, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, img.shape[1::-1], 
                                    None, None, flags=(cv2.CALIB_FIX_K3+cv2.CALIB_USE_LU))# + cv2.CALIB_FIX_PRINCIPAL_POINT))

as suggested below it give similar results (should maybe be investigated in more detail)

https://stackoverflow.com/questions/51073309/why-does-the-camera-calibration-in-opencv-python-takes-more-than-30-minutes

Any thought about it ?

Best regards

@davidpagnon
Copy link
Collaborator

I would have suggested calibrating with fewer images, but I must say that this approach sounds pretty convincing!
I even looked into triangulation using LU decomposition rather than SVD, but it does not seem relevant in this case.

Have you tried it yourself? If so and it looks convincing in practice, feel free to submit a pull request :)

@davidpagnon davidpagnon added the enhancement New feature or request label Feb 5, 2025
@ANaaim
Copy link
Contributor Author

ANaaim commented Feb 5, 2025

Maybe I am trying to have to much different point of view from my checkerboard. I tried it my self, it seems alright.

I could check if we have huge difference in my case and if not I can do a pull request ?

@davidpagnon
Copy link
Collaborator

I would appreciate it, thanks in advance :)
From what I can see in various sources, I expect it to be good, too.

@davidpagnon
Copy link
Collaborator

I just pushed it with another release on a bunch of various things but it was probably a bit optimistic. If you ever see anything wrong, please tell me and I'll revert back to the previous version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants