0
누구나 PGH (Pairwise Geometric Histogram) 유사성 계산을위한 코드를 공유 할 수 있습니까? 나는 이미지 목록에서 가장 유사한 물체를 찾아야한다.OpenCV (Emgu)를 사용하는 PGH
다음 코드를 작성했지만 결과가 의미가 없습니다. 어리석은 실수를 저질렀다는 걸 알았고 나는 갇혀있다.
제안 사항? 이 여기, 사람을 도움이
public double GetBestPGHMatch(Contour<Point> currContour, List<Contour<Point>> ContoursList)
{
double match = -1.0d;
DenseHistogram histCurrContour = new DenseHistogram(
new int[2]
{
currContour.Total,
currContour.Total,
},
new RangeF[2]
{
new RangeF(0, 100),
new RangeF(0, 100)
}
);
CvInvoke.cvCalcPGH(currContour.Ptr, histCurrContour.Ptr);
foreach (Contour<Point> contour in ContoursList)
{
DenseHistogram hist = new DenseHistogram(
new int[2]
{
currContour.Total,
currContour.Total,
},
new RangeF[2]
{
new RangeF(0, 100),
new RangeF(0, 100)
}
);
CvInvoke.cvCalcPGH(contour.Ptr, hist.Ptr);
double c = CvInvoke.cvCompareHist(histCurrContour.Ptr, hist.Ptr, Emgu.CV.CvEnum.HISTOGRAM_COMP_METHOD.CV_COMP_CORREL);
if (c > match) match = c;
}
return match;
}