有没有办法将功能匹配存储在OpenCV中?
我正在使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论