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