// Function to get a preview image (used when 'load' button is pressed)
        public Bitmap getPreview()
        {
            Bitmap result;

            if (Status == 0) // no files converted
            {
                result = null;
            }
            else
            {
                Processer Temp = new Processer(inputFile[0], convertOutputLocation, threshold, objectSize, movementWindow, Rect);
                result = Temp.getPreview();
            }
            return(result);
        }
 // Process all files, return 0:succes, 1:convert first, 2:no area selected, 3:other reason, 4:already processed
 public int doProcess()
 {
     if (Status != 0)
     {
         if (Rect.Width == 0 || Rect.Height == 0)
         {
             return(2);
         }
         else
         {
             // Code here:
             progressStorage.resetProcessing();
             trackerlist = new Tracker[inputFile.Length];
             Processer Temp;
             for (int i = 0; i < inputFile.Length; i++)
             {
                 Temp = new Processer(inputFile[i], convertOutputLocation, threshold, objectSize, movementWindow, Rect);
                 progressStorage.newProcessingFile(Temp.getLength()); // a file started in progressStorage
                 int okay = Temp.doProcess(progressStorage);
                 if (okay == 1)
                 {
                     progressStorage.resetProcessing();
                     return(3);
                 }
                 progressStorage.processingFileFinished(); // the file finished in progressStorage
                 trackerlist[i] = Temp.getTracker();
             }
             if (Status == 2)
             {
                 return(4);
             }
             else
             {
                 Status = 2;
                 return(0);
             }
         }
     }
     else
     {
         return(1);
     }
 }
 // Function to get the length of all files in hours, minutes, seconds (2 fps used for conversion)
 public String[] getVideoLengths()
 {
     String[] result;
     if (Status == 0) // no files converted
     {
         result = null;
     }
     else
     {
         result = new String[inputFile.Length];
         Processer Temp;
         for (int i = 0; i < inputFile.Length; i++)
         {
             Temp = new Processer(inputFile[i], convertOutputLocation, threshold, objectSize, movementWindow, Rect);
             int Length = Temp.getLength();
             result[i] = convertLength(Length);
         }
     }
     return(result);
 }
 // Process all files, return 0:succes, 1:convert first, 2:no area selected, 3:other reason, 4:already processed
 public int doProcess()
 {
     if(Status != 0)
     {
         if(Rect.Width == 0 || Rect.Height == 0)
         {
             return 2;
         } else
         {
             // Code here:
             progressStorage.resetProcessing();
             trackerlist = new Tracker[inputFile.Length];
             Processer Temp;
             for (int i = 0; i < inputFile.Length; i++)
             {
                 Temp = new Processer(inputFile[i], convertOutputLocation, threshold, objectSize, movementWindow, Rect);
                 progressStorage.newProcessingFile(Temp.getLength()); // a file started in progressStorage
                 int okay = Temp.doProcess(progressStorage);
                 if (okay == 1)
                 {
                     progressStorage.resetProcessing();
                     return 3;                          
                 }
                 progressStorage.processingFileFinished(); // the file finished in progressStorage
                 trackerlist[i] = Temp.getTracker();
             }
             if(Status == 2)
             {
                 return 4;
             } else
             {
                 Status = 2;
                 return 0;
             }                   
         }
     } else
     {
         return 1;
     }
 }
 // Function to get the length of all files in hours, minutes, seconds (2 fps used for conversion)
 public String[] getVideoLengths()
 {
     String[] result;
     if (Status == 0) // no files converted
     {
         result = null;
     }
     else
     {
         result = new String[inputFile.Length];
         Processer Temp;
         for (int i = 0; i < inputFile.Length; i++)
         {
             Temp = new Processer(inputFile[i], convertOutputLocation, threshold, objectSize, movementWindow, Rect);
             int Length = Temp.getLength();
             result[i] = convertLength(Length);
         }
     }
     return result;
 }
 // Function to get a preview image (used when 'load' button is pressed)
 public Bitmap getPreview()
 {
     Bitmap result;
     if (Status == 0) // no files converted
     {
         result = null;
     } else
     {
         Processer Temp = new Processer(inputFile[0], convertOutputLocation, threshold, objectSize, movementWindow, Rect);
         result = Temp.getPreview();
     }
     return result;
 }