mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 04:26:58 +03:00
Add support for OV5640 camera (#3063)
* Add support for OV5640 camera * clean up sharpness handling * limit sharpness range to -2 and +2 * refactor * Fix OV3660 sharpness handling * refactor sharpness handling * fix OV3660 zoom mode * reinstate aspect ratio via imageSize * Changed OV5640 full frame size to match datasheet * various fixes * add denoise config and general clean up * fix line endings to LF * Support enabling red blue swap via web interface * update jpeg quality limits * remove color swap config; color swap workaround dependent on vflip * fix missing commit * fix gain ceiling * Update cam vflip param page * fix typo: camdenoise, not camsdenoise * fix compile errors
This commit is contained in:
@@ -142,8 +142,10 @@ esp_err_t CCamera::InitCam(void)
|
|||||||
|
|
||||||
if (s != NULL)
|
if (s != NULL)
|
||||||
{
|
{
|
||||||
|
CCstatus.CamSensor_id = s->id.PID;
|
||||||
|
|
||||||
// Dump camera module, warn for unsupported modules.
|
// Dump camera module, warn for unsupported modules.
|
||||||
switch (s->id.PID)
|
switch (CCstatus.CamSensor_id)
|
||||||
{
|
{
|
||||||
case OV2640_PID:
|
case OV2640_PID:
|
||||||
ESP_LOGI(TAG, "OV2640 camera module detected");
|
ESP_LOGI(TAG, "OV2640 camera module detected");
|
||||||
@@ -151,6 +153,9 @@ esp_err_t CCamera::InitCam(void)
|
|||||||
case OV3660_PID:
|
case OV3660_PID:
|
||||||
ESP_LOGI(TAG, "OV3660 camera module detected");
|
ESP_LOGI(TAG, "OV3660 camera module detected");
|
||||||
break;
|
break;
|
||||||
|
case OV5640_PID:
|
||||||
|
ESP_LOGI(TAG, "OV5640 camera module detected");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGE(TAG, "Camera module is unknown and not properly supported!");
|
ESP_LOGE(TAG, "Camera module is unknown and not properly supported!");
|
||||||
CCstatus.CameraInitSuccessful = false;
|
CCstatus.CameraInitSuccessful = false;
|
||||||
@@ -237,8 +242,6 @@ esp_err_t CCamera::setSensorDatenFromCCstatus(void)
|
|||||||
if (s != NULL)
|
if (s != NULL)
|
||||||
{
|
{
|
||||||
s->set_framesize(s, CCstatus.ImageFrameSize);
|
s->set_framesize(s, CCstatus.ImageFrameSize);
|
||||||
s->set_gainceiling(s, CCstatus.ImageGainceiling); // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
|
||||||
|
|
||||||
s->set_quality(s, CCstatus.ImageQuality); // 0 - 63
|
s->set_quality(s, CCstatus.ImageQuality); // 0 - 63
|
||||||
|
|
||||||
s->set_brightness(s, CCstatus.ImageBrightness); // -2 to 2
|
s->set_brightness(s, CCstatus.ImageBrightness); // -2 to 2
|
||||||
@@ -247,34 +250,37 @@ esp_err_t CCamera::setSensorDatenFromCCstatus(void)
|
|||||||
// s->set_sharpness(s, CCstatus.ImageSharpness); // auto-sharpness is not officially supported, default to 0
|
// s->set_sharpness(s, CCstatus.ImageSharpness); // auto-sharpness is not officially supported, default to 0
|
||||||
SetCamSharpness(CCstatus.ImageAutoSharpness, CCstatus.ImageSharpness);
|
SetCamSharpness(CCstatus.ImageAutoSharpness, CCstatus.ImageSharpness);
|
||||||
|
|
||||||
s->set_exposure_ctrl(s, CCstatus.ImageAec); // 0 = disable , 1 = enable
|
s->set_denoise(s, CCstatus.ImageDenoiseLevel); // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
|
||||||
|
|
||||||
|
s->set_special_effect(s, CCstatus.ImageSpecialEffect); // 0 to 6 (0 - No Effect, 1 - Negative, 2 - Grayscale, 3 - Red Tint, 4 - Green Tint, 5 - Blue Tint, 6 - Sepia)
|
||||||
|
s->set_wb_mode(s, CCstatus.ImageWbMode); // 0 to 4 - if awb_gain enabled (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
|
||||||
|
|
||||||
s->set_ae_level(s, CCstatus.ImageAeLevel); // -2 to 2
|
s->set_ae_level(s, CCstatus.ImageAeLevel); // -2 to 2
|
||||||
s->set_aec_value(s, CCstatus.ImageAecValue); // 0 to 1200
|
s->set_aec_value(s, CCstatus.ImageAecValue); // 0 to 1200
|
||||||
|
|
||||||
s->set_aec2(s, CCstatus.ImageAec2); // 0 = disable , 1 = enable
|
|
||||||
|
|
||||||
s->set_gain_ctrl(s, CCstatus.ImageAgc); // 0 = disable , 1 = enable
|
|
||||||
s->set_agc_gain(s, CCstatus.ImageAgcGain); // 0 to 30
|
s->set_agc_gain(s, CCstatus.ImageAgcGain); // 0 to 30
|
||||||
|
|
||||||
|
// s->set_gainceiling(s, CCstatus.ImageGainceiling); // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
||||||
|
ov5640_set_gainceiling(s, CCstatus.ImageGainceiling);
|
||||||
|
|
||||||
|
s->set_lenc(s, CCstatus.ImageLenc); // 0 = disable , 1 = enable
|
||||||
|
s->set_gain_ctrl(s, CCstatus.ImageAgc); // 0 = disable , 1 = enable
|
||||||
|
s->set_exposure_ctrl(s, CCstatus.ImageAec); // 0 = disable , 1 = enable
|
||||||
|
|
||||||
|
s->set_hmirror(s, CCstatus.ImageHmirror); // 0 = disable , 1 = enable
|
||||||
|
s->set_vflip(s, CCstatus.ImageVflip); // 0 = disable , 1 = enable
|
||||||
|
s->set_aec2(s, CCstatus.ImageAec2); // 0 = disable , 1 = enable
|
||||||
|
|
||||||
s->set_bpc(s, CCstatus.ImageBpc); // 0 = disable , 1 = enable
|
s->set_bpc(s, CCstatus.ImageBpc); // 0 = disable , 1 = enable
|
||||||
s->set_wpc(s, CCstatus.ImageWpc); // 0 = disable , 1 = enable
|
s->set_wpc(s, CCstatus.ImageWpc); // 0 = disable , 1 = enable
|
||||||
|
|
||||||
s->set_raw_gma(s, CCstatus.ImageRawGma); // 0 = disable , 1 = enable
|
s->set_raw_gma(s, CCstatus.ImageRawGma); // 0 = disable , 1 = enable
|
||||||
s->set_lenc(s, CCstatus.ImageLenc); // 0 = disable , 1 = enable
|
|
||||||
|
|
||||||
s->set_hmirror(s, CCstatus.ImageHmirror); // 0 = disable , 1 = enable
|
|
||||||
s->set_vflip(s, CCstatus.ImageVflip); // 0 = disable , 1 = enable
|
|
||||||
|
|
||||||
s->set_dcw(s, CCstatus.ImageDcw); // 0 = disable , 1 = enable
|
|
||||||
|
|
||||||
s->set_wb_mode(s, CCstatus.ImageWbMode); // 0 to 4 - if awb_gain enabled (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
|
|
||||||
s->set_awb_gain(s, CCstatus.ImageAwbGain); // 0 = disable , 1 = enable
|
s->set_awb_gain(s, CCstatus.ImageAwbGain); // 0 = disable , 1 = enable
|
||||||
s->set_whitebal(s, CCstatus.ImageAwb); // 0 = disable , 1 = enable
|
s->set_whitebal(s, CCstatus.ImageAwb); // 0 = disable , 1 = enable
|
||||||
|
|
||||||
// special_effect muß als Letztes gesetzt werden, sonst geht es nicht
|
s->set_dcw(s, CCstatus.ImageDcw); // 0 = disable , 1 = enable
|
||||||
s->set_special_effect(s, CCstatus.ImageSpecialEffect); // 0 to 6 (0 - No Effect, 1 - Negative, 2 - Grayscale, 3 - Red Tint, 4 - Green Tint, 5 - Blue Tint, 6 - Sepia)
|
|
||||||
|
|
||||||
TickType_t xDelay2 = 1000 / portTICK_PERIOD_MS;
|
TickType_t xDelay2 = 100 / portTICK_PERIOD_MS;
|
||||||
vTaskDelay(xDelay2);
|
vTaskDelay(xDelay2);
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
@@ -291,6 +297,8 @@ esp_err_t CCamera::getSensorDatenToCCstatus(void)
|
|||||||
|
|
||||||
if (s != NULL)
|
if (s != NULL)
|
||||||
{
|
{
|
||||||
|
CCstatus.CamSensor_id = s->id.PID;
|
||||||
|
|
||||||
CCstatus.ImageFrameSize = (framesize_t)s->status.framesize;
|
CCstatus.ImageFrameSize = (framesize_t)s->status.framesize;
|
||||||
CCstatus.ImageGainceiling = (gainceiling_t)s->status.gainceiling;
|
CCstatus.ImageGainceiling = (gainceiling_t)s->status.gainceiling;
|
||||||
|
|
||||||
@@ -316,6 +324,7 @@ esp_err_t CCamera::getSensorDatenToCCstatus(void)
|
|||||||
CCstatus.ImageHmirror = s->status.hmirror;
|
CCstatus.ImageHmirror = s->status.hmirror;
|
||||||
CCstatus.ImageVflip = s->status.vflip;
|
CCstatus.ImageVflip = s->status.vflip;
|
||||||
CCstatus.ImageDcw = s->status.dcw;
|
CCstatus.ImageDcw = s->status.dcw;
|
||||||
|
CCstatus.ImageDenoiseLevel = s->status.denoise;
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
@@ -325,7 +334,93 @@ esp_err_t CCamera::getSensorDatenToCCstatus(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCamera::SetZoomSize(bool zoomEnabled, int zoomOffsetX, int zoomOffsetY, int imageSize)
|
// on the OV5640, gainceiling must be set with the real value (x2>>>level = 2, .... x128>>>level = 128)
|
||||||
|
int CCamera::ov5640_set_gainceiling(sensor_t *s, gainceiling_t level)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
|
ret = s->set_gainceiling(s, CCstatus.ImageGainceiling); // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int _level = (1 << ((int)level + 1));
|
||||||
|
|
||||||
|
ret = s->set_reg(s, 0x3A18, 0xFF, (_level >> 8) & 3) || s->set_reg(s, 0x3A19, 0xFF, _level & 0xFF);
|
||||||
|
|
||||||
|
if (ret == 0)
|
||||||
|
{
|
||||||
|
// ESP_LOGD(TAG, "Set gainceiling to: %d", level);
|
||||||
|
s->status.gainceiling = level;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - It always zooms to the image center when offsets are zero
|
||||||
|
// - if imageSize = 0 then the image is not zoomed
|
||||||
|
// - if imageSize = max value, then the image is fully zoomed in
|
||||||
|
// - a zoom step is >>> Width + 32 px / Height + 24 px
|
||||||
|
void CCamera::SanitizeZoomParams(int imageSize, int frameSizeX, int frameSizeY, int &imageWidth, int &imageHeight, int &zoomOffsetX, int &zoomOffsetY)
|
||||||
|
{
|
||||||
|
// for OV2640, This works only if the aspect ratio of 4:3 is preserved in the window size.
|
||||||
|
// use only values divisible by 8 without remainder
|
||||||
|
imageWidth = CCstatus.ImageWidth + (imageSize * 4 * 8);
|
||||||
|
imageHeight = CCstatus.ImageHeight + (imageSize * 3 * 8);
|
||||||
|
|
||||||
|
int _maxX = frameSizeX - imageWidth;
|
||||||
|
int _maxY = frameSizeY - imageHeight;
|
||||||
|
|
||||||
|
if ((abs(zoomOffsetX) * 2) > _maxX)
|
||||||
|
{
|
||||||
|
if (zoomOffsetX > 0)
|
||||||
|
{
|
||||||
|
zoomOffsetX = _maxX;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
zoomOffsetX = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (zoomOffsetX > 0)
|
||||||
|
{
|
||||||
|
zoomOffsetX = ((_maxX / 2) + zoomOffsetX);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
zoomOffsetX = ((_maxX / 2) + zoomOffsetX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((abs(zoomOffsetY) * 2) > _maxY)
|
||||||
|
{
|
||||||
|
if (zoomOffsetY > 0)
|
||||||
|
{
|
||||||
|
zoomOffsetY = _maxY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
zoomOffsetY = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (zoomOffsetY > 0)
|
||||||
|
{
|
||||||
|
zoomOffsetY = ((_maxY / 2) + zoomOffsetY);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
zoomOffsetY = ((_maxY / 2) + zoomOffsetY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCamera::SetZoomSize(bool zoomEnabled, int zoomOffsetX, int zoomOffsetY, int imageSize, int imageVflip)
|
||||||
{
|
{
|
||||||
sensor_t *s = esp_camera_sensor_get();
|
sensor_t *s = esp_camera_sensor_get();
|
||||||
|
|
||||||
@@ -333,89 +428,59 @@ void CCamera::SetZoomSize(bool zoomEnabled, int zoomOffsetX, int zoomOffsetY, in
|
|||||||
{
|
{
|
||||||
if (zoomEnabled)
|
if (zoomEnabled)
|
||||||
{
|
{
|
||||||
// ov2640_sensor_mode_t _mode = OV2640_MODE_UXGA; // 1600x1200
|
int _imageSize_temp = 0;
|
||||||
// ov2640_sensor_mode_t _mode = OV2640_MODE_SVGA; // 800x600
|
int _imageWidth = CCstatus.ImageWidth;
|
||||||
// ov2640_sensor_mode_t _mode = OV2640_MODE_CIF; // 400x296
|
int _imageHeight = CCstatus.ImageHeight;
|
||||||
int _mode = 0;
|
|
||||||
|
|
||||||
int _offsetx = zoomOffsetX;
|
int _offsetx = zoomOffsetX;
|
||||||
int _offsety = zoomOffsetY;
|
int _offsety = zoomOffsetY;
|
||||||
int _imageSize_temp = 0;
|
int frameSizeX;
|
||||||
int _maxX = 0;
|
int frameSizeY;
|
||||||
int _maxY = 0;
|
|
||||||
|
|
||||||
|
switch (CCstatus.CamSensor_id)
|
||||||
|
{
|
||||||
|
case OV5640_PID:
|
||||||
|
frameSizeX = 2592;
|
||||||
|
frameSizeY = 1944;
|
||||||
|
// max imageSize = ((frameSizeX - CCstatus.ImageWidth) / 8 / 4) - 1
|
||||||
|
// 59 = ((2560 - 640) / 8 / 4) - 1
|
||||||
|
if (imageSize < 59)
|
||||||
|
{
|
||||||
|
_imageSize_temp = (59 - imageSize);
|
||||||
|
}
|
||||||
|
SanitizeZoomParams(_imageSize_temp, frameSizeX, frameSizeY, _imageWidth, _imageHeight, _offsetx, _offsety);
|
||||||
|
SetCamWindow(s, frameSizeX, frameSizeY, _offsetx, _offsety, _imageWidth, _imageHeight, CCstatus.ImageWidth, CCstatus.ImageHeight, imageVflip);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OV3660_PID:
|
||||||
|
frameSizeX = 2048;
|
||||||
|
frameSizeY = 1536;
|
||||||
|
// max imageSize = ((frameSizeX - CCstatus.ImageWidth) / 8 / 4) -1
|
||||||
|
// 43 = ((2048 - 640) / 8 / 4) - 1
|
||||||
|
if (imageSize < 43)
|
||||||
|
{
|
||||||
|
_imageSize_temp = (43 - imageSize);
|
||||||
|
}
|
||||||
|
SanitizeZoomParams(_imageSize_temp, frameSizeX, frameSizeY, _imageWidth, _imageHeight, _offsetx, _offsety);
|
||||||
|
SetCamWindow(s, frameSizeX, frameSizeY, _offsetx, _offsety, _imageWidth, _imageHeight, CCstatus.ImageWidth, CCstatus.ImageHeight, imageVflip);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OV2640_PID:
|
||||||
|
frameSizeX = 1600;
|
||||||
|
frameSizeY = 1200;
|
||||||
|
// max imageSize = ((frameSizeX - CCstatus.ImageWidth) / 8 / 4) -1
|
||||||
|
// 29 = ((1600 - 640) / 8 / 4) - 1
|
||||||
if (imageSize < 29)
|
if (imageSize < 29)
|
||||||
{
|
{
|
||||||
_imageSize_temp = (29 - imageSize);
|
_imageSize_temp = (29 - imageSize);
|
||||||
}
|
}
|
||||||
|
SanitizeZoomParams(_imageSize_temp, frameSizeX, frameSizeY, _imageWidth, _imageHeight, _offsetx, _offsety);
|
||||||
|
SetCamWindow(s, frameSizeX, frameSizeY, _offsetx, _offsety, _imageWidth, _imageHeight, CCstatus.ImageWidth, CCstatus.ImageHeight, imageVflip);
|
||||||
|
break;
|
||||||
|
|
||||||
// This works only if the aspect ratio of 4:3 is preserved in the window size.
|
default:
|
||||||
// use values divisible by 8 without remainder
|
// do nothing
|
||||||
int _imageWidth = CCstatus.ImageWidth + (_imageSize_temp * 4 * 8);
|
break;
|
||||||
int _imageHeight = CCstatus.ImageHeight + (_imageSize_temp * 3 * 8);
|
|
||||||
|
|
||||||
_maxX = 1600 - _imageWidth;
|
|
||||||
_maxY = 1200 - _imageHeight;
|
|
||||||
|
|
||||||
if ((abs(_offsetx) * 2) > _maxX)
|
|
||||||
{
|
|
||||||
if (_offsetx > 0)
|
|
||||||
{
|
|
||||||
_offsetx = _maxX;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
_offsetx = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (_offsetx > 0)
|
|
||||||
{
|
|
||||||
// wenn der Wert von _offsetx nicht durch 8 teilbar ist,
|
|
||||||
// werden die Farben sehr oft vertauscht(insbesondere Rot mit Blau)
|
|
||||||
_offsetx = ((_maxX / 2) + _offsetx);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// wenn der Wert von _offsetx nicht durch 8 teilbar ist,
|
|
||||||
// werden die Farben sehr oft vertauscht(insbesondere Rot mit Blau)
|
|
||||||
_offsetx = ((_maxX / 2) + _offsetx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((abs(_offsety) * 2) > _maxY)
|
|
||||||
{
|
|
||||||
if (_offsety > 0)
|
|
||||||
{
|
|
||||||
_offsety = _maxY;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_offsety = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (_offsety > 0)
|
|
||||||
{
|
|
||||||
// wenn der Wert von _offsety nicht durch 8 teilbar ist,
|
|
||||||
// werden die Farben sehr oft vertauscht(insbesondere Rot mit Blau)
|
|
||||||
_offsety = ((_maxY / 2) + _offsety);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// wenn der Wert von _offsety nicht durch 8 teilbar ist,
|
|
||||||
// werden die Farben sehr oft vertauscht(insbesondere Rot mit Blau)
|
|
||||||
_offsety = ((_maxY / 2) + _offsety);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// _mode sets the sensor resolution (3 options available),
|
|
||||||
// _offsetx and _offsety set the start of the ROI,
|
|
||||||
// _imageWidth and _imageHeight set the size of the ROI,
|
|
||||||
// CCstatus.ImageWidth and CCstatus.ImageHeight set the output window size.
|
|
||||||
SetCamWindow(s, _mode, _offsetx, _offsety, _imageWidth, _imageHeight, CCstatus.ImageWidth, CCstatus.ImageHeight);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -424,18 +489,22 @@ void CCamera::SetZoomSize(bool zoomEnabled, int zoomOffsetX, int zoomOffsetY, in
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCamera::SetQualityZoomSize(int qual, framesize_t resol, bool zoomEnabled, int zoomOffsetX, int zoomOffsetY, int imageSize)
|
void CCamera::SetQualityZoomSize(int qual, framesize_t resol, bool zoomEnabled, int zoomOffsetX, int zoomOffsetY, int imageSize, int imageVflip)
|
||||||
{
|
{
|
||||||
qual = min(63, max(8, qual)); // Limit quality from 8..63 (values lower than 8 tent to be unstable)
|
sensor_t *s = esp_camera_sensor_get();
|
||||||
|
|
||||||
|
// OV2640 has no lower limit on jpeg quality
|
||||||
|
if (CCstatus.CamSensor_id == OV5640_PID)
|
||||||
|
{
|
||||||
|
qual = min(63, max(8, qual));
|
||||||
|
}
|
||||||
|
|
||||||
SetImageWidthHeightFromResolution(resol);
|
SetImageWidthHeightFromResolution(resol);
|
||||||
|
|
||||||
sensor_t *s = esp_camera_sensor_get();
|
|
||||||
|
|
||||||
if (s != NULL)
|
if (s != NULL)
|
||||||
{
|
{
|
||||||
s->set_quality(s, qual);
|
s->set_quality(s, qual);
|
||||||
SetZoomSize(zoomEnabled, zoomOffsetX, zoomOffsetY, imageSize);
|
SetZoomSize(zoomEnabled, zoomOffsetX, zoomOffsetY, imageSize, imageVflip);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -445,16 +514,16 @@ void CCamera::SetQualityZoomSize(int qual, framesize_t resol, bool zoomEnabled,
|
|||||||
|
|
||||||
void CCamera::SetCamSharpness(bool _autoSharpnessEnabled, int _sharpnessLevel)
|
void CCamera::SetCamSharpness(bool _autoSharpnessEnabled, int _sharpnessLevel)
|
||||||
{
|
{
|
||||||
_sharpnessLevel = min(2, max(-2, _sharpnessLevel));
|
|
||||||
|
|
||||||
sensor_t *s = esp_camera_sensor_get();
|
sensor_t *s = esp_camera_sensor_get();
|
||||||
|
|
||||||
if (s != NULL)
|
if (s != NULL)
|
||||||
{
|
{
|
||||||
// post processing
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
|
_sharpnessLevel = min(2, max(-2, _sharpnessLevel));
|
||||||
|
// The OV2640 does not officially support sharpness, so the detour is made with the ov2640_sharpness.cpp.
|
||||||
if (_autoSharpnessEnabled)
|
if (_autoSharpnessEnabled)
|
||||||
{
|
{
|
||||||
s->set_sharpness(s, 0);
|
|
||||||
ov2640_enable_auto_sharpness(s);
|
ov2640_enable_auto_sharpness(s);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -463,52 +532,47 @@ void CCamera::SetCamSharpness(bool _autoSharpnessEnabled, int _sharpnessLevel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
_sharpnessLevel = min(3, max(-3, _sharpnessLevel));
|
||||||
|
// for CAMERA_OV5640 and CAMERA_OV3660
|
||||||
|
if (_autoSharpnessEnabled)
|
||||||
|
{
|
||||||
|
// autoSharpness is not supported, default to zero
|
||||||
|
s->set_sharpness(s, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s->set_sharpness(s, _sharpnessLevel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "SetCamSharpness, Failed to get Cam control structure");
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "SetCamSharpness, Failed to get Cam control structure");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void CCamera::SetCamWindow(sensor_t *s, int frameSizeX, int frameSizeY, int xOffset, int yOffset, int xTotal, int yTotal, int xOutput, int yOutput, int imageVflip)
|
||||||
* resolution = 0 \\ OV2640_MODE_UXGA -> 1600 x 1200
|
|
||||||
* resolution = 1 \\ OV2640_MODE_SVGA -> 800 x 600
|
|
||||||
* resolution = 2 \\ OV2640_MODE_CIF -> 400 x 296
|
|
||||||
* resolution = 3 \\ OV2640_MODE_MAX
|
|
||||||
*/
|
|
||||||
void CCamera::SetCamWindow(sensor_t *s, int resolution, int xOffset, int yOffset, int xTotal, int yTotal, int xOutput, int yOutput)
|
|
||||||
{
|
{
|
||||||
// - (xOffset,yOffset) is the origin of the window in pixels and (xLength,yLength) is the size of the window in pixels.
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
// - (xOffset,yOffset) ist der Ursprung des Fensters in Pixel und (xLength,yLength) ist die Größe des Fensters in Pixel.
|
{
|
||||||
|
s->set_res_raw(s, 0, 0, 0, 0, xOffset, yOffset, xTotal, yTotal, xOutput, yOutput, false, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// for CAMERA_OV5640 and CAMERA_OV3660
|
||||||
|
bool scale = !(xOutput == xTotal && yOutput == yTotal);
|
||||||
|
bool binning = (xTotal >= (frameSizeX >> 1));
|
||||||
|
|
||||||
// - Be aware that changing the resolution will effectively overwrite these settings.
|
if (imageVflip == true)
|
||||||
// - Beachten Sie, dass eine Änderung der Auflösung diese Einstellungen effektiv überschreibt.
|
{
|
||||||
|
s->set_res_raw(s, xOffset, yOffset, xOffset + xTotal - 1, yOffset + yTotal - 1, 0, 0, frameSizeX, frameSizeY, xOutput, yOutput, scale, binning);
|
||||||
// - This works only if the aspect ratio of 4:3 is preserved in the window size.
|
}
|
||||||
// - Dies funktioniert nur, wenn das Seitenverhältnis von 4:3 in der Fenstergröße beibehalten wird.
|
else
|
||||||
|
{
|
||||||
// - total_x and total_y defines the size on the sensor
|
s->set_res_raw(s, xOffset, yOffset, xOffset + xTotal, yOffset + yTotal, 0, 0, frameSizeX, frameSizeY, xOutput, yOutput, scale, binning);
|
||||||
// - total_x und total_y definieren die Größe des Sensors
|
}
|
||||||
|
}
|
||||||
// - width and height defines the resulting image(may be smaller than the size on the sensor)
|
|
||||||
// - width und height definieren das resultierende Bild (kann kleiner sein als die Größe des Sensor)
|
|
||||||
|
|
||||||
// - keep the aspect total_x : total_y == width : height
|
|
||||||
// - Behalten Sie den Aspekt total_x : total_y == width : height bei
|
|
||||||
|
|
||||||
// - use values divisible by 8 without remainder
|
|
||||||
// - Verwenden Sie Werte, die ohne Rest durch 8 teilbar sind
|
|
||||||
|
|
||||||
// - start with total_x = width and total_y = height, reduce both values by eg.32 pixels
|
|
||||||
// - Beginnen Sie mit total_x = width und total_y = height und reduzieren Sie beide Werte um z.B.32 Pixel
|
|
||||||
|
|
||||||
// - next try moving with offset_x or offset_y by 8 pixels
|
|
||||||
// - Versuchen Sie als Nächstes, mit offset_x oder offset_y um 8 Pixel zu verschieben
|
|
||||||
|
|
||||||
// set_res_raw(sensor_t *sensor, int startX, int startY, int endX, int endY, int offsetX, int offsetY, int totalX, int totalY, int outputX, int outputY, bool scale, bool binning)
|
|
||||||
// set_window(sensor, (ov2640_sensor_mode_t)startX, offsetX, offsetY, totalX, totalY, outputX, outputY);
|
|
||||||
// set_window(sensor, mode, offset_x, offset_y, max_x, max_y, w, h);
|
|
||||||
|
|
||||||
int unused = 0;
|
|
||||||
s->set_res_raw(s, resolution, unused, unused, unused, xOffset, yOffset, xTotal, yTotal, xOutput, yOutput, unused, unused);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t jpg_encode_stream(void *arg, size_t index, const void *data, size_t len)
|
static size_t jpg_encode_stream(void *arg, size_t index, const void *data, size_t len)
|
||||||
@@ -839,7 +903,7 @@ esp_err_t CCamera::CaptureToStream(httpd_req_t *req, bool FlashlightOn)
|
|||||||
if (CFstatus.changedCameraSettings)
|
if (CFstatus.changedCameraSettings)
|
||||||
{
|
{
|
||||||
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
||||||
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize);
|
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize, CCstatus.ImageVflip);
|
||||||
CFstatus.changedCameraSettings = false;
|
CFstatus.changedCameraSettings = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,15 +15,10 @@
|
|||||||
#include "CImageBasis.h"
|
#include "CImageBasis.h"
|
||||||
#include "../../include/defines.h"
|
#include "../../include/defines.h"
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
OV2640_MODE_UXGA,
|
|
||||||
OV2640_MODE_SVGA,
|
|
||||||
OV2640_MODE_CIF
|
|
||||||
} ov2640_sensor_mode_t;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
uint16_t CamSensor_id;
|
||||||
|
|
||||||
framesize_t ImageFrameSize = FRAMESIZE_VGA; // 0 - 10
|
framesize_t ImageFrameSize = FRAMESIZE_VGA; // 0 - 10
|
||||||
gainceiling_t ImageGainceiling; // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
gainceiling_t ImageGainceiling; // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
||||||
|
|
||||||
@@ -51,13 +46,14 @@ typedef struct
|
|||||||
int ImageVflip; // Invert image (0 or 1)
|
int ImageVflip; // Invert image (0 or 1)
|
||||||
int ImageDcw; // downsize enable (1 or 0)
|
int ImageDcw; // downsize enable (1 or 0)
|
||||||
|
|
||||||
|
int ImageDenoiseLevel; // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
|
||||||
|
|
||||||
int ImageWidth;
|
int ImageWidth;
|
||||||
int ImageHeight;
|
int ImageHeight;
|
||||||
|
|
||||||
int ImageLedIntensity;
|
int ImageLedIntensity;
|
||||||
|
|
||||||
bool ImageZoomEnabled;
|
bool ImageZoomEnabled;
|
||||||
int ImageZoomMode;
|
|
||||||
int ImageZoomOffsetX;
|
int ImageZoomOffsetX;
|
||||||
int ImageZoomOffsetY;
|
int ImageZoomOffsetY;
|
||||||
int ImageZoomSize;
|
int ImageZoomSize;
|
||||||
@@ -79,8 +75,9 @@ protected:
|
|||||||
void ledc_init(void);
|
void ledc_init(void);
|
||||||
bool loadNextDemoImage(camera_fb_t *fb);
|
bool loadNextDemoImage(camera_fb_t *fb);
|
||||||
long GetFileSize(std::string filename);
|
long GetFileSize(std::string filename);
|
||||||
void SetCamWindow(sensor_t *s, int resolution, int xOffset, int yOffset, int xTotal, int yTotal, int xOutput, int yOutput);
|
void SetCamWindow(sensor_t *s, int frameSizeX, int frameSizeY, int xOffset, int yOffset, int xTotal, int yTotal, int xOutput, int yOutput, int imageVflip);
|
||||||
void SetImageWidthHeightFromResolution(framesize_t resol);
|
void SetImageWidthHeightFromResolution(framesize_t resol);
|
||||||
|
void SanitizeZoomParams(int imageSize, int frameSizeX, int frameSizeY, int &imageWidth, int &imageHeight, int &zoomOffsetX, int &zoomOffsetY);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CCamera(void);
|
CCamera(void);
|
||||||
@@ -92,11 +89,13 @@ public:
|
|||||||
esp_err_t setSensorDatenFromCCstatus(void);
|
esp_err_t setSensorDatenFromCCstatus(void);
|
||||||
esp_err_t getSensorDatenToCCstatus(void);
|
esp_err_t getSensorDatenToCCstatus(void);
|
||||||
|
|
||||||
|
int ov5640_set_gainceiling(sensor_t *s, gainceiling_t level);
|
||||||
|
|
||||||
esp_err_t CaptureToHTTP(httpd_req_t *req, int delay = 0);
|
esp_err_t CaptureToHTTP(httpd_req_t *req, int delay = 0);
|
||||||
esp_err_t CaptureToStream(httpd_req_t *req, bool FlashlightOn);
|
esp_err_t CaptureToStream(httpd_req_t *req, bool FlashlightOn);
|
||||||
|
|
||||||
void SetQualityZoomSize(int qual, framesize_t resol, bool zoomEnabled, int zoomOffsetX, int zoomOffsetY, int imageSize);
|
void SetQualityZoomSize(int qual, framesize_t resol, bool zoomEnabled, int zoomOffsetX, int zoomOffsetY, int imageSize, int imageVflip);
|
||||||
void SetZoomSize(bool zoomEnabled, int zoomOffsetX, int zoomOffsetY, int imageSize);
|
void SetZoomSize(bool zoomEnabled, int zoomOffsetX, int zoomOffsetY, int imageSize, int imageVflip);
|
||||||
void SetCamSharpness(bool _autoSharpnessEnabled, int _sharpnessLevel);
|
void SetCamSharpness(bool _autoSharpnessEnabled, int _sharpnessLevel);
|
||||||
|
|
||||||
void SetLEDIntensity(float _intrel);
|
void SetLEDIntensity(float _intrel);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ esp_err_t handler_capture(httpd_req_t *req)
|
|||||||
if (CFstatus.changedCameraSettings)
|
if (CFstatus.changedCameraSettings)
|
||||||
{
|
{
|
||||||
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
||||||
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize);
|
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize, CCstatus.ImageVflip);
|
||||||
CFstatus.changedCameraSettings = false;
|
CFstatus.changedCameraSettings = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ esp_err_t handler_capture_with_light(httpd_req_t *req)
|
|||||||
if (CFstatus.changedCameraSettings)
|
if (CFstatus.changedCameraSettings)
|
||||||
{
|
{
|
||||||
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
||||||
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize);
|
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize, CCstatus.ImageVflip);
|
||||||
CFstatus.changedCameraSettings = false;
|
CFstatus.changedCameraSettings = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ esp_err_t handler_capture_save_to_file(httpd_req_t *req)
|
|||||||
if (CFstatus.changedCameraSettings)
|
if (CFstatus.changedCameraSettings)
|
||||||
{
|
{
|
||||||
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
||||||
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize);
|
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize, CCstatus.ImageVflip);
|
||||||
CFstatus.changedCameraSettings = false;
|
CFstatus.changedCameraSettings = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,8 +197,15 @@ bool ClassFlowTakeImage::ReadParameter(FILE *pfile, string &aktparamgraph)
|
|||||||
if (isStringNumeric(splitted[1]))
|
if (isStringNumeric(splitted[1]))
|
||||||
{
|
{
|
||||||
int _ImageSharpness = std::stoi(splitted[1]);
|
int _ImageSharpness = std::stoi(splitted[1]);
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
CCstatus.ImageSharpness = clipInt(_ImageSharpness, 2, -2);
|
CCstatus.ImageSharpness = clipInt(_ImageSharpness, 2, -2);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CCstatus.ImageSharpness = clipInt(_ImageSharpness, 3, -3);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ((toUpper(splitted[0]) == "CAMAUTOSHARPNESS") && (splitted.size() > 1))
|
else if ((toUpper(splitted[0]) == "CAMAUTOSHARPNESS") && (splitted.size() > 1))
|
||||||
@@ -289,8 +296,15 @@ bool ClassFlowTakeImage::ReadParameter(FILE *pfile, string &aktparamgraph)
|
|||||||
if (isStringNumeric(splitted[1]))
|
if (isStringNumeric(splitted[1]))
|
||||||
{
|
{
|
||||||
int _ImageAeLevel = std::stoi(splitted[1]);
|
int _ImageAeLevel = std::stoi(splitted[1]);
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
CCstatus.ImageAeLevel = clipInt(_ImageAeLevel, 2, -2);
|
CCstatus.ImageAeLevel = clipInt(_ImageAeLevel, 2, -2);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CCstatus.ImageAeLevel = clipInt(_ImageAeLevel, 5, -5);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ((toUpper(splitted[0]) == "CAMAECVALUE") && (splitted.size() > 1))
|
else if ((toUpper(splitted[0]) == "CAMAECVALUE") && (splitted.size() > 1))
|
||||||
@@ -351,6 +365,22 @@ bool ClassFlowTakeImage::ReadParameter(FILE *pfile, string &aktparamgraph)
|
|||||||
CCstatus.ImageDcw = alphanumericToBoolean(splitted[1]);
|
CCstatus.ImageDcw = alphanumericToBoolean(splitted[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if ((toUpper(splitted[0]) == "CAMDENOISE") && (splitted.size() > 1))
|
||||||
|
{
|
||||||
|
if (isStringNumeric(splitted[1]))
|
||||||
|
{
|
||||||
|
int _ImageDenoiseLevel = std::stoi(splitted[1]);
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
|
CCstatus.ImageDenoiseLevel = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CCstatus.ImageDenoiseLevel = clipInt(_ImageDenoiseLevel, 8, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if ((toUpper(splitted[0]) == "CAMZOOM") && (splitted.size() > 1))
|
else if ((toUpper(splitted[0]) == "CAMZOOM") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
CCstatus.ImageZoomEnabled = alphanumericToBoolean(splitted[1]);
|
CCstatus.ImageZoomEnabled = alphanumericToBoolean(splitted[1]);
|
||||||
@@ -360,7 +390,19 @@ bool ClassFlowTakeImage::ReadParameter(FILE *pfile, string &aktparamgraph)
|
|||||||
{
|
{
|
||||||
if (isStringNumeric(splitted[1]))
|
if (isStringNumeric(splitted[1]))
|
||||||
{
|
{
|
||||||
CCstatus.ImageZoomOffsetX = std::stoi(splitted[1]);
|
int _ImageZoomOffsetX = std::stoi(splitted[1]);
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
|
CCstatus.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 480, -480);
|
||||||
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
||||||
|
{
|
||||||
|
CCstatus.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 704, -704);
|
||||||
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
||||||
|
{
|
||||||
|
CCstatus.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 960, -960);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,7 +410,19 @@ bool ClassFlowTakeImage::ReadParameter(FILE *pfile, string &aktparamgraph)
|
|||||||
{
|
{
|
||||||
if (isStringNumeric(splitted[1]))
|
if (isStringNumeric(splitted[1]))
|
||||||
{
|
{
|
||||||
CCstatus.ImageZoomOffsetY = std::stoi(splitted[1]);
|
int _ImageZoomOffsetY = std::stoi(splitted[1]);
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
|
CCstatus.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 360, -360);
|
||||||
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
||||||
|
{
|
||||||
|
CCstatus.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 528, -528);
|
||||||
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
||||||
|
{
|
||||||
|
CCstatus.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 720, -720);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +430,19 @@ bool ClassFlowTakeImage::ReadParameter(FILE *pfile, string &aktparamgraph)
|
|||||||
{
|
{
|
||||||
if (isStringNumeric(splitted[1]))
|
if (isStringNumeric(splitted[1]))
|
||||||
{
|
{
|
||||||
CCstatus.ImageZoomSize = std::stoi(splitted[1]);
|
int _ImageZoomSize = std::stoi(splitted[1]);
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
|
CCstatus.ImageZoomSize = clipInt(_ImageZoomSize, 29, 0);
|
||||||
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
||||||
|
{
|
||||||
|
CCstatus.ImageZoomSize = clipInt(_ImageZoomSize, 43, 0);
|
||||||
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
||||||
|
{
|
||||||
|
CCstatus.ImageZoomSize = clipInt(_ImageZoomSize, 59, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -400,7 +466,7 @@ bool ClassFlowTakeImage::ReadParameter(FILE *pfile, string &aktparamgraph)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
||||||
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize);
|
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize, CCstatus.ImageVflip);
|
||||||
|
|
||||||
rawImage = new CImageBasis("rawImage");
|
rawImage = new CImageBasis("rawImage");
|
||||||
rawImage->CreateEmptyImage(CCstatus.ImageWidth, CCstatus.ImageHeight, 3);
|
rawImage->CreateEmptyImage(CCstatus.ImageWidth, CCstatus.ImageHeight, 3);
|
||||||
@@ -443,7 +509,7 @@ bool ClassFlowTakeImage::doFlow(string zwtime)
|
|||||||
if (CFstatus.changedCameraSettings)
|
if (CFstatus.changedCameraSettings)
|
||||||
{
|
{
|
||||||
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
Camera.setSensorDatenFromCCstatus(); // CCstatus >>> Kamera
|
||||||
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize);
|
Camera.SetQualityZoomSize(CCstatus.ImageQuality, CCstatus.ImageFrameSize, CCstatus.ImageZoomEnabled, CCstatus.ImageZoomOffsetX, CCstatus.ImageZoomOffsetY, CCstatus.ImageZoomSize, CCstatus.ImageVflip);
|
||||||
CFstatus.changedCameraSettings = false;
|
CFstatus.changedCameraSettings = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -145,6 +145,8 @@ bool doflow(void)
|
|||||||
|
|
||||||
esp_err_t setCCstatusToCFstatus(void)
|
esp_err_t setCCstatusToCFstatus(void)
|
||||||
{
|
{
|
||||||
|
CFstatus.CamSensor_id = CCstatus.CamSensor_id;
|
||||||
|
|
||||||
CFstatus.ImageFrameSize = CCstatus.ImageFrameSize;
|
CFstatus.ImageFrameSize = CCstatus.ImageFrameSize;
|
||||||
CFstatus.ImageGainceiling = CCstatus.ImageGainceiling;
|
CFstatus.ImageGainceiling = CCstatus.ImageGainceiling;
|
||||||
|
|
||||||
@@ -171,11 +173,11 @@ esp_err_t setCCstatusToCFstatus(void)
|
|||||||
CFstatus.ImageHmirror = CCstatus.ImageHmirror;
|
CFstatus.ImageHmirror = CCstatus.ImageHmirror;
|
||||||
CFstatus.ImageVflip = CCstatus.ImageVflip;
|
CFstatus.ImageVflip = CCstatus.ImageVflip;
|
||||||
CFstatus.ImageDcw = CCstatus.ImageDcw;
|
CFstatus.ImageDcw = CCstatus.ImageDcw;
|
||||||
|
CFstatus.ImageDenoiseLevel = CCstatus.ImageDenoiseLevel;
|
||||||
|
|
||||||
CFstatus.ImageLedIntensity = CCstatus.ImageLedIntensity;
|
CFstatus.ImageLedIntensity = CCstatus.ImageLedIntensity;
|
||||||
|
|
||||||
CFstatus.ImageZoomEnabled = CCstatus.ImageZoomEnabled;
|
CFstatus.ImageZoomEnabled = CCstatus.ImageZoomEnabled;
|
||||||
CFstatus.ImageZoomMode = CCstatus.ImageZoomMode;
|
|
||||||
CFstatus.ImageZoomOffsetX = CCstatus.ImageZoomOffsetX;
|
CFstatus.ImageZoomOffsetX = CCstatus.ImageZoomOffsetX;
|
||||||
CFstatus.ImageZoomOffsetY = CCstatus.ImageZoomOffsetY;
|
CFstatus.ImageZoomOffsetY = CCstatus.ImageZoomOffsetY;
|
||||||
CFstatus.ImageZoomSize = CCstatus.ImageZoomSize;
|
CFstatus.ImageZoomSize = CCstatus.ImageZoomSize;
|
||||||
@@ -187,6 +189,8 @@ esp_err_t setCCstatusToCFstatus(void)
|
|||||||
|
|
||||||
esp_err_t setCFstatusToCCstatus(void)
|
esp_err_t setCFstatusToCCstatus(void)
|
||||||
{
|
{
|
||||||
|
// CCstatus.CamSensor_id = CFstatus.CamSensor_id;
|
||||||
|
|
||||||
CCstatus.ImageFrameSize = CFstatus.ImageFrameSize;
|
CCstatus.ImageFrameSize = CFstatus.ImageFrameSize;
|
||||||
CCstatus.ImageGainceiling = CFstatus.ImageGainceiling;
|
CCstatus.ImageGainceiling = CFstatus.ImageGainceiling;
|
||||||
|
|
||||||
@@ -213,11 +217,11 @@ esp_err_t setCFstatusToCCstatus(void)
|
|||||||
CCstatus.ImageHmirror = CFstatus.ImageHmirror;
|
CCstatus.ImageHmirror = CFstatus.ImageHmirror;
|
||||||
CCstatus.ImageVflip = CFstatus.ImageVflip;
|
CCstatus.ImageVflip = CFstatus.ImageVflip;
|
||||||
CCstatus.ImageDcw = CFstatus.ImageDcw;
|
CCstatus.ImageDcw = CFstatus.ImageDcw;
|
||||||
|
CCstatus.ImageDenoiseLevel = CFstatus.ImageDenoiseLevel;
|
||||||
|
|
||||||
CCstatus.ImageLedIntensity = CFstatus.ImageLedIntensity;
|
CCstatus.ImageLedIntensity = CFstatus.ImageLedIntensity;
|
||||||
|
|
||||||
CCstatus.ImageZoomEnabled = CFstatus.ImageZoomEnabled;
|
CCstatus.ImageZoomEnabled = CFstatus.ImageZoomEnabled;
|
||||||
CCstatus.ImageZoomMode = CFstatus.ImageZoomMode;
|
|
||||||
CCstatus.ImageZoomOffsetX = CFstatus.ImageZoomOffsetX;
|
CCstatus.ImageZoomOffsetX = CFstatus.ImageZoomOffsetX;
|
||||||
CCstatus.ImageZoomOffsetY = CFstatus.ImageZoomOffsetY;
|
CCstatus.ImageZoomOffsetY = CFstatus.ImageZoomOffsetY;
|
||||||
CCstatus.ImageZoomSize = CFstatus.ImageZoomSize;
|
CCstatus.ImageZoomSize = CFstatus.ImageZoomSize;
|
||||||
@@ -234,8 +238,6 @@ esp_err_t setCFstatusToCam(void)
|
|||||||
if (s != NULL)
|
if (s != NULL)
|
||||||
{
|
{
|
||||||
s->set_framesize(s, CFstatus.ImageFrameSize);
|
s->set_framesize(s, CFstatus.ImageFrameSize);
|
||||||
s->set_gainceiling(s, CFstatus.ImageGainceiling);
|
|
||||||
|
|
||||||
s->set_quality(s, CFstatus.ImageQuality); // 0 - 63
|
s->set_quality(s, CFstatus.ImageQuality); // 0 - 63
|
||||||
|
|
||||||
s->set_brightness(s, CFstatus.ImageBrightness); // -2 to 2
|
s->set_brightness(s, CFstatus.ImageBrightness); // -2 to 2
|
||||||
@@ -244,33 +246,37 @@ esp_err_t setCFstatusToCam(void)
|
|||||||
// s->set_sharpness(s, CFstatus.ImageSharpness); // auto-sharpness is not officially supported, default to 0
|
// s->set_sharpness(s, CFstatus.ImageSharpness); // auto-sharpness is not officially supported, default to 0
|
||||||
Camera.SetCamSharpness(CFstatus.ImageAutoSharpness, CFstatus.ImageSharpness);
|
Camera.SetCamSharpness(CFstatus.ImageAutoSharpness, CFstatus.ImageSharpness);
|
||||||
|
|
||||||
s->set_exposure_ctrl(s, CFstatus.ImageAec); // 0 = disable , 1 = enable
|
s->set_denoise(s, CFstatus.ImageDenoiseLevel); // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
|
||||||
|
|
||||||
|
s->set_special_effect(s, CFstatus.ImageSpecialEffect); // 0 to 6 (0 - No Effect, 1 - Negative, 2 - Grayscale, 3 - Red Tint, 4 - Green Tint, 5 - Blue Tint, 6 - Sepia)
|
||||||
|
s->set_wb_mode(s, CFstatus.ImageWbMode); // 0 to 4 - if awb_gain enabled (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
|
||||||
|
|
||||||
s->set_ae_level(s, CFstatus.ImageAeLevel); // -2 to 2
|
s->set_ae_level(s, CFstatus.ImageAeLevel); // -2 to 2
|
||||||
s->set_aec_value(s, CFstatus.ImageAecValue); // 0 to 1200
|
s->set_aec_value(s, CFstatus.ImageAecValue); // 0 to 1200
|
||||||
s->set_aec2(s, CFstatus.ImageAec2); // 0 = disable , 1 = enable
|
|
||||||
|
|
||||||
s->set_gain_ctrl(s, CFstatus.ImageAgc); // 0 = disable , 1 = enable
|
|
||||||
s->set_agc_gain(s, CFstatus.ImageAgcGain); // 0 to 30
|
s->set_agc_gain(s, CFstatus.ImageAgcGain); // 0 to 30
|
||||||
|
|
||||||
|
// s->set_gainceiling(s, CFstatus.ImageGainceiling); // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
||||||
|
Camera.ov5640_set_gainceiling(s, CFstatus.ImageGainceiling);
|
||||||
|
|
||||||
|
s->set_lenc(s, CFstatus.ImageLenc); // 0 = disable , 1 = enable
|
||||||
|
s->set_gain_ctrl(s, CFstatus.ImageAgc); // 0 = disable , 1 = enable
|
||||||
|
s->set_exposure_ctrl(s, CFstatus.ImageAec); // 0 = disable , 1 = enable
|
||||||
|
|
||||||
|
s->set_hmirror(s, CFstatus.ImageHmirror); // 0 = disable , 1 = enable
|
||||||
|
s->set_vflip(s, CFstatus.ImageVflip); // 0 = disable , 1 = enable
|
||||||
|
s->set_aec2(s, CFstatus.ImageAec2); // 0 = disable , 1 = enable
|
||||||
|
|
||||||
s->set_bpc(s, CFstatus.ImageBpc); // 0 = disable , 1 = enable
|
s->set_bpc(s, CFstatus.ImageBpc); // 0 = disable , 1 = enable
|
||||||
s->set_wpc(s, CFstatus.ImageWpc); // 0 = disable , 1 = enable
|
s->set_wpc(s, CFstatus.ImageWpc); // 0 = disable , 1 = enable
|
||||||
|
|
||||||
s->set_raw_gma(s, CFstatus.ImageRawGma); // 0 = disable , 1 = enable
|
s->set_raw_gma(s, CFstatus.ImageRawGma); // 0 = disable , 1 = enable
|
||||||
s->set_lenc(s, CFstatus.ImageLenc); // 0 = disable , 1 = enable
|
|
||||||
|
|
||||||
s->set_hmirror(s, CFstatus.ImageHmirror); // 0 = disable , 1 = enable
|
|
||||||
s->set_vflip(s, CFstatus.ImageVflip); // 0 = disable , 1 = enable
|
|
||||||
|
|
||||||
s->set_dcw(s, CFstatus.ImageDcw); // 0 = disable , 1 = enable
|
|
||||||
|
|
||||||
s->set_wb_mode(s, CFstatus.ImageWbMode); // 0 to 4 - if awb_gain enabled (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
|
|
||||||
s->set_awb_gain(s, CFstatus.ImageAwbGain); // 0 = disable , 1 = enable
|
s->set_awb_gain(s, CFstatus.ImageAwbGain); // 0 = disable , 1 = enable
|
||||||
s->set_whitebal(s, CFstatus.ImageAwb); // 0 = disable , 1 = enable
|
s->set_whitebal(s, CFstatus.ImageAwb); // 0 = disable , 1 = enable
|
||||||
|
|
||||||
// special_effect muß als Letztes gesetzt werden, sonst geht es nicht
|
s->set_dcw(s, CFstatus.ImageDcw); // 0 = disable , 1 = enable
|
||||||
s->set_special_effect(s, CFstatus.ImageSpecialEffect); // 0 to 6 (0 - No Effect, 1 - Negative, 2 - Grayscale, 3 - Red Tint, 4 - Green Tint, 5 - Blue Tint, 6 - Sepia)
|
|
||||||
|
|
||||||
TickType_t xDelay2 = 1000 / portTICK_PERIOD_MS;
|
TickType_t xDelay2 = 100 / portTICK_PERIOD_MS;
|
||||||
vTaskDelay(xDelay2);
|
vTaskDelay(xDelay2);
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
@@ -961,6 +967,21 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (httpd_query_key_value(_query, "aecgc", _valuechar, 30) == ESP_OK)
|
||||||
|
{
|
||||||
|
int _aecgc = std::stoi(_valuechar);
|
||||||
|
switch (_aecgc)
|
||||||
|
{
|
||||||
|
case 1: CFstatus.ImageGainceiling = GAINCEILING_4X; break;
|
||||||
|
case 2: CFstatus.ImageGainceiling = GAINCEILING_8X; break;
|
||||||
|
case 3: CFstatus.ImageGainceiling = GAINCEILING_16X; break;
|
||||||
|
case 4: CFstatus.ImageGainceiling = GAINCEILING_32X; break;
|
||||||
|
case 5: CFstatus.ImageGainceiling = GAINCEILING_64X; break;
|
||||||
|
case 6: CFstatus.ImageGainceiling = GAINCEILING_128X; break;
|
||||||
|
default: CFstatus.ImageGainceiling = GAINCEILING_2X;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "qual", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "qual", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
std::string _qual = std::string(_valuechar);
|
std::string _qual = std::string(_valuechar);
|
||||||
@@ -1007,7 +1028,14 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|||||||
if (isStringNumeric(_shp))
|
if (isStringNumeric(_shp))
|
||||||
{
|
{
|
||||||
int _shp_ = std::stoi(_valuechar);
|
int _shp_ = std::stoi(_valuechar);
|
||||||
CFstatus.ImageSaturation = clipInt(_shp_, 2, -2);
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
|
CFstatus.ImageSharpness = clipInt(_shp_, 2, -2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CFstatus.ImageSharpness = clipInt(_shp_, 3, -3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1067,8 +1095,15 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|||||||
if (isStringNumeric(_ael))
|
if (isStringNumeric(_ael))
|
||||||
{
|
{
|
||||||
int _ael_ = std::stoi(_valuechar);
|
int _ael_ = std::stoi(_valuechar);
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
CFstatus.ImageAeLevel = clipInt(_ael_, 2, -2);
|
CFstatus.ImageAeLevel = clipInt(_ael_, 2, -2);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CFstatus.ImageAeLevel = clipInt(_ael_, 5, -5);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "aecv", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "aecv", _valuechar, 30) == ESP_OK)
|
||||||
@@ -1139,6 +1174,23 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|||||||
CFstatus.ImageDcw = alphanumericToBoolean(_dcw);
|
CFstatus.ImageDcw = alphanumericToBoolean(_dcw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (httpd_query_key_value(_query, "den", _valuechar, 30) == ESP_OK)
|
||||||
|
{
|
||||||
|
std::string _idlv = std::string(_valuechar);
|
||||||
|
if (isStringNumeric(_idlv))
|
||||||
|
{
|
||||||
|
int _ImageDenoiseLevel = std::stoi(_valuechar);
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
|
CCstatus.ImageDenoiseLevel = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CFstatus.ImageDenoiseLevel = clipInt(_ImageDenoiseLevel, 8, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "zoom", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "zoom", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
std::string _zoom = std::string(_valuechar);
|
std::string _zoom = std::string(_valuechar);
|
||||||
@@ -1151,9 +1203,20 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|||||||
if (isStringNumeric(_zoomx))
|
if (isStringNumeric(_zoomx))
|
||||||
{
|
{
|
||||||
int _ImageZoomOffsetX = std::stoi(_valuechar);
|
int _ImageZoomOffsetX = std::stoi(_valuechar);
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
|
CFstatus.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 480, -480);
|
||||||
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
||||||
|
{
|
||||||
|
CFstatus.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 704, -704);
|
||||||
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
||||||
|
{
|
||||||
CFstatus.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 960, -960);
|
CFstatus.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 960, -960);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "zoomy", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "zoomy", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
@@ -1161,9 +1224,20 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|||||||
if (isStringNumeric(_zoomy))
|
if (isStringNumeric(_zoomy))
|
||||||
{
|
{
|
||||||
int _ImageZoomOffsetY = std::stoi(_valuechar);
|
int _ImageZoomOffsetY = std::stoi(_valuechar);
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
|
CFstatus.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 360, -360);
|
||||||
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
||||||
|
{
|
||||||
|
CFstatus.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 528, -528);
|
||||||
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
||||||
|
{
|
||||||
CFstatus.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 720, -720);
|
CFstatus.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 720, -720);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "zooms", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "zooms", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
@@ -1171,8 +1245,19 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|||||||
if (isStringNumeric(_zooms))
|
if (isStringNumeric(_zooms))
|
||||||
{
|
{
|
||||||
int _ImageZoomSize = std::stoi(_valuechar);
|
int _ImageZoomSize = std::stoi(_valuechar);
|
||||||
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
||||||
|
{
|
||||||
CFstatus.ImageZoomSize = clipInt(_ImageZoomSize, 29, 0);
|
CFstatus.ImageZoomSize = clipInt(_ImageZoomSize, 29, 0);
|
||||||
}
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
||||||
|
{
|
||||||
|
CFstatus.ImageZoomSize = clipInt(_ImageZoomSize, 43, 0);
|
||||||
|
}
|
||||||
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
||||||
|
{
|
||||||
|
CFstatus.ImageZoomSize = clipInt(_ImageZoomSize, 59, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "ledi", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "ledi", _valuechar, 30) == ESP_OK)
|
||||||
@@ -1205,8 +1290,8 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|||||||
// CFstatus >>> Kamera
|
// CFstatus >>> Kamera
|
||||||
setCFstatusToCam();
|
setCFstatusToCam();
|
||||||
|
|
||||||
Camera.SetQualityZoomSize(CFstatus.ImageQuality, CFstatus.ImageFrameSize, CFstatus.ImageZoomEnabled, CFstatus.ImageZoomOffsetX, CFstatus.ImageZoomOffsetY, CFstatus.ImageZoomSize);
|
Camera.SetQualityZoomSize(CFstatus.ImageQuality, CFstatus.ImageFrameSize, CFstatus.ImageZoomEnabled, CFstatus.ImageZoomOffsetX, CFstatus.ImageZoomOffsetY, CFstatus.ImageZoomSize, CFstatus.ImageVflip);
|
||||||
// Camera.SetZoomSize(CFstatus.ImageZoomEnabled, CFstatus.ImageZoomOffsetX, CFstatus.ImageZoomOffsetY, CFstatus.ImageZoomSize);
|
// Camera.SetZoomSize(CFstatus.ImageZoomEnabled, CFstatus.ImageZoomOffsetX, CFstatus.ImageZoomOffsetY, CFstatus.ImageZoomSize, CFstatus.ImageVflip);
|
||||||
|
|
||||||
// Kameraeinstellungen wurden verädert
|
// Kameraeinstellungen wurden verädert
|
||||||
CFstatus.changedCameraSettings = true;
|
CFstatus.changedCameraSettings = true;
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
uint16_t CamSensor_id;
|
||||||
|
|
||||||
framesize_t ImageFrameSize = FRAMESIZE_VGA; // 0 - 10
|
framesize_t ImageFrameSize = FRAMESIZE_VGA; // 0 - 10
|
||||||
gainceiling_t ImageGainceiling; // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
gainceiling_t ImageGainceiling; // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
||||||
|
|
||||||
@@ -40,13 +42,14 @@ typedef struct
|
|||||||
int ImageVflip; // Invert image (0 or 1)
|
int ImageVflip; // Invert image (0 or 1)
|
||||||
int ImageDcw; // downsize enable (1 or 0)
|
int ImageDcw; // downsize enable (1 or 0)
|
||||||
|
|
||||||
|
int ImageDenoiseLevel; // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
|
||||||
|
|
||||||
int ImageWidth;
|
int ImageWidth;
|
||||||
int ImageHeight;
|
int ImageHeight;
|
||||||
|
|
||||||
int ImageLedIntensity;
|
int ImageLedIntensity;
|
||||||
|
|
||||||
bool ImageZoomEnabled;
|
bool ImageZoomEnabled;
|
||||||
int ImageZoomMode;
|
|
||||||
int ImageZoomOffsetX;
|
int ImageZoomOffsetX;
|
||||||
int ImageZoomOffsetY;
|
int ImageZoomOffsetY;
|
||||||
int ImageZoomSize;
|
int ImageZoomSize;
|
||||||
|
|||||||
@@ -135,7 +135,8 @@ CONFIG_OV7670_SUPPORT=n
|
|||||||
CONFIG_OV7725_SUPPORT=n
|
CONFIG_OV7725_SUPPORT=n
|
||||||
CONFIG_NT99141_SUPPORT=n
|
CONFIG_NT99141_SUPPORT=n
|
||||||
CONFIG_OV3660_SUPPORT=n
|
CONFIG_OV3660_SUPPORT=n
|
||||||
CONFIG_OV5640_SUPPORT=n
|
CONFIG_OV2640_SUPPORT=y
|
||||||
|
CONFIG_OV5640_SUPPORT=y
|
||||||
CONFIG_GC2145_SUPPORT=n
|
CONFIG_GC2145_SUPPORT=n
|
||||||
CONFIG_GC032A_SUPPORT=n
|
CONFIG_GC032A_SUPPORT=n
|
||||||
CONFIG_GC0308_SUPPORT=n
|
CONFIG_GC0308_SUPPORT=n
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ CamWpc
|
|||||||
CamRawGma
|
CamRawGma
|
||||||
CamLenc
|
CamLenc
|
||||||
CamDcw
|
CamDcw
|
||||||
|
CamDenoise
|
||||||
CamZoom
|
CamZoom
|
||||||
CamZoomSize
|
CamZoomSize
|
||||||
CamZoomOffsetX
|
CamZoomOffsetX
|
||||||
|
|||||||
@@ -13,4 +13,5 @@ Default Value: `0`
|
|||||||
|
|
||||||
The exposure offset for automatic exposure, lower values produce darker image.
|
The exposure offset for automatic exposure, lower values produce darker image.
|
||||||
|
|
||||||
Range (`-2` .. `2`)
|
available range on OV2640 (`-2` .. `2`)
|
||||||
|
available range on OV3660 and OV5640 (`-5` .. `5`)
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
# Parameter `CamDenoise`
|
# Parameter `CamDenoise`
|
||||||
Default Value: `true`
|
Default Value: `0`
|
||||||
|
|
||||||
!!! Warning
|
!!! Warning
|
||||||
This is an **Expert Parameter**! Only change it if you understand what it does!
|
This is an **Expert Parameter**! Only change it if you understand what it does!
|
||||||
|
|
||||||
**Denoise**
|
**Denoise**
|
||||||
|
|
||||||
Denoise Image (not supported and not implemented).
|
Denoise Image, is only supported by OV3660 and OV5640
|
||||||
|
|
||||||
|
Range (`0` .. `8`)
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ Default Value: `false`
|
|||||||
!!! Note
|
!!! Note
|
||||||
This parameter can also be set on the Reference Image configuration page!
|
This parameter can also be set on the Reference Image configuration page!
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
On some OV5640 Cameras, the image becomes reddish when Vflip is used in conjunction with the zoom function!
|
||||||
|
|
||||||
**Flip Image**
|
**Flip Image**
|
||||||
|
|
||||||
When **true**, the camera image is flipped top-to-bottom.
|
When **true**, the camera image is flipped top-to-bottom.
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ CamLenc = true
|
|||||||
CamHmirror = false
|
CamHmirror = false
|
||||||
CamVflip = false
|
CamVflip = false
|
||||||
CamDcw = true
|
CamDcw = true
|
||||||
|
CamDenoise = 0
|
||||||
CamZoom = false
|
CamZoom = false
|
||||||
CamZoomOffsetX = 0
|
CamZoomOffsetX = 0
|
||||||
CamZoomOffsetY = 0
|
CamZoomOffsetY = 0
|
||||||
|
|||||||
@@ -375,8 +375,8 @@
|
|||||||
<class id="TakeImage_CamSharpness_text" style="color:black;">Sharpness</class>
|
<class id="TakeImage_CamSharpness_text" style="color:black;">Sharpness</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input required type="number" id="TakeImage_CamSharpness_value1" size="13" min="-2" max="2" onchange="cameraParameterChanged()"
|
<input required type="number" id="TakeImage_CamSharpness_value1" size="13" min="-3" max="3" onchange="cameraParameterChanged()"
|
||||||
oninput="(!validity.rangeUnderflow||(value=-2)) && (!validity.rangeOverflow||(value=2)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
oninput="(!validity.rangeUnderflow||(value=-3)) && (!validity.rangeOverflow||(value=3)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
||||||
</td>
|
</td>
|
||||||
<td>$TOOLTIP_TakeImage_CamSharpness</td>
|
<td>$TOOLTIP_TakeImage_CamSharpness</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -472,8 +472,8 @@
|
|||||||
<class id="TakeImage_CamAeLevel_text" style="color:black;">Auto Exposure Level</class>
|
<class id="TakeImage_CamAeLevel_text" style="color:black;">Auto Exposure Level</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input required type="number" id="TakeImage_CamAeLevel_value1" size="13" min="-2" max="2" onchange="cameraParameterChanged()"
|
<input required type="number" id="TakeImage_CamAeLevel_value1" size="13" min="-5" max="5" onchange="cameraParameterChanged()"
|
||||||
oninput="(!validity.rangeUnderflow||(value=-2)) && (!validity.rangeOverflow||(value=2)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
oninput="(!validity.rangeUnderflow||(value=-5)) && (!validity.rangeOverflow||(value=5)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
||||||
</td>
|
</td>
|
||||||
<td>$TOOLTIP_TakeImage_CamAeLevel</td>
|
<td>$TOOLTIP_TakeImage_CamAeLevel</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -605,6 +605,17 @@
|
|||||||
<td>$TOOLTIP_TakeImage_CamDcw</td>
|
<td>$TOOLTIP_TakeImage_CamDcw</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr class="expert" unused_id="TakeImage_CamDenoise_ex3">
|
||||||
|
<td class="indent1">
|
||||||
|
<class id="TakeImage_CamDenoise_text" style="color:black;">Denoise</class>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input required type="number" id="TakeImage_CamDenoise_value1" value="0" min="0" max="8" step="1" onchange="cameraParameterChanged()"
|
||||||
|
oninput="(!validity.rangeOverflow||(value=8)) && (!validity.rangeUnderflow||(value=0)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
||||||
|
</td>
|
||||||
|
<td>$TOOLTIP_TakeImage_CamDenoise</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr class="expert" unused_id="TakeImage_CamZoom_ex3">
|
<tr class="expert" unused_id="TakeImage_CamZoom_ex3">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="TakeImage_CamZoom_text" style="color:black;">Zoom</class>
|
<class id="TakeImage_CamZoom_text" style="color:black;">Zoom</class>
|
||||||
@@ -623,8 +634,8 @@
|
|||||||
<class id="TakeImage_CamZoomSize_text" style="color:black;">Zoom Size</class>
|
<class id="TakeImage_CamZoomSize_text" style="color:black;">Zoom Size</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input required type="number" id="TakeImage_CamZoomSize_value1" value="0" min="0" max="29" step="1" onchange="cameraParameterChanged()"
|
<input required type="number" id="TakeImage_CamZoomSize_value1" value="0" min="0" max="59" step="1" onchange="cameraParameterChanged()"
|
||||||
oninput="(!validity.rangeOverflow||(value=29)) && (!validity.rangeUnderflow||(value=0)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
oninput="(!validity.rangeOverflow||(value=59)) && (!validity.rangeUnderflow||(value=0)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
||||||
</td>
|
</td>
|
||||||
<td>$TOOLTIP_TakeImage_CamZoomSize</td>
|
<td>$TOOLTIP_TakeImage_CamZoomSize</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -634,8 +645,8 @@
|
|||||||
<class id="TakeImage_CamZoomOffsetX_text" style="color:black;">Zoom Offset X</class>
|
<class id="TakeImage_CamZoomOffsetX_text" style="color:black;">Zoom Offset X</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input required type="number" id="TakeImage_CamZoomOffsetX_value1" value="0" min="-480" max="480" step="8" onchange="cameraParameterChanged()"
|
<input required type="number" id="TakeImage_CamZoomOffsetX_value1" value="0" min="-960" max="960" step="8" onchange="cameraParameterChanged()"
|
||||||
oninput="(!validity.rangeOverflow||(value=480)) && (!validity.rangeUnderflow||(value=-480)) && (!validity.stepMismatch||(value=parseInt(this.value)));">Pixel
|
oninput="(!validity.rangeOverflow||(value=960)) && (!validity.rangeUnderflow||(value=-960)) && (!validity.stepMismatch||(value=parseInt(this.value)));">Pixel
|
||||||
</td>
|
</td>
|
||||||
<td>$TOOLTIP_TakeImage_CamZoomOffsetX</td>
|
<td>$TOOLTIP_TakeImage_CamZoomOffsetX</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -645,8 +656,8 @@
|
|||||||
<class id="TakeImage_CamZoomOffsetY_text" style="color:black;">Zoom Offset Y</class>
|
<class id="TakeImage_CamZoomOffsetY_text" style="color:black;">Zoom Offset Y</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input required type="number" id="TakeImage_CamZoomOffsetY_value1" value="0" min="-360" max="360" step="8" onchange="cameraParameterChanged()"
|
<input required type="number" id="TakeImage_CamZoomOffsetY_value1" value="0" min="-720" max="720" step="8" onchange="cameraParameterChanged()"
|
||||||
oninput="(!validity.rangeOverflow||(value=360)) && (!validity.rangeUnderflow||(value=-360)) && (!validity.stepMismatch||(value=parseInt(this.value)));">Pixel
|
oninput="(!validity.rangeOverflow||(value=720)) && (!validity.rangeUnderflow||(value=-720)) && (!validity.stepMismatch||(value=parseInt(this.value)));">Pixel
|
||||||
</td>
|
</td>
|
||||||
<td>$TOOLTIP_TakeImage_CamZoomOffsetY</td>
|
<td>$TOOLTIP_TakeImage_CamZoomOffsetY</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -2231,6 +2242,7 @@ function UpdateInput() {
|
|||||||
WriteParameter(param, category, "TakeImage", "CamHmirror", false);
|
WriteParameter(param, category, "TakeImage", "CamHmirror", false);
|
||||||
WriteParameter(param, category, "TakeImage", "CamVflip", false);
|
WriteParameter(param, category, "TakeImage", "CamVflip", false);
|
||||||
WriteParameter(param, category, "TakeImage", "CamDcw", false);
|
WriteParameter(param, category, "TakeImage", "CamDcw", false);
|
||||||
|
WriteParameter(param, category, "TakeImage", "CamDenoise", false);
|
||||||
WriteParameter(param, category, "TakeImage", "CamZoom", false);
|
WriteParameter(param, category, "TakeImage", "CamZoom", false);
|
||||||
WriteParameter(param, category, "TakeImage", "CamZoomOffsetX", false);
|
WriteParameter(param, category, "TakeImage", "CamZoomOffsetX", false);
|
||||||
WriteParameter(param, category, "TakeImage", "CamZoomOffsetY", false);
|
WriteParameter(param, category, "TakeImage", "CamZoomOffsetY", false);
|
||||||
@@ -2393,6 +2405,7 @@ function ReadParameterAll() {
|
|||||||
ReadParameter(param, "TakeImage", "CamHmirror", false);
|
ReadParameter(param, "TakeImage", "CamHmirror", false);
|
||||||
ReadParameter(param, "TakeImage", "CamVflip", false);
|
ReadParameter(param, "TakeImage", "CamVflip", false);
|
||||||
ReadParameter(param, "TakeImage", "CamDcw", false);
|
ReadParameter(param, "TakeImage", "CamDcw", false);
|
||||||
|
ReadParameter(param, "TakeImage", "CamDenoise", false);
|
||||||
ReadParameter(param, "TakeImage", "CamZoom", false);
|
ReadParameter(param, "TakeImage", "CamZoom", false);
|
||||||
ReadParameter(param, "TakeImage", "CamZoomOffsetX", false);
|
ReadParameter(param, "TakeImage", "CamZoomOffsetX", false);
|
||||||
ReadParameter(param, "TakeImage", "CamZoomOffsetY", false);
|
ReadParameter(param, "TakeImage", "CamZoomOffsetY", false);
|
||||||
@@ -2582,6 +2595,8 @@ function camSettingsSet(){
|
|||||||
document.getElementById("overlaytext").innerHTML = "Save Cam Settings...";
|
document.getElementById("overlaytext").innerHTML = "Save Cam Settings...";
|
||||||
|
|
||||||
var _waitb_temp = document.getElementById("TakeImage_WaitBeforeTakingPicture_value1").value;
|
var _waitb_temp = document.getElementById("TakeImage_WaitBeforeTakingPicture_value1").value;
|
||||||
|
|
||||||
|
var _aecgc_temp = document.getElementById("TakeImage_CamGainceiling_value1").selectedIndex;
|
||||||
var _qual_temp = document.getElementById("TakeImage_CamQuality_value1").value;
|
var _qual_temp = document.getElementById("TakeImage_CamQuality_value1").value;
|
||||||
|
|
||||||
var _bri_temp = document.getElementById("TakeImage_CamBrightness_value1").value;
|
var _bri_temp = document.getElementById("TakeImage_CamBrightness_value1").value;
|
||||||
@@ -2701,6 +2716,8 @@ function camSettingsSet(){
|
|||||||
_dcw_temp = '0';
|
_dcw_temp = '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _denoise_temp = document.getElementById("TakeImage_CamDenoise_value1").value;
|
||||||
|
|
||||||
var _ledi_temp = document.getElementById("TakeImage_LEDIntensity_value1").value;
|
var _ledi_temp = document.getElementById("TakeImage_LEDIntensity_value1").value;
|
||||||
|
|
||||||
var _zoom_temp = document.getElementById("TakeImage_CamZoom_value1").selectedIndex;
|
var _zoom_temp = document.getElementById("TakeImage_CamZoom_value1").selectedIndex;
|
||||||
@@ -2717,7 +2734,7 @@ function camSettingsSet(){
|
|||||||
|
|
||||||
// bei einmal Alles senden kommt es zu problemen!!!!!!!!!!!!!!!!!!!!
|
// bei einmal Alles senden kommt es zu problemen!!!!!!!!!!!!!!!!!!!!
|
||||||
var url_1 = domainname + "/editflow?task=cam_settings";
|
var url_1 = domainname + "/editflow?task=cam_settings";
|
||||||
url_1 = url_1 + "&waitb=" + _waitb_temp + "&qual=" + _qual_temp;
|
url_1 = url_1 + "&waitb=" + _waitb_temp + "&aecgc=" + _aecgc_temp + "&qual=" + _qual_temp;
|
||||||
url_1 = url_1 + "&bri=" + _bri_temp + "&con=" + _con_temp + "&sat=" + _sat_temp + "&shp=" + _shp_temp + "&ashp=" + _ashp_temp;
|
url_1 = url_1 + "&bri=" + _bri_temp + "&con=" + _con_temp + "&sat=" + _sat_temp + "&shp=" + _shp_temp + "&ashp=" + _ashp_temp;
|
||||||
url_1 = url_1 + "&spe=" + _spe_temp + "&wbm=" + _wbm_temp + "&awb=" + _awb_temp + "&awbg=" + _awbg_temp;
|
url_1 = url_1 + "&spe=" + _spe_temp + "&wbm=" + _wbm_temp + "&awb=" + _awb_temp + "&awbg=" + _awbg_temp;
|
||||||
url_1 = url_1 + "&aec=" + _aec_temp + "&aec2=" + _aec2_temp + "&ael=" + _ael_temp + "&aecv=" + _aecv_temp;
|
url_1 = url_1 + "&aec=" + _aec_temp + "&aec2=" + _aec2_temp + "&ael=" + _ael_temp + "&aecv=" + _aecv_temp;
|
||||||
@@ -2725,7 +2742,7 @@ function camSettingsSet(){
|
|||||||
var url_2 = domainname + "/editflow?task=cam_settings";
|
var url_2 = domainname + "/editflow?task=cam_settings";
|
||||||
url_2 = url_2 + "&agc=" + _agc_temp + "&agcg=" + _agcg_temp + "&bpc=" + _bpc_temp + "&wpc=" + _wpc_temp;
|
url_2 = url_2 + "&agc=" + _agc_temp + "&agcg=" + _agcg_temp + "&bpc=" + _bpc_temp + "&wpc=" + _wpc_temp;
|
||||||
url_2 = url_2 + "&rgma=" + _rgma_temp + "&lenc=" + _lenc_temp + "&mirror=" + _mirror_temp + "&flip=" + _flip_temp;
|
url_2 = url_2 + "&rgma=" + _rgma_temp + "&lenc=" + _lenc_temp + "&mirror=" + _mirror_temp + "&flip=" + _flip_temp;
|
||||||
url_2 = url_2 + "&dcw=" + _dcw_temp + "&ledi=" + _ledi_temp;
|
url_2 = url_2 + "&dcw=" + _dcw_temp + "&den=" + _denoise_temp + "&ledi=" + _ledi_temp;
|
||||||
|
|
||||||
if (_zoom_temp != '0') {
|
if (_zoom_temp != '0') {
|
||||||
url_2 = url_2 + "&zoom=" + _zoom_temp + "&zooms=" + _zooms_temp;
|
url_2 = url_2 + "&zoom=" + _zoom_temp + "&zooms=" + _zooms_temp;
|
||||||
|
|||||||
@@ -184,8 +184,8 @@
|
|||||||
<label id="TakeImage_CamZoomOffsetX_text" style="color:black;">Zoom Offset X: </label>
|
<label id="TakeImage_CamZoomOffsetX_text" style="color:black;">Zoom Offset X: </label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input required type="number" id="TakeImage_CamZoomOffsetX_value1" value="0" min="-480" max="480" step="8" onchange="cameraParameterChanged()"
|
<input required type="number" id="TakeImage_CamZoomOffsetX_value1" value="0" min="-960" max="960" step="8" onchange="cameraParameterChanged()"
|
||||||
oninput="(!validity.rangeOverflow||(value=480)) && (!validity.rangeUnderflow||(value=-480)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
oninput="(!validity.rangeOverflow||(value=960)) && (!validity.rangeUnderflow||(value=-960)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
||||||
</td>
|
</td>
|
||||||
<td>$TOOLTIP_TakeImage_CamZoomOffsetX</td>
|
<td>$TOOLTIP_TakeImage_CamZoomOffsetX</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -195,8 +195,8 @@
|
|||||||
<label id="TakeImage_CamZoomSize_text" style="color:black;">Zoom Size: </label>
|
<label id="TakeImage_CamZoomSize_text" style="color:black;">Zoom Size: </label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input required type="number" id="TakeImage_CamZoomSize_value1" value="0" min="0" max="29" step="1" onchange="cameraParameterChanged()"
|
<input required type="number" id="TakeImage_CamZoomSize_value1" value="0" min="0" max="59" step="1" onchange="cameraParameterChanged()"
|
||||||
oninput="(!validity.rangeOverflow||(value=29)) && (!validity.rangeUnderflow||(value=0)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
oninput="(!validity.rangeOverflow||(value=59)) && (!validity.rangeUnderflow||(value=0)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
||||||
</td>
|
</td>
|
||||||
<td>$TOOLTIP_TakeImage_CamZoomSize</td>
|
<td>$TOOLTIP_TakeImage_CamZoomSize</td>
|
||||||
|
|
||||||
@@ -204,8 +204,8 @@
|
|||||||
<label id="TakeImage_CamZoomOffsetY_text" style="color:black;">Zoom Offset Y: </label>
|
<label id="TakeImage_CamZoomOffsetY_text" style="color:black;">Zoom Offset Y: </label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input required type="number" id="TakeImage_CamZoomOffsetY_value1" value="0" min="-360" max="360" step="8" onchange="cameraParameterChanged()"
|
<input required type="number" id="TakeImage_CamZoomOffsetY_value1" value="0" min="-720" max="720" step="8" onchange="cameraParameterChanged()"
|
||||||
oninput="(!validity.rangeOverflow||(value=360)) && (!validity.rangeUnderflow||(value=-360)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
oninput="(!validity.rangeOverflow||(value=720)) && (!validity.rangeUnderflow||(value=-720)) && (!validity.stepMismatch||(value=parseInt(this.value)));">
|
||||||
</td>
|
</td>
|
||||||
<td>$TOOLTIP_TakeImage_CamZoomOffsetY</td>
|
<td>$TOOLTIP_TakeImage_CamZoomOffsetY</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ function ParseConfig() {
|
|||||||
ParamAddValue(param, catname, "CamHmirror"); // (0 or 1) flip horizontally
|
ParamAddValue(param, catname, "CamHmirror"); // (0 or 1) flip horizontally
|
||||||
ParamAddValue(param, catname, "CamVflip"); // Invert image (0 or 1)
|
ParamAddValue(param, catname, "CamVflip"); // Invert image (0 or 1)
|
||||||
ParamAddValue(param, catname, "CamDcw"); // downsize enable (1 or 0)
|
ParamAddValue(param, catname, "CamDcw"); // downsize enable (1 or 0)
|
||||||
|
ParamAddValue(param, catname, "CamDenoise"); // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
|
||||||
ParamAddValue(param, catname, "CamZoom");
|
ParamAddValue(param, catname, "CamZoom");
|
||||||
ParamAddValue(param, catname, "CamZoomOffsetX");
|
ParamAddValue(param, catname, "CamZoomOffsetX");
|
||||||
ParamAddValue(param, catname, "CamZoomOffsetY");
|
ParamAddValue(param, catname, "CamZoomOffsetY");
|
||||||
@@ -501,6 +502,7 @@ function getCamConfig() {
|
|||||||
param["TakeImage"]["CamHmirror"]["enabled"] = true; // (0 or 1) flip horizontally
|
param["TakeImage"]["CamHmirror"]["enabled"] = true; // (0 or 1) flip horizontally
|
||||||
param["TakeImage"]["CamVflip"]["enabled"] = true; // Invert image (0 or 1)
|
param["TakeImage"]["CamVflip"]["enabled"] = true; // Invert image (0 or 1)
|
||||||
param["TakeImage"]["CamDcw"]["enabled"] = true; // downsize enable (1 or 0)
|
param["TakeImage"]["CamDcw"]["enabled"] = true; // downsize enable (1 or 0)
|
||||||
|
param["TakeImage"]["CamDenoise"]["enabled"] = true; // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
|
||||||
param["TakeImage"]["CamZoom"]["enabled"] = true;
|
param["TakeImage"]["CamZoom"]["enabled"] = true;
|
||||||
param["TakeImage"]["CamZoomOffsetX"]["enabled"] = true;
|
param["TakeImage"]["CamZoomOffsetX"]["enabled"] = true;
|
||||||
param["TakeImage"]["CamZoomOffsetY"]["enabled"] = true;
|
param["TakeImage"]["CamZoomOffsetY"]["enabled"] = true;
|
||||||
@@ -618,6 +620,10 @@ function getCamConfig() {
|
|||||||
param["TakeImage"]["CamDcw"]["found"] = true;
|
param["TakeImage"]["CamDcw"]["found"] = true;
|
||||||
param["TakeImage"]["CamDcw"].value1 = 'true';
|
param["TakeImage"]["CamDcw"].value1 = 'true';
|
||||||
}
|
}
|
||||||
|
if (!param["TakeImage"]["CamDenoise"]["found"]) {
|
||||||
|
param["TakeImage"]["CamDenoise"]["found"] = true;
|
||||||
|
param["TakeImage"]["CamDenoise"].value1 = '0';
|
||||||
|
}
|
||||||
if (!param["TakeImage"]["CamZoom"]["found"]) {
|
if (!param["TakeImage"]["CamZoom"]["found"]) {
|
||||||
param["TakeImage"]["CamZoom"]["found"] = true;
|
param["TakeImage"]["CamZoom"]["found"] = true;
|
||||||
param["TakeImage"]["CamZoom"].value1 = 'false';
|
param["TakeImage"]["CamZoom"].value1 = 'false';
|
||||||
|
|||||||
Reference in New Issue
Block a user