Example #1
0
        //keresési tér
        public Rectangle RandomOptimizationAlgorithm(int Epoint, int Esize, byte intensity)
        {
            IntPoint    pPoint = FindStartingPoint(intensity);
            int         pSize  = rand.Next(GreyImage.Width / 8, GreyImage.Width / 4);
            MyRectangle pRect  = new MyRectangle(pPoint, pSize);

            for (int i = 0; i < maxIterations; i++)
            {
                MyRectangle qRect = pRect.MoveRectangle(Epoint, Esize);
                if (Fitness(qRect, intensity) <= Fitness(pRect, intensity))
                {
                    pRect = qRect;
                }
            }
            return(pRect.Rectangle);
        }