---
panlei
2019-07-02 8added81d3fa7aa2616711a80e3a3edf71840f6a
---
2个文件已修改
9 ■■■■■ 已修改文件
ruleserver/ruleToformula.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
util/image.go 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruleserver/ruleToformula.go
@@ -361,7 +361,7 @@
            }
        }
    }
    log.Println("-----------------------------------------------听说你是空的?",faces)
    //log.Println("-----------------------------------------------听说你是空的?",faces)
    return faces
}
util/image.go
@@ -3,6 +3,7 @@
import (
    "gocv.io/x/gocv"
    "image"
    "log"
)
// 按尺寸去切图
func Subimg(dbyte []byte,x0,y0,x1,y1 int,) []byte{
@@ -24,9 +25,9 @@
    //f, _ := os.Create("./test.jpg")                   //创建文件
    //defer f.Close()                                         //关闭文件
    //jpeg.Encode(f, subImg, nil)                         //写入文件
    img,_ := gocv.NewMatFromBytes(100,100,gocv.MatTypeCV8UC3,dbyte)
    rect := image.Rect(x0,y0,x0+100,y0+100)
    log.Println("--------------------------四大金刚:",x0,y0,x1,y1)
    img,_ := gocv.NewMatFromBytes(50,50,gocv.MatTypeCV8UC3,dbyte)
    rect := image.Rect(x0,y0,x0+50,y0+50)
    region := img.Region(rect)
    bytes, _ := gocv.IMEncode(".jpg", region)
    return bytes