StructInfos.cs
5.99 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace OS.Spin.Modle.Sdk
{
public class StructInfos
{
//public struct Fore_Result
//{
// public int img_id; //所在图片号
// public int label; //类别
// public float prob; //分类置信度
// public int xCenter; //实际横坐标
// public int yCenter; //实际纵坐标
// public int xCenter_cam; //像素横坐标
// public int yCenter_cam; //像素纵坐标
// public int aera; //瑕疵像素面积
// public int width; //瑕疵宽度
// public int height; //瑕疵高度
// public int location; //瑕疵纬向位置
// public int is_repeat; //瑕疵2米内重复
// public int id;
//}
/// <summary>
/// TWB20210902
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct Fore_Result
{
public int img_id; //所在图片号
public int label; //类别
public float prob; //分类置信度
public float prob_sum; //分类置信度2
public int is_valid; //是否有效
public int is_repeat; //瑕疵2米内重复
public int deduction; //扣分
public int direction; //候选区域方向:0 横向;1 纵向;2 布边
public int location; //瑕疵纬向位置
public int xCenter_cam; //像素横坐标
public int yCenter_cam; //像素纵坐标
public int width; //瑕疵宽度
public int height; //瑕疵高度
public int aera; //瑕疵像素面积
public float m_slope; //瑕疵斜率
}
//public struct DETC_PARAM
//{
// public int m_id;
// public int index_shift; //布边偏移
// public int edge_width; //布边宽度
// public double mean_factor; //二值化系数
//}
/// <summary>
/// TWB20210902
/// </summary>
public struct DETC_PARAM
{
public int m_id; //相机ID
public int cloths_kind; //布种
public int index_shift; //切边偏移
public int overlap_left; //左相机重叠宽度
public int overlap_right; //右相机重叠宽度
public int width_MidTrue; //中间相机实际宽度
public float width_factorL; //CameraLeft幅宽计算系数
public float width_factorR; //CameraRight幅宽计算系数
public float thresh_ratio; //二值化系数
public float num_ratio; //二值化系数2
}
[StructLayout(LayoutKind.Sequential)]
public struct DATA_IMAGE
{
public IntPtr data;
public int width;
public int height;
public int channel;
}
[StructLayout(LayoutKind.Sequential)]
public struct DATA_IMAGE1
{
public int width;
public int height;
public int channel;
public IntPtr data;
}
// Marshal.Copy(bytes, 0, structPtr, size);
[StructLayout(LayoutKind.Sequential)]
public struct CTOOLS_Result
{
public int index; //类别
public float prob;
}
/// <summary>
/// TWB20210902
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct CLAS_PARAM
{
public float prob_cls; //通用瑕疵
public float prob_sma; //小瑕疵
public float prob_color; //色纤
public float prob_thin; //淡痕
public int len_sma; //小瑕疵长度限制阈值
public int cloths_kind; //布种 0:通用; 1:粗布.
public int m_gain; //增益返回值
public int m_base; //增益基准值
public int m_meters; //当前米数计数值
public int thre_are;//点状瑕疵面积
public int thre_location;//布尾米数位置阈值
}
[StructLayout(LayoutKind.Sequential)]
public struct TFD_PARAM
{
public int mode; //GPU_MODE or CPU_MODE
public int gpuid; //显卡号
public string protopath;
public string wigehtpath;
}
//[StructLayout(LayoutKind.Sequential)]
//public struct FinalResults
//{
// public int location; //纬向位置
// public int label; //瑕疵标号
// public int is_repeat; //是否一米内重复
// public int deduction; //扣分
// public int flaw_length; //(300 600 940)/4 75 150 270
// public int flaw_area; //400
//}
[StructLayout(LayoutKind.Sequential)]
public struct FinalResults
{
public int label; //瑕疵标号
public int location; //纬向位置
public int is_repeat; //是否一米内重复
public int is_valid; //连续性隐性瑕疵是否有效
public int deduction; //扣分
public int flaw_length; //(300 600 940)/4 75 150 270
public int flaw_area; //400
public int sub_num; //子区域数量
}
public struct D_PARAM
{
public int m_id;
public int index_shift; //布边偏移
public int edge_width; //布边宽度
public double mean_factor; //二值化系数
}
}
}