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