mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-07 20:16:55 +03:00
Rolling 20220127
This commit is contained in:
16
README.md
16
README.md
@@ -54,7 +54,21 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
##### Rolling (2022-01-23)
|
##### Rolling (2022-01-27)
|
||||||
|
|
||||||
|
- Implemented LED flash dimming (in "Take Reference Image")
|
||||||
|
|
||||||
|
- Additional camera parameters: saturation, contrast (although not too much impact)
|
||||||
|
|
||||||
|
- Updated esp32 camera hardware driver
|
||||||
|
|
||||||
|
- **ATTENTION: if the esp32 is stalled or permanently reboot try this:**
|
||||||
|
- Update the parameter `ImageQuality` to `12` instead of the default value `5`
|
||||||
|
(manually in the `config.ini`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Rolling (2022-01-23)
|
||||||
|
|
||||||
- Bug fix: MQTT connection problems
|
- Bug fix: MQTT connection problems
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,22 @@
|
|||||||
|
|
||||||
// #define DEBUG_DETAIL_ON
|
// #define DEBUG_DETAIL_ON
|
||||||
|
|
||||||
|
#define USE_PWM_LEDFLASH
|
||||||
|
|
||||||
|
#ifdef USE_PWM_LEDFLASH
|
||||||
|
|
||||||
|
//// PWM für Flash-LED
|
||||||
|
#define LEDC_TIMER LEDC_TIMER_1 // LEDC_TIMER_0
|
||||||
|
#define LEDC_MODE LEDC_LOW_SPEED_MODE
|
||||||
|
#define LEDC_OUTPUT_IO (4) // Define the output GPIO
|
||||||
|
#define LEDC_CHANNEL LEDC_CHANNEL_1
|
||||||
|
#define LEDC_DUTY_RES LEDC_TIMER_13_BIT // Set duty resolution to 13 bits
|
||||||
|
//#define LEDC_DUTY (195) // Set duty to 50%. ((2 ** 13) - 1) * 50% = 4095
|
||||||
|
#define LEDC_FREQUENCY (5000) // Frequency in Hertz. Set frequency at 5 kHz
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ESP32Cam (AiThinker) PIN Map
|
// ESP32Cam (AiThinker) PIN Map
|
||||||
|
|
||||||
@@ -74,18 +90,19 @@ static camera_config_t camera_config = {
|
|||||||
.pin_pclk = CAM_PIN_PCLK,
|
.pin_pclk = CAM_PIN_PCLK,
|
||||||
|
|
||||||
//XCLK 20MHz or 10MHz for OV2640 double FPS (Experimental)
|
//XCLK 20MHz or 10MHz for OV2640 double FPS (Experimental)
|
||||||
// .xclk_freq_hz = 20000000, // Orginalwert
|
.xclk_freq_hz = 20000000, // Orginalwert
|
||||||
.xclk_freq_hz = 5000000, // Test, um die Bildfehler los zu werden !!!!
|
// .xclk_freq_hz = 5000000, // Test, um die Bildfehler los zu werden !!!! Hängt in Version 9.2 !!!!
|
||||||
.ledc_timer = LEDC_TIMER_0,
|
.ledc_timer = LEDC_TIMER_0,
|
||||||
.ledc_channel = LEDC_CHANNEL_0,
|
.ledc_channel = LEDC_CHANNEL_0,
|
||||||
|
|
||||||
.pixel_format = PIXFORMAT_JPEG, //YUV422,GRAYSCALE,RGB565,JPEG
|
.pixel_format = PIXFORMAT_JPEG, //YUV422,GRAYSCALE,RGB565,JPEG
|
||||||
.frame_size = FRAMESIZE_VGA, //QQVGA-UXGA Do not use sizes above QVGA when not JPEG
|
.frame_size = FRAMESIZE_VGA, //QQVGA-UXGA Do not use sizes above QVGA when not JPEG
|
||||||
// .frame_size = FRAMESIZE_UXGA, //QQVGA-UXGA Do not use sizes above QVGA when not JPEG
|
// .frame_size = FRAMESIZE_UXGA, //QQVGA-UXGA Do not use sizes above QVGA when not JPEG
|
||||||
.jpeg_quality = 5, //0-63 lower number means higher quality
|
.jpeg_quality = 12, //0-63 lower number means higher quality
|
||||||
.fb_count = 1, //if more than one, i2s runs in continuous mode. Use only with JPEG
|
.fb_count = 1, //if more than one, i2s runs in continuous mode. Use only with JPEG
|
||||||
|
.fb_location = CAMERA_FB_IN_PSRAM, /*!< The location where the frame buffer will be allocated */
|
||||||
// .grab_mode = CAMERA_GRAB_WHEN_EMPTY,
|
// .grab_mode = CAMERA_GRAB_WHEN_EMPTY,
|
||||||
.grab_mode = CAMERA_GRAB_LATEST,
|
.grab_mode = CAMERA_GRAB_LATEST, // erst ab neuer esp32cam-version
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -103,29 +120,36 @@ typedef struct {
|
|||||||
} jpg_chunking_t;
|
} jpg_chunking_t;
|
||||||
|
|
||||||
|
|
||||||
#define LEDC_LS_CH2_GPIO (4)
|
void CCamera::ledc_init(void)
|
||||||
#define LEDC_LS_CH2_CHANNEL LEDC_CHANNEL_2
|
{
|
||||||
#define LEDC_LS_TIMER LEDC_TIMER_1
|
#ifdef USE_PWM_LEDFLASH
|
||||||
#define LEDC_LS_MODE LEDC_LOW_SPEED_MODE
|
|
||||||
#define LEDC_TEST_DUTY (4000)
|
|
||||||
|
|
||||||
void test(){
|
// Prepare and then apply the LEDC PWM timer configuration
|
||||||
|
ledc_timer_config_t ledc_timer = { };
|
||||||
|
|
||||||
|
ledc_timer.speed_mode = LEDC_MODE;
|
||||||
|
ledc_timer.timer_num = LEDC_TIMER;
|
||||||
|
ledc_timer.duty_resolution = LEDC_DUTY_RES;
|
||||||
|
ledc_timer.freq_hz = LEDC_FREQUENCY; // Set output frequency at 5 kHz
|
||||||
|
ledc_timer.clk_cfg = LEDC_AUTO_CLK;
|
||||||
|
|
||||||
|
ESP_ERROR_CHECK(ledc_timer_config(&ledc_timer));
|
||||||
|
|
||||||
|
// Prepare and then apply the LEDC PWM channel configuration
|
||||||
ledc_channel_config_t ledc_channel = { };
|
ledc_channel_config_t ledc_channel = { };
|
||||||
|
|
||||||
ledc_channel.channel = LEDC_LS_CH2_CHANNEL;
|
ledc_channel.speed_mode = LEDC_MODE;
|
||||||
ledc_channel.duty = 0;
|
ledc_channel.channel = LEDC_CHANNEL;
|
||||||
ledc_channel.gpio_num = FLASH_GPIO;
|
ledc_channel.timer_sel = LEDC_TIMER;
|
||||||
ledc_channel.speed_mode = LEDC_LS_MODE;
|
ledc_channel.intr_type = LEDC_INTR_DISABLE;
|
||||||
ledc_channel.hpoint = 0;
|
ledc_channel.gpio_num = LEDC_OUTPUT_IO;
|
||||||
ledc_channel.timer_sel = LEDC_LS_TIMER;
|
ledc_channel.duty = 0; // Set duty to 0%
|
||||||
|
ledc_channel.hpoint = 0;
|
||||||
|
|
||||||
ledc_channel_config(&ledc_channel);
|
ESP_ERROR_CHECK(ledc_channel_config(&ledc_channel));
|
||||||
|
|
||||||
ledc_set_duty(ledc_channel.speed_mode, ledc_channel.channel, LEDC_TEST_DUTY);
|
|
||||||
ledc_update_duty(ledc_channel.speed_mode, ledc_channel.channel);
|
|
||||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
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){
|
||||||
@@ -148,9 +172,11 @@ bool CCamera::SetBrightnessContrastSaturation(int _brightness, int _contrast, in
|
|||||||
_brightness = min(2, max(-2, _brightness));
|
_brightness = min(2, max(-2, _brightness));
|
||||||
if (_contrast > -100)
|
if (_contrast > -100)
|
||||||
_contrast = min(2, max(-2, _contrast));
|
_contrast = min(2, max(-2, _contrast));
|
||||||
// _saturation = min(2, max(-2, _saturation));
|
if (_saturation > -100)
|
||||||
|
_saturation = min(2, max(-2, _saturation));
|
||||||
|
|
||||||
// s->set_saturation(s, _saturation);
|
if (_saturation > -100)
|
||||||
|
s->set_saturation(s, _saturation);
|
||||||
if (_contrast > -100)
|
if (_contrast > -100)
|
||||||
s->set_contrast(s, _contrast);
|
s->set_contrast(s, _contrast);
|
||||||
if (_brightness > -100)
|
if (_brightness > -100)
|
||||||
@@ -521,15 +547,31 @@ void CCamera::LightOnOff(bool status)
|
|||||||
printf("Use gpioHandler flashLigh\n");
|
printf("Use gpioHandler flashLigh\n");
|
||||||
gpioHandler->flashLightEnable(status);
|
gpioHandler->flashLightEnable(status);
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef USE_PWM_LEDFLASH
|
||||||
|
if (status)
|
||||||
|
{
|
||||||
|
printf("Internal Flash-LED turn on with PWMy\n");
|
||||||
|
ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, led_intensity));
|
||||||
|
// Update duty to apply the new value
|
||||||
|
ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("Internal Flash-LED turn off PWM\n");
|
||||||
|
ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, 0));
|
||||||
|
ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
|
||||||
|
}
|
||||||
|
#else
|
||||||
// Init the GPIO
|
// Init the GPIO
|
||||||
gpio_pad_select_gpio(FLASH_GPIO);
|
gpio_pad_select_gpio(FLASH_GPIO);
|
||||||
/* Set the GPIO as a push/pull output */
|
// Set the GPIO as a push/pull output
|
||||||
gpio_set_direction(FLASH_GPIO, GPIO_MODE_OUTPUT);
|
gpio_set_direction(FLASH_GPIO, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
if (status)
|
if (status)
|
||||||
gpio_set_level(FLASH_GPIO, 1);
|
gpio_set_level(FLASH_GPIO, 1);
|
||||||
else
|
else
|
||||||
gpio_set_level(FLASH_GPIO, 0);
|
gpio_set_level(FLASH_GPIO, 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -620,20 +662,12 @@ CCamera::CCamera()
|
|||||||
contrast = -5;
|
contrast = -5;
|
||||||
saturation = -5;
|
saturation = -5;
|
||||||
isFixedExposure = false;
|
isFixedExposure = false;
|
||||||
|
|
||||||
|
ledc_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t CCamera::InitCam()
|
esp_err_t CCamera::InitCam()
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if( CAM_PIN_PWDN != -1){
|
|
||||||
// Init the GPIO
|
|
||||||
gpio_pad_select_gpio((gpio_num_t) CAM_PIN_PWDN);
|
|
||||||
// Set the GPIO as a push/pull output
|
|
||||||
gpio_set_direction((gpio_num_t) CAM_PIN_PWDN, GPIO_MODE_OUTPUT);
|
|
||||||
gpio_set_level((gpio_num_t) CAM_PIN_PWDN, 0);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
printf("Init Camera\n");
|
printf("Init Camera\n");
|
||||||
ActualQuality = camera_config.jpeg_quality;
|
ActualQuality = camera_config.jpeg_quality;
|
||||||
ActualResolution = camera_config.frame_size;
|
ActualResolution = camera_config.frame_size;
|
||||||
@@ -645,4 +679,13 @@ esp_err_t CCamera::InitCam()
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCamera::SetLEDIntensity(float _intrel)
|
||||||
|
{
|
||||||
|
_intrel = min(_intrel, (float) 100);
|
||||||
|
_intrel = max(_intrel, (float) 0);
|
||||||
|
_intrel = _intrel / 100;
|
||||||
|
led_intensity = (int) (_intrel * 8191);
|
||||||
|
printf("Set led_intensity to %d of 8191\n", led_intensity);
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ class CCamera {
|
|||||||
int brightness, contrast, saturation;
|
int brightness, contrast, saturation;
|
||||||
bool isFixedExposure;
|
bool isFixedExposure;
|
||||||
int waitbeforepicture_org;
|
int waitbeforepicture_org;
|
||||||
|
int led_intensity = 4095;
|
||||||
|
|
||||||
|
void ledc_init(void);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int image_height, image_width;
|
int image_height, image_width;
|
||||||
@@ -36,6 +39,7 @@ class CCamera {
|
|||||||
void SetQualitySize(int qual, framesize_t resol);
|
void SetQualitySize(int qual, framesize_t resol);
|
||||||
bool SetBrightnessContrastSaturation(int _brightness, int _contrast, int _saturation);
|
bool SetBrightnessContrastSaturation(int _brightness, int _contrast, int _saturation);
|
||||||
void GetCameraParameter(httpd_req_t *req, int &qual, framesize_t &resol);
|
void GetCameraParameter(httpd_req_t *req, int &qual, framesize_t &resol);
|
||||||
|
void SetLEDIntensity(float _intrel);
|
||||||
|
|
||||||
void EnableAutoExposure(int flashdauer);
|
void EnableAutoExposure(int flashdauer);
|
||||||
|
|
||||||
|
|||||||
@@ -8,15 +8,15 @@
|
|||||||
|
|
||||||
#include "ClassLogFile.h"
|
#include "ClassLogFile.h"
|
||||||
|
|
||||||
// #define SCRATCH_BUFSIZE2 8192
|
#define SCRATCH_BUFSIZE2 8192
|
||||||
// char scratch2[SCRATCH_BUFSIZE2];
|
char scratch2[SCRATCH_BUFSIZE2];
|
||||||
|
|
||||||
//#define DEBUG_DETAIL_ON
|
//#define DEBUG_DETAIL_ON
|
||||||
static const char *TAGPARTCAMERA = "server_camera";
|
static const char *TAGPARTCAMERA = "server_camera";
|
||||||
|
|
||||||
|
|
||||||
void PowerResetCamera(){
|
void PowerResetCamera(){
|
||||||
printf("Resetting camera by power down line\n");
|
ESP_LOGD(TAGPARTCAMERA, "Resetting camera by power down line");
|
||||||
gpio_config_t conf;
|
gpio_config_t conf;
|
||||||
conf.intr_type = GPIO_INTR_DISABLE;
|
conf.intr_type = GPIO_INTR_DISABLE;
|
||||||
conf.pin_bit_mask = 1LL << GPIO_NUM_32;
|
conf.pin_bit_mask = 1LL << GPIO_NUM_32;
|
||||||
|
|||||||
@@ -5,10 +5,14 @@
|
|||||||
#include "CImageBasis.h"
|
#include "CImageBasis.h"
|
||||||
#include "ClassControllCamera.h"
|
#include "ClassControllCamera.h"
|
||||||
|
|
||||||
|
#include "esp_wifi.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
// #define DEBUG_DETAIL_ON
|
// #define DEBUG_DETAIL_ON
|
||||||
|
|
||||||
|
// #define WIFITURNOFF
|
||||||
|
|
||||||
static const char* TAG = "flow_make_image";
|
static const char* TAG = "flow_make_image";
|
||||||
|
|
||||||
esp_err_t ClassFlowMakeImage::camera_capture(){
|
esp_err_t ClassFlowMakeImage::camera_capture(){
|
||||||
@@ -118,7 +122,15 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
if ((toUpper(zerlegt[0]) == "FIXEDEXPOSURE") && (zerlegt.size() > 1))
|
if ((toUpper(zerlegt[0]) == "FIXEDEXPOSURE") && (zerlegt.size() > 1))
|
||||||
{
|
{
|
||||||
if (toUpper(zerlegt[1]) == "TRUE")
|
if (toUpper(zerlegt[1]) == "TRUE")
|
||||||
FixedExposure = true;
|
FixedExposure = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((toUpper(zerlegt[0]) == "LEDINTENSITY") && (zerlegt.size() > 1))
|
||||||
|
{
|
||||||
|
float ledintensity = stof(zerlegt[1]);
|
||||||
|
ledintensity = min((float) 1, ledintensity);
|
||||||
|
ledintensity = max((float) 0, ledintensity);
|
||||||
|
Camera.SetLEDIntensity(ledintensity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,8 +174,18 @@ bool ClassFlowMakeImage::doFlow(string zwtime)
|
|||||||
LogFile.WriteHeapInfo("ClassFlowMakeImage::doFlow - Before takePictureWithFlash");
|
LogFile.WriteHeapInfo("ClassFlowMakeImage::doFlow - Before takePictureWithFlash");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef WIFITURNOFF
|
||||||
|
esp_wifi_stop(); // to save power usage and
|
||||||
|
#endif
|
||||||
|
|
||||||
takePictureWithFlash(flashdauer);
|
takePictureWithFlash(flashdauer);
|
||||||
|
|
||||||
|
#ifdef WIFITURNOFF
|
||||||
|
esp_wifi_start();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
LogFile.WriteHeapInfo("ClassFlowMakeImage::doFlow - After takePictureWithFlash");
|
LogFile.WriteHeapInfo("ClassFlowMakeImage::doFlow - After takePictureWithFlash");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ esp_err_t handler_json(httpd_req_t *req)
|
|||||||
printf("handler_JSON uri:\n"); printf(req->uri); printf("\n");
|
printf("handler_JSON uri:\n"); printf(req->uri); printf("\n");
|
||||||
|
|
||||||
char _query[100];
|
char _query[100];
|
||||||
char _size[10];
|
// char _size[10];
|
||||||
|
|
||||||
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
||||||
httpd_resp_set_type(req, "application/json");
|
httpd_resp_set_type(req, "application/json");
|
||||||
@@ -491,13 +491,19 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|||||||
std::string _bri = "";
|
std::string _bri = "";
|
||||||
std::string _con = "";
|
std::string _con = "";
|
||||||
std::string _sat = "";
|
std::string _sat = "";
|
||||||
|
std::string _int = "";
|
||||||
int bri = -100;
|
int bri = -100;
|
||||||
int sat = -100;
|
int sat = -100;
|
||||||
int con = -100;
|
int con = -100;
|
||||||
|
int intens = -100;
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "host", _valuechar, 30) == ESP_OK) {
|
if (httpd_query_key_value(_query, "host", _valuechar, 30) == ESP_OK) {
|
||||||
_host = std::string(_valuechar);
|
_host = std::string(_valuechar);
|
||||||
}
|
}
|
||||||
|
if (httpd_query_key_value(_query, "int", _valuechar, 30) == ESP_OK) {
|
||||||
|
_int = std::string(_valuechar);
|
||||||
|
intens = stoi(_int);
|
||||||
|
}
|
||||||
if (httpd_query_key_value(_query, "bri", _valuechar, 30) == ESP_OK) {
|
if (httpd_query_key_value(_query, "bri", _valuechar, 30) == ESP_OK) {
|
||||||
_bri = std::string(_valuechar);
|
_bri = std::string(_valuechar);
|
||||||
bri = stoi(_bri);
|
bri = stoi(_bri);
|
||||||
@@ -515,7 +521,9 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|||||||
// printf("Parameter host: "); printf(_host.c_str()); printf("\n");
|
// printf("Parameter host: "); printf(_host.c_str()); printf("\n");
|
||||||
// string zwzw = "Do " + _task + " start\n"; printf(zwzw.c_str());
|
// string zwzw = "Do " + _task + " start\n"; printf(zwzw.c_str());
|
||||||
Camera.SetBrightnessContrastSaturation(bri, con, sat);
|
Camera.SetBrightnessContrastSaturation(bri, con, sat);
|
||||||
|
Camera.SetLEDIntensity(intens);
|
||||||
std::string zw = tfliteflow.doSingleStep("[MakeImage]", _host);
|
std::string zw = tfliteflow.doSingleStep("[MakeImage]", _host);
|
||||||
|
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
||||||
httpd_resp_sendstr_chunk(req, zw.c_str());
|
httpd_resp_sendstr_chunk(req, zw.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const char* GIT_REV="53606d5";
|
const char* GIT_REV="567dc74";
|
||||||
const char* GIT_TAG="";
|
const char* GIT_TAG="";
|
||||||
const char* GIT_BRANCH="rolling";
|
const char* GIT_BRANCH="rolling";
|
||||||
const char* BUILD_TIME="2022-01-23 19:34";
|
const char* BUILD_TIME="2022-01-27 21:04";
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
const char* GIT_REV="53606d5";
|
const char* GIT_REV="567dc74";
|
||||||
const char* GIT_TAG="";
|
const char* GIT_TAG="";
|
||||||
const char* GIT_BRANCH="rolling";
|
const char* GIT_BRANCH="rolling";
|
||||||
const char* BUILD_TIME="2022-01-23 19:34";
|
const char* BUILD_TIME="2022-01-27 21:04";
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,9 +3,10 @@
|
|||||||
WaitBeforeTakingPicture = 5
|
WaitBeforeTakingPicture = 5
|
||||||
;LogfileRetentionInDays = 15
|
;LogfileRetentionInDays = 15
|
||||||
Brightness = 0
|
Brightness = 0
|
||||||
;Contrast = 0
|
Contrast = 0
|
||||||
;Saturation = 0
|
Saturation = 0
|
||||||
ImageQuality = 5
|
LEDIntensity = 50
|
||||||
|
ImageQuality = 12
|
||||||
ImageSize = VGA
|
ImageSize = VGA
|
||||||
FixedExposure = false
|
FixedExposure = false
|
||||||
|
|
||||||
|
|||||||
@@ -45,34 +45,37 @@ table {
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="padding-top: 10px"><label for="mirror" id="labelmirror">Mirror Image:</label></td>
|
<td style="padding-top: 10px"><label for="mirror" id="labelmirror">Mirror Image:</label></td>
|
||||||
<td style="padding-top: 10px"><input type="checkbox" id="mirror" name="mirror" value="1" onchange="drawRotated()"></td>
|
<td style="padding-top: 10px"><input type="checkbox" id="mirror" name="mirror" value="1" onchange="drawRotated()"></td>
|
||||||
|
<td>
|
||||||
|
<class id="MakeImage_LEDIntensity_text" style="color:black;">LEDIntensity: </class>
|
||||||
|
<input type="number" id="MakeImage_LEDIntensity_value1" size="13" value=0 min="0" max="100" style="float: right; clear: both;">
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td><label for="flip" id="labelflip">Flip Image Size:</label></td>
|
<td><label for="flip" id="labelflip">Flip Image Size:</label></td>
|
||||||
<td><input type="checkbox" id="flip" name="flip" value="1" onchange="drawRotated()"></td>
|
<td><input type="checkbox" id="flip" name="flip" value="1" onchange="drawRotated()"></td>
|
||||||
|
<td>
|
||||||
|
<class id="MakeImage_Brightness_text" style="color:black;">Brightness: </class>
|
||||||
|
<input type="number" id="MakeImage_Brightness_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
||||||
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="mirror">Pre-rotate Angle:</label></td>
|
<td><label for="mirror">Pre-rotate Angle:</label></td>
|
||||||
<td><input type="number" id="prerotateangle" name="prerotateangle" value="0" min="-360" max="360" onchange="drawRotated()">Degrees</td>
|
<td><input type="number" id="prerotateangle" name="prerotateangle" value="0" min="-360" max="360" onchange="drawRotated()">Degrees</td>
|
||||||
<td>
|
<td>
|
||||||
<class id="MakeImage_Brightness_text" style="color:black;">Brightness: </class>
|
<class id="MakeImage_Contrast_text" style="color:black;">Contrast</class>
|
||||||
<input type="number" id="MakeImage_Brightness_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
<input type="number" id="MakeImage_Contrast_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="mirror">Fine Alignment:</label></td>
|
<td><label for="mirror">Fine Alignment:</label></td>
|
||||||
<td><input type="number" id="finerotate" name="finerotate" value=0.0 min="-1" max="1" step="0.2" onchange="drawRotated()">Degrees</td>
|
<td><input type="number" id="finerotate" name="finerotate" value=0.0 min="-1" max="1" step="0.2" onchange="drawRotated()">Degrees</td>
|
||||||
<!--
|
|
||||||
<td>
|
|
||||||
<class id="MakeImage_Contrast_text" style="color:black;">Contrast</class>
|
|
||||||
<input type="number" id="MakeImage_Contrast_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<class id="MakeImage_Saturation_text" style="color:black;">Saturation</class>
|
<class id="MakeImage_Saturation_text" style="color:black;">Saturation</class>
|
||||||
<input type="number" id="MakeImage_Saturation_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
<input type="number" id="MakeImage_Saturation_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
||||||
</td>
|
</td>
|
||||||
-->
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@@ -104,10 +107,13 @@ table {
|
|||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
|
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
|
||||||
{
|
{
|
||||||
|
_intensity = document.getElementById("MakeImage_LEDIntensity_value1").value;
|
||||||
|
if (_intensity == "") _intensity = "50";
|
||||||
_brightness = document.getElementById("MakeImage_Brightness_value1").value;
|
_brightness = document.getElementById("MakeImage_Brightness_value1").value;
|
||||||
// _contrast = document.getElementById("MakeImage_Contrast_value1").value;
|
_contrast = document.getElementById("MakeImage_Contrast_value1").value;
|
||||||
// _saturation = document.getElementById("MakeImage_Saturation_value1").value;
|
_saturation = document.getElementById("MakeImage_Saturation_value1").value;
|
||||||
url = basepath + "/editflow.html?task=test_take&bri=" + _brightness;
|
url = basepath + "/editflow.html?task=test_take&bri=" + _brightness;
|
||||||
|
url = url + "&con=" + _saturation + "&sat=" + _saturation + "&int=" + _intensity;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -116,8 +122,11 @@ table {
|
|||||||
if (basepath.length > 0){
|
if (basepath.length > 0){
|
||||||
url = url + "&host=" + basepath;
|
url = url + "&host=" + basepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
xhttp.open("GET", url, false);
|
xhttp.open("GET", url, false);
|
||||||
xhttp.send();
|
xhttp.send();
|
||||||
|
|
||||||
|
|
||||||
loadRawImage();
|
loadRawImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,7 +151,12 @@ table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
|
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
|
||||||
|
{
|
||||||
document.getElementById("MakeImage_Brightness_value1").disabled = false;
|
document.getElementById("MakeImage_Brightness_value1").disabled = false;
|
||||||
|
document.getElementById("MakeImage_Contrast_value1").disabled = false;
|
||||||
|
document.getElementById("MakeImage_Saturation_value1").disabled = false;
|
||||||
|
document.getElementById("MakeImage_LEDIntensity_value1").disabled = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
document.getElementById("MakeImage_Brightness_value1").type = "hidden";
|
document.getElementById("MakeImage_Brightness_value1").type = "hidden";
|
||||||
@@ -176,8 +190,9 @@ table {
|
|||||||
document.getElementById("updatereferenceimage").disabled = true;
|
document.getElementById("updatereferenceimage").disabled = true;
|
||||||
document.getElementById("take").disabled = true;
|
document.getElementById("take").disabled = true;
|
||||||
document.getElementById("MakeImage_Brightness_value1").disabled = true;
|
document.getElementById("MakeImage_Brightness_value1").disabled = true;
|
||||||
// document.getElementById("MakeImage_Saturation_value1").disabled = true;
|
document.getElementById("MakeImage_Saturation_value1").disabled = true;
|
||||||
// document.getElementById("MakeImage_Contrast_value1").disabled = true;
|
document.getElementById("MakeImage_Contrast_value1").disabled = true;
|
||||||
|
document.getElementById("MakeImage_LEDIntensity_value1").disabled = true;
|
||||||
document.getElementById("mirror").disabled = false;
|
document.getElementById("mirror").disabled = false;
|
||||||
document.getElementById("flip").disabled = false;
|
document.getElementById("flip").disabled = false;
|
||||||
if (!(param["MakeImage"]["Brightness"].found))
|
if (!(param["MakeImage"]["Brightness"].found))
|
||||||
@@ -225,8 +240,9 @@ table {
|
|||||||
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
|
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
|
||||||
{
|
{
|
||||||
ReadParameter(param, "MakeImage", "Brightness", false);
|
ReadParameter(param, "MakeImage", "Brightness", false);
|
||||||
// ReadParameter(param, "MakeImage", "Contrast", false);
|
ReadParameter(param, "MakeImage", "Contrast", false);
|
||||||
// ReadParameter(param, "MakeImage", "Saturation", false);
|
ReadParameter(param, "MakeImage", "Saturation", false);
|
||||||
|
ReadParameter(param, "MakeImage", "LEDIntensity", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
var canvas = document.getElementById("canvas");
|
var canvas = document.getElementById("canvas");
|
||||||
@@ -238,6 +254,7 @@ table {
|
|||||||
SaveCanvasToImage(canvas, "/config/reference.jpg", true, basepath);
|
SaveCanvasToImage(canvas, "/config/reference.jpg", true, basepath);
|
||||||
showReference();
|
showReference();
|
||||||
UpdatePage();
|
UpdatePage();
|
||||||
|
alert("Reference is updated!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,14 +291,42 @@ table {
|
|||||||
loadConfig(basepath);
|
loadConfig(basepath);
|
||||||
ParseConfig();
|
ParseConfig();
|
||||||
param = getConfigParameters();
|
param = getConfigParameters();
|
||||||
|
|
||||||
|
param["MakeImage"]["LEDIntensity"]["enabled"] = true;
|
||||||
|
param["MakeImage"]["Brightness"]["enabled"] = true;
|
||||||
|
param["MakeImage"]["Contrast"]["enabled"] = true;
|
||||||
|
param["MakeImage"]["Saturation"]["enabled"] = true;
|
||||||
|
|
||||||
|
if (!param["MakeImage"]["LEDIntensity"]["found"])
|
||||||
|
{
|
||||||
|
param["MakeImage"]["LEDIntensity"]["found"] = true;
|
||||||
|
param["MakeImage"]["LEDIntensity"]["value1"] = "50";
|
||||||
|
}
|
||||||
|
if (!param["MakeImage"]["Brightness"]["found"])
|
||||||
|
{
|
||||||
|
param["MakeImage"]["Brightness"]["found"] = true;
|
||||||
|
param["MakeImage"]["Brightness"]["value1"] = "0";
|
||||||
|
}
|
||||||
|
if (!param["MakeImage"]["Contrast"]["found"])
|
||||||
|
{
|
||||||
|
param["MakeImage"]["Contrast"]["found"] = true;
|
||||||
|
param["MakeImage"]["Contrast"]["value1"] = "0";
|
||||||
|
}
|
||||||
|
if (!param["MakeImage"]["Saturation"]["found"])
|
||||||
|
{
|
||||||
|
param["MakeImage"]["Saturation"]["found"] = true;
|
||||||
|
param["MakeImage"]["Saturation"]["value1"] = "0";
|
||||||
|
}
|
||||||
|
|
||||||
UpdateInput();
|
UpdateInput();
|
||||||
showReference(param);
|
showReference(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateInput() {
|
function UpdateInput() {
|
||||||
WriteParameter(param, category, "MakeImage", "Brightness", false);
|
WriteParameter(param, category, "MakeImage", "Brightness", false);
|
||||||
// WriteParameter(param, category, "MakeImage", "Contrast", false);
|
WriteParameter(param, category, "MakeImage", "Contrast", false);
|
||||||
// WriteParameter(param, category, "MakeImage", "Saturation", false);
|
WriteParameter(param, category, "MakeImage", "Saturation", false);
|
||||||
|
WriteParameter(param, category, "MakeImage", "LEDIntensity", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function getbasepath(){
|
|||||||
{
|
{
|
||||||
// host = "http://192.168.2.219"; // jomjol interner test
|
// host = "http://192.168.2.219"; // jomjol interner test
|
||||||
// host = "http://192.168.178.46"; // jomjol interner test
|
// host = "http://192.168.178.46"; // jomjol interner test
|
||||||
host = "http://192.168.178.34"; // jomjol interner Real
|
host = "http://192.168.178.60"; // jomjol interner Real
|
||||||
// host = "http://192.168.43.191";
|
// host = "http://192.168.43.191";
|
||||||
// host = "."; // jomjol interner localhost
|
// host = "."; // jomjol interner localhost
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ function ParseConfig() {
|
|||||||
ParamAddValue(param, catname, "Brightness");
|
ParamAddValue(param, catname, "Brightness");
|
||||||
ParamAddValue(param, catname, "Contrast");
|
ParamAddValue(param, catname, "Contrast");
|
||||||
ParamAddValue(param, catname, "Saturation");
|
ParamAddValue(param, catname, "Saturation");
|
||||||
|
ParamAddValue(param, catname, "LEDIntensity");
|
||||||
ParamAddValue(param, catname, "ImageQuality");
|
ParamAddValue(param, catname, "ImageQuality");
|
||||||
ParamAddValue(param, catname, "ImageSize");
|
ParamAddValue(param, catname, "ImageSize");
|
||||||
ParamAddValue(param, catname, "FixedExposure");
|
ParamAddValue(param, catname, "FixedExposure");
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
11.4.1
|
12.0.0
|
||||||
Reference in New Issue
Block a user