public int CostTo(ShapeContext other) { int cost = 0; for (int i = 0; i < LogPolar2Histogram.ThetaBin; ++i) { for (int j = 0; j < LogPolar2Histogram.RadiusBin; ++j) { int a = this.Histogram[i, j], b = other.Histogram[i, j]; if (a == 0 && b == 0) { continue; } cost += (a - b) * (a - b) / (a + b); } } return(cost / 2); }
public ImageShapeContext(List <Point> points) { ShapeContests = new ShapeContext[points.Count]; Points = points; }
public int CostTo(ShapeContext other) { int cost = 0; for (int i = 0; i < LogPolar2Histogram.ThetaBin; ++i) { for (int j = 0; j < LogPolar2Histogram.RadiusBin; ++j) { int a = this.Histogram[i, j], b = other.Histogram[i, j]; if (a == 0 && b == 0) continue; cost += (a - b) * (a - b) / (a + b); } } return cost / 2; }
public ShapeContextMatching(ShapeContext[] scsa, ShapeContext[] scsb) { this.scsa = scsa; this.scsb = scsb; }
public ImageShapeContext(List<Point> points) { ShapeContests = new ShapeContext[points.Count]; Points = points; }