-
Notifications
You must be signed in to change notification settings - Fork 375
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
Regarding estimating Camera matrix K, R and T #26
Comments
Hi @Ram-198 I am not very familiar with the functions you used, but you could do something similar with pycolmap: import pycolmap
import cv2
image0 = load_image('path/to/image0.jpg')
image1 = load_image('path/to/image1.jpg')
# run lightglue to obtain m_kpts0, m_kpts1 (see demo notebook)
K0 = pycolmap.infer_camera_from_image('path/to/image0.jpg').calibration_matrix()
K1 = pycolmap.infer_camera_from_image('path/to/image1.jpg').calibration_matrix()
H, inliers = cv2.findHomography(m_kpts0, m_kpts1, cv2.USAC_MAGSAC, 0.5, 0.999, 100000)
ret = pycolmap.homography_decomposition(H, K0, K1, m_kpts0, m_kpts1)
R, t = ret['R'], ret['t'] |
Thank you @Phil26AT for providing this code snippet. I think |
Hi! |
Hello @yayaYsmile. As far as I'm aware, if you're working with PyTorch tensors, Kornia is a good option since it allows for operations directly on tensors. However, in terms of outlier removal, I believe Kornia primarily offers RANSAC. It's possible they may have added more methods in newer versions, so it might be worth checking their documentation or source code for any updates. |
Hello, may I ask, after I install pycolmap, the following error will appear: |
Hi,
Thank you and the matching results are very good. :)
Earlier i used Sift for feature extraction and cv.detail_BestOf2NearestMatcher() for matching. Then i use cv.detail_HomographyBasedEstimator() to estimate the K, R and T.
How can i achieve this using LightGlue results? Could you please help me with calculating K, R and T from lightglue results?
Thank you
The text was updated successfully, but these errors were encountered: