PassengerStatistics/Main/DetectAlgorithm.h

35 lines
813 B
C
Raw Normal View History

2024-03-13 18:01:36 +08:00
#ifndef __DETECTALGORITHM_H__
#define __DETECTALGORITHM_H__
#include <array>
#include <cstdint>
2024-03-14 21:41:54 +08:00
#include <vector>
class DetectAlgorithmPrivate;
2024-03-13 18:01:36 +08:00
class DetectAlgorithm {
public:
2024-03-14 21:41:54 +08:00
enum TrackState : int {
Remove = -2,
Hibernate = -1,
PreTrack = 0,
Confirmed = 1,
};
class Result {
public:
std::vector<int> leaveTrackers;
};
2024-03-13 18:01:36 +08:00
constexpr static uint32_t DetectWidth = 576;
constexpr static uint32_t DetectHeight = 320;
DetectAlgorithm();
~DetectAlgorithm();
2024-03-14 21:41:54 +08:00
Result detect(const uint8_t *nv21ImageData, uint64_t frameIndex);
2024-03-13 18:01:36 +08:00
void initialize();
private:
2024-03-14 21:41:54 +08:00
DetectAlgorithmPrivate *m_d = nullptr;
2024-03-13 18:01:36 +08:00
void *m_handle = nullptr;
std::array<uint8_t, DetectWidth * DetectHeight * 3> m_rgbImageBuffer;
};
#endif // __DETECTALGORITHM_H__