zhangzengfei
2024-06-05 b7a070b1ad684d826a7af781e892a18dbbe58de8
优化坐标转换
2个文件已修改
20 ■■■■ 已修改文件
config/config.go 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
repository/captureRepo.go 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/config.go
@@ -52,9 +52,9 @@
}
type image struct {
    CutFaceImage bool `mapstructure:"cut-face-image"`
    OriginWidth  int  `mapstructure:"origin-width"`
    OriginHeight int  `mapstructure:"origin-height"`
    CutFaceImage bool    `mapstructure:"cut-face-image"`
    OriginWidth  float64 `mapstructure:"origin-width"`
    OriginHeight float64 `mapstructure:"origin-height"`
}
// 梯控设备
repository/captureRepo.go
@@ -73,13 +73,13 @@
        // 判断图片类型是否为场景图, 根据人脸坐标切小图.
        if imageType == "14" && config.ImageConf.CutFaceImage {
            scaleX := bgImageWidth / config.ImageConf.OriginWidth
            scaleY := bgImageHeight / config.ImageConf.OriginHeight
            scaleX := float64(bgImageWidth) / config.ImageConf.OriginWidth
            scaleY := float64(bgImageHeight) / config.ImageConf.OriginHeight
            faceRect := &vo.Rect{
                Left:   face.LeftTopX * scaleX,
                Top:    face.LeftTopY * scaleY,
                Right:  face.RightBtmX * scaleX,
                Bottom: face.RightBtmY * scaleY,
                Left:   int(float64(face.LeftTopX) * scaleX),
                Top:    int(float64(face.LeftTopY) * scaleY),
                Right:  int(float64(face.RightBtmX) * scaleX),
                Bottom: int(float64(face.RightBtmY) * scaleY),
            }
            faceImageBytes, err = util.SubCutImg(bgImageBytes, faceRect, 90)
@@ -96,7 +96,7 @@
                return
            }
            // 处理梯控填写的楼层信息 暂时使用oherFeature字段
            // 处理梯控填写的楼层信息 暂时使用otherFeature字段
            if face.OtherFeature != "" {
                pd.CameraFloor = face.OtherFeature
            }