123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- #pragma once
- #include <string>
- #include <vector>
- namespace identify{
- namespace autoschema{
- //主观题类型
- enum ASCH_QUESTION_SCORE_TYPE{
- SINGLE_SCORE,
- MUTIL_SCORE
- };
- //客观题输出类型
- enum ASCH_OMR_OUT_TYPE{
- OMR_OUT_TYPE_SINGLE_NONSTRICT_ERROR,// 输出一个或*号,若解析中有0个、2个或2个以上涂点被填涂,输出*号
- OMR_OUT_TYPE_SINGLE_NONSTRICT,// 输出一个,若解析中有2个或2个以上涂点被填涂,则从中选出一个作为该组结果
- OMR_OUT_TYPE_SINGLE_STRICT,// 输出一个,若解析中有2个或2个以上涂点被填涂,则认为用户多选,输出多选字符
- OMR_OUT_TYPE_MUTIL_STRICT,//输出多选字符
- };
- struct ASCH_SCHEMA_RECT_FIELD{
- int centerx;
- int centery;
- int width;
- int height;
- };
- struct ASCH_KEGUANTI_QUESTION_LOCATEPOINT_INDEX{
- int indexs[4];
- int &operator[](int index){
- return indexs[index];
- }
- };
- struct ASCH_question_basic{
- std::string question_code;
- int question_index;
- };
- struct ASCH_SCHEMA_ELEMENT_FIELD :ASCH_SCHEMA_RECT_FIELD{
- int index;
- };
- struct ASCH_SchemaLocatePoint :ASCH_SCHEMA_ELEMENT_FIELD{//定位点
- };
- struct ASCH_SchemaLocateArea :ASCH_SCHEMA_ELEMENT_FIELD{//区域定位点
- };
- struct ASCH_SchemaLoacteCross :ASCH_SCHEMA_ELEMENT_FIELD{//交叉点定位
- };
- struct ASCH_SchemaCode :ASCH_SCHEMA_ELEMENT_FIELD{//条码、二维码
- };
- enum ASCH_DIRECTION{
- Horizontal,
- Vertical,
- DIR_UNKNOWN,
- };
- struct ASCH_SCHEMA_MATRIX :ASCH_SCHEMA_ELEMENT_FIELD{
- int nRows;
- int nCols;
- float optionWidth;
- float optionHeight;
- ASCH_DIRECTION direction;
- char outputchars[256];
- };
- typedef ASCH_SCHEMA_MATRIX ASCH_TIANTUKAOHAO;
- struct ASCH_SchemaItem :ASCH_SCHEMA_ELEMENT_FIELD{//填涂项
- //填涂项输出字符
- char OutChar;
- int keguanti_question_locate_point_index;
- };
- struct ASCH_SchemaGroup :ASCH_SCHEMA_ELEMENT_FIELD, ASCH_question_basic{//填涂组
- //本组涂点涂点数量
- int itemCount;
- //记录本组涂点位置索引
- std::vector<int> itemIndex;
- //OMR 输出类型
- ASCH_OMR_OUT_TYPE omr_out_type;
- };
- struct ASCH_SchemaCutArea :ASCH_SCHEMA_ELEMENT_FIELD{//切割区域
- //是否该题第一个区域
- bool isfirst;
- //裁切区域名称(当isfirst为真时有效)
- std::string area_name;
- //该区域对应的题目索引(当isfirst为真时有效)
- int question_index;
- };
- struct ASCH_SchemaQuestionScore :ASCH_SCHEMA_ELEMENT_FIELD, ASCH_question_basic{//题目分数
- ASCH_QUESTION_SCORE_TYPE type;
- struct Point{
- int x;
- int y;
- }lt, rt, lb, rb;
- //填涂框数量
- int count;
- int questionLocatePointIndex[2];
- int valid_option_count;
- };
- struct ASCH_SchemaPage{
- ASCH_SchemaPage(){
- group_spacer = ';';
- hei_du_ling_min_du = 4;
- height = 0;
- index = 0;
- option_spacer = ',';
- unselect_char = '*';
- user_float_heidu = 4;
- width = 0;
- worthwhileBlk = 4;
- }
- //从0开始的页面
- int index;
- int width;
- int height;
- std::string paper_id;
- std::string student_code;
- std::vector<ASCH_SchemaLocatePoint> locatePoints;
- std::vector<ASCH_SchemaLocatePoint> questionLocatePoints;
- //客观题题目定位点的索引
- std::vector<ASCH_KEGUANTI_QUESTION_LOCATEPOINT_INDEX> keguantiQuestionLocatePointIndexs;
- std::vector<ASCH_SchemaLoacteCross> locateCrosses;
- std::vector<ASCH_SchemaLocateArea> locateAreas;
- std::vector<ASCH_SchemaCode> codes;
- std::vector<ASCH_SchemaGroup> groups;
- std::vector<ASCH_SchemaItem> items;
- std::vector<ASCH_TIANTUKAOHAO> tiantukaohaos;
- std::vector<ASCH_SchemaCutArea> cutAreas;
- std::vector<ASCH_SchemaQuestionScore> question_score;
- //黑度整体浮动系数
- int user_float_heidu;
- //黑度选中灵敏度
- int worthwhileBlk;
- //多个选项之间的间隔字符
- char option_spacer;
- //选择题没有选择时的输出字符
- char unselect_char;
- //两组选择题之间的间隔字符
- char group_spacer;
- //
- int hei_du_ling_min_du;
- };
- typedef std::vector<ASCH_SchemaPage> ASCH_Schema;
- }
- }
|