示例#1
0
        public HistogramSolver(string characterSet, int imageWidth, int imageHeight)
        {
            // Split the set of characters into a list
            charsSet = characterSet.ToCharStringList();

            ExpectedWidth  = imageWidth;
            ExpectedHeight = imageHeight;

            solver = new BitmapVectorCollection();

            trainerWorker                       = new BackgroundWorker();
            trainerWorker.DoWork               += new DoWorkEventHandler(worker_DoWork);
            trainerWorker.RunWorkerCompleted   += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
            trainerWorker.ProgressChanged      += new ProgressChangedEventHandler(worker_ProgressChanged);
            trainerWorker.WorkerReportsProgress = true;

            testerWorker                     = new BackgroundWorker();
            testerWorker.DoWork             += new DoWorkEventHandler(testerWorker_DoWork);
            testerWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(testerWorker_RunWorkerCompleted);
        }
示例#2
0
 public override void Load(BinaryReader r)
 {
     base.Load(r);
     charsSet = r.ReadString().ToCharArray().ToList().Select(c => c.ToString()).ToList();
     solver   = BitmapVectorCollection.LoadFromFile(r);
 }