panlei
2019-07-15 19a240f4b729d2b343a7422d6deb00541b6646a2
构建一个baseInfo
4个文件已修改
22 ■■■■■ 已修改文件
go.mod 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
go.sum 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruleserver/readyDataForRule.go 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruleserver/ruleToformula.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
go.mod
@@ -5,6 +5,7 @@
require (
    basic.com/dbapi.git v0.0.0-20190701055817-73bca225181f
    basic.com/pubsub/cache.git v0.0.0-20190712095028-e73efb4afc3b
    basic.com/pubsub/protomsg.git v0.0.0-20190712081201-5a482419c227
    basic.com/pubsub/sdkcompare.git v0.0.0-20190715013640-f536a4647d00
    basic.com/valib/deliver.git v0.0.0-20190531095353-25d8c3b20051
    basic.com/valib/gopherdiscovery.git v0.0.0-20190605034340-15d89d8b4e28
go.sum
@@ -1,8 +1,11 @@
basic.com/dbapi.git v0.0.0-20190701055817-73bca225181f h1:CVB4pmUXTPPFN7w/DQfU1YWg2Tp2gG93TTr1M5W86sE=
basic.com/dbapi.git v0.0.0-20190701055817-73bca225181f/go.mod h1:eDXPnxaz6jZPDvBSk7ya7oSASWPCuUEgRTJCjsfKt/Q=
basic.com/pubsub/cache.git v0.0.0-20190712095028-e73efb4afc3b h1:UAasACFqEYUBCuZkkdxYVc1QmSyB7McvNHS36QxDJp4=
basic.com/pubsub/cache.git v0.0.0-20190712095028-e73efb4afc3b/go.mod h1:gHLJZz2ee1cGL0X0ae69fs56bAxkDgEQwDhhXZJNUcY=
basic.com/pubsub/protomsg.git v0.0.0-20190709070734-b34c868adcc2 h1:ygh9CQPS48KmXv+PNUrOcrMqIiDZOs11apnQdu9oGEY=
basic.com/pubsub/protomsg.git v0.0.0-20190709070734-b34c868adcc2/go.mod h1:un5NV5VWQoblVLZfx1Rt5vyLgwR0jI92d3VJhfrJhWU=
basic.com/pubsub/protomsg.git v0.0.0-20190712081201-5a482419c227 h1:1jprxyxmeQ8X4/S7cFnhRf4ByVqD0xLZNvx8/0xTk2k=
basic.com/pubsub/protomsg.git v0.0.0-20190712081201-5a482419c227/go.mod h1:un5NV5VWQoblVLZfx1Rt5vyLgwR0jI92d3VJhfrJhWU=
basic.com/pubsub/sdkcompare.git v0.0.0-20190715013640-f536a4647d00 h1:sK+Tx7rvM9J2WnNIwrzMDjZSylWiKNfQO0prUBfKsDk=
basic.com/pubsub/sdkcompare.git v0.0.0-20190715013640-f536a4647d00/go.mod h1:8by33F9E1w17Pw/rDgJGJXAo122w0wDENG14hiMS+RE=
basic.com/valib/deliver.git v0.0.0-20190531095353-25d8c3b20051 h1:9flC2o3kasaM2Y6I+mY+mxmve/pyAY/UzGQZLT3lFHM=
ruleserver/readyDataForRule.go
@@ -16,6 +16,20 @@
    bigCache.Init()
}
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"`
}
// 以摄像机id查出跟其相关的所有任务下的所有规则组
func GetRuleGroup(cameraId string) []*protomsg.TaskGroupArgs {
    all := cache.GetCameraTaskRulesByCameraId(cameraId)
@@ -190,7 +204,7 @@
        if threshold <= obj.Score && size <= float64(obj.Rects.Width*obj.Rects.Height) && intersectionper <= PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale) {
            // 这步要备齐表达式里所需要的所有参数
            a.targetNum++
            arg1 := Arg{obj.Score, PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale), float64(obj.Rects.Width * obj.Rects.Height), obj.IsYolo, obj.Rects, obj.Feature, obj.ThftRes, []*protomsg.Baseinfo{}}
            arg1 := Arg{obj.Score, PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale), float64(obj.Rects.Width * obj.Rects.Height), obj.IsYolo, obj.Rects, obj.Feature, obj.ThftRes, []*BaseInfo{}}
            //logger.Println("放进去的arg:-------", arg1)
            a.args = append(a.args, &arg1)
            a.filterData = append(a.filterData, &arg1)
ruleserver/ruleToformula.go
@@ -22,7 +22,7 @@
    Location   Rect    // 记下每个目标的位置参数,最后给结果装配人脸数据的时候用的到
    Feature    []byte
    ThftRes    protomsg.ThftResult
    Liker      []*protomsg.Baseinfo
    Liker      []*BaseInfo
}
// 每个区域内的图片数据集合