mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 20:46:52 +03:00
Optimized CImageBasis
This commit is contained in:
@@ -162,7 +162,7 @@ string ClassFlowAlignment::getHTMLSingleStep(string host)
|
|||||||
bool ClassFlowAlignment::doFlow(string time)
|
bool ClassFlowAlignment::doFlow(string time)
|
||||||
{
|
{
|
||||||
if (!ImageTMP)
|
if (!ImageTMP)
|
||||||
ImageTMP = new CImageBasis(ImageBasis, 5);
|
ImageTMP = new CImageBasis(ImageBasis);
|
||||||
|
|
||||||
delete AlignAndCutImage;
|
delete AlignAndCutImage;
|
||||||
|
|
||||||
|
|||||||
@@ -364,7 +364,8 @@ void CImageBasis::LoadFromMemory(stbi_uc *_buffer, int len)
|
|||||||
RGBImageRelease();
|
RGBImageRelease();
|
||||||
}
|
}
|
||||||
|
|
||||||
CImageBasis::CImageBasis(CImageBasis *_copyfrom, int _anzrepeat)
|
|
||||||
|
CImageBasis::CImageBasis(CImageBasis *_copyfrom)
|
||||||
{
|
{
|
||||||
islocked = false;
|
islocked = false;
|
||||||
externalImage = false;
|
externalImage = false;
|
||||||
@@ -378,15 +379,6 @@ CImageBasis::CImageBasis(CImageBasis *_copyfrom, int _anzrepeat)
|
|||||||
int memsize = width * height * channels;
|
int memsize = width * height * channels;
|
||||||
rgb_image = (unsigned char*)GET_MEMORY(memsize);
|
rgb_image = (unsigned char*)GET_MEMORY(memsize);
|
||||||
|
|
||||||
int anz = 1;
|
|
||||||
while (!rgb_image && (anz < _anzrepeat))
|
|
||||||
{
|
|
||||||
ESP_LOGD(TAG, "Create Image from Copy - Memory is full - try again: %d", anz);
|
|
||||||
rgb_image = (unsigned char*) malloc(memsize);
|
|
||||||
anz++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!rgb_image)
|
if (!rgb_image)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "%s", getESPHeapInfo().c_str());
|
ESP_LOGD(TAG, "%s", getESPHeapInfo().c_str());
|
||||||
@@ -399,6 +391,7 @@ CImageBasis::CImageBasis(CImageBasis *_copyfrom, int _anzrepeat)
|
|||||||
RGBImageRelease();
|
RGBImageRelease();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CImageBasis::CImageBasis(int _width, int _height, int _channels)
|
CImageBasis::CImageBasis(int _width, int _height, int _channels)
|
||||||
{
|
{
|
||||||
islocked = false;
|
islocked = false;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class CImageBasis
|
|||||||
CImageBasis(std::string _image);
|
CImageBasis(std::string _image);
|
||||||
CImageBasis(uint8_t* _rgb_image, int _channels, int _width, int _height, int _bpp);
|
CImageBasis(uint8_t* _rgb_image, int _channels, int _width, int _height, int _bpp);
|
||||||
CImageBasis(int _width, int _height, int _channels);
|
CImageBasis(int _width, int _height, int _channels);
|
||||||
CImageBasis(CImageBasis *_copyfrom, int _anzrepeat = 0);
|
CImageBasis(CImageBasis *_copyfrom);
|
||||||
|
|
||||||
void Resize(int _new_dx, int _new_dy);
|
void Resize(int _new_dx, int _new_dy);
|
||||||
void Resize(int _new_dx, int _new_dy, CImageBasis *_target);
|
void Resize(int _new_dx, int _new_dy, CImageBasis *_target);
|
||||||
|
|||||||
Reference in New Issue
Block a user