Skip to content

Commit

Permalink
improve the performance of character
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlyqing00 committed Jun 11, 2019
1 parent 196c635 commit 59b768b
Show file tree
Hide file tree
Showing 4 changed files with 236 additions and 192 deletions.
13 changes: 7 additions & 6 deletions include/stripes_solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,9 @@ class StripesSolver {
const string tesseract_model_path {"data/tesseract_model/"};
// tesseract::TessBaseAPI * ocr;
const double conf_thres {70};
const double lambda_ = 0.7;
const double lambda_ = 0.3;
const double filter_rate = 0.3;


// Compatibility
// const int symbols_n = 64;
// const cv::Size cp_net_img_size {64, 64};
Expand All @@ -112,20 +111,22 @@ class StripesSolver {
int sols_n {10};
int candidate_len {10};
const int candidate_factor {5};
vector< vector<double> > pixel_graph;
vector< vector<double> > pixel_graph2;
vector< vector<double> > low_level_graph;


double m_metric_char(const cv::Mat & piece0, const cv::Mat & piece1, tesseract::TessBaseAPI * ocr);
double m_metric_char(const cv::Mat & piece0, const cv::Mat & piece1, tesseract::TessBaseAPI * ocr, int idx=0);
// double m_metric_comp_eva(const cv::Mat & piece0, const cv::Mat & piece1);
void m_metric_word();

vector< vector<int> > reassemble_greedy(bool probability_flag=false);
void reassemble_GCOM();

void compute_mutual_graph(vector< vector<double> > & mutual_graph);
void stochastic_search( vector<int> & sol, const vector< vector<StripePair> > & compose_next);
cv::Mat word_detection( const cv::Mat & img,
const vector<int> & sol,
vector<int> & sol_x);
vector<int> & sol_x,
tesseract::TessBaseAPI * ocr);
void merge_single_sol(vector< vector<int> > & fragments);
void finetune_sols(const vector< vector<int> > & fragments);

Expand Down
4 changes: 2 additions & 2 deletions include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ const cv::Scalar seam_color_green(100, 200, 100);

double avg_vec3b(const cv::Vec3b &v);

bool check_pure(int c);
int check_pure(double c);

double diff_vec3b(const cv::Vec3b & v0, const cv::Vec3b & v1);

double m_metric_pixel(const cv::Mat & piece0, const cv::Mat & piece1, bool shift_flag=false);
double m_metric_pixel(const cv::Mat & piece0, const cv::Mat & piece1, bool shift_flag=false, int idx=0);

cv::Mat merge_imgs( const cv::Mat & in_img0,
const cv::Mat & in_img1,
Expand Down
Loading

0 comments on commit 59b768b

Please sign in to comment.