private double diff(double[,,] arrayImage, int x1, int y1, int x2, int y2)
        {
            double[] colorA = new[] { arrayImage[0, y1, x1], arrayImage[1, y1, x1], arrayImage[2, y1, x1] };
            double[] colorB = new[] { arrayImage[0, y2, x2], arrayImage[1, y2, x2], arrayImage[2, y2, x2] };

            return(m_colorSheme.Difference(colorA, colorB));
        }
Exemplo n.º 2
0
        internal override double GeAssessment(AssesmentsSegment[] segments, IColorSheme colorSheme)
        {
            int k = segments.Length;

            SumOfPairwiseInternalDistancesAssessment tempassessment = new SumOfPairwiseInternalDistancesAssessment();

            double a = tempassessment.GeAssessment(segments, colorSheme);

            double denominatorToACoef = 0;
            double denominatorToBCoef = 1;

            for (int i = 0; i < k; i++)
            {
                var Nj = segments[i].Length;
                denominatorToACoef += (Nj * (Nj - 1) / 2d);

                denominatorToBCoef *= Nj;
            }

            a /= 1d / denominatorToACoef;

            double b = 0;

            for (int j = 0; j < k - 1; j++)
            {
                for (int l = 0; l < segments[j].Length; l++)
                {
                    for (int m = j + 1; m < k; m++)
                    {
                        for (int h = 0; h < segments[m].Length; h++)
                        {
                            b += colorSheme.Difference(segments[j].points[l], segments[m].points[h]);
                        }
                    }
                }
            }

            b /= 1d / denominatorToBCoef;

            return(a / b);
        }