调整曝光时间设置的单位

hdrplus
Matthew 11 months ago
parent 13a567abb6
commit 93d3a4d554

@ -1171,7 +1171,6 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
params.autoExposure = mPhotoInfo.autoExposure;
params.focusTimeout = mPhotoInfo.focusTimeout * 1000;
params.exposureTime = mPhotoInfo.exposureTime;
params.expsTimeUs = mPhotoInfo.expsTimeUs;
params.sensitivity = mPhotoInfo.sensitivity;
params.compensation = mPhotoInfo.compensation;
params.orientation = mPhotoInfo.orientation;
@ -1184,16 +1183,17 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
params.requestTemplate = 2;
}
#if 0
if (photoInfo.ldrEnabled)
{
if (GpioControl::getLightAdc() > 1400)
{
params.autoExposure = 0;
params.exposureTime = 1200;
params.expsTimeUs = 0;
params.exposureTime = 1200000000;
params.sensitivity = 1200;
}
}
#endif
// GpioControl::EnableGpio(CMD_SET_CAM_3V3_EN_STATE, true);
bool res = false;
@ -1509,12 +1509,12 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat)
photoInfo.autoExposure = 0;
if (captureResult.avgY == 0)
{
photoInfo.exposureTime = 600;
photoInfo.exposureTime = 600000000;
photoInfo.sensitivity = 2500;
}
else if (captureResult.avgY <= 6)
{
photoInfo.exposureTime = captureResult.exposureTime / 1000000 * 150 / captureResult.avgY;
photoInfo.exposureTime = captureResult.exposureTime * 150 / captureResult.avgY;
photoInfo.sensitivity = photoInfo.sensitivity * 80 / captureResult.avgY;
if (photoInfo.sensitivity < captureResult.sensitivity)
{
@ -1527,7 +1527,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat)
}
else
{
photoInfo.exposureTime = captureResult.exposureTime / 1000000 * 120 / captureResult.avgY;
photoInfo.exposureTime = captureResult.exposureTime * 120 / captureResult.avgY;
photoInfo.sensitivity = photoInfo.sensitivity * 60 / captureResult.avgY;
if (photoInfo.sensitivity < captureResult.sensitivity)
{

@ -704,10 +704,10 @@ int NdkCamera::open(const std::string& cameraId) {
int32_t sensitivity = m_params.sensitivity;
status = ACaptureRequest_setEntry_i32(capture_request, ACAMERA_SENSOR_SENSITIVITY, 1, &sensitivity);
}
if (m_params.exposureTime > 0 || m_params.expsTimeUs > 0)
if (m_params.exposureTime > 0)
{
int64_t exposureTime = ((int64_t)m_params.exposureTime) * 1000000;
exposureTime += ((int64_t)m_params.expsTimeUs) * 1000;
int64_t exposureTime = m_params.exposureTime;
status = ACaptureRequest_setEntry_i64(capture_request, ACAMERA_SENSOR_EXPOSURE_TIME, 1, &exposureTime);
}
}

@ -77,8 +77,7 @@ public:
unsigned int zoom : 1;
unsigned int wait3ALocked : 1;
unsigned int reserved : 6;
unsigned int exposureTime; // ms
unsigned short expsTimeUs; // μs
int64_t exposureTime;
unsigned int sensitivity;
int compensation;
float zoomRatio;

Loading…
Cancel
Save