mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-15 16:06:54 +03:00
Update
This commit is contained in:
@@ -34,6 +34,7 @@ void ClassFlowMakeImage::SetInitialParameter(void)
|
||||
ImageSize = FRAMESIZE_VGA;
|
||||
SaveAllFiles = false;
|
||||
disabled = false;
|
||||
FixedExposure = false;
|
||||
namerawimage = "/sdcard/img_tmp/raw.jpg";
|
||||
}
|
||||
|
||||
@@ -97,6 +98,11 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
|
||||
_saturation = stoi(zerlegt[1]);
|
||||
}
|
||||
|
||||
if ((toUpper(zerlegt[0]) == "FIXEDEXPOSURE") && (zerlegt.size() > 1))
|
||||
{
|
||||
if (toUpper(zerlegt[1]) == "TRUE")
|
||||
FixedExposure = true;
|
||||
}
|
||||
}
|
||||
|
||||
Camera.SetBrightnessContrastSaturation(_brightness, _contrast, _saturation);
|
||||
@@ -107,6 +113,18 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
|
||||
rawImage = new CImageBasis();
|
||||
rawImage->CreateEmptyImage(image_width, image_height, 3);
|
||||
|
||||
waitbeforepicture_store = waitbeforepicture;
|
||||
if (FixedExposure)
|
||||
{
|
||||
printf("Fixed Exposure enabled!\n");
|
||||
int flashdauer = (int) (waitbeforepicture * 1000);
|
||||
Camera.EnableAutoExposure(flashdauer);
|
||||
waitbeforepicture = 0.2;
|
||||
// flashdauer = (int) (waitbeforepicture * 1000);
|
||||
// takePictureWithFlash(flashdauer);
|
||||
// rawImage->SaveToFile("/sdcard/init2.jpg");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -121,7 +139,7 @@ bool ClassFlowMakeImage::doFlow(string zwtime)
|
||||
{
|
||||
string logPath = CreateLogFolder(zwtime);
|
||||
|
||||
int flashdauer = (int) waitbeforepicture * 1000;
|
||||
int flashdauer = (int) (waitbeforepicture * 1000);
|
||||
|
||||
#ifdef DEBUG_DETAIL_ON
|
||||
LogFile.WriteHeapInfo("ClassFlowMakeImage::doFlow - Before takePictureWithFlash");
|
||||
@@ -146,7 +164,7 @@ bool ClassFlowMakeImage::doFlow(string zwtime)
|
||||
|
||||
esp_err_t ClassFlowMakeImage::SendRawJPG(httpd_req_t *req)
|
||||
{
|
||||
int flashdauer = (int) waitbeforepicture * 1000;
|
||||
int flashdauer = (int) (waitbeforepicture * 1000);
|
||||
return Camera.CaptureToHTTP(req, flashdauer);
|
||||
}
|
||||
|
||||
@@ -155,7 +173,7 @@ ImageData* ClassFlowMakeImage::SendRawImage()
|
||||
{
|
||||
CImageBasis *zw = new CImageBasis(rawImage);
|
||||
ImageData *id;
|
||||
int flashdauer = (int) waitbeforepicture * 1000;
|
||||
int flashdauer = (int) (waitbeforepicture * 1000);
|
||||
Camera.CaptureToBasisImage(zw, flashdauer);
|
||||
id = zw->writeToMemoryAsJPG();
|
||||
delete zw;
|
||||
|
||||
@@ -15,6 +15,7 @@ class ClassFlowMakeImage :
|
||||
{
|
||||
protected:
|
||||
float waitbeforepicture;
|
||||
float waitbeforepicture_store;
|
||||
framesize_t ImageSize;
|
||||
bool isImageSize;
|
||||
int ImageQuality;
|
||||
@@ -22,6 +23,8 @@ protected:
|
||||
string namerawimage;
|
||||
int image_height, image_width;
|
||||
bool SaveAllFiles;
|
||||
bool FixedExposure;
|
||||
|
||||
|
||||
|
||||
void CopyFile(string input, string output);
|
||||
@@ -29,6 +32,7 @@ protected:
|
||||
esp_err_t camera_capture();
|
||||
void takePictureWithFlash(int flashdauer);
|
||||
|
||||
|
||||
void SetInitialParameter(void);
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user