package structure
|
|
import "basic.com/pubsub/protomsg.git"
|
|
// 每个目标的参数:相似度,占比,尺寸
|
type Arg struct {
|
Id uint64
|
Score float64 // 区域内的目标的相似度
|
Proportion float64 // 区域内的目标的占比
|
Size float64 // 区域内的目标的尺寸
|
IsYolo bool // 是否是yolo数据
|
Location Rect // 记下每个目标的位置参数,最后给结果装配人脸数据的时候用的到
|
Feature []byte
|
ThftRes protomsg.ThftResult
|
Liker []*BaseInfo
|
}
|
|
// 每个区域内的图片数据集合
|
type AreaMap struct {
|
CameraId string
|
AreaId string
|
GroupId string
|
TaskId string
|
SdkId string
|
SdkName string
|
AreaJson string
|
TriggerLine string
|
DirectionLine string
|
TargetNum int // 区域内目标数量
|
Args []*Arg // 区域内目标集合
|
FilterData []*Arg // 过滤后区域内目标集合
|
Time string // 当前时间(用以匹配时间规则)
|
IsEffective bool // 规则中是否用到了此区域
|
KeepRight bool // 是否靠右行
|
IsStatic bool // 是否静止
|
}
|
|
// sdk输出的图片上单个目标的数据
|
type PhotoMap struct {
|
Id uint64
|
Rects Rect // 矩形区域参数
|
Score float64 // 相似度得分(有多大程度像一个目标。人脸,人体或车等等)
|
IsYolo bool // 是否是yolo数据
|
ThftRes protomsg.ThftResult
|
Feature []byte
|
}
|
|
// 每个算法对于当前帧画面自己提取的数据
|
type SdkData struct {
|
TaskId string
|
IpcId string
|
IsYolo bool
|
Photo []PhotoMap // yolo算法结构,也可以存人脸的数据,毕竟人脸中能用规则来测的还是那些参数
|
KeepRight bool // 是否靠右行 算法判断的与上一帧图像的比较结果
|
IsStatic bool // 是否静止
|
ImageWidth int // 摄像机拍摄的图像宽 像素
|
ImageHeight int // 摄像机拍摄的图像高 像素
|
AreaMapList []*AreaMap // 本sdk提取的数据按照区域划分后的数据集合
|
}
|
|
// 从算法模块儿拿来的对一帧图像各个算法提取的数据集合
|
type SdkDatas struct {
|
CameraId string
|
TaskId string
|
Sdkdata []*SdkData
|
RuleResult map[string]interface{} // 过完规则后打的标签 face: []FaceResult, yolo: []Result
|
}
|
|
type ResultMsg struct {
|
*protomsg.SdkMessage
|
RuleResult map[string]interface{} // 过完规则后打的标签 face: []FaceResult, yolo: []Result
|
}
|
|
// 过规则库打上的标签
|
type Result struct {
|
TaskId string // 任务id
|
SdkName string
|
RuleGroupId string // 规则组id
|
DefenceState bool // 是否布防
|
AlarmLevel int32 // 报警等级
|
RuleText string // 文字版规则组
|
Location []TargetInfo // 目标的坐标
|
AlarmPolygon string // 触发的报警框
|
IsLink bool // 是否是联动任务
|
Others
|
}
|
type Others struct {
|
CacheData []ResultMsg //(本组规则中含有持续时间的规则开启的定时器缓存的数据帧)
|
LinkCache []ResultMsg
|
TimeLabel string
|
}
|
|
type TargetInfo struct {
|
Rect
|
TargetId uint64
|
TargetScore float64
|
}
|
|
// 过规则库打上的标签
|
type FaceResult struct {
|
Result
|
Args []Arg
|
}
|
type LittleRuleResult struct {
|
SdkName string // 记录下此结果是哪个sdk的结果
|
Result string // 已包含了前置连接符
|
Sort int32
|
}
|
|
type TimeRange struct {
|
Start string `json:"start"`
|
End string `json:"end"`
|
}
|
type Day struct {
|
Day int `json:"day"` // 标示当前星期几
|
TimeRange []TimeRange `json:"time_range"` // 当天的几个时间段
|
}
|
|
type BaseInfo struct {
|
TableId string `json:"tableId"`
|
TableName string `json:"tableName"`
|
BwType string `json:"bwType"`
|
CompareScore float64 `json:"compareScore"`
|
PersonId string `json:"personId"`
|
PersonName string `json:"personName"`
|
PersonPicUrl string `json:"personPicUrl"`
|
PhoneNum string `json:"phoneNum"`
|
Sex string `json:"sex"`
|
IdCard string `json:"idCard"`
|
MonitorLevel string `json:"monitorLevel"`
|
Content string `json:"content"`
|
}
|