static void Main(string[] args)
        {
            StreamReader labels_file = new StreamReader(LABEL_FILE);

            test     = new StreamWriter(OUTPUT_TEST);
            trainval = new StreamWriter(OUTPUT_TRAINVAL);
            string            line, id = null;
            List <coordinate> coordinates = new List <coordinate>();

            while ((line = labels_file.ReadLine()) != null)
            {
                string[] fields = line.Split(',');
                if (id != fields[0])
                {
                    if (id != null)
                    {
                        if (coordinates.Count != 0)
                        {
                            writeXML(id, coordinates);
                        }
                        coordinates = new List <coordinate>();
                    }
                    id = fields[0];
                }
                coordinate new_coordinate = new coordinate();
                int        x1             = Convert.ToInt32(fields[1]);
                int        y1             = Convert.ToInt32(fields[2]);
                int        x2             = Convert.ToInt32(fields[3]);
                int        y2             = Convert.ToInt32(fields[4]);
                if (y2 <= 533)
                {
                    if (x1 == 0)
                    {
                        x1 = 1;
                    }
                    if (x2 >= 779)
                    {
                        x2 = 778;
                    }
                    if (y1 == 0)
                    {
                        y1 = 1;
                    }
                    if (y2 >= 529)
                    {
                        y2 = 528;
                    }
                    new_coordinate.x1 = x1;
                    new_coordinate.y1 = y1;
                    new_coordinate.x2 = x2;
                    new_coordinate.y2 = y2;
                    coordinates.Add(new_coordinate);
                }
            }
            if (coordinates.Count != 0)
            {
                writeXML(id, coordinates);
            }
            trainval.Close();
            test.Close();
            labels_file.Close();
        }