#include//#include #include #include #include #include //#include //#include //#include //#include #include #include #include using namespace std;using namespace cv;//FeatureEvaluatorint main(){ /************************************************************************************ 参数设置 *************************************************************************************/ //some parameters: int positive_num = 1000; int negative_num = 9000; vector v_positive_img; vector v_negative_img; //先考虑训练0 int test_char = 0; //正例、负例 string all_class_path = "C:\\Users\\cong\\Desktop\\研一实战\\项目\\图像中时间数字识别\\OCR\\result\\"; string img_txt; for (int i = 0; i < 10; i++) { //数字转字符 stringstream ss; ss << i; string test_char_str = ss.str(); img_txt = all_class_path + "result" + test_char_str + ".txt"; string path; ifstream finPos(img_txt); if (test_char == i) { //vector channels; //用来装一幅图的N个通道;还没初始化 getline(finPos, path); //应该把文件中的图片个数也记录下来,由于该次的数据集,0~9个数一样,因此,可以考虑先不这么做 int img_num = 0; //把path,第一行字符变成数字,还没有完成 for (int j = 0; j channels; //用来装一幅图的N个通道;还没初始化 getline(finPos, path); //应该把文件中的图片个数也记录下来,由于该次的数据集,0~9个数一样,因此,可以考虑先不这么做 int img_num = 0; //把path,第一行字符变成数字,还没有完成 for (int j = 0; j myRect; //float scaleFactor; //Size minSize; //Size maxSize; //float threshold; //int slidingStep; //vector values; //myICFDetector.detect(img_test, myRect, scaleFactor, 10, 50, threshold, slidingStep, values); /* C++: void ICFDetector::detect(const Mat& image, vector & objects, float scaleFactor, Size minSize, Size maxSize, float threshold, int slidingStep, std::vector & values) C++: detect(const Mat& img, std::vector & objects, float minScaleFactor, float maxScaleFactor, float factorStep, float threshold, int slidingStep, std::vector & values) Parameters: image – image for detection objects – output array of bounding boxes scaleFactor – scale between layers in detection pyramid minSize – min size of objects in pixels maxSize – max size of objects in pixels minScaleFactor – min factor by which the image will be resized maxScaleFactor – max factor by which the image will be resized factorStep – scaling factor is incremented each pyramid layer according to this parameter slidingStep – sliding window step values – output vector with values of positive samples */ return 0;}