我正在研究 here 的源代码.
看来indices
变量存储匹配信息,但我不知道信息是如何存储的。
例如,你能告诉我找到了多少匹配的点吗?哪个点匹配哪个点?
最佳答案
看看这条线。
Image<Bgr, Byte> result = Features2DToolbox.DrawMatches(modelImage, modelKeyPoints, observedImage, observedKeyPoints,
indices, new Bgr(255, 255, 255), new Bgr(255, 255, 255), mask, Features2DToolbox.KeypointDrawType.DEFAULT);
public int CountHowManyPairsExist( Matrix<byte> mask)
{
var matched = mask.ManagedArray;
var list = matched.OfType<byte>().ToList();
var count = list.Count(a => a.Equals(1));
return count;
}
https://stackoverflow.com/questions/14374423/