| | |
| | | } |
| | | height := int32(picMat.Rows()) |
| | | width := int32(picMat.Cols()) |
| | | data := picMat.ToBytes() |
| | | //data := picMat.ToBytes() |
| | | timeUnix := time.Now().Unix() |
| | | formatTimeStr := time.Unix(timeUnix, 0).Format("2006-01-02 15:04:05") |
| | | |
| | |
| | | Width: width, |
| | | Height: height, |
| | | Timestamp: formatTimeStr, |
| | | Data: data, |
| | | Data: imgB, |
| | | Id: timeUnix, |
| | | Cid:s.Id, |
| | | },nil |
| | |
| | | go func() { |
| | | for { |
| | | select { |
| | | case <-time.Tick(time.Second*10): |
| | | case <-time.Tick(time.Second*5): |
| | | fmt.Println("倒计时结束") |
| | | ch <- nil |
| | | wg.Done() |
| | | return |
| | |
| | | fmt.Println("faceFea got!!!") |
| | | ch <- feas |
| | | return |
| | | } else { |
| | | fmt.Println("尚未拿到fea") |
| | | } |
| | | } |
| | | } |
| | | }() |
| | | fmt.Println("wa.Wait") |
| | | wg.Wait() |
| | | fmt.Println("<-ch") |
| | | msg := <- ch |
| | | if msg != nil { |
| | | return msg,nil |