zhangmeng
2019-12-13 2d25b62b60da018412ed164b6fd29470498cea17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package sdk
 
import (
    "analysis/work"
 
    "basic.com/valib/gosdk.git"
)
 
// Run impl
func cloud(img *gosdk.SDKImage, rc *gosdk.CRECT, mW, mH int, rMsg *work.MsgRS, out chan<- work.MsgRS) {
 
    // result := gosdk.PlateIDCloudSDKDetect(*img, rc)
    // count := len(result)
    // if count <= 0 {
    //     ejectResult(nil, *rMsg, out)
    //     return
    // }
 
    // plateids := convert2ProtoPlateIDResultCloud(result)
 
    // plateresult := protomsg.PlateCloudIDResult{Result: plateids}
    // data, err := proto.Marshal(&plateresult)
    // if err != nil {
    //     logo.Errorln("PLATE ID DETECTOR MARSHAL PROTO PLATE IDS ERROR", err)
    //     data = nil
    // }
    // ejectResult(data, *rMsg, out)
}
 
// func convert2ProtoPlateIDResultCloud(obj []gosdk.CPlateIDCloudResult) []*protomsg.PlateCloudID {
//     ret := []*protomsg.PlateCloudID{}
 
//     for _, v := range obj {
 
//         rcPlateID := &protomsg.Rect{
//             Left:   v.RcLocation.Left,
//             Right:  v.RcLocation.Right,
//             Top:    v.RcLocation.Top,
//             Bottom: v.RcLocation.Bottom,
//         }
//         lic := string(v.License[:])
//         end := len(lic)
//         for i := len(lic) - 1; i >= 0; i-- {
//             if lic[i] != '\000' {
//                 end = i + 1
//                 break
//             }
//         }
//         if end > 0 {
//             lic = lic[:end]
//         }
 
//         obj := &protomsg.PlateCloudID{
//             License:      lic,
//             RcLocation:   rcPlateID,
//             NConfidence:  v.NConfidence,
//             NType:        v.NType,
//             NDirection:   v.NDirection,
//             NCarColor:    v.NCarColor,
//             NCarColor1:   v.NCarColor1,
//             NCarBright:   v.NBright,
//             FrameNo:      v.FramNo,
//             FaceWidth:    v.FaceWidth,
//             FaceHeight:   v.FaceHeight,
//             GrayFaceFlag: v.GrayFaceFlag,
//             CharNum:      v.CharNum,
//         }
 
//         ret = append(ret, obj)
//     }
//     return ret
// }