#pragma once #include #include 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 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 locatePoints; std::vector questionLocatePoints; //客观题题目定位点的索引 std::vector keguantiQuestionLocatePointIndexs; std::vector locateCrosses; std::vector locateAreas; std::vector codes; std::vector groups; std::vector items; std::vector tiantukaohaos; std::vector cutAreas; std::vector 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_Schema; } }