From 91997e2f8078eba3f3b27ed3ea0a19c1fdcee9b2 Mon Sep 17 00:00:00 2001 From: modehua Date: Tue, 26 Sep 2023 05:13:12 -0700 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A0=A1=E6=AD=A3=E5=8F=8A?= =?UTF-8?q?=E5=87=BA=E5=9B=BE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CImageMerge.cpp | 2 +- MultiFrameCapture.cpp | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CImageMerge.cpp b/CImageMerge.cpp index 2444288..e345753 100644 --- a/CImageMerge.cpp +++ b/CImageMerge.cpp @@ -14,7 +14,7 @@ cv::Mat CImageMerge::MergeImage(cv::Mat &srcMat, int dstwidth, int dstheight, in { //printf("7010 7010 10 7010 7010 7010 7010 7010 7010!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n"); cv::Mat matdst; - if (!mode ) // gray mode + if (!mode) // gray mode { matdst = srcMat; } diff --git a/MultiFrameCapture.cpp b/MultiFrameCapture.cpp index 1a8d223..72593c9 100644 --- a/MultiFrameCapture.cpp +++ b/MultiFrameCapture.cpp @@ -209,7 +209,7 @@ void MultiFrameCapture::UpdateScanParam(HG_ScanConfiguration config) { int val = config.params.dpi == 3 ? 600 :(config.params.dpi == 2?300:200); printf("val = %d\r\n",val); - uint32_t cnt = compute_frame(paper_size_ , val) ; //多设一帧 + uint32_t cnt = compute_frame(paper_size_ , val) ; if (m_config.params.dpi == 2 && m_config.params.pageSize == (int)PaperSize::G400_A4) { cnt -=1 ; @@ -475,32 +475,32 @@ void MultiFrameCapture::snaprun() // printf("--------------------- frame_info.dpi ------------------ :%d\r\n",frame_info.dpi ); sw.reset(); - for (size_t i = 0; i <= frame_cnt ; i++) //frame_cnt -1 目前最好一帧采集会超时 所以多采集一帧 + for (size_t i = 1; i <= frame_info.frame_index ; i++) { - printf("***********设置的帧数:%d 正在采集第[%d]帧************\r\n",frame_info.frame_index,i +1); - frame_info.first_frame = i == 0 ? true : false; - frame_info.last_frame = i == frame_cnt ? true : false; + printf("***********设置的帧数:%d 正在采集第[%d]帧************\r\n",frame_info.frame_index,i); + frame_info.first_frame = i == 1 ? true : false; + frame_info.last_frame = i == frame_info.frame_index ? true : false; func_sig = snap_func(frame_info, channels,time_out,i); if (b_stop_snap) { video->HtCamGetFrameNum(frame_num); - int ind = i + 1; //已采集了的帧数 + int ind = i; //已采集了的帧数 int val = frame_num - ind; //剩余还未采集的帧数 + printf("val:%d\r\n",val); while (val > 0) { frame_info.last_frame = val == 1 ? true : false; frame_info.frame_index = frame_num; - func_sig = snap_func(frame_info, channels,time_out ,ind);//同上面一样 ind++; - printf("-----------当前采集到第:[%d]帧 CIS总共采集[%d]帧 -------\r\n",ind,frame_num); - - video->HtCamGetFrameNum(frame_num); - val = frame_num - ind; + + func_sig = snap_func(frame_info, channels,time_out ,ind);//同上面一样 + + val--; if(resolution_ == DPI_600) { int d = 200; @@ -1126,7 +1126,7 @@ void MultiFrameCapture::creatcorrectconfig(int dpi, int mode) std::this_thread::sleep_for(std::chrono::milliseconds(5)); isDone = saveLutImg(dpi, mode, false); // 0 color_black 1 color_white 2 gray_balck 3 gray_white video->HtCamStopVideoCapturing(); - this_thread::sleep_for(std::chrono::milliseconds(200)); + this_thread::sleep_for(std::chrono::seconds(2)); i++; } printf("creatcorrectconfig %s \n", (mode == IMAGE_COLOR ? " Color" : " Gray"));