| | |
| | | defer rook.Close() |
| | | |
| | | yellow := color.RGBA{255, 255, 0, 0} |
| | | green := color.RGBA{0, 255, 0, 0} |
| | | red := color.RGBA{255, 0, 0, 0} |
| | | |
| | | // 分割区域id集合并根据id查询区域然后画框 |
| | | for _,result := range results { |
| | |
| | | // 把目标框出来 |
| | | for _,result := range results { |
| | | for _,rect := range result.Location { |
| | | gocv.Rectangle(&rook, image.Rect(int(rect.X), int(rect.Y), int(rect.X+rect.Width), int(rect.Y+rect.Height)), green, 1) |
| | | gocv.Rectangle(&rook, image.Rect(int(rect.X), int(rect.Y), int(rect.X+rect.Width), int(rect.Y+rect.Height)), red, 1) |
| | | } |
| | | } |
| | | //return nil,nil |