| | |
| | | logger.Debug("gocv.IMDecode err:",err) |
| | | return nil,err |
| | | } |
| | | logger.Debug("picMat.Data.len:", len(picMat.ToBytes())) |
| | | newMat := gocv.NewMat() |
| | | if picMat.Rows() > 1000 || picMat.Cols() > 1000 { |
| | | gocv.Resize(picMat,&newMat, image.Pt(0,0), 0.5, 0.5, gocv.InterpolationDefault) |
| | | size := 1024 |
| | | if picMat.Rows() > size || picMat.Cols() > size { |
| | | fx := float64(size)/float64(picMat.Rows()) |
| | | fy := float64(size)/float64(picMat.Cols()) |
| | | ff := fx |
| | | if fx > fy{ |
| | | ff = fy |
| | | } |
| | | gocv.Resize(picMat,&newMat, image.Pt(0,0), ff, ff, gocv.InterpolationDefault) |
| | | picMat = newMat |
| | | } |
| | | |
| | |
| | | } |
| | | rMsg := protomsg.SdkMessage{} |
| | | if err := proto.Unmarshal(resultBytes, &rMsg); err == nil { |
| | | logger.Debug("received MSG:", rMsg.Cid) |
| | | i := protomsg.Image{} |
| | | bdata, err := util.UnCompress(rMsg.Data) |
| | | if err !=nil { |