| | |
| | | |
| | | #include "win32_screen_shots.h" |
| | | |
| | | #ifndef _NUMBER_L2_WIDTH |
| | | #define _NUMBER_L2_WIDTH 5 |
| | | #endif |
| | | |
| | | #ifndef _NUMBER_L2_HEIGHT |
| | | #define _NUMBER_L2_HEIGHT 8 |
| | | #endif |
| | | |
| | | #ifndef _NUMBER_L2_TOTAL_NUMBER |
| | | #define _NUMBER_L2_TOTAL_NUMBER 17 |
| | | #endif |
| | | |
| | | |
| | | #ifndef _NUMBER_GP_CODE_WIDTH |
| | | #define _NUMBER_GP_CODE_WIDTH 11 |
| | | #endif |
| | | |
| | | #ifndef _NUMBER_GP_CODE_HEIGHT |
| | | #define _NUMBER_GP_CODE_HEIGHT 14 |
| | | #endif |
| | | |
| | | #ifndef _NUMBER_GP_CODE_TOTAL_NUMBER |
| | | #define _NUMBER_GP_CODE_TOTAL_NUMBER 6 |
| | | #endif |
| | | |
| | | #ifndef _IMG_BINARY_THRESHOLD |
| | | #define _IMG_BINARY_THRESHOLD 64 |
| | | #endif |
| | | |
| | | |
| | | using namespace std; |
| | | class ImgUtil |
| | | { |
| | | public: |
| | | static NumberData NUMS[10]; |
| | | static NumberData NUMS_LEVEL2[10]; |
| | | static NumberData NUMS_GP_CODE[10]; |
| | | |
| | | |
| | | //数字(0-9)一维数据 |
| | | static uchar* numsOneLevel; |
| | | static const int NUM_WIDTH = 5; |
| | | static const int NUM_HEIGHT = 8; |
| | | static uchar* numsOneLevel_level2; |
| | | static uchar* numsOneLevel_gpcode; |
| | | |
| | | |
| | | private: |
| | |
| | | static list<cv::Mat> splitTime(cv::Mat img) throw(string); |
| | | //分隔小数,中间的空Mat表示小数点 |
| | | static list<cv::Mat> splitDecimal(cv::Mat img) throw(string); |
| | | //分隔整数 |
| | | static list<cv::Mat> splitNum(cv::Mat img) throw(string); |
| | | |
| | | //将0-9的数字图片做格式化 |
| | | static cv::Mat formatNum(cv::Mat num) throw(string); |
| | | static cv::Mat formatNumLevel2(cv::Mat num) throw(string); |
| | | |
| | | |
| | | |
| | | public: |
| | | |
| | |
| | | |
| | | //构建模板数据,用于opencl矩阵运算中的数字识别 |
| | | static uchar* createTemplateNumData(int lines); |
| | | |
| | | //分隔整数 |
| | | static list<cv::Mat> splitNum(cv::Mat img) throw(string); |
| | | |
| | | static cv::Mat formatNumGPCode(cv::Mat num) throw(string); |
| | | }; |
| | | |
| | | |