更新:

(1)基于非线性校正的数据  生成  定标文件;
(2)将非线性定标参数写到文件中,给卓哥用;
This commit is contained in:
2022-04-29 17:10:40 +08:00
committed by xin
parent ffef3cf163
commit 2c0462b3fa
5 changed files with 94 additions and 56 deletions

View File

@ -512,7 +512,7 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
double fLastExposureTime = 0.1;
int iRepeatCount = 0;
int iRes = SetExposureTime(2000);//need change to load from files
int iRes = SetExposureTime(m_daDeviceAttr.iMinIntegrationTimeInMS);//need change to load from files
if (iRes != 0)
{
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:1";
@ -527,16 +527,20 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
{
bFlagIsAutoExposureFailed = true;
bFlagIsOverTrying = true;
qDebug() << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>30<EFBFBD><EFBFBD>"<<endl;
break;
}
fExposureTime = (float)m_daDeviceAttr.iMinIntegrationTimeInMS;
// fExposureTime = (float)m_daDeviceAttr.iMinIntegrationTimeInMS;
int tc_tmp;
GetExposureTime(tc_tmp);
fExposureTime=tc_tmp;
fTempExposureTime = fExposureTime;
iRes = SingleShot(dfTemp);
if (iRes != 0)
{
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:2";
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:2"<<endl;
return 2;
}
@ -549,6 +553,8 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
dSum += dfTemp.lData[i];
}
double dTemp = dSum / iCount;
qDebug() << "1111111111111111111111111111111" << dTemp << endl;
if (dTemp >= iDeviceDepth * 0.99)
{
@ -566,6 +572,7 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
else if (iDeviceDepth * fMaxScaleFactor >= dTemp && dTemp >= iDeviceDepth * fMinScaleFactor)
{
bFlagIsAutoExposureOK = 1;
continue;
}
else if (dTemp > iDeviceDepth * fMaxScaleFactor)
{
@ -592,12 +599,15 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
dFactor = dTemp / (iDeviceDepth * fMaxScaleFactor);
fExposureTime = (float)(fExposureTime / dFactor);
}
if (/*fExposureTime > 100 || */fExposureTime < 10)
if (fExposureTime < m_daDeviceAttr.iMinIntegrationTimeInMS)
{
bFlagIsAutoExposureOK = false;
bFlagIsAutoExposureFailed = true;
bFlagIsLowerMinExposureTime = true;
qDebug() << "lower-----------------------"<<endl;
}
}
bIsLastValueOverflow = bIsValueOverflow;
fLastExposureTime = fTempExposureTime;
@ -669,7 +679,7 @@ int ZZ_ATPControl_Serial_Qt::SetExposureTime(int iExposureTimeInMS)
if ((ZZ_U8)qbRecv[0] != 0)
{
qDebug() << "Err:SetExposureTime Failed.Exit Code:1";
return 1;
//return 1;
}
return 0;
@ -720,6 +730,9 @@ int ZZ_ATPControl_Serial_Qt::SingleShot(DataFrame &dfData)
// qbSend[2] = 0x01;
qbSend[1] = m_iExposureTime >> 8;;
qbSend[2] = m_iExposureTime & 0xFF;
qDebug() << "-------------"<<m_iExposureTime<<endl;
int iRes = SendCommand(qbSend);
if (iRes != 0)
{