profile.h

来自「Ocr source code. provides an Ocr engine 」· C头文件 代码 · 共 55 行

H
55
字号
/* profile.h : stores info about (previously) trained scans  * Author: Maxie D. Schmidt (created 5/30/2006)           */#ifndef _PROFILE_H_#define _PROFILE_H_#include <stdlib.h>#include <stdio.h>#include <errno.h>#include <string>#include <vector>using namespace std;#include "types.h"#include "classnotes.h"#include "runutils.h"#include "parselist.h"// profile currently only handles A-Z, a-z:#define NUM_TRAINED_CHARS     52typedef struct {     string character;     int num_instances;     grid_int_t gc_count;} profile_node;class profile {     public:          profile(int gsx, int gsy, int gcx, int gcy);          void update();                    int total_instances;          int gs_x, gs_y, gc_x, gc_y; // gs = grid size, gc = grid cell size          vector<profile_node> character_nodes;          grid_int_t gridcell_totals;};// related functions:bool load_profile_from_file(string filename);bool write_profile_to_file(string filename, profile *prf);// merges prof1 _into prof0_; returns false if profiles have diff grid sizes:bool merge_profiles(profile *prof1);void merge_parse_list(parse_list *plist, profile *prf);int find_character_index(string character, profile *prof); // index or -1#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?