public bool IsEqual(IClusterableItem item)
        {
            bool b1 = width == item.Width;
            bool b2 = height == item.Height;
            bool b3 = red == item.Red();
            bool b4 = green == item.Green();
            bool b5 = blue == item.Blue();

            return (b1 && b2 && b3 && b4 && b5);
        }
Exemple #2
0
        public double getDistance(IClusterableItem image1, IClusterableItem image2)
        {
            double distance = 0;

            double heightDistance = Math.Pow((image2.Height - image1.Height), 2);
            double widthDistance = Math.Pow((image2.Width - image1.Width), 2);
            double redDistance = Math.Pow((image2.Red() - image1.Red()), 2);
            double greenDistance = Math.Pow((image2.Green() - image1.Green()), 2);
            double blueDistance = Math.Pow((image2.Blue() - image1.Blue()), 2);

            distance = Math.Sqrt((heightDistance + widthDistance + redDistance + greenDistance + blueDistance));

            return distance;
        }