#pragma once
|
|
#include <map>
|
#include <algorithm>
|
#include "../vp_node.h"
|
#include "../../objects/shapes/vp_point.h"
|
#include "../../objects/shapes/vp_line.h"
|
#include "../../objects/vp_image_record_control_meta.h"
|
#include "../../objects/vp_video_record_control_meta.h"
|
|
namespace vp_nodes
|
{
|
// behaviour analysis node for stop (support multi channels)
|
class vp_ba_report_detect_node : public vp_node
|
{
|
private:
|
// channel -> detect status of channel (has or not)
|
std::map<int, int> all_detect_result_counts;
|
|
// channel -> last frame index to notify jam
|
std::map<int, int> all_last_notifys;
|
|
// only appliy to some certain classes
|
std::vector<int> class_ids ={0};
|
|
std::string detect_type_name;
|
|
// record params
|
bool need_record_image;
|
bool need_record_video;
|
|
|
// checking logic parameters which may be configed by constructor passed in by user
|
const int check_min_hit_frames = 2 * 1; // 25 fps * 2 seconds
|
|
const int check_notify_interval = 5; // interval time (seconds) to notify (ensure not frequently)
|
protected:
|
virtual std::shared_ptr<vp_objects::vp_meta> handle_frame_meta(std::shared_ptr<vp_objects::vp_frame_meta> meta) override;
|
|
public:
|
vp_ba_report_detect_node(std::string node_name,
|
std::string detect_type_name,
|
std::vector<int> class_ids,
|
bool need_record_image = true,
|
bool need_record_video = true);
|
~vp_ba_report_detect_node();
|
std::string to_string() override;
|
};
|
}
|