Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
faf83b2545 | |||
e8760dcfe5 |
@ -436,6 +436,10 @@ bool Configfile::createConfigFile()
|
||||
ximeadll.add("buffer_policy", Setting::TypeInt) = 0;
|
||||
ximeadll.add("acq_buffer_size", Setting::TypeInt) = 400;
|
||||
|
||||
Setting &push_flow_param = root.add("push_flow_param", Setting::TypeGroup);
|
||||
push_flow_param.add("flow_switch", Setting::TypeInt) = 1;
|
||||
push_flow_param.add("rgb_height", Setting::TypeInt) = 720;
|
||||
push_flow_param.add("framerate_video", Setting::TypeInt) = 5;
|
||||
|
||||
// Write out the new configuration.
|
||||
QString output_file = "/media/nvme/300TC/config/ximea.cfg";
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::cout<<"ximeaAirborneSystem 版本:"<< "42." <<std::endl;
|
||||
std::cout<<"ximeaAirborneSystem 版本:"<< "44." <<std::endl;
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
//UdpServer* x=new UdpServer();
|
||||
|
@ -96,7 +96,7 @@ void XimeaImager::openImger()
|
||||
}
|
||||
|
||||
float gain, offset;//用于生成头文件中的波长信息
|
||||
ret = m_configfile.getGainOffsetOfSpectralBin1(gain, offset);
|
||||
ret = m_configfile.getGainOffset(gain, offset);
|
||||
if (ret)
|
||||
{
|
||||
m_imager.setGainOffset(gain, offset);
|
||||
@ -509,24 +509,9 @@ double XimeaImager::geWavelengthAtBand(int x)
|
||||
void XimeaImager::getRgbBandNumber(int &redBandNumber, int &greenBandNumber, int &blueBandNumber)
|
||||
{
|
||||
vector<double> wavelengths;
|
||||
if (m_imager.getSpectralBin() == 1)
|
||||
for (int i = getWindowStartBand(); i < getWindowEndBand(); i++)
|
||||
{
|
||||
for (int i = getWindowStartBand(); i < getWindowEndBand(); i++)
|
||||
{
|
||||
wavelengths.push_back(geWavelengthAtBand(i));
|
||||
}
|
||||
}
|
||||
else if (m_imager.getSpectralBin() == 2)
|
||||
{
|
||||
for (int i = m_iOffsetyOfSpectralBin2; i < m_iOffsetyOfSpectralBin2 + m_iHeightOfSpectralBin2; i++)
|
||||
{
|
||||
if (i*2 + 1 > m_iOffsetyOfSpectralBin1 + m_iHeightOfSpectralBin1)
|
||||
{
|
||||
printf("XimeaImager::writeHdr 出现错误:窗口中,光谱 bin1 波段数小于 bin2 的 2 倍。\n");
|
||||
break;
|
||||
}
|
||||
wavelengths.push_back((geWavelengthAtBand(i*2) + geWavelengthAtBand(i*2 + 1)) / 2);
|
||||
}
|
||||
wavelengths.push_back(geWavelengthAtBand(i));
|
||||
}
|
||||
|
||||
//envi打开文件时的红绿蓝波长(nm)
|
||||
@ -801,41 +786,16 @@ void XimeaImager::writeHdr()
|
||||
hdrFileHandle << "wavelength = {";
|
||||
//hdrFileHandle << std::setprecision(5);
|
||||
|
||||
if (m_imager.getSpectralBin() == 1)
|
||||
for (int i = getWindowStartBand(); i < getWindowEndBand(); i++)
|
||||
{
|
||||
for (int i = getWindowStartBand(); i < getWindowEndBand(); i++)
|
||||
hdrFileHandle << geWavelengthAtBand(i);
|
||||
if (i < getWindowEndBand() - 1)
|
||||
hdrFileHandle << ", ";
|
||||
else
|
||||
{
|
||||
hdrFileHandle << geWavelengthAtBand(i);
|
||||
if (i < getWindowEndBand() - 1)
|
||||
hdrFileHandle << ", ";
|
||||
else
|
||||
{
|
||||
printf("头文件中写入了多少个波段:%d\n",i-getWindowStartBand()+1);//???????????????
|
||||
}
|
||||
printf("头文件中写入了多少个波段:%d\n",i-getWindowStartBand()+1);//???????????????
|
||||
}
|
||||
}
|
||||
else if (m_imager.getSpectralBin() == 2)
|
||||
{
|
||||
int counter = 0;
|
||||
for (int i = m_iOffsetyOfSpectralBin2; i < m_iOffsetyOfSpectralBin2 + m_iHeightOfSpectralBin2; i++)
|
||||
{
|
||||
if (i*2 + 1 > m_iOffsetyOfSpectralBin1 + m_iHeightOfSpectralBin1)
|
||||
{
|
||||
printf("XimeaImager::writeHdr 出现错误:窗口中,光谱 bin1 波段数小于 bin2 的 2 倍。\n");
|
||||
break;
|
||||
}
|
||||
|
||||
hdrFileHandle << (geWavelengthAtBand(i*2) + geWavelengthAtBand(i*2 + 1)) / 2;
|
||||
counter++;
|
||||
if (i < m_iOffsetyOfSpectralBin2 + m_iHeightOfSpectralBin2 - 1)
|
||||
hdrFileHandle << ", ";
|
||||
else
|
||||
{
|
||||
printf("头文件中写入了多少个波段:%d\n", counter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hdrFileHandle << "}\n";
|
||||
hdrFileHandle.close();
|
||||
@ -1232,8 +1192,8 @@ void PushFlow::encodePushFlow()
|
||||
codecContext->height = m_iHeight;
|
||||
codecContext->time_base = {1, m_iFramerateVideo};
|
||||
codecContext->pix_fmt = AV_PIX_FMT_YUV420P; // 设置为YUV420P格式
|
||||
codecContext->gop_size = 1;//多少帧产生一组关键帧
|
||||
codecContext->max_b_frames = 1;//b帧,参考帧
|
||||
codecContext->gop_size = 50;//多少帧产生一组关键帧
|
||||
codecContext->max_b_frames = 0;//b帧,参考帧:设置为1会导致视频回退的现象
|
||||
// codecContext->bit_rate = 1000000; // 设置比特率为 1000000
|
||||
|
||||
// 打开视频编码器
|
||||
|
Reference in New Issue
Block a user