Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public ImageShapeContext(List <Point> points)
 {
     ShapeContests = new ShapeContext[points.Count];
     Points        = points;
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 public ShapeContextMatching(ShapeContext[] scsa, ShapeContext[] scsb)
 {
     this.scsa = scsa;
     this.scsb = scsb;
 }
Exemplo n.º 5
0
 public ImageShapeContext(List<Point> points)
 {
     ShapeContests = new ShapeContext[points.Count];
     Points = points;
 }