Tesseract  3.02
tesseract-ocr/cube/cube_tuning_params.h
Go to the documentation of this file.
00001 /**********************************************************************
00002  * File:        cube_tuning_params.h
00003  * Description: Declaration of the CubeTuningParameters Class
00004  * Author:    Ahmad Abdulkader
00005  * Created:   2007
00006  *
00007  * (C) Copyright 2008, Google Inc.
00008  ** Licensed under the Apache License, Version 2.0 (the "License");
00009  ** you may not use this file except in compliance with the License.
00010  ** You may obtain a copy of the License at
00011  ** http://www.apache.org/licenses/LICENSE-2.0
00012  ** Unless required by applicable law or agreed to in writing, software
00013  ** distributed under the License is distributed on an "AS IS" BASIS,
00014  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  ** See the License for the specific language governing permissions and
00016  ** limitations under the License.
00017  *
00018  **********************************************************************/
00019 
00020 // The CubeTuningParams class abstracts all the parameters that are used
00021 // in Cube and are tuned/learned during the training process. Inherits
00022 // from the TuningParams class.
00023 
00024 #ifndef CUBE_TUNING_PARAMS_H
00025 #define CUBE_TUNING_PARAMS_H
00026 
00027 #include <string>
00028 #include "tuning_params.h"
00029 
00030 namespace tesseract {
00031 class CubeTuningParams : public TuningParams {
00032  public:
00033   CubeTuningParams();
00034   ~CubeTuningParams();
00035 
00036   // Accessor functions
00037   inline double OODWgt() { return ood_wgt_; }
00038   inline double NumWgt() { return num_wgt_; }
00039 
00040   inline void SetOODWgt(double wgt) { ood_wgt_ = wgt; }
00041   inline void SetNumWgt(double wgt) { num_wgt_ = wgt; }
00042 
00043   // Create an object given the data file path and the language by loading
00044   // the approporiate file
00045   static CubeTuningParams * Create(const string &data_file,
00046                                    const string &lang);
00047   // Save and load the tuning parameters to a specified file
00048   bool Save(string file_name);
00049   bool Load(string file_name);
00050 
00051  private:
00052   double ood_wgt_;
00053   double num_wgt_;
00054 };
00055 }
00056 
00057 #endif  // CUBE_TUNING_PARAMS_H