有没有办法将功能匹配存储在OpenCV中?

发布于 2025-01-22 05:18:22 字数 682 浏览 2 评论 0原文

我正在使用OpenCV中使用SIFT进行图像功能提取。匹配需要很长时间才能运行,我想尽可能将匹配的对象存储到文件中并加载。有办法这样做吗?似乎可以存储关键点和描述符,但我没有找到有关比赛的任何有用信息。

update1

我要存储的信息如下:

sift = cv2.SIFT_create()
kp1, des1 = sift.detectAndCompute(img1,None)
kp2, des2 = sift.detectAndCompute(img2,None)
bf = cv2.BFMatcher(cv2.NORM_L2, crossCheck=True)
matches = bf.match(des1,des2)

### Want magically to store the information of the variable matches

update2

我没有意识到对象dmatch包含不同的信息层。另外,自从 DMatch仅存储匹配的关键点的索引文件可能不是最好的主意。我现在正在尝试提取这些信息并保存索引。由于可以存储关键点和描述符,因此我可以在加载匹配指数后重建匹配项。

I am doing image features extraction using SIFT in opencv. The matching takes a really long time to run, and I want to store the matching object into a file and load whenever possible. Is there a way to do this? It seems that storing keypoints and descriptors are possible, but I didn't find any useful information about the matches.

Update1:

The information I wanted to store is the following:

sift = cv2.SIFT_create()
kp1, des1 = sift.detectAndCompute(img1,None)
kp2, des2 = sift.detectAndCompute(img2,None)
bf = cv2.BFMatcher(cv2.NORM_L2, crossCheck=True)
matches = bf.match(des1,des2)

### Want magically to store the information of the variable matches

Update2:

I didn't realize that the object DMatch contains different layers of information. Also, since DMatch only stores the indices of matched keypoints, their distance and the index of the image, trying to save a DMatch file may not be the best idea. I am now trying to extract those information and save the indices instead. As it is possible to store the keypoints and descriptors, I may be able to reconstruct the matches after loading the match indices.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文