调整校正及出图结构

This commit is contained in:
modehua 2023-09-26 05:13:12 -07:00
parent d613a1dd16
commit 91997e2f80
2 changed files with 13 additions and 13 deletions

View File

@ -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"); //printf("7010 7010 10 7010 7010 7010 7010 7010 7010!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n");
cv::Mat matdst; cv::Mat matdst;
if (!mode ) // gray mode if (!mode) // gray mode
{ {
matdst = srcMat; matdst = srcMat;
} }

View File

@ -209,7 +209,7 @@ void MultiFrameCapture::UpdateScanParam(HG_ScanConfiguration config)
{ {
int val = config.params.dpi == 3 ? 600 :(config.params.dpi == 2?300:200); int val = config.params.dpi == 3 ? 600 :(config.params.dpi == 2?300:200);
printf("val = %d\r\n",val); 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) if (m_config.params.dpi == 2 && m_config.params.pageSize == (int)PaperSize::G400_A4)
{ {
cnt -=1 ; cnt -=1 ;
@ -475,32 +475,32 @@ void MultiFrameCapture::snaprun()
// printf("--------------------- frame_info.dpi ------------------ :%d\r\n",frame_info.dpi ); // printf("--------------------- frame_info.dpi ------------------ :%d\r\n",frame_info.dpi );
sw.reset(); 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); printf("***********设置的帧数:%d 正在采集第[%d]帧************\r\n",frame_info.frame_index,i);
frame_info.first_frame = i == 0 ? true : false; frame_info.first_frame = i == 1 ? true : false;
frame_info.last_frame = i == frame_cnt ? true : false; frame_info.last_frame = i == frame_info.frame_index ? true : false;
func_sig = snap_func(frame_info, channels,time_out,i); func_sig = snap_func(frame_info, channels,time_out,i);
if (b_stop_snap) if (b_stop_snap)
{ {
video->HtCamGetFrameNum(frame_num); video->HtCamGetFrameNum(frame_num);
int ind = i + 1; //已采集了的帧数 int ind = i; //已采集了的帧数
int val = frame_num - ind; //剩余还未采集的帧数 int val = frame_num - ind; //剩余还未采集的帧数
printf("val:%d\r\n",val);
while (val > 0) while (val > 0)
{ {
frame_info.last_frame = val == 1 ? true : false; frame_info.last_frame = val == 1 ? true : false;
frame_info.frame_index = frame_num; frame_info.frame_index = frame_num;
func_sig = snap_func(frame_info, channels,time_out ,ind);//同上面一样
ind++; ind++;
printf("-----------当前采集到第:[%d]帧 CIS总共采集[%d]帧 -------\r\n",ind,frame_num); printf("-----------当前采集到第:[%d]帧 CIS总共采集[%d]帧 -------\r\n",ind,frame_num);
video->HtCamGetFrameNum(frame_num); func_sig = snap_func(frame_info, channels,time_out ,ind);//同上面一样
val = frame_num - ind;
val--;
if(resolution_ == DPI_600) if(resolution_ == DPI_600)
{ {
int d = 200; int d = 200;
@ -1126,7 +1126,7 @@ void MultiFrameCapture::creatcorrectconfig(int dpi, int mode)
std::this_thread::sleep_for(std::chrono::milliseconds(5)); 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 isDone = saveLutImg(dpi, mode, false); // 0 color_black 1 color_white 2 gray_balck 3 gray_white
video->HtCamStopVideoCapturing(); video->HtCamStopVideoCapturing();
this_thread::sleep_for(std::chrono::milliseconds(200)); this_thread::sleep_for(std::chrono::seconds(2));
i++; i++;
} }
printf("creatcorrectconfig %s \n", (mode == IMAGE_COLOR ? " Color" : " Gray")); printf("creatcorrectconfig %s \n", (mode == IMAGE_COLOR ? " Color" : " Gray"));