控制总帧数

This commit is contained in:
modehua 2023-09-04 00:46:21 -07:00
parent 96e71d9415
commit c0e7db3c88
1 changed files with 7 additions and 5 deletions

View File

@ -460,7 +460,7 @@ void MultiFrameCapture::snaprun()
uint32_t frame_cnt = 0; uint32_t frame_cnt = 0;
video->HtCamGetFrameCnt(frame_cnt); video->HtCamGetFrameCnt(frame_cnt);
frame_info.frame_index = frame_cnt; frame_info.frame_index = frame_cnt + 1;
//video->HtCamSetVsnpTime(6); //video->HtCamSetVsnpTime(6);
//printf("设置 vsnp%d\r\n",ti); //printf("设置 vsnp%d\r\n",ti);
//ti++; //ti++;
@ -474,7 +474,7 @@ void MultiFrameCapture::snaprun()
for (size_t i = 1; i <= frame_cnt; i++) for (size_t i = 1; i <= frame_cnt; i++)
{ {
printf("***********设置的帧数:%d 正在采集第[%d]帧************\r\n",frame_cnt,i); printf("***********设置的帧数:%d 正在采集第[%d]帧************\r\n",frame_info.frame_index,i);
frame_info.first_frame = i == 1 ? 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_cnt ? true : false;
@ -500,6 +500,7 @@ void MultiFrameCapture::snaprun()
while (val) while (val)
{ {
frame_info.last_frame = val == 1 ? true : false; frame_info.last_frame = val == 1 ? true : false;
frame_info.frame_index = frame_num;
func_sig = snap_func(frame_info, channels,time_out ,ind);//同上面一样 func_sig = snap_func(frame_info, channels,time_out ,ind);//同上面一样
printf("-----------当前采集到第:[%d]帧 CIS总共采集[%d]帧 -------\r\n",ind,frame_num); printf("-----------当前采集到第:[%d]帧 CIS总共采集[%d]帧 -------\r\n",ind,frame_num);
@ -515,7 +516,7 @@ void MultiFrameCapture::snaprun()
} }
val--; val--;
ind++; ind++;
//this_thread::sleep_for(std::chrono::milliseconds(65)); this_thread::sleep_for(std::chrono::milliseconds(65));
} }
break; break;
} }
@ -525,9 +526,10 @@ void MultiFrameCapture::snaprun()
////////////////////////////采集过快会导致队列堆积///////////////////////// ////////////////////////////采集过快会导致队列堆积/////////////////////////
////////////////////////////所以这个延时是采集速度和传图速度的差值///////////////////////// ////////////////////////////所以这个延时是采集速度和传图速度的差值/////////////////////////
////////////////////////////DPI 颜色不同 会导致数据大小不同所以这个地方延时肯定不一样 目前 60是200dpi///////////////////////// ////////////////////////////DPI 颜色不同 会导致数据大小不同所以这个地方延时肯定不一样 目前 60是200dpi/////////////////////////
int mill = resolution_ == DPI_600 ? 60 * 10 : 10; int mill = resolution_ == DPI_600 ? 60 * 10 : 60;
printf("mill:%d\r\n",mill);
this_thread::sleep_for(std::chrono::milliseconds(mill)); this_thread::sleep_for(std::chrono::milliseconds(mill));
} }
video->HtCamStopVideoCapturing(); video->HtCamStopVideoCapturing();