【发布时间】:2012-12-31 17:12:45
【问题描述】:
【问题讨论】:
-
请把代码贴在这里。
-
我的代码与the linked article 完全相同。如果我在这里发布,我认为我的帖子会太长。还是stackoverflow中的一种方式应该在问题中发布代码而不是链接到其他地方?
标签: c# image-processing opencv emgucv surf
【问题讨论】:
标签: c# image-processing opencv emgucv surf
看看这条线。
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);
最重要的变量是mask。这个变量有所有需要的信息。它是数组。如果这个数组上的值等于 1,这意味着我们有一个共同的对。您必须计算在这个数组中出现 1 的次数。
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;
}
【讨论】: