|
|
|
@ -12,7 +12,6 @@ CDetectorAlgorithm::CDetectorAlgorithm() : m_mutex(QReadWriteLock::Recursive)
|
|
|
|
m_mapOutParams.clear();
|
|
|
|
m_mapOutParams.clear();
|
|
|
|
m_pAlgo = NULL;
|
|
|
|
m_pAlgo = NULL;
|
|
|
|
m_pTask = NULL;
|
|
|
|
m_pTask = NULL;
|
|
|
|
m_pAlgoShare = NULL;
|
|
|
|
|
|
|
|
m_bIsFinished = false;
|
|
|
|
m_bIsFinished = false;
|
|
|
|
m_bIsExec = true;
|
|
|
|
m_bIsExec = true;
|
|
|
|
m_dExecTime = 0.0;
|
|
|
|
m_dExecTime = 0.0;
|
|
|
|
@ -23,13 +22,12 @@ CDetectorAlgorithm::~CDetectorAlgorithm()
|
|
|
|
CleanUp();
|
|
|
|
CleanUp();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CDetectorAlgorithm::Initialize(IDetectorTask* pTask, IAlgorithmShare* pAlgoShare, IAlgorithmLibMgr* pAlgoLibMgr)
|
|
|
|
bool CDetectorAlgorithm::Initialize(IDetectorTask* pTask, IAlgorithmLibMgr* pAlgoLibMgr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!pTask)
|
|
|
|
if (!pTask)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
m_pTask = pTask;
|
|
|
|
m_pTask = pTask;
|
|
|
|
m_pAlgoShare = pAlgoShare;
|
|
|
|
|
|
|
|
m_pAlgoLibMgr = pAlgoLibMgr;
|
|
|
|
m_pAlgoLibMgr = pAlgoLibMgr;
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
@ -112,9 +110,6 @@ bool CDetectorAlgorithm::SetAlgorithmInfo(const PLP_DETECTOR_ALGORITHM pAlgorith
|
|
|
|
m_tAlgorithmInfo.strLibName = pAlgorithmInfo->strLibName;
|
|
|
|
m_tAlgorithmInfo.strLibName = pAlgorithmInfo->strLibName;
|
|
|
|
m_tAlgorithmInfo.strFuncName = pAlgorithmInfo->strFuncName;
|
|
|
|
m_tAlgorithmInfo.strFuncName = pAlgorithmInfo->strFuncName;
|
|
|
|
|
|
|
|
|
|
|
|
//if (!Load(m_tAlgorithmInfo.strName))
|
|
|
|
|
|
|
|
// return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -162,28 +157,6 @@ PLP_ALGORITHM_PARAM CDetectorAlgorithm::AddParam(const PLP_ALGORITHM_PARAM pPara
|
|
|
|
m_mapParams[pParam->strName] = (*its);
|
|
|
|
m_mapParams[pParam->strName] = (*its);
|
|
|
|
return (*its);
|
|
|
|
return (*its);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// LP_ALGORITHM_PARAM* p = new LP_ALGORITHM_PARAM;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// p->nID = ++m_nParamBaseID;
|
|
|
|
|
|
|
|
// p->nTaskID = pParam->nTaskID;
|
|
|
|
|
|
|
|
// p->nSrcAlgoID = pParam->nSrcAlgoID;
|
|
|
|
|
|
|
|
// p->nSrcParamID = pParam->nSrcParamID;
|
|
|
|
|
|
|
|
// p->strName = pParam->strName;
|
|
|
|
|
|
|
|
// p->type = pParam->type;
|
|
|
|
|
|
|
|
// p->value = pParam->value;
|
|
|
|
|
|
|
|
// p->strDescription = pParam->strDescription;
|
|
|
|
|
|
|
|
// p->bIsSave = pParam->bIsSave;
|
|
|
|
|
|
|
|
// p->bIsLock = pParam->bIsLock;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// //m_vecParams.push_back(p);
|
|
|
|
|
|
|
|
// m_mapParams.insert(p->strName, p);
|
|
|
|
|
|
|
|
// m_vecParams[p->strName] = p;
|
|
|
|
|
|
|
|
// return p;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -204,7 +177,6 @@ bool CDetectorAlgorithm::DeleteParam(int nParamID)
|
|
|
|
delete *iter;
|
|
|
|
delete *iter;
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -222,9 +194,7 @@ PLP_ALGORITHM_PARAM CDetectorAlgorithm::GetParam(int nParamID)
|
|
|
|
if (p->nID == nParamID)
|
|
|
|
if (p->nID == nParamID)
|
|
|
|
return p;
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -284,23 +254,6 @@ PLP_ALGORITHM_PARAM CDetectorAlgorithm::AddOutParam(const PLP_ALGORITHM_PARAM pP
|
|
|
|
m_mapOutParams[pParam->strName] = (*its);
|
|
|
|
m_mapOutParams[pParam->strName] = (*its);
|
|
|
|
return (*its);
|
|
|
|
return (*its);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// PLP_ALGORITHM_PARAM p = new LP_ALGORITHM_PARAM;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// p->nID = ++m_nOutParamBaseID;
|
|
|
|
|
|
|
|
// p->nTaskID = pParam->nTaskID;
|
|
|
|
|
|
|
|
// p->nSrcAlgoID = pParam->nSrcAlgoID;
|
|
|
|
|
|
|
|
// p->nSrcParamID = pParam->nSrcParamID;
|
|
|
|
|
|
|
|
// p->strName = pParam->strName;
|
|
|
|
|
|
|
|
// p->type = pParam->type;
|
|
|
|
|
|
|
|
// p->value = pParam->value;
|
|
|
|
|
|
|
|
// p->strDescription = pParam->strDescription;
|
|
|
|
|
|
|
|
// p->bIsSave = pParam->bIsSave;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// m_vecOutParams[p->strName] = p;
|
|
|
|
|
|
|
|
// m_mapOutParams.insert(p->strName, p);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -409,7 +362,6 @@ bool CDetectorAlgorithm::SerializeParamPropertyToJson(QJsonObject* pJsonObject,
|
|
|
|
|
|
|
|
|
|
|
|
PropertyArray.push_back(propertys);
|
|
|
|
PropertyArray.push_back(propertys);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pJsonObject->insert("property", PropertyArray);
|
|
|
|
pJsonObject->insert("property", PropertyArray);
|
|
|
|
@ -1111,7 +1063,6 @@ bool CDetectorAlgorithm::SerializeFromJson(QJsonObject* pJsonObject)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LP_DETECTOR_ROI_DATA roiData;
|
|
|
|
LP_DETECTOR_ROI_DATA roiData;
|
|
|
|
|
|
|
|
|
|
|
|
//roiData.img = m_pTask->GetTaskInfo()->templateImg;
|
|
|
|
|
|
|
|
QJsonArray recordArray = jsonObject.value("out_param_value").toArray();
|
|
|
|
QJsonArray recordArray = jsonObject.value("out_param_value").toArray();
|
|
|
|
|
|
|
|
|
|
|
|
int nRecordCount = recordArray.size();
|
|
|
|
int nRecordCount = recordArray.size();
|
|
|
|
@ -1633,16 +1584,6 @@ bool CDetectorAlgorithm::InitRoiInfo()
|
|
|
|
|
|
|
|
|
|
|
|
QVariant CDetectorAlgorithm::GetParamValue(QString strKey, AlgoParamType type)
|
|
|
|
QVariant CDetectorAlgorithm::GetParamValue(QString strKey, AlgoParamType type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//for (QVector<PLP_ALGORITHM_PARAM>::iterator iter = m_vecParams.begin();
|
|
|
|
|
|
|
|
// iter != m_vecParams.end(); ++iter)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// PLP_ALGORITHM_PARAM param = *iter;
|
|
|
|
|
|
|
|
// if (param && param->type ==type && param->strName == strKey)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// return param->value;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_mapParams.value(strKey))
|
|
|
|
if (m_mapParams.value(strKey))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return m_mapParams.value(strKey)->value;
|
|
|
|
return m_mapParams.value(strKey)->value;
|
|
|
|
@ -1653,16 +1594,6 @@ QVariant CDetectorAlgorithm::GetParamValue(QString strKey, AlgoParamType type)
|
|
|
|
|
|
|
|
|
|
|
|
QVariant CDetectorAlgorithm::GetOutParamValue(QString strKey, AlgoParamType type)
|
|
|
|
QVariant CDetectorAlgorithm::GetOutParamValue(QString strKey, AlgoParamType type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//for (QVector<PLP_ALGORITHM_PARAM>::iterator iter = m_vecOutParams.begin();
|
|
|
|
|
|
|
|
// iter != m_vecOutParams.end(); ++iter)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// PLP_ALGORITHM_PARAM param = *iter;
|
|
|
|
|
|
|
|
// if (param && param->type == type && param->strName == strKey)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// return param->value;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_mapOutParams.value(strKey))
|
|
|
|
if (m_mapOutParams.value(strKey))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return m_mapOutParams.value(strKey)->value;
|
|
|
|
return m_mapOutParams.value(strKey)->value;
|
|
|
|
@ -1673,26 +1604,6 @@ QVariant CDetectorAlgorithm::GetOutParamValue(QString strKey, AlgoParamType type
|
|
|
|
|
|
|
|
|
|
|
|
bool CDetectorAlgorithm::SetOutParamValue(QString strKey, QVariant value)
|
|
|
|
bool CDetectorAlgorithm::SetOutParamValue(QString strKey, QVariant value)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//for (QVector<PLP_ALGORITHM_PARAM>::iterator iter = m_vecOutParams.begin();
|
|
|
|
|
|
|
|
// iter != m_vecOutParams.end(); ++iter)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// PLP_ALGORITHM_PARAM param = *iter;
|
|
|
|
|
|
|
|
// if (param && param->strName == strKey)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// if (param->type == LP_IMAGE)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// QImage img = value.value<QImage>();
|
|
|
|
|
|
|
|
// param->value = img;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// param->value = value;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// return true;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PLP_ALGORITHM_PARAM pParam = m_mapOutParams.value(strKey);
|
|
|
|
PLP_ALGORITHM_PARAM pParam = m_mapOutParams.value(strKey);
|
|
|
|
if (pParam)
|
|
|
|
if (pParam)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -1927,7 +1838,7 @@ bool CDetectorAlgorithm::ImportParam(QJsonArray paramArray)//导入参数
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QString strFileName = jsonObject.value("param_value").toString();
|
|
|
|
QString strFileName = jsonObject.value("param_value").toString();
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
cv::Mat resultFile = cv::imread(strpath/*strFileName.toLatin1().data()*/, CV_LOAD_IMAGE_UNCHANGED);
|
|
|
|
cv::Mat resultFile = cv::imread(strpath, CV_LOAD_IMAGE_UNCHANGED);
|
|
|
|
param.value.setValue(resultFile);
|
|
|
|
param.value.setValue(resultFile);
|
|
|
|
if (m_pTask)
|
|
|
|
if (m_pTask)
|
|
|
|
m_pTask->AppendOtherFile(QString(strpath.c_str()));
|
|
|
|
m_pTask->AppendOtherFile(QString(strpath.c_str()));
|
|
|
|
@ -1942,7 +1853,7 @@ bool CDetectorAlgorithm::ImportParam(QJsonArray paramArray)//导入参数
|
|
|
|
QString strFilePath = strExePath + LP_DETECTOR_BUSSINESS_IMAGE_DIR;
|
|
|
|
QString strFilePath = strExePath + LP_DETECTOR_BUSSINESS_IMAGE_DIR;
|
|
|
|
QString strFileName = strFilePath + QString::number(param.nID) + ".bmp";
|
|
|
|
QString strFileName = strFilePath + QString::number(param.nID) + ".bmp";
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
roiData.img = cv::imread(strpath/*strFileName.toLatin1().data()*/, CV_LOAD_IMAGE_UNCHANGED);
|
|
|
|
roiData.img = cv::imread(strpath, CV_LOAD_IMAGE_UNCHANGED);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QJsonArray recordArray = jsonObject.value("param_value").toArray();
|
|
|
|
QJsonArray recordArray = jsonObject.value("param_value").toArray();
|
|
|
|
@ -2002,8 +1913,6 @@ bool CDetectorAlgorithm::ImportParam(QJsonArray paramArray)//导入参数
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
param.value.setValue(roiData);
|
|
|
|
param.value.setValue(roiData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -2013,10 +1922,7 @@ bool CDetectorAlgorithm::ImportParam(QJsonArray paramArray)//导入参数
|
|
|
|
|
|
|
|
|
|
|
|
param.strDescription = jsonObject.value("param_description").toString();
|
|
|
|
param.strDescription = jsonObject.value("param_description").toString();
|
|
|
|
PLP_ALGORITHM_PARAM pParam = (PLP_ALGORITHM_PARAM)AddParam(¶m,false);
|
|
|
|
PLP_ALGORITHM_PARAM pParam = (PLP_ALGORITHM_PARAM)AddParam(¶m,false);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -2071,7 +1977,7 @@ QByteArray CDetectorAlgorithm::ExportParam()
|
|
|
|
QString strFilePath = strExePath + "/" + "paramfiles/";
|
|
|
|
QString strFilePath = strExePath + "/" + "paramfiles/";
|
|
|
|
QString strFileName = strFilePath + QString::number(p->nID) + ".bmp";
|
|
|
|
QString strFileName = strFilePath + QString::number(p->nID) + ".bmp";
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
if (!matResult.empty() && !cv::imwrite(strpath/*strFileName.toLatin1().data()*/, matResult))
|
|
|
|
if (!matResult.empty() && !cv::imwrite(strpath, matResult))
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
jsonParam.insert("param_value", strFileName);
|
|
|
|
jsonParam.insert("param_value", strFileName);
|
|
|
|
@ -2086,7 +1992,7 @@ QByteArray CDetectorAlgorithm::ExportParam()
|
|
|
|
QString strFilePath = strExePath + "/" + "images/";
|
|
|
|
QString strFilePath = strExePath + "/" + "images/";
|
|
|
|
QString strFileName = strFilePath + QString::number(p->nID) + ".bmp";
|
|
|
|
QString strFileName = strFilePath + QString::number(p->nID) + ".bmp";
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
if (!roiData.img.empty() && !cv::imwrite(strpath/*strFileName.toLatin1().data()*/, roiData.img))
|
|
|
|
if (!roiData.img.empty() && !cv::imwrite(strpath, roiData.img))
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
int nCount = roiData.records.size();
|
|
|
|
int nCount = roiData.records.size();
|
|
|
|
@ -2219,7 +2125,7 @@ bool CDetectorAlgorithm::ImportOutParam(QJsonArray outParamArray)//导入参数
|
|
|
|
QString strFileName = jsonObject.value("param_value").toString();
|
|
|
|
QString strFileName = jsonObject.value("param_value").toString();
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
|
|
|
|
|
|
|
|
cv::Mat resultFile = cv::imread(strpath/*strFileName.toLatin1().data()*/);
|
|
|
|
cv::Mat resultFile = cv::imread(strpath);
|
|
|
|
param.value.setValue(resultFile);
|
|
|
|
param.value.setValue(resultFile);
|
|
|
|
if (m_pTask)
|
|
|
|
if (m_pTask)
|
|
|
|
m_pTask->AppendOtherFile(QString(strpath.c_str()));
|
|
|
|
m_pTask->AppendOtherFile(QString(strpath.c_str()));
|
|
|
|
@ -2234,7 +2140,7 @@ bool CDetectorAlgorithm::ImportOutParam(QJsonArray outParamArray)//导入参数
|
|
|
|
QString strFilePath = strExePath + LP_DETECTOR_BUSSINESS_IMAGE_DIR;
|
|
|
|
QString strFilePath = strExePath + LP_DETECTOR_BUSSINESS_IMAGE_DIR;
|
|
|
|
QString strFileName = strFilePath + QString::number(param.nID) + ".bmp";
|
|
|
|
QString strFileName = strFilePath + QString::number(param.nID) + ".bmp";
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
roiData.img = cv::imread(strpath/*strFileName.toLatin1().data()*/, CV_LOAD_IMAGE_UNCHANGED);
|
|
|
|
roiData.img = cv::imread(strpath, CV_LOAD_IMAGE_UNCHANGED);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QJsonArray recordArray = jsonObject.value("param_value").toArray();
|
|
|
|
QJsonArray recordArray = jsonObject.value("param_value").toArray();
|
|
|
|
@ -2361,7 +2267,7 @@ QByteArray CDetectorAlgorithm::ExportOutParam()//导出参数
|
|
|
|
QString strFilePath = strExePath + "/" + "paramfiles/";
|
|
|
|
QString strFilePath = strExePath + "/" + "paramfiles/";
|
|
|
|
QString strFileName = strFilePath + QString::number(p->nID) + ".bmp";
|
|
|
|
QString strFileName = strFilePath + QString::number(p->nID) + ".bmp";
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
if (!matResult.empty() && !cv::imwrite(strpath/*strFileName.toLatin1().data()*/, matResult))
|
|
|
|
if (!matResult.empty() && !cv::imwrite(strpath, matResult))
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
jsonParam.insert("param_value", strFileName);
|
|
|
|
jsonParam.insert("param_value", strFileName);
|
|
|
|
@ -2376,7 +2282,7 @@ QByteArray CDetectorAlgorithm::ExportOutParam()//导出参数
|
|
|
|
QString strFilePath = strExePath + "/" + "images/";
|
|
|
|
QString strFilePath = strExePath + "/" + "images/";
|
|
|
|
QString strFileName = strFilePath + QString::number(p->nID) + ".bmp";
|
|
|
|
QString strFileName = strFilePath + QString::number(p->nID) + ".bmp";
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
std::string strpath = strFileName.toLocal8Bit().toStdString();
|
|
|
|
if (!roiData.img.empty() && !cv::imwrite(strpath/*strFileName.toLatin1().data()*/, roiData.img))
|
|
|
|
if (!roiData.img.empty() && !cv::imwrite(strpath, roiData.img))
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
int nCount = roiData.records.size();
|
|
|
|
int nCount = roiData.records.size();
|
|
|
|
@ -2546,14 +2452,6 @@ bool CDetectorAlgorithm::UpdateParamValueByName(QString strName, QVariant& value
|
|
|
|
return bRet;
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PLP_ALGORITHM_PARAM CDetectorAlgorithm::GetShareParam(QString strName, int idx /* = -1 */)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!m_pAlgoShare || !m_pTask)
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return m_pAlgoShare->GetParam(strName, m_pTask->GetTaskInfo()->nGroupParamID);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CDetectorAlgorithm::LoadUserParamValue(int nParamID /*= LP_DETECTOR_INVALID_ID*/)
|
|
|
|
void CDetectorAlgorithm::LoadUserParamValue(int nParamID /*= LP_DETECTOR_INVALID_ID*/)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!m_pAlgo)
|
|
|
|
if (!m_pAlgo)
|
|
|
|
@ -2570,7 +2468,6 @@ void CDetectorAlgorithm::LoadUserParamValue(int nParamID /*= LP_DETECTOR_INVALID
|
|
|
|
if (p->type == LP_USER)
|
|
|
|
if (p->type == LP_USER)
|
|
|
|
m_pAlgo->LoadUserParamValue(m_pTask, this, p->strName, p->value);
|
|
|
|
m_pAlgo->LoadUserParamValue(m_pTask, this, p->strName, p->value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
@ -2631,7 +2528,6 @@ void CDetectorAlgorithm::ClearUserParamValue(int nParamID /*= LP_DETECTOR_INVALI
|
|
|
|
if (p->type == LP_USER)
|
|
|
|
if (p->type == LP_USER)
|
|
|
|
p->value.clear();
|
|
|
|
p->value.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
@ -2655,3 +2551,4 @@ bool CDetectorAlgorithm::HandleEvent(QString strParamName /*= ""*/, int event/*
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|