修改部分中文路径读取文件异常的问题

main
seiyu 1 year ago
parent a4a9b3f7e1
commit dfacffd891

@ -151,7 +151,6 @@
<ClCompile Include="alarmdialog.cpp" /> <ClCompile Include="alarmdialog.cpp" />
<ClCompile Include="AlarmInfo.cpp" /> <ClCompile Include="AlarmInfo.cpp" />
<ClCompile Include="alg_jd.cpp" /> <ClCompile Include="alg_jd.cpp" />
<ClCompile Include="alg_jd_ng.cpp" />
<ClCompile Include="ASyncQueue.cpp" /> <ClCompile Include="ASyncQueue.cpp" />
<ClCompile Include="balluffcamera.cpp" /> <ClCompile Include="balluffcamera.cpp" />
<ClCompile Include="basecamera.cpp" /> <ClCompile Include="basecamera.cpp" />
@ -394,7 +393,6 @@
</CustomBuild> </CustomBuild>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="alg_jd_ng.h" />
<ClInclude Include="tinyxml2.h" /> <ClInclude Include="tinyxml2.h" />
<CustomBuild Include="threadReceive.h"> <CustomBuild Include="threadReceive.h">
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs> <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>

@ -257,9 +257,6 @@
<ClCompile Include="tinyxml2.cpp"> <ClCompile Include="tinyxml2.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="alg_jd_ng.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<CustomBuild Include="cigarette.h"> <CustomBuild Include="cigarette.h">
@ -420,8 +417,5 @@
<ClInclude Include="tinyxml2.h"> <ClInclude Include="tinyxml2.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="alg_jd_ng.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -152,6 +152,7 @@ void AlgJd::analyse(cv::Mat vec_in, std::vector<std::pair<int, cv::Rect> >& vec_
cv::imshow("analyse", topography); cv::imshow("analyse", topography);
cv::waitKey(1); cv::waitKey(1);
} }
} }
// Get the names of the output layers // Get the names of the output layers

@ -15,7 +15,6 @@ class AlgJd
bool init(QString model_path, QString model_name); bool init(QString model_path, QString model_name);
bool test_detect(); bool test_detect();
bool test_detect_batcht(int shoot); bool test_detect_batcht(int shoot);
int detect(cv::Mat& in, cv::Mat &draw_frame, cv::Mat& out, std::vector<std::pair<int, cv::Rect> >& results);
int detect(cv::Mat& in, cv::Mat &out, std::vector<std::pair<int, cv::Rect> > &results); int detect(cv::Mat& in, cv::Mat &out, std::vector<std::pair<int, cv::Rect> > &results);
// Remove the bounding boxes with low confidence using non-maxima suppression // Remove the bounding boxes with low confidence using non-maxima suppression
void post_process(cv::Mat& frame, std::vector<cv::Mat>& outs, std::vector<std::pair<int, cv::Rect> > &results); void post_process(cv::Mat& frame, std::vector<cv::Mat>& outs, std::vector<std::pair<int, cv::Rect> > &results);
@ -32,10 +31,5 @@ class AlgJd
cv::dnn::Net net; cv::dnn::Net net;
std::vector<std::string> classes; std::vector<std::string> classes;
}; };
//jinhuan+
bool sort_rect_by_x_center(cv::Rect r1, cv::Rect r2);
bool sort_rect_by_y_center(cv::Rect r1, cv::Rect r2);
bool sort_rect_by_height(cv::Rect r1, cv::Rect r2);
bool sort_rect_by_width(cv::Rect r1, cv::Rect r2);
//jinhuan-
#endif //end of _CIGARETTE_JD #endif //end of _CIGARETTE_JD

@ -28,10 +28,8 @@ QDateTime g_ts_start;
extern SingleCamInfoStruct SingleCamInfo[NumberOfSupportedCameras]; extern SingleCamInfoStruct SingleCamInfo[NumberOfSupportedCameras];
AlgJd alg_jd[NumberOfSupportedCameras]; //检测胶点的AI算法 AlgJd alg_jd[NumberOfSupportedCameras]; //检测胶点的AI算法
AlgJd_ng alg_jd_ng[NumberOfSupportedCameras]; // 检测卡纸、薄膜褶皱
#ifdef __DEBUG #ifdef __DEBUG
AlgJd alg_test;//test AI算法 AlgJd alg_test;//test AI算法
AlgKz alg_kz_test;
#endif #endif
QThread* pThread[NumberOfSupportedCameras]; QThread* pThread[NumberOfSupportedCameras];
@ -92,7 +90,6 @@ VOID BeforeWork(int shoot[])
{ {
if (SingleCamInfo[i].Detect && SingleCamInfo[i].IsOpen) { if (SingleCamInfo[i].Detect && SingleCamInfo[i].IsOpen) {
alg_jd[i].test_detect_batcht(shoot[i]); alg_jd[i].test_detect_batcht(shoot[i]);
alg_jd_ng[i].test_detect_batcht_ng(shoot[i]);
} }
} }
} }
@ -105,6 +102,7 @@ Cigarette::Cigarette(QWidget *parent)
ui.setupUi(this); ui.setupUi(this);
InitPtrMat(); InitPtrMat();
read_conf(g_conf_path); read_conf(g_conf_path);
if (!g_conf_path.config_path.isEmpty()) { if (!g_conf_path.config_path.isEmpty()) {
// 如果非空 // 如果非空
QDir* dirinfo = new QDir(g_conf_path.config_path); QDir* dirinfo = new QDir(g_conf_path.config_path);
@ -276,7 +274,6 @@ Cigarette::Cigarette(QWidget *parent)
m_PLCDevice = new PLCDevice; m_PLCDevice = new PLCDevice;
PLCDevice::init_plc(m_PLCDevice); PLCDevice::init_plc(m_PLCDevice);
if(m_PLCDevice->g_plc_ok) if(m_PLCDevice->g_plc_ok)
{ {
printf("Connected to dev!\n"); printf("Connected to dev!\n");
@ -314,36 +311,26 @@ Cigarette::Cigarette(QWidget *parent)
{ {
if(SingleCamInfo[i].Detect){ if(SingleCamInfo[i].Detect){
cam_status_mat[i]->setStyleSheet(tr("background-color: rgb(0, 170, 0);")); cam_status_mat[i]->setStyleSheet(tr("background-color: rgb(0, 170, 0);"));
QString model_path, model_name;
QString model_path, model1_name, model2_name;
if (g_sys_conf.model_path.isEmpty()) { if (g_sys_conf.model_path.isEmpty()) {
model_path = "D:/model"; model_path = "D:/model";
//g_sys_conf.model_path = model_path; g_sys_conf.model_path = "D:/model";
} }
else else
model_path = g_sys_conf.model_path; model_path = g_sys_conf.model_path;
if (g_sys_conf.model1_name.isEmpty()) { if (g_sys_conf.model_name.isEmpty()) {
model1_name = "jd.weights"; model_name = "jd.weights";
g_sys_conf.model1_name = model1_name; g_sys_conf.model_name = "jd.weights";
model2_name = "jd_ng.weights";
g_sys_conf.model2_name = model2_name;
}
else {
model1_name = g_sys_conf.model1_name;
model2_name = g_sys_conf.model2_name;
} }
else
model_name = g_sys_conf.model_name;
if (!alg_jd[i].init(model_path, model1_name)) if (!alg_jd[i].init(model_path, model_name))
{ {
QMessageBox::information(NULL, QStringLiteral("系统自检失败"), QStringLiteral("AI模型1初始化失败请检查程序完整性"), QMessageBox::Ok); QMessageBox::information(NULL, QStringLiteral("系统自检失败"), QStringLiteral("AI模型1初始化失败请检查程序完整性"), QMessageBox::Ok);
exit(-1); exit(-1);
} }
else if (!alg_jd_ng[i].init_ng(model_path, model2_name))
{
QMessageBox::information(NULL, QStringLiteral("系统自检失败"), QStringLiteral("AI模型2初始化失败请检查程序完整性"), QMessageBox::Ok);
exit(-1);
}
CreatWorkThread(SingleCamInfo[i].CamClass, i, this); CreatWorkThread(SingleCamInfo[i].CamClass, i, this);
} }
else { else {
@ -390,8 +377,7 @@ Cigarette::Cigarette(QWidget *parent)
} }
#ifdef __DEBUG #ifdef __DEBUG
alg_test.init(g_sys_conf.model_path, g_sys_conf.model1_name);//test AI算法 alg_test.init(g_sys_conf.model_path, g_sys_conf.model_name);//test AIËã·¨
alg_kz_test.init(g_sys_conf.model_path, g_sys_conf.model2_name);
#endif #endif
//自动打开所有相机 //自动打开所有相机
@ -792,14 +778,7 @@ void Cigarette::TestImg()
} }
std::vector<std::pair<int, cv::Rect> > results; std::vector<std::pair<int, cv::Rect> > results;
cv::Mat output; cv::Mat output;
// alg_test.detect(imagein, output, results); alg_test.detect(imagein, output,results);
//alg_kz_test.detect(imagein, output, results);
cv::Mat transit = imagein.clone();
//std::vector<std::pair<int, cv::Rect> > results;
alg_test.detect(imagein, transit, output, results);
alg_kz_test.detect(imagein, transit, output, results);
std::string WindowName = "TestImg"; std::string WindowName = "TestImg";
cv::namedWindow(WindowName, cv::WINDOW_NORMAL); cv::namedWindow(WindowName, cv::WINDOW_NORMAL);
cv::imshow(WindowName, output); cv::imshow(WindowName, output);
@ -835,17 +814,12 @@ void Cigarette::TestImgs()
} }
cv::Mat output; cv::Mat output;
cv::Mat transit = imagein.clone();
std::vector<std::pair<int, cv::Rect> > results; std::vector<std::pair<int, cv::Rect> > results;
std::vector<cv::Rect> vec_jd_results; alg_test.detect(imagein, output,results);
std::vector<cv::Rect> vec_bm_results; std::string WindowName = "TestImg";
alg_test.detect(imagein, transit, output, results);
alg_kz_test.detect(imagein, transit, output, results);
std::string WindowName = "TestImgs";
cv::namedWindow(WindowName, cv::WINDOW_NORMAL); cv::namedWindow(WindowName, cv::WINDOW_NORMAL);
cv::imshow(WindowName, transit); cv::imshow(WindowName, output);
int k = cv::waitKeyEx(100); int k = cv::waitKeyEx(1);
if (k == 27)break;//ESC键 if (k == 27)break;//ESC键
#ifdef __ExportData #ifdef __ExportData
alg_test.analyse(imagein, results); alg_test.analyse(imagein, results);
@ -2410,26 +2384,6 @@ bool Cigarette::read_sys_config(SysConf &conf, QString conf_path)
{ ///相似度 { ///相似度
conf.ConfThreshold = atoi(line.substr(pos + 1).c_str()); conf.ConfThreshold = atoi(line.substr(pos + 1).c_str());
} }
else if (tmp_key == "CONFTHRESHOLDS")
{ ///相似度
std::vector<std::string> vec_info;
string_split(line.substr(pos + 1), "|",vec_info);
if (vec_info.size() == 4)
{
conf.ConfThresholds[0]=atoi(vec_info[0].c_str());// 0 胶点
conf.ConfThresholds[1]=atoi(vec_info[1].c_str());// 1 卡纸
conf.ConfThresholds[2]=atoi(vec_info[2].c_str());// 2 薄膜
conf.ConfThresholds[3]=atoi(vec_info[3].c_str());// 3 卡纸下
}
}
else if (tmp_key == "UP_JD_SPACE")
{ /// 是否自动打开相机0否1是
conf.Up_jd_Space= atoi(line.substr(pos + 1).c_str());
}
else if (tmp_key == "DOWN_JD_SPACE")
{ /// 是否自动打开相机0否1是
conf.Down_jd_Space = atoi(line.substr(pos + 1).c_str());
}
else if (tmp_key == "AUTO_OPEN") else if (tmp_key == "AUTO_OPEN")
{ /// 是否自动打开相机0否1是 { /// 是否自动打开相机0否1是
conf.auto_open = atoi(line.substr(pos + 1).c_str()); conf.auto_open = atoi(line.substr(pos + 1).c_str());
@ -2483,11 +2437,7 @@ bool Cigarette::read_sys_config(SysConf &conf, QString conf_path)
} }
else if (tmp_key == "MODELNAME") else if (tmp_key == "MODELNAME")
{ {
conf.model1_name = line.substr(pos + 1).c_str(); conf.model_name = line.substr(pos + 1).c_str();
}
else if (tmp_key == "KZMODELNAME")
{
conf.model2_name = line.substr(pos + 1).c_str();
} }
else if (tmp_key == "JPGPATH") else if (tmp_key == "JPGPATH")
{ {
@ -3006,11 +2956,13 @@ void Cigarette::read_plc_items()
std::fstream cfg_file; std::fstream cfg_file;
QString plc_file = g_conf_path.config_path + "/" + PLC_CONFIG_FILE; QString plc_file = g_conf_path.config_path + "/" + PLC_CONFIG_FILE;
cfg_file.open(plc_file.toLocal8Bit().constData()); cfg_file.open(plc_file.toLocal8Bit().constData());
if (!cfg_file.is_open()) if (!cfg_file.is_open())
{ {
std::cout << "Error: Open production file " << PLC_CONFIG_FILE << std::endl; std::cout << "Error: Open production file " << PLC_CONFIG_FILE << std::endl;
return; return;
} }
while (!cfg_file.eof()) while (!cfg_file.eof())
{ {
char tmp[1024] = ""; char tmp[1024] = "";
@ -3844,18 +3796,25 @@ void Cigarette::CleanThreadStartAuto()
void Cigarette::record_output_statistic(qint64 quantity, int Kick[NumberOfSupportedCameras], int shift) void Cigarette::record_output_statistic(qint64 quantity, int Kick[NumberOfSupportedCameras], int shift)
{ {
QString file_name, file_path;
for (int i = 0; i < NumberOfSupportedCameras; i++) for (int i = 0; i < NumberOfSupportedCameras; i++)
{ {
if (SingleCamInfo[i].IsOpen && quantity > 0) { if (SingleCamInfo[i].IsOpen && quantity > 0) {
std::fstream cfg_file; std::fstream cfg_file;
char str[256]; //char str[256];
memset(str, 0, 256); //memset(str, 0, 256);
sprintf(str, STATISTIC_FILE, i); //sprintf(str, STATISTIC_FILE, i);
//char buf[256];
//memset(buf, 0, 256);
//sprintf(buf, "%s/%s", g_conf_path.config_path.toLocal8Bit().constData(), str);
file_name = QString(STATISTIC_FILE).arg(i);
file_path = g_conf_path.config_path + "/" + file_name;
char buf[256]; char buf[256];
memset(buf, 0, 256); memset(buf, 0, 256);
sprintf(buf, "%s/%s", g_conf_path.config_path.toLocal8Bit().constData(), str); sprintf(buf, "%s", file_path.toLocal8Bit().constData());
//std::cout<<"===buf>"<<buf<<std::endl; //std::cout<<"===buf>"<<buf<<std::endl;
cfg_file.open(buf, std::ios::app); cfg_file.open(buf, std::ios::app);
if (cfg_file.good()) if (cfg_file.good())
{ {
@ -4058,14 +4017,18 @@ void Cigarette::recMsgFromUdp(QString data)
} }
else if (data == "GETCONF") else if (data == "GETCONF")
{ {
QString file_name, file_path;
sThread.sendFile(g_conf_path.config_path, g_sys_conf.FilePort); sThread.sendFile(g_conf_path.config_path, g_sys_conf.FilePort);
for(int i=0;i<NumberOfSupportedCameras;i++) for(int i=0;i<NumberOfSupportedCameras;i++)
{ {
char buf[256]; //char buf[256];
memset(buf, 0, 256); //memset(buf, 0, 256);
sprintf(buf, STATISTIC_FILE, i); //sprintf(buf, STATISTIC_FILE, i);
QString str(buf); //QString str(buf);
sThread.sendFile(str.toLocal8Bit().constData(), g_sys_conf.FilePort);
file_name = QString(STATISTIC_FILE).arg(i);
file_path = g_conf_path.config_path + "/" + file_name;
sThread.sendFile(file_path.toLocal8Bit().constData(), g_sys_conf.FilePort);
} }
} }

@ -7,7 +7,6 @@
#include "dialogsetup.hpp" #include "dialogsetup.hpp"
#include "plcsetup.hpp" #include "plcsetup.hpp"
#include "alg_jd.h" #include "alg_jd.h"
#include "alg_jd_ng.h"
#include "balluffcamera.h" #include "balluffcamera.h"
#include "baslercamera.h" #include "baslercamera.h"
#include "hikcamera.h" #include "hikcamera.h"

@ -56,7 +56,7 @@ void DrawSelectRects(cv::Mat input,DisplayLabelConf &t_DisplayLabelConf,int Cnt)
cv::Point( cv::Point(
t_DisplayLabelConf.processPoint.x * input.cols, t_DisplayLabelConf.processPoint.x * input.cols,
t_DisplayLabelConf.processPoint.y * input.rows), t_DisplayLabelConf.processPoint.y * input.rows),
cv::Scalar(127, 255, 0), cv::Scalar(0, 0, 255),
4); 4);
} }
for (int i = 0; i < t_DisplayLabelConf.RectVet[Cnt].size(); i++) { for (int i = 0; i < t_DisplayLabelConf.RectVet[Cnt].size(); i++) {
@ -68,7 +68,7 @@ void DrawSelectRects(cv::Mat input,DisplayLabelConf &t_DisplayLabelConf,int Cnt)
cv::Point( cv::Point(
t_DisplayLabelConf.RectVet[Cnt][i].BR.x * input.cols, t_DisplayLabelConf.RectVet[Cnt][i].BR.x * input.cols,
t_DisplayLabelConf.RectVet[Cnt][i].BR.y * input.rows), t_DisplayLabelConf.RectVet[Cnt][i].BR.y * input.rows),
cv::Scalar(127, 255, 0), cv::Scalar(0, 0, 255),
4); 4);
} }
} }

@ -86,9 +86,6 @@ public:
int freesize; /// 设定清理图片最小空间 int freesize; /// 设定清理图片最小空间
std::string ComPort; ///COM口 std::string ComPort; ///COM口
int ConfThreshold; //识别率 int ConfThreshold; //识别率
int ConfThresholds[4]; //四类别识别率
int Up_jd_Space; //上方胶点到卡纸上边间距
int Down_jd_Space; //下方胶点到卡纸下边间距
int auto_open; //是否自动打开相机0否1是 int auto_open; //是否自动打开相机0否1是
int auto_work; //是否自动开始工作0否1是 int auto_work; //是否自动开始工作0否1是
int auto_shift; //是否自动换班0否1是 int auto_shift; //是否自动换班0否1是
@ -98,8 +95,7 @@ public:
QTime shiftC; //C换班时间 QTime shiftC; //C换班时间
QString location; // 所在地 QString location; // 所在地
QString model_path; // 模型文件夹路径 QString model_path; // 模型文件夹路径
QString model1_name; // 模型名 QString model_name; // Ä£ÐÍÃû
QString model2_name;
QString model_jpg_path; // 模型图片路径 QString model_jpg_path; // 模型图片路径
int timing_shift; //是否定时换班0否1是 int timing_shift; //是否定时换班0否1是
int expo[NumberOfSupportedCameras]; //相机曝光时间,单位微秒 int expo[NumberOfSupportedCameras]; //相机曝光时间,单位微秒
@ -125,9 +121,6 @@ public:
freesize = 10; /// 设定清理图片最小空间 freesize = 10; /// 设定清理图片最小空间
ComPort = "COM1"; ///COM口 ComPort = "COM1"; ///COM口
ConfThreshold = 1; ///百分比识别率 ConfThreshold = 1; ///百分比识别率
ConfThresholds[4] = 0; ///四类别百分比识别率
Up_jd_Space = 0; //上方胶点到卡纸上边间距
Down_jd_Space = 0; //下方胶点到卡纸下边间距
auto_open=1; //是否自动打开相机0否1是 auto_open=1; //是否自动打开相机0否1是
auto_work=1; //是否自动开始工作0否1是 auto_work=1; //是否自动开始工作0否1是
auto_shift=0; //是否自动换班0否1是 auto_shift=0; //是否自动换班0否1是
@ -135,8 +128,7 @@ public:
timing_shift = 0; //是否定时换班0否1是 timing_shift = 0; //是否定时换班0否1是
location = ""; location = "";
model_path = ""; model_path = "";
model1_name = ""; model_name = "";
model2_name = "";
model_jpg_path = ""; model_jpg_path = "";
shiftA.setHMS(0, 0, 0); shiftA.setHMS(0, 0, 0);
shiftB.setHMS(0, 0, 0); shiftB.setHMS(0, 0, 0);

@ -1,2 +1,2 @@
CONF_PATH=D:/conf-test CONF_PATH=D:/conf-模型1
SAVE_PICS_PATH=D:/image SAVE_PICS_PATH=D:/image-中文测试

@ -90,17 +90,17 @@ DialogSetup::DialogSetup(QWidget * parent) : QDialog(parent) {
fileList.removeOne(".."); fileList.removeOne("..");
ui.comboBox_model_path->clear(); ui.comboBox_model_path->clear();
ui.comboBox_model_path->addItems(fileList); ui.comboBox_model_path->addItems(fileList);
if (!g_sys_conf.model1_name.isEmpty()) { if (!g_sys_conf.model_name.isEmpty()) {
// 如果曾选择过模型则在comboBox显示选择模型的文件名 // 如果曾选择过模型则在comboBox显示选择模型的文件名
ui.comboBox_model_path->setCurrentText(g_sys_conf.model1_name); ui.comboBox_model_path->setCurrentText(g_sys_conf.model_name);
} }
delete dirinfo, dirinfo = nullptr; delete dirinfo, dirinfo = nullptr;
} }
else { else {
// 如果未曾选择过模型文件夹 // 如果未曾选择过模型文件夹
if (!g_sys_conf.model1_name.isEmpty()) { if (!g_sys_conf.model_name.isEmpty()) {
// 如果曾经选择过模型文件 // 如果曾经选择过模型文件
ui.comboBox_model_path->addItem(g_sys_conf.model1_name); ui.comboBox_model_path->addItem(g_sys_conf.model_name);
} }
} }
// 更换模型事件 // 更换模型事件
@ -114,9 +114,8 @@ DialogSetup::DialogSetup(QWidget * parent) : QDialog(parent) {
dirinfo->mkdir(g_conf_path.save_pics_path); dirinfo->mkdir(g_conf_path.save_pics_path);
} }
ui.comboBox_save_pics_path->clear(); //ui.comboBox_save_pics_path->clear();
ui.comboBox_save_pics_path->addItem(g_conf_path.save_pics_path); ui.comboBox_save_pics_path->addItem(g_conf_path.save_pics_path);
delete dirinfo, dirinfo = nullptr; delete dirinfo, dirinfo = nullptr;
} }
else { else {
@ -124,7 +123,7 @@ DialogSetup::DialogSetup(QWidget * parent) : QDialog(parent) {
QDir *dirinfo = new QDir(dirPath); QDir *dirinfo = new QDir(dirPath);
if (!dirinfo->exists()) if (!dirinfo->exists())
delete dirinfo, dirinfo = nullptr; delete dirinfo, dirinfo = nullptr;
ui.comboBox_save_pics_path->clear(); //ui.comboBox_save_pics_path->clear();
ui.comboBox_save_pics_path->setCurrentText(dirPath); ui.comboBox_save_pics_path->setCurrentText(dirPath);
g_conf_path.save_pics_path = dirPath; g_conf_path.save_pics_path = dirPath;
} }
@ -175,7 +174,7 @@ void DialogSetup::onComboBoxSelect(int index) {
// 获取comboBox当前内容 // 获取comboBox当前内容
QString ct = ui.comboBox_model_path->currentText(); QString ct = ui.comboBox_model_path->currentText();
// 保存到配置文件中 // 保存到配置文件中
g_sys_conf.model1_name = ct; g_sys_conf.model_name = ct;
} }
void DialogSetup::on_toolButton_keyboard_released() void DialogSetup::on_toolButton_keyboard_released()
@ -392,7 +391,7 @@ void DialogSetup::on_toolButton_choose_model_path_released() {
QString dirName = QFileDialog::getExistingDirectory(this, QStringLiteral("请选择模型所在文件夹"), "./"); QString dirName = QFileDialog::getExistingDirectory(this, QStringLiteral("请选择模型所在文件夹"), "./");
//std::cout << "dirName is " << dirName.toStdString().c_str() << std::endl; //std::cout << "dirName is " << dirName.toStdString().c_str() << std::endl;
//std::cout << "g_sys_conf.dir_path is " << g_sys_conf.dir_path.toStdString().c_str() << std::endl; //std::cout << "g_sys_conf.dir_path is " << g_sys_conf.dir_path.toStdString().c_str() << std::endl;
//std::cout << "g_sys_conf.model1_name is " << g_sys_conf.model1_name.toStdString().c_str() << std::endl; //std::cout << "g_sys_conf.model_name is " << g_sys_conf.model_name.toStdString().c_str() << std::endl;
if (dirName.isEmpty()) { if (dirName.isEmpty()) {
if (g_sys_conf.model_path.isEmpty()) if (g_sys_conf.model_path.isEmpty())
@ -402,7 +401,7 @@ void DialogSetup::on_toolButton_choose_model_path_released() {
ui.comboBox_model_path->addItem(dirName); ui.comboBox_model_path->addItem(dirName);
g_sys_conf.model_path = dirName; g_sys_conf.model_path = dirName;
g_sys_conf.model1_name = "jd.weights"; g_sys_conf.model_name = "jd.weights";
} }
QDir* dirinfo = new QDir(dirName); QDir* dirinfo = new QDir(dirName);
if (!dirinfo->exists()) if (!dirinfo->exists())
@ -411,7 +410,7 @@ void DialogSetup::on_toolButton_choose_model_path_released() {
QStringList fileList = dirinfo->entryList(QDir::Files); QStringList fileList = dirinfo->entryList(QDir::Files);
if (fileList.count() == 0) { if (fileList.count() == 0) {
g_sys_conf.model_path = "D:/model"; g_sys_conf.model_path = "D:/model";
g_sys_conf.model1_name = "jd.weights"; g_sys_conf.model_name = "jd.weights";
} }
else else
g_sys_conf.model_path = dirName; g_sys_conf.model_path = dirName;
@ -421,7 +420,7 @@ void DialogSetup::on_toolButton_choose_model_path_released() {
ui.comboBox_model_path->clear(); ui.comboBox_model_path->clear();
ui.comboBox_model_path->addItems(fileList); ui.comboBox_model_path->addItems(fileList);
//g_sys_conf.model1_name = ui.comboBox_model_path->currentText(); //g_sys_conf.model_name = ui.comboBox_model_path->currentText();
connect(ui.comboBox_model_path, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxSelect(int))); connect(ui.comboBox_model_path, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxSelect(int)));
delete dirinfo, dirinfo = nullptr; delete dirinfo, dirinfo = nullptr;
@ -436,7 +435,7 @@ void DialogSetup::on_toolButton_choose_save_pics_path_released() {
dirName = "D:/image"; dirName = "D:/image";
else else
dirName = g_conf_path.save_pics_path; dirName = g_conf_path.save_pics_path;
ui.comboBox_save_pics_path->addItem(dirName); //ui.comboBox_save_pics_path->addItem(dirName);
//return; //return;
} }
@ -444,14 +443,17 @@ void DialogSetup::on_toolButton_choose_save_pics_path_released() {
if (!dirinfo->exists()) if (!dirinfo->exists())
delete dirinfo, dirinfo = nullptr; delete dirinfo, dirinfo = nullptr;
ui.comboBox_save_pics_path->clear(); QFileInfo fileInfo(dirName);
ui.comboBox_save_pics_path->addItem(dirName); if (fileInfo.isDir() && ui.comboBox_save_pics_path->findText(fileInfo.absoluteFilePath())) {
//g_conf_path.save_pics_path = dirName; ui.comboBox_save_pics_path->addItem(fileInfo.absoluteFilePath());
ui.comboBox_save_pics_path->setCurrentText(fileInfo.absoluteFilePath());
}
connect(ui.comboBox_save_pics_path, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxPicsPathSelect(int))); g_conf_path.save_pics_path = dirName;
delete dirinfo, dirinfo = nullptr; connect(ui.comboBox_save_pics_path, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxPicsPathSelect(int)));
write_conf_path(); write_conf_path();
delete dirinfo, dirinfo = nullptr;
} }
void DialogSetup::on_toolButton_choose_path_jpg_released() { void DialogSetup::on_toolButton_choose_path_jpg_released() {
@ -536,15 +538,6 @@ void DialogSetup::write_config()
memset(buf, 0, 256);/// memset(buf, 0, 256);///
sprintf(buf, "CONFTHRESHOLD=%d\n", g_sys_conf.ConfThreshold); sprintf(buf, "CONFTHRESHOLD=%d\n", g_sys_conf.ConfThreshold);
cfg_file.write(buf, strlen(buf)); cfg_file.write(buf, strlen(buf));
memset(buf, 0, 256);///
sprintf(buf, "CONFTHRESHOLDS=%d|%d|%d|%d\n", g_sys_conf.ConfThresholds[0], g_sys_conf.ConfThresholds[1], g_sys_conf.ConfThresholds[2], g_sys_conf.ConfThresholds[3]);
cfg_file.write(buf, strlen(buf));
memset(buf, 0, 256);
sprintf(buf, "UP_JD_SPACE=%d\n", g_sys_conf.Up_jd_Space);
cfg_file.write(buf, strlen(buf));
memset(buf, 0, 256);
sprintf(buf, "DOWN_JD_SPACE=%d\n", g_sys_conf.Down_jd_Space);
cfg_file.write(buf, strlen(buf));
memset(buf, 0, 256); memset(buf, 0, 256);
sprintf(buf, "AUTO_OPEN=%d\n", g_sys_conf.auto_open); sprintf(buf, "AUTO_OPEN=%d\n", g_sys_conf.auto_open);
cfg_file.write(buf, strlen(buf)); cfg_file.write(buf, strlen(buf));
@ -576,10 +569,7 @@ void DialogSetup::write_config()
sprintf(buf, "MODELPATH=%s\n", g_sys_conf.model_path.toStdString().c_str()); sprintf(buf, "MODELPATH=%s\n", g_sys_conf.model_path.toStdString().c_str());
cfg_file.write(buf, strlen(buf)); cfg_file.write(buf, strlen(buf));
memset(buf, 0, 256); memset(buf, 0, 256);
sprintf(buf, "MODELNAME=%s\n", g_sys_conf.model1_name.toStdString().c_str()); sprintf(buf, "MODELNAME=%s\n", g_sys_conf.model_name.toStdString().c_str());
cfg_file.write(buf, strlen(buf));
memset(buf, 0, 256);
sprintf(buf, "KZMODELNAME=%s\n", g_sys_conf.model2_name.toStdString().c_str());
cfg_file.write(buf, strlen(buf)); cfg_file.write(buf, strlen(buf));
memset(buf, 0, 256); memset(buf, 0, 256);
sprintf(buf, "JPGPATH=%s\n", g_sys_conf.model_jpg_path.toStdString().c_str()); sprintf(buf, "JPGPATH=%s\n", g_sys_conf.model_jpg_path.toStdString().c_str());

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>660</width> <width>682</width>
<height>992</height> <height>900</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">
@ -24,17 +24,26 @@
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: rgb(240, 240, 240);</string> <string notr="true">background-color: rgb(240, 240, 240);</string>
</property> </property>
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>683</width>
<height>900</height>
</rect>
</property>
<widget class="QScrollArea" name="scrollArea"> <widget class="QScrollArea" name="scrollArea">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>661</width> <width>681</width>
<height>1000</height> <height>901</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -52,9 +61,9 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>-122</y>
<width>670</width> <width>670</width>
<height>977</height> <height>1000</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -66,7 +75,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>670</width> <width>670</width>
<height>900</height> <height>1000</height>
</size> </size>
</property> </property>
<widget class="QGroupBox" name="groupBox_startSets"> <widget class="QGroupBox" name="groupBox_startSets">
@ -2166,6 +2175,7 @@
</widget> </widget>
</widget> </widget>
</widget> </widget>
</widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources> <resources>
<include location="cigarette.qrc"/> <include location="cigarette.qrc"/>

@ -82,11 +82,11 @@ void output_statistic::recMsgFromDialogSetup()
for (int i = 0; i < NumberOfSupportedCameras; i++) { for (int i = 0; i < NumberOfSupportedCameras; i++) {
file_name = QString(STATISTIC_FILE).arg(i); file_name = QString(STATISTIC_FILE).arg(i);
file_path = g_conf_path.config_path + "/" + file_name; file_path = g_conf_path.config_path + "/" + file_name;
//std::cout << "===>" << file_path.toStdString() << std::endl;
file.setFileName(file_path); file.setFileName(file_path);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) if (file.open(QIODevice::ReadOnly | QIODevice::Text))
{ {
QTextStream in(&file); QTextStream in(&file);
//in.setCodec("UTF-8");
textBrowser_mat[i]->setText(in.readAll()); textBrowser_mat[i]->setText(in.readAll());
} }
else { else {

@ -244,7 +244,10 @@ void PlcSetup::handleTimeout()
void PlcSetup::read_plc_items() void PlcSetup::read_plc_items()
{ {
std::fstream cfg_file; std::fstream cfg_file;
cfg_file.open(g_conf_path.config_path.toStdString() + "/" + PLC_ITEM_FILE); QString plc_file = g_conf_path.config_path + "/" + PLC_CONFIG_FILE;
cfg_file.open(plc_file.toLocal8Bit().constData());
if (!cfg_file.is_open()) if (!cfg_file.is_open())
{ {
std::cout << "Error: Open production file " << PLC_ITEM_FILE << std::endl; std::cout << "Error: Open production file " << PLC_ITEM_FILE << std::endl;
@ -277,7 +280,8 @@ void PlcSetup::read_plc_items()
void PlcSetup::save_plc_items() void PlcSetup::save_plc_items()
{ {
std::fstream cfg_file; std::fstream cfg_file;
cfg_file.open(g_conf_path.config_path.toStdString() + "/" + PLC_ITEM_FILE, std::ios::out | std::ios::trunc); QString plc_file = g_conf_path.config_path + "/" + PLC_CONFIG_FILE;
cfg_file.open(plc_file.toLocal8Bit().constData(), std::ios::out | std::ios::trunc);
if (cfg_file.good()) if (cfg_file.good())
{ {
for (int i = 0; i < m_plc_items.size(); i++) for (int i = 0; i < m_plc_items.size(); i++)

@ -55,7 +55,6 @@ protected:
std::pair<std::string, cv::Mat> element; std::pair<std::string, cv::Mat> element;
g_save_queue->take(element); g_save_queue->take(element);
std::string file_name = element.first; std::string file_name = element.first;
//std::cout << file_name << std::endl;
image = element.second; image = element.second;
if (image.data) if (image.data)
{ {
@ -78,7 +77,9 @@ protected:
} }
if (!b_find) if (!b_find)
{ {
QString dir_str = QString::fromStdString(dir_path); //QString dir_str = QString::fromStdString(dir_path);
QString dir_str = QString::fromLocal8Bit(QByteArray::fromRawData(dir_path.c_str(), dir_path.size()));
QDir dir; QDir dir;
if (!dir.exists(dir_str)) if (!dir.exists(dir_str))
{ {

@ -1,6 +1,5 @@
#include "workthread.h" #include "workthread.h"
#include "alg_jd.h" #include "alg_jd.h"
#include "alg_jd_ng.h"
#include "common.h" #include "common.h"
#include "balluffcamera.h" #include "balluffcamera.h"
#include "baslercamera.h" #include "baslercamera.h"
@ -9,8 +8,6 @@
#include "exportData.h" #include "exportData.h"
extern AlgJd alg_jd[NumberOfSupportedCameras]; //检测胶点的AI算法 extern AlgJd alg_jd[NumberOfSupportedCameras]; //检测胶点的AI算法
extern AlgJd_ng alg_jd_ng[NumberOfSupportedCameras]; // ng模型
extern ConfPath g_conf_path; extern ConfPath g_conf_path;
extern SysConf g_sys_conf; //系统配置参数 extern SysConf g_sys_conf; //系统配置参数
extern DisplayLabelConf g_display_label_conf[NumberOfSupportedCameras]; extern DisplayLabelConf g_display_label_conf[NumberOfSupportedCameras];
@ -62,9 +59,6 @@ void WorkThread::run()
local_SysConf.shoot[local_camera_number] = g_sys_conf.shoot[local_camera_number]; local_SysConf.shoot[local_camera_number] = g_sys_conf.shoot[local_camera_number];
local_SysConf.MisMatchAct = g_sys_conf.MisMatchAct; local_SysConf.MisMatchAct = g_sys_conf.MisMatchAct;
local_SysConf.ConfThreshold = g_sys_conf.ConfThreshold;// local_SysConf.ConfThreshold = g_sys_conf.ConfThreshold;//
local_SysConf.Up_jd_Space = g_sys_conf.Up_jd_Space;
local_SysConf.Down_jd_Space = g_sys_conf.Down_jd_Space;
for (int i = 0; i < 3; i++)local_SysConf.no[local_camera_number][i] = g_sys_conf.no[local_camera_number][i]; for (int i = 0; i < 3; i++)local_SysConf.no[local_camera_number][i] = g_sys_conf.no[local_camera_number][i];
#ifdef DRAW_RECT #ifdef DRAW_RECT
@ -79,6 +73,7 @@ void WorkThread::run()
#endif #endif
} }
QDateTime now_ts = QDateTime::currentDateTime(); QDateTime now_ts = QDateTime::currentDateTime();
std::pair<int, cv::Mat> element; std::pair<int, cv::Mat> element;
local_g_image_queue->take(element); local_g_image_queue->take(element);
@ -101,7 +96,6 @@ void WorkThread::run()
{ {
cv::cvtColor(image, image, CV_BGR2RGB); //灰度图像转为彩色图像 cv::cvtColor(image, image, CV_BGR2RGB); //灰度图像转为彩色图像
} }
if (local_SysConf.shoot[local_camera_number] == unit_count) if (local_SysConf.shoot[local_camera_number] == unit_count)
{ {
exportDataInfo.shotCounts = unit_count; exportDataInfo.shotCounts = unit_count;
@ -122,39 +116,23 @@ void WorkThread::run()
} }
std::vector<cv::Mat> vec_out; std::vector<cv::Mat> vec_out;
//单张
cv::Mat transits;
std::vector<std::pair<int, cv::Rect>> results;
std::vector<std::pair<int, cv::Rect>> results_ng;
//多张
std::vector<cv::Mat> transits_ng;
std::vector<std::vector<std::pair<int, cv::Rect> > > vec_results; std::vector<std::vector<std::pair<int, cv::Rect> > > vec_results;
std::vector<std::vector<std::pair<int, cv::Rect>>> vec_results_ng;
QDateTime ts_start = QDateTime::currentDateTime(); QDateTime ts_start = QDateTime::currentDateTime();
if(unit_count == 1){ if(unit_count == 1){
//std::vector<std::pair<int, cv::Rect>> results; std::vector<std::pair<int, cv::Rect> > results;
//std::vector<std::pair<int, cv::Rect>> results_ng;
cv::Mat imagein,imageout; cv::Mat imagein,imageout;
imagein = vec_in[0]; imagein = vec_in[0];
alg_jd[local_camera_number].detect(imagein, imageout, results); alg_jd[local_camera_number].detect(imagein, imageout, results);
transits = imageout.clone();
alg_jd_ng[local_camera_number].detect_ng(imagein, transits, imageout, results_ng);
vec_out.push_back(imageout.clone()); vec_out.push_back(imageout.clone());
vec_results.push_back(results); vec_results.push_back(results);
vec_results_ng.push_back(results_ng); }else{
}
else {
alg_jd[local_camera_number].detect_batch(vec_in, vec_out, vec_results); alg_jd[local_camera_number].detect_batch(vec_in, vec_out, vec_results);
for (int i = 0; i < vec_out.size(); i++)
transits_ng.push_back(vec_out[i]);
alg_jd_ng[local_camera_number].detect_batch_ng(vec_in, transits_ng, vec_out, vec_results_ng);
} }
QDateTime ts_jd = QDateTime::currentDateTime(); QDateTime ts_jd = QDateTime::currentDateTime();
int time_process = ts_start.msecsTo(ts_jd); int time_process = ts_start.msecsTo(ts_jd);
emit display_timecost(local_camera_number, time_process); emit display_timecost(local_camera_number, time_process);
//UDPSendInfo.timecost = QString::number(time_process); UDPSendInfo.timecost = QString::number(time_process);
//exportDataInfo.timeCost = QString::number(time_process).toStdString(); exportDataInfo.timeCost = QString::number(time_process).toStdString();
cv::Mat image1; cv::Mat image1;
cv::Mat image2; cv::Mat image2;
@ -171,10 +149,10 @@ void WorkThread::run()
UDPSendInfo.JD = jd_no; UDPSendInfo.JD = jd_no;
bool IsNG = false; bool IsNG = false;
bool IsNG_model2[3] = { false };
for(int index=0;index<unit_count;index++) for(int index=0;index<unit_count;index++)
{ {
if(vec_results[index].size() < local_SysConf.no[local_camera_number][index])IsNG |= true; if(vec_results[index].size() < local_SysConf.no[local_camera_number][index])IsNG |= true;
//if (vec_results[index].size() != 1)IsNG |= true;//·´ÏòѵÁ·
if (local_SysConf.ConfThreshold == 0)IsNG = false; if (local_SysConf.ConfThreshold == 0)IsNG = false;
if (local_SysConf.save == 2)//三张照片分别存储 if (local_SysConf.save == 2)//三张照片分别存储
{ {
@ -184,12 +162,13 @@ void WorkThread::run()
+ QString::number(local_camera_number + 1) + "/" + QString::number(index + 1) + "/" + + QString::number(local_camera_number + 1) + "/" + QString::number(index + 1) + "/" +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) + now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + ".jpg"; "#" + "_" + QString::number(index + 1) + ".jpg";
g_save_queue->put(std::make_pair(file_name.toStdString(), m));
g_save_queue->put(std::make_pair(file_name.toLocal8Bit().constData(), m));
} }
} }
if (unit_count >= 2){ if (unit_count >= 2){
image1 = vec_out[0].clone(); image1 = vec_out[(result_index) % 2].clone();
#ifdef DRAW_RECT #ifdef DRAW_RECT
IsNG|=CheckSelectRects(image1,vec_results,(result_index) % 2,local_DisplayLabelConf,0); IsNG|=CheckSelectRects(image1,vec_results,(result_index) % 2,local_DisplayLabelConf,0);
#endif #endif
@ -211,54 +190,16 @@ void WorkThread::run()
#endif #endif
} }
result_index++; result_index++;
//exportDataInfo.isNg = IsNG; exportDataInfo.isNg = IsNG;
////jinhuan+
//if (vec_jd_results.size() && vec_kzjl_results.size())
//{
// //从上往下第一个胶点的中心y值
// int top_jd_y = vec_jd_results[0].y + vec_jd_results[0].height / 2;
// //从上往下最后一个胶点的中心y值
// int bottom_jd_y = vec_jd_results[vec_jd_results.size()-1].y + vec_jd_results[vec_jd_results.size()-1].height / 2;
// //卡纸的上边沿y值
// int top_kz_y = vec_kzjl_results[0].tl().y;
// //卡纸的下边沿y值
// int bottom_kz_y = vec_kzjl_results[0].br().y;
// //if (abs(top_jd_y - top_kz_y) < local_SysConf.Up_jd_Space)IsNG=true;//像素
// //if (abs(bottom_kz_y - bottom_jd_y) < local_SysConf.Down_jd_Space)IsNG = true;//像素
//
//}
//else
//{
// IsNG = true;//卡纸和胶点数量不够
//}
//if (vec_kzzz_results.size() != 0) {//卡纸有褶皱
// IsNG = true;
//}
//if (vec_bm_results.size() != 0) {//薄膜有褶皱
// IsNG = true;
//}
//if (vec_qb_results.size() != 0) {//卡纸有翘边
// IsNG = true;
// IsNG_model2[2] = IsNG;
//}
////jinhuan-
for (int index = 0; index < unit_count; index++)
{
if (results_ng.size() != 0 || vec_results_ng[index].size() != 0) {//ng模型检测有ng
IsNG = true;
IsNG_model2[index] = IsNG;
}
}
if (!IsNG) if (!IsNG)
{
if (!g_debug_mode)
{ {
emit event_ok(local_camera_number); emit event_ok(local_camera_number);
local_g_result_queue->put(true); local_g_result_queue->put(true);
} }
}
else else
{ {
if (!g_debug_mode) if (!g_debug_mode)
@ -270,8 +211,6 @@ void WorkThread::run()
if ((local_SysConf.save == 2) || (local_SysConf.save == 1)) if ((local_SysConf.save == 2) || (local_SysConf.save == 1))
{ {
for(int index=0;index<unit_count;index++) for(int index=0;index<unit_count;index++)
{
if ((vec_results[index].size() < local_SysConf.no[local_camera_number][index])|| IsNG_model2[index])
{ {
cv::Mat m = vec_in[index].clone(); cv::Mat m = vec_in[index].clone();
QString file_name = g_conf_path.save_pics_path + "/ng/" + QString file_name = g_conf_path.save_pics_path + "/ng/" +
@ -279,16 +218,15 @@ void WorkThread::run()
+ QString::number(local_camera_number + 1) + "/" + QString::number(index + 1) + "/" + + QString::number(local_camera_number + 1) + "/" + QString::number(index + 1) + "/" +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) + now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + ".jpg"; "#" + "_" + QString::number(index + 1) + ".jpg";
g_save_queue->put(std::make_pair(file_name.toStdString(), m));
/*m = vec_out[index].clone(); /*m = vec_out[index].clone();
file_name = g_conf_path.save_pics_path + "/ng_result/" + file_name = "D:/image/" +
now_ts.toString("yyyy-MM-dd") + "/" now_ts.toString("yyyy-MM-dd") +
+ QString::number(local_camera_number + 1) + "/" + QString::number(index + 1) + "/" + "/" + QString::number(local_camera_number + 1) +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) + "/ng_result/" + QString::number(index) + "/" +
"#" + "_" + QString::number(index + 1) + ".jpg"; now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + "_" + QString::number(index) + ".bmp";*/
g_save_queue->put(std::make_pair(file_name.toStdString(), m));*/ //g_save_queue->put(std::make_pair(file_name.toStdString(), m));
} g_save_queue->put(std::make_pair(file_name.toLocal8Bit().constData(), m));
} }
} }
} }

Loading…
Cancel
Save