34 static constexpr int kMaxLabels = kCells / 2;
35 static constexpr int kMaxComponents = 64;
44 void copy_background(
const GrayFrame& frame);
45 void seed_background(
const GrayFrame& frame);
46 int mask_and_learn(
const GrayFrame& frame);
48 uint16_t find(uint16_t label);
49 void unite(uint16_t a, uint16_t b);
55 int background_mean_ = 0;
57 std::array<uint16_t, kCells> background_{};
58 std::array<uint8_t, kCells> mask_{};
59 std::array<uint8_t, kCells> fg_age_{};
60 std::array<uint16_t, kCells> labels_{};
61 std::array<uint16_t, kMaxLabels + 1> parent_{};
62 std::array<uint8_t, kMaxLabels + 1> component_of_{};
63 std::array<Accum, kMaxComponents> accum_{};
Definition motion_detector.h:21
void reset()
Forget the background; the next frame re-seeds it and starts the warm-up.
Definition motion_detector.cpp:19
const DetectionResult & process(const GrayFrame &frame)
Analyse one frame. The returned reference stays valid until the next call.
Definition motion_detector.cpp:26
Inclusive cell rectangle. A default-constructed box is empty.
Definition tracking_types.h:24
What the detector found in one frame. Blobs are sorted by area, largest first.
Definition tracking_types.h:83
Motion detector tunables. Defaults are tuned for an indoor scene 1-3 m away.
Definition tracking_types.h:67
Value types shared by the motion detector and the tracker (pure C++20, natively tested).
std::array< uint8_t, kCells > GrayFrame
One 40x30 luma frame, row-major (index = y * kGridW + x).
Definition tracking_types.h:21