From faf83b2545e257e0dedd5b205ef6838ae4d085c4 Mon Sep 17 00:00:00 2001 From: tangchao0503 <735056338@qq.com> Date: Tue, 3 Dec 2024 20:15:42 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=201=E3=80=81=E5=85=89=E8=B0=B1bin2?= =?UTF-8?q?=20hdr=E6=96=87=E4=BB=B6=E4=B8=AD=E7=9A=84=E6=B3=A2=E9=95=BF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=EF=BC=9B=202=E3=80=81=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E8=BF=90=E8=A1=8C=E5=88=9B=E5=BB=BA=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=97=B6=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=8E=A8?= =?UTF-8?q?=E6=B5=81=E9=85=8D=E7=BD=AE=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source_Files/configfile.cpp | 4 +++ Source_Files/main.cpp | 2 +- Source_Files/ximeaimager.cpp | 58 ++++++------------------------------ 3 files changed, 14 insertions(+), 50 deletions(-) diff --git a/Source_Files/configfile.cpp b/Source_Files/configfile.cpp index 2f76fad..91c589d 100644 --- a/Source_Files/configfile.cpp +++ b/Source_Files/configfile.cpp @@ -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"; diff --git a/Source_Files/main.cpp b/Source_Files/main.cpp index 50f4dd6..be42197 100644 --- a/Source_Files/main.cpp +++ b/Source_Files/main.cpp @@ -3,7 +3,7 @@ int main(int argc, char *argv[]) { - std::cout<<"ximeaAirborneSystem 版本:"<< "43." < 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();