---
panlei
2019-11-19 4bff97b12981fb4b07c8d2036abe546c339e58c4
structure/rule.go
@@ -1,19 +1,24 @@
package structure
import "basic.com/pubsub/protomsg.git"
import (
   "basic.com/pubsub/protomsg.git"
)
// 每个目标的参数:相似度,占比,尺寸
type Arg struct {
   Id         uint64
   Id         string
   Uuid      string
   Score      float64 // 区域内的目标的相似度
   Proportion float64 // 区域内的目标的占比
   Size       float64 // 区域内的目标的尺寸
   AreaJson   string  // 所属区域
   IsYolo     bool    // 是否是yolo数据
   Location   Rect    // 记下每个目标的位置参数,最后给结果装配人脸数据的时候用的到
   Type       string  // 记载数据类型
   Location   Rect    // 记下每个目标的位置参数,最后给结果装配目标数据的时候用的到
   Car         *protomsg.PlateID // 车辆参数
   Feature    []byte
   ThftRes    protomsg.ThftResult
   Liker      []*BaseInfo
   TimeLable  string
   CacheData  ResultMsg
}
@@ -38,12 +43,13 @@
// sdk输出的图片上单个目标的数据
type PhotoMap struct {
   Id      uint64
   Id      string
   Rects   Rect    // 矩形区域参数
   Score   float64 // 相似度得分(有多大程度像一个目标。人脸,人体或车等等)
   IsYolo  bool    // 是否是yolo数据
   Type     string  // 记载数据类型
   ThftRes protomsg.ThftResult
   Feature []byte
   Car      *protomsg.PlateID
}
// 每个算法对于当前帧画面自己提取的数据
@@ -52,8 +58,6 @@
   IpcId       string
   IsYolo      bool
   Photo       []PhotoMap // yolo算法结构,也可以存人脸的数据,毕竟人脸中能用规则来测的还是那些参数
   KeepRight   bool       // 是否靠右行 算法判断的与上一帧图像的比较结果
   IsStatic    bool       // 是否静止
   ImageWidth  int        // 摄像机拍摄的图像宽 像素
   ImageHeight int        // 摄像机拍摄的图像高 像素
   AreaMapList []*AreaMap // 本sdk提取的数据按照区域划分后的数据集合
@@ -80,7 +84,8 @@
   DefenceState bool   // 是否布防
   AlarmLevel   int32  // 报警等级
   RuleText     string // 文字版规则组
   Location     []TargetInfo // 目标的坐标
   //Location     []TargetInfo // 目标的坐标
   AlarmObj    []*Arg   // 报警的目标数据  打算废掉上面的Location
   AlarmPolygon string // 触发的报警框
   IsLink       bool   // 是否是联动任务
   Others
@@ -95,12 +100,6 @@
   Rect
   TargetId    uint64
   TargetScore float64
}
// 过规则库打上的标签
type TargetResult struct {
   Result
   Args []Arg
}
type LittleRuleResult struct {
   SdkName string // 记录下此结果是哪个sdk的结果
@@ -122,12 +121,13 @@
   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"`
   TargetId     string  `json:"targetId"`
   TargetName   string  `json:"targetName"`
   TargetPicUrl string  `json:"targetPicUrl"`
   MonitorLevel string  `json:"monitorLevel"`
   Content      string  `json:"content"`
   DbLabel       string    `json:"labels"`
   //PhoneNum     string  `json:"phoneNum"`
   //Sex          string  `json:"sex"`
   //IdCard       string  `json:"idCard"`
}