liuxiaolong
2019-06-27 8ceae6fc8ef80a43e1c5e4c82487963a3450cb7b
service/FaceSdkService.go
@@ -30,14 +30,13 @@
   i := readImgFile()
   fmt.Printf("width:%d,height:%d,data.length:%d,timestamp:%s,id:%d\n",i.Width,i.Height,len(i.Data),i.Timestamp,i.Id)
   i.Data = []byte("hello")
   if b, err := proto.Marshal(&i);err !=nil{
      fmt.Println("protoImage marshal err")
      return
   } else {
      bc := make([]byte,len(b))
      ht := make([]int, 64<<10)
      n,err := lz4.CompressBlock(b,bc,ht)
      n,err := lz4.CompressBlock(b, bc, ht)
      if err !=nil {
         fmt.Println(err)
      }
@@ -66,15 +65,18 @@
   picMat := gocv.IMRead(filePath, gocv.IMReadColor)
   window := gocv.NewWindow("Hello")
   window.IMShow(picMat)
   defer picMat.Close()
   if picMat.Empty() {
      fmt.Println("file not exist")
      return i
   }
   width := int32(picMat.Rows())
   height := int32(picMat.Cols())
   data := picMat.DataPtrUint8()
   height := int32(picMat.Rows())
   width := int32(picMat.Cols())
   data := picMat.ToBytes()
   i = protomsg.Image{
      Width: width,
      Height: height,
@@ -139,12 +141,13 @@
            sdkInfos := rMsg.Tasklab.Sdkinfos
            fmt.Println("Len(sdkInfos)=",len(sdkInfos))
               for _,swt :=range sdkInfos{
                  fmt.Println("sdkName:",swt.SdkName)
                  if swt.Sdktype == "FaceExtract"{
                     fmt.Println("sdkName:",swt.SdkName)
                     fmt.Println("sdkData.len:",len(swt.Sdkdata))
                     var pff protomsg.ParamFaceFeature
                     if err := proto.Unmarshal(swt.Sdkdata, &pff);err !=nil{
                        fmt.Println("ParamFaceFeature unmarshal err:",err)
                        //fmt.Println("ParamFaceFeature unmarshal err:",err)
                     } else {
                        fmt.Println("目标数:",len(pff.ExtComp))
                        for _,fea :=range pff.ExtComp{