diff --git a/Cigarette/alg_jd.cpp b/Cigarette/alg_jd.cpp index a27fb4e..9bea4ef 100644 --- a/Cigarette/alg_jd.cpp +++ b/Cigarette/alg_jd.cpp @@ -19,7 +19,7 @@ static int inpHeight = 416; // Height of network's input image static std::vector classes; -bool AlgJd::init(QString model_path, QString jpg_path) +bool AlgJd::init(QString path_model, QString path_jpg) { // Load names of classes std::string classesFile = "../model/jd.names"; @@ -28,8 +28,8 @@ bool AlgJd::init(QString model_path, QString jpg_path) cv::String modelConfiguration = "../model/jd.cfg"; cv::String modelWeights; - if (model_path.length() > 0) { - modelWeights = model_path.toStdString(); + if (path_model.length() > 0) { + modelWeights = path_model.toStdString(); } else { modelWeights = "../model/jd.weights"; @@ -54,8 +54,8 @@ bool AlgJd::init(QString model_path, QString jpg_path) //cv::Mat image = cv::imread("alg_jd.jpg"); cv::Mat image; - if (jpg_path.length() > 0) { - image = cv::imread(jpg_path.toStdString()); + if (path_jpg.length() > 0) { + image = cv::imread(path_jpg.toStdString()); } else { image = cv::imread("alg_jd.jpg"); diff --git a/Cigarette/alg_jd.h b/Cigarette/alg_jd.h index 25263f2..9b3bc83 100644 --- a/Cigarette/alg_jd.h +++ b/Cigarette/alg_jd.h @@ -12,7 +12,7 @@ class AlgJd { public: - bool init(QString model_path, QString jpg_path); + bool init(QString path_model, QString path_jpg); bool test_detect(); bool test_detect_batcht(int shoot); int detect(cv::Mat& in, cv::Mat &out, std::vector > &results); diff --git a/Cigarette/cigarette.cpp b/Cigarette/cigarette.cpp index 9359abf..a9b4487 100644 --- a/Cigarette/cigarette.cpp +++ b/Cigarette/cigarette.cpp @@ -279,7 +279,7 @@ Cigarette::Cigarette(QWidget *parent) { if(SingleCamInfo[i].Detect){ cam_status_mat[i]->setStyleSheet(tr("background-color: rgb(0, 170, 0);")); - if (!alg_jd[i].init(g_sys_conf.model_path,g_sys_conf.jpg_path)) + if (!alg_jd[i].init(g_sys_conf.path_model,g_sys_conf.path_jpg)) { QMessageBox::information(NULL, QStringLiteral("系统自检失败"), QStringLiteral("AI模型1初始化失败,请检查程序完整性"), QMessageBox::Ok); exit(-1); @@ -288,7 +288,7 @@ Cigarette::Cigarette(QWidget *parent) } } #ifdef __DEBUG - alg_test.init(g_sys_conf.model_path,g_sys_conf.jpg_path); + alg_test.init(g_sys_conf.path_model,g_sys_conf.path_jpg); #endif //自动打开所有相机 if (g_sys_conf.auto_open == 1) @@ -2028,7 +2028,7 @@ bool Cigarette::read_sys_config(SysConf &conf) } else if (tmp_key == "MODELPATH") { - conf.path = line.substr(pos + 1).c_str(); + conf.path_model = line.substr(pos + 1).c_str(); } else if (tmp_key == "JPGPATH") { diff --git a/Cigarette/common.h b/Cigarette/common.h index df82c51..c9574f9 100644 --- a/Cigarette/common.h +++ b/Cigarette/common.h @@ -76,7 +76,7 @@ public: QTime shiftB; //B换班时间 QTime shiftC; //C换班时间 QString location; // 所在地 - QString path; // 模型路径 + QString path_model; // 模型路径 QString path_jpg; // 图片路径 int timing_shift; //是否定时换班,0否,1是 int expo[NumberOfSupportedCameras]; //相机曝光时间,单位微秒 @@ -89,8 +89,6 @@ public: int MonitorPort; int FeedbackPort; int FilePort; - QString model_path; - QString jpg_path; //MonitorPort为数据端口 //MonitorPort+NumberOfSupportedCameras为图像端口 //MonitorPort+NumberOfSupportedCameras*2为发送命令端口,也就是FeedbackPort @@ -109,7 +107,7 @@ public: shift_byhand = 1; timing_shift=0; //是否定时换班,0否,1是 location = ""; - path = ""; + path_model = ""; path_jpg = ""; shiftA.setHMS(0, 0, 0); shiftB.setHMS(0, 0, 0); diff --git a/Cigarette/dialogsetup.cpp b/Cigarette/dialogsetup.cpp index fcf9841..4c5312b 100644 --- a/Cigarette/dialogsetup.cpp +++ b/Cigarette/dialogsetup.cpp @@ -261,7 +261,7 @@ void DialogSetup::on_toolButton_choose_path_released() { else { if (ui.comboBox->findText(WeightsPath) == -1) { ui.comboBox->addItem(WeightsPath); // 鍦╟omboBox涓樉绀烘枃浠惰矾寰 - g_sys_conf.path = WeightsPath; // 灏嗛夋嫨鐨勮矾寰勫啓鍏onf閰嶇疆鏂囦欢涓 + g_sys_conf.path_model = WeightsPath; // 灏嗛夋嫨鐨勮矾寰勫啓鍏onf閰嶇疆鏂囦欢涓 } } } @@ -352,7 +352,7 @@ void DialogSetup::write_config() sprintf(buf, "LOCATION=%s\n", g_sys_conf.location.toStdString().c_str()); cfg_file.write(buf, strlen(buf)); memset(buf, 0, 256); - sprintf(buf, "MODELPATH=%s\n", g_sys_conf.path.toStdString().c_str()); + sprintf(buf, "MODELPATH=%s\n", g_sys_conf.path_model.toStdString().c_str()); cfg_file.write(buf, strlen(buf)); memset(buf, 0, 256); sprintf(buf, "JPGPATH=%s\n", g_sys_conf.path_jpg.toStdString().c_str());