public object Clone()
        {
            HaarRectangle[] newRectangles = new HaarRectangle[Rectangles.Length];
            for (int i = 0; i < newRectangles.Length; i++)
            {
                HaarRectangle rect = Rectangles[i];
                newRectangles[i] = new HaarRectangle(rect.X, rect.Y,
                    rect.Width, rect.Height, rect.Weight);
            }

            HaarFeature r = new HaarFeature();
            r.Rectangles = newRectangles;
            r.Tilted = Tilted;

            return r;
        }
 private void writeRectangle(HaarRectangle rectangle)
 {
     writer.Write("new int[] {{ {0}, {1}, {2}, {3}, {4} }}",
         rectangle.X.ToString(NumberFormatInfo.InvariantInfo),
         rectangle.Y.ToString(NumberFormatInfo.InvariantInfo),
         rectangle.Width.ToString(NumberFormatInfo.InvariantInfo),
         rectangle.Height.ToString(NumberFormatInfo.InvariantInfo),
         rectangle.Weight.ToString("R", NumberFormatInfo.InvariantInfo));
 }
        public object Clone()
        {
            HaarRectangle r = new HaarRectangle();
            r.Height = Height;
            r.ScaledHeight = ScaledHeight;
            r.ScaledWeight = ScaledWeight;
            r.ScaledWidth = ScaledWidth;
            r.ScaledX = ScaledX;
            r.ScaledY = ScaledY;
            r.Weight = Weight;
            r.Width = Width;
            r.X = X;
            r.Y = Y;

            return r;
        }