24 lines
606 B
C++
24 lines
606 B
C++
#ifndef __ALGORITHM_H__
|
|
#define __ALGORITHM_H__
|
|
|
|
#include <array>
|
|
#include <chrono>
|
|
#include <cstdint>
|
|
|
|
class Algorithm {
|
|
public:
|
|
static constexpr int DetectImageWidth = 1024;
|
|
static constexpr int DetectImageHeight = 576;
|
|
bool initialize();
|
|
void detect(const uint8_t *imageData);
|
|
|
|
protected:
|
|
void NV21ToBGR24(const unsigned char *nv21Data, unsigned char *bgr24Data, int width, int height);
|
|
|
|
private:
|
|
void *m_handle = nullptr;
|
|
std::array<uint8_t, DetectImageWidth * DetectImageHeight> m_buffer;
|
|
std::chrono::system_clock::time_point m_firstTime;
|
|
};
|
|
|
|
#endif // __ALGORITHM_H__
|