Skip to content

Commit

Permalink
refactor: Correct typos
Browse files Browse the repository at this point in the history
  • Loading branch information
becem-gharbi committed Oct 25, 2023
1 parent 34caa7d commit d62df02
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions include/ei_cam.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class EICam
bool _initCam(void);
void _deinitCam(void);
static bool _captureCamForInference(uint32_t img_width, uint32_t img_height, uint8_t *out_buf);
static int _getDataCamForEnference(size_t offset, size_t length, float *out_ptr);
static int _getDataCamForInference(size_t offset, size_t length, float *out_ptr);
static esp_err_t _streamHandler(httpd_req_t *req);
static httpd_handle_t _streamHttpd;
static bool _isCapturingForEnference;
static bool _isCapturingForInference;
static bool _logEnabled;
static void _log(const char *format, ...);
};
Expand Down
22 changes: 11 additions & 11 deletions src/ei_cam.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "inference.h"
#include "Inference.h"
#include "edge-impulse-sdk/dsp/image/image.hpp"
#include <ei_cam.h>

bool EICam::_logEnabled = false;
bool EICam::_camInitialized = false;
bool EICam::_isCapturingForEnference = false;
bool EICam::_isCapturingForInference = false;
uint8_t *EICam::_snapshotBufferForInference = nullptr;
httpd_handle_t EICam::_streamHttpd = NULL;

Expand Down Expand Up @@ -32,7 +32,7 @@ void EICam::begin(bool logEnabled)
_log("Camera initialized\r\n");
}

_log("\nStarting continuous inference in 2 seconds...\n");
_log("\nStarting continuous Inference in 2 seconds...\n");
ei_sleep(2000);
}

Expand Down Expand Up @@ -62,7 +62,7 @@ ei_impulse_result_t EICam::predict()

ei::signal_t signal;
signal.total_length = EI_CLASSIFIER_INPUT_WIDTH * EI_CLASSIFIER_INPUT_HEIGHT;
signal.get_data = &_getDataCamForEnference;
signal.get_data = &_getDataCamForInference;

if (_captureCamForInference((size_t)EI_CLASSIFIER_INPUT_WIDTH, (size_t)EI_CLASSIFIER_INPUT_HEIGHT, _snapshotBufferForInference) == false)
{
Expand All @@ -85,7 +85,7 @@ ei_impulse_result_t EICam::predict()
return result;
}

int EICam::_getDataCamForEnference(size_t offset, size_t length, float *out_ptr)
int EICam::_getDataCamForInference(size_t offset, size_t length, float *out_ptr)
{
// we already have a RGB888 buffer, so recalculate offset into pixel index
size_t pixel_ix = offset * 3;
Expand All @@ -107,14 +107,14 @@ int EICam::_getDataCamForEnference(size_t offset, size_t length, float *out_ptr)

bool EICam::_captureCamForInference(uint32_t img_width, uint32_t img_height, uint8_t *out_buf)
{
_isCapturingForEnference = true;
_isCapturingForInference = true;

bool do_resize = false;

if (_camInitialized == false)
{
_log("Camera is not initialized\r\n");
_isCapturingForEnference = false;
_isCapturingForInference = false;
return false;
}

Expand All @@ -123,7 +123,7 @@ bool EICam::_captureCamForInference(uint32_t img_width, uint32_t img_height, uin
if (!fb)
{
_log("[capture] Camera capture failed\n");
_isCapturingForEnference = false;
_isCapturingForInference = false;
return false;
}

Expand All @@ -134,7 +134,7 @@ bool EICam::_captureCamForInference(uint32_t img_width, uint32_t img_height, uin
if (!converted)
{
_log("[capture] Conversion failed\n");
_isCapturingForEnference = false;
_isCapturingForInference = false;
return false;
}

Expand All @@ -154,7 +154,7 @@ bool EICam::_captureCamForInference(uint32_t img_width, uint32_t img_height, uin
img_height);
}

_isCapturingForEnference = false;
_isCapturingForInference = false;
return true;
}

Expand Down Expand Up @@ -276,7 +276,7 @@ esp_err_t EICam::_streamHandler(httpd_req_t *req)

while (true)
{
if (_isCapturingForEnference)
if (_isCapturingForInference)
{
delay(1);
continue;
Expand Down

0 comments on commit d62df02

Please sign in to comment.