| | |
| | | package main |
| | | |
| | | import ( |
| | | "basic.com/pubsub/protomsg.git" |
| | | "basic.com/valib/deliver.git" |
| | | "bufio" |
| | | "bytes" |
| | | "encoding/json" |
| | | "errors" |
| | | "fmt" |
| | | "github.com/golang/protobuf/proto" |
| | | "gocv.io/x/gocv" |
| | | "image" |
| | | "image/color" |
| | | "io" |
| | | "log" |
| | | "mime/multipart" |
| | | "net/http" |
| | | "os" |
| | | "ruleprocess/insertdata" |
| | | "ruleprocess/ruleserver" |
| | | "ruleprocess/util" |
| | | "time" |
| | | |
| | | "basic.com/pubsub/protomsg.git" |
| | | "basic.com/valib/deliver.git" |
| | | "github.com/golang/protobuf/proto" |
| | | "sync" |
| | | ) |
| | | |
| | | func main() { |
| | | //wg := sync.WaitGroup{} |
| | | //wg.Add(1) |
| | | //go ruleserver.TimeTicker() |
| | | //nReciever("ipc:///tmp/sdk-2-rules-process.ipc", deliver.PushPull, 1) |
| | | //wg.Wait() |
| | | resp,err := DrawPolygonOnImage() |
| | | if err != nil { |
| | | log.Println("画框或者上传有问题") |
| | | } |
| | | log.Println(resp["fileUrl"].(string)) |
| | | wg := sync.WaitGroup{} |
| | | wg.Add(1) |
| | | go ruleserver.TimeTicker() |
| | | nReciever("ipc:///tmp/sdk-2-rules-process.ipc", deliver.PushPull, 1) |
| | | wg.Wait() |
| | | //resp,err := DrawPolygonOnImage() |
| | | //if err != nil { |
| | | // log.Println("画框或者上传有问题") |
| | | //} |
| | | //log.Println(resp["fileUrl"].(string)) |
| | | } |
| | | func nReciever(url string, m deliver.Mode, count int) { |
| | | c := deliver.NewServer(m, url) |
| | |
| | | // return nil, err |
| | | // } |
| | | return nil, nil |
| | | } |
| | | //} |
| | | } |
| | | |
| | | // 把图片转成二进制流 |