forked from zakaria/chicken-counting-sukawarna-det
40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <chrono>
|
|
#include <optional>
|
|
|
|
#include <opencv2/core.hpp>
|
|
#include <opencv2/videoio.hpp>
|
|
|
|
#include "chicken_counter/config.hpp"
|
|
#include "chicken_counter/counting.hpp"
|
|
#include "chicken_counter/motion.hpp"
|
|
#include "chicken_counter/tracking.hpp"
|
|
#include "chicken_counter/types.hpp"
|
|
|
|
namespace cc {
|
|
|
|
struct PipelineArtifacts {
|
|
cv::VideoCapture capture;
|
|
DetectionTracker* tracker;
|
|
CountingZone counting_zone;
|
|
BackwardMotionDetector motion_detector;
|
|
cv::VideoWriter writer;
|
|
cv::Mat overlay_buffer;
|
|
double run_start_time;
|
|
int total_source_frames;
|
|
bool owns_tracker;
|
|
cv::Rect detection_zone_rect;
|
|
bool has_writer;
|
|
bool has_detection_zone;
|
|
};
|
|
|
|
PipelineArtifacts build_pipeline(const CameraConfig& config,
|
|
DetectionTracker* tracker = nullptr);
|
|
|
|
PipelineResult run_pipeline(const CameraConfig& config,
|
|
DetectionTracker* tracker = nullptr,
|
|
bool show_progress = false);
|
|
|
|
} // namespace cc
|