first commit
This commit is contained in:
34
objects/ba/vp_ba_result.cpp
Normal file
34
objects/ba/vp_ba_result.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "vp_ba_result.h"
|
||||
|
||||
|
||||
namespace vp_objects {
|
||||
|
||||
vp_ba_result::vp_ba_result(vp_ba_type type,
|
||||
int channel_index,
|
||||
int frame_index,
|
||||
std::vector<int> involve_target_ids_in_frame,
|
||||
std::vector<vp_objects::vp_point> involve_region_in_frame,
|
||||
std::string ba_label,
|
||||
std::string record_image_name,
|
||||
std::string record_video_name):
|
||||
type(type), channel_index(channel_index), frame_index(frame_index),
|
||||
involve_target_ids_in_frame(involve_target_ids_in_frame),
|
||||
involve_region_in_frame(involve_region_in_frame),
|
||||
ba_label(ba_label),
|
||||
record_image_name(record_image_name),
|
||||
record_video_name(record_video_name) {
|
||||
|
||||
}
|
||||
|
||||
vp_ba_result::~vp_ba_result() {
|
||||
|
||||
}
|
||||
|
||||
std::string vp_ba_result::to_string() {
|
||||
return "";
|
||||
}
|
||||
|
||||
std::shared_ptr<vp_ba_result> vp_ba_result::clone() {
|
||||
return std::make_shared<vp_ba_result>(*this);
|
||||
}
|
||||
}
|
||||
65
objects/ba/vp_ba_result.h
Normal file
65
objects/ba/vp_ba_result.h
Normal file
@@ -0,0 +1,65 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include "../shapes/vp_point.h"
|
||||
|
||||
|
||||
namespace vp_objects {
|
||||
// type of behaviour analysis
|
||||
enum class vp_ba_type {
|
||||
NONE = 0b00000000, // none
|
||||
CROSSLINE = 0b00000001, // cross line
|
||||
STOP = 0b00000010, // enter stop status
|
||||
UNSTOP = 0b00000100, // leave stop status
|
||||
JAM = 0b00001000, // enter jam status
|
||||
UNJAM = 0b00010000 // leave jam status
|
||||
/* more */
|
||||
};
|
||||
|
||||
// result of behaviour analysis
|
||||
// BA logic can ONLY works on vp_frame_target
|
||||
class vp_ba_result
|
||||
{
|
||||
private:
|
||||
/* data */
|
||||
public:
|
||||
// type
|
||||
vp_ba_type type;
|
||||
// target ids which involved for this ba result, empty allowed.
|
||||
std::vector<int> involve_target_ids_in_frame;
|
||||
// region (or single line) involved for this ba result, empty allowed.
|
||||
std::vector<vp_objects::vp_point> involve_region_in_frame;
|
||||
|
||||
// channel index of this ba result
|
||||
int channel_index;
|
||||
// frame index of this ba result
|
||||
int frame_index;
|
||||
|
||||
// name of ba
|
||||
std::string ba_label = "not specified";
|
||||
|
||||
// record image name if exist
|
||||
std::string record_image_name = "";
|
||||
// record video name if exist
|
||||
std::string record_video_name = "";
|
||||
|
||||
vp_ba_result(vp_ba_type type,
|
||||
int channel_index,
|
||||
int frame_index,
|
||||
std::vector<int> involve_target_ids_in_frame,
|
||||
std::vector<vp_objects::vp_point> involve_region_in_frame,
|
||||
std::string ba_label = "not specified",
|
||||
std::string record_image_name = "",
|
||||
std::string record_video_name = "");
|
||||
~vp_ba_result();
|
||||
|
||||
// get description for ba result
|
||||
virtual std::string to_string();
|
||||
|
||||
// clone myself
|
||||
std::shared_ptr<vp_ba_result> clone();
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user