1. 通过sock发送设置成功的帧率;

2. 通过sock发送设置成功的曝光时间和曝光时最大的像素值;
This commit is contained in:
tangchao0503
2023-05-24 16:38:10 +08:00
parent 371c422a34
commit 09d224075a
4 changed files with 49 additions and 5 deletions

View File

@ -160,6 +160,8 @@ void XimeaImager::setFramerate(double framerate)
m_iImagerState=102;
emit ximeaImageStatus(m_iImagerState);
emit frameRateSignal(framerate);
}
catch(int xiApiErrorCodes)
{
@ -216,12 +218,22 @@ double XimeaImager::setExposureTime(float exposureTime_in_us)
}
}
double XimeaImager::wrapSetExposureTime(float exposureTime_in_us)
int XimeaImager::wrapSetExposureTime(float exposureTime_in_us)
{
setExposureTime(exposureTime_in_us);
double exposureTime = setExposureTime(exposureTime_in_us);
m_imager.start();
m_imager.get_frame(m_buffer);
m_imager.stop();
int maxValueOfOneFrame = getMaxValueOfOneFrame((short unsigned int*)m_imager.m_image.bp,m_imager.get_band_count()*m_imager.get_sample_count());
m_iImagerState=103;
emit ximeaImageStatus(m_iImagerState);
emit autoExposeMaxValueOfOneFrame(maxValueOfOneFrame, exposureTime/1000);
return maxValueOfOneFrame;
}
double XimeaImager::autoExposure()
@ -247,6 +259,7 @@ double XimeaImager::autoExposure()
m_imager.stop();
maxValueOfOneFrame=getMaxValueOfOneFrame((short unsigned int*)m_imager.m_image.bp,m_imager.get_band_count()*m_imager.get_sample_count());
printf("本帧最大值为: %d.\n",maxValueOfOneFrame);
if(maxValueOfOneFrame <= suitableMaxValue)
{
@ -281,6 +294,7 @@ double XimeaImager::autoExposure()
m_iImagerState=103;
emit ximeaImageStatus(m_iImagerState);
emit autoExposeMaxValueOfOneFrame(maxValueOfOneFrame, exposureTime/1000);
std::cout<<"自动曝光完成!"<<std::endl;
return exposureTime;
@ -438,7 +452,6 @@ int XimeaImager::getMaxValueOfOneFrame(unsigned short * data, int numberOfPixel)
int a=0;
}
}
printf("本帧最大值为: %d.\n",maxValue);
return maxValue;
}
@ -827,7 +840,7 @@ void WriteData2Disk::write2Disk()
r_qtx.unlock();
//构造rgb图像用于推流到m300遥控器
m_rgbImage->FillRgbImage(dataBuffer);
// m_rgbImage->FillRgbImage(dataBuffer);
// std::cout<<"WriteData2Disk::write2Disk-----------------------正在写磁盘!" << m_pool->max_size() <<std::endl;//