gpt4 book ai didi

c# - EMGU 2.4.0 BruteForceMatcher KNNMATCH 不工作?

转载 作者:太空宇宙 更新时间:2023-11-03 20:59:05 25 4
gpt4 key购买 nike

这是我的代码的快照,

Matrix<byte> mask;
int k = 2;
VectorOfKeyPoint modelKeyPoints;
VectorOfKeyPoint observedKeyPoints;
SURFDetector surfCPU = new SURFDetector(500, false);
modelKeyPoints = surfCPU.DetectKeyPointsRaw(modelImage, null);
Matrix<float> modelDescriptors = surfCPU.ComputeDescriptorsRaw(modelImage, null, modelKeyPoints);
observedKeyPoints = surfCPU.DetectKeyPointsRaw(observedImage, null);
Matrix<float> observedDescriptors = surfCPU.ComputeDescriptorsRaw(observedImage, null, observedKeyPoints);
BruteForceMatcher<float> matcher = new BruteForceMatcher<float>(DistanceType.L2);
matcher.Add(modelDescriptors);
indices = new Matrix<int>(observedDescriptors.Rows, k);
using (Matrix<float> dist = new Matrix<float>(observedDescriptors.Rows, k))
{
matcher.KnnMatch(observedDescriptors, indices, dist, k, null);
}

我总是在 KnnMatch() 中得到以下异常

发生Emgu.CV.Util.CvException消息:OpenCV:queryDescriptors.type() == trainDescCollection[0].type()

我已经很努力地想摆脱这个异常,但没有希望:(

最佳答案

终于找到问题的原因了

它是 modelKeyPoints 或 observedKeyPoints 之一 null :)

关于c# - EMGU 2.4.0 BruteForceMatcher KNNMATCH 不工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13381052/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com