/// <summary>
        /// Create a new CAPTCHABreaker with a specified solver and segmenter.
        /// </summary>
        /// <param name="solveMethod">The method used for recognizing patterns that have been extracted from an image.</param>
        /// <param name="segmentMethod">The method to use for segmenting an image into patterns.</param>
        public CAPTCHABreaker(Solver solveMethod, SegmentMethod segmentMethod)
        {
            segmenter = new Segmenter();
            segmenter.SegmentationMethod = segmentMethod;

            solver = solveMethod;
            solver.OnTraininProgressChanged += new Action<object, OnTrainingProgressChangeEventArgs>(solver_OnTraininProgressChanged);
            solver.OnTrainingComplete += new Action<object, PatternResult>(solver_OnTrainingComplete);
            solver.OnTestingComplete += new Action<object, PatternResult>(solver_OnTestingComplete);

            asyncSolver = new BackgroundWorker();
            asyncSolver.DoWork += new DoWorkEventHandler(asyncSolver_DoWork);
            asyncSolver.RunWorkerCompleted += new RunWorkerCompletedEventHandler(asyncSolver_RunWorkerCompleted);

            asyncSetCreater = new BackgroundWorker();
            asyncSetCreater.DoWork += new DoWorkEventHandler(asyncSetCreater_DoWork);
            asyncSetCreater.RunWorkerCompleted += new RunWorkerCompletedEventHandler(asyncSetCreater_RunWorkerCompleted);
            asyncSetCreater.WorkerReportsProgress = true;
            asyncSetCreater.ProgressChanged += new ProgressChangedEventHandler(asyncSetCreater_ProgressChanged);

            asyncFullTest = new BackgroundWorker();
            asyncFullTest.DoWork += new DoWorkEventHandler(asyncFullTest_DoWork);
            asyncFullTest.RunWorkerCompleted += new RunWorkerCompletedEventHandler(asyncFullTest_RunWorkerCompleted);
        }
 /// <summary>
 /// Specify the segmentation method that will be used to extract patterns from a CAPTCHA image.
 /// </summary>
 public void SetSegmentationMethod(SegmentMethod segmentMethod)
 {
     segmenter.SegmentationMethod = segmentMethod;
 }