【发布时间】:2018-09-02 12:30:36
【问题描述】:
对于图像拼接应用程序,我获取了描述符的匹配并将其存储在一个矩阵匹配 2xM 中。我现在想用仿射应用 Ransac,所以我的随机样本是 2x3 矩阵,然后我尝试应用代码
[tform,inlier1,inlier2] =estimateGeometricTransform(sample(1,:),sSample(2,:),'affine');
这似乎不起作用,因为它要求我的列为 2,将其转换为 3x2 也不起作用,因为对于仿射我需要 3 个对应点。
Matches 也只返回匹配描述符的索引,我怎么能 提取其坐标并将其应用于我的 tform 转换?
[f,d] = vl_sift(image1);
[f1,d2] = vl_sift(image2);
[matches, scores] = vl_ubcmatch(d, d2) ;
ranMatch = randperm(size(matches,2),3);
sample = matches(:,ranMatch);
[tform,inlier1,inlier2] =
estimateGeometricTransform(sample(1,:),sample(2,:),'affine');
【问题讨论】:
-
您应该输入两个矩阵,每个矩阵代表点的坐标。在我看来,您输入的是向量而不是矩阵。请显示您的所有代码,如this page on to create a minimal, complete example 中所述。
-
vl_ubcmatch 给出匹配描述符在 2x562 矩阵中的索引,分数是它们之间的距离。我正在尝试使用匹配的索引来估计仿射变换。但是,estimateGeometric 给我的错误是它不是 Mx2,如果我将它设为 Mx2,它不再有 3 个点,所以仿射不起作用。