Comments (4)
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']
from lightglue.
Thank you @Phil26AT for providing this code snippet. I think cv2.findHomography
takes 4 arguments while cv2.FindFundamentalMat
takes 6. And a minor comment, considering that m_kpts0, m_kpts1 are tensors, they need to be transformed to numpy thus, m_kpts0.numpy()
, m_kpts1.numpy()
will work. Thanks again @Phil26AT! LightGlue is outstanding.
from lightglue.
Thank you @Phil26AT for providing this code snippet. I think
cv2.findHomography
takes 4 arguments whilecv2.FindFundamentalMat
takes 6. And a minor comment, considering that m_kpts0, m_kpts1 are tensors, they need to be transformed to numpy thus,m_kpts0.numpy()
,m_kpts1.numpy()
will work. Thanks again @Phil26AT! LightGlue is outstanding.
Hi!
When calculating the camera matrix and converting the tensor m_kpts0, m_kpts1 to numpy it seems that the tensor on the GPU can't be converted directly with numpy, it has to be converted to a tensor on the CPU and then to numpy: torch.cpu().numpy(). However this seems to make the computation slow, is there any other way to solve this problem?
from lightglue.
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.
from lightglue.
Related Issues (20)
- can I use this algorithm to get the similarity score of two pictures? HOT 1
- How to get description from giving point(x,y) HOT 2
- The matching effect of similar images is too different HOT 5
- ERROR in the Installation HOT 1
- TSNE on descriptors outputted by SuperPoint?
- How to display the matching status of each pair of feature points HOT 2
- Retrain model LightGlue with ourdataset HOT 2
- While Reproducing the results HOT 1
- Questions about SIFT+LightGlue HOT 3
- spelling error in README HOT 1
- Compatibility Issue with GridSample and ONNX Opset 15 on NXP i.MX 93 NPU HOT 1
- How to do inference with trained model? HOT 1
- No keypoints with sift = error
- FlashAttention actually does not support attention mask HOT 3
- What's the difference between matches0 and matches1
- some problem that delopy on device, such as snapdragon snpe HOT 1
- Training with own dataset on both extractor and matcher HOT 2
- Illegal License HOT 4
- inference_for_LightGlue
- Bad matches running on GPU (related to non_blocking parameter) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightglue.