Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
AccAOI
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0b7e7fc4
由
LN
编写于
2019-08-05 16:46:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
界面调整
1 个父辈
b63041d8
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
97 行增加
和
28 行删除
AOI/blob/AoiBlobMethod.cs
AOI/mark/AoiMarkMethod.cs
AOI/match/AoiTemplateMethod.cs
AccAOI/FrmAoiSetting.cs
AccAOI/control/AioMarkControl.Designer.cs
AccAOI/control/AioMarkControl.cs
AccAOI/control/AioTempMatchControl.Designer.cs
AccAOI/control/AioTempMatchControl.cs
AccAOI/control/AoiBlobControl.Designer.cs
AccAOI/control/AoiBlobControl.cs
AOI/blob/AoiBlobMethod.cs
查看文件 @
0b7e7fc
...
@@ -120,6 +120,7 @@ namespace AOI
...
@@ -120,6 +120,7 @@ namespace AOI
}
}
return
false
;
return
false
;
}).
ToList
();
}).
ToList
();
blobList
=
resultBlobs
;
return
resultBlobs
.
Count
;
return
resultBlobs
.
Count
;
}
}
}
}
...
...
AOI/mark/AoiMarkMethod.cs
查看文件 @
0b7e7fc
...
@@ -95,7 +95,7 @@ namespace AOI
...
@@ -95,7 +95,7 @@ namespace AOI
//double same = Cv2.MatchShapes(grayMarkMat, graySearchMat, ShapeMatchModes.I1);
//double same = Cv2.MatchShapes(grayMarkMat, graySearchMat, ShapeMatchModes.I1);
//Console.WriteLine("===============" + same);
//Console.WriteLine("===============" + same);
Mat
result
=
new
Mat
(
searchMat
.
Cols
-
markMat
.
Cols
+
1
,
searchMat
.
Rows
-
markMat
.
Col
s
+
1
,
MatType
.
CV_32FC1
);
Mat
result
=
new
Mat
(
searchMat
.
Cols
-
markMat
.
Cols
+
1
,
searchMat
.
Rows
-
markMat
.
Row
s
+
1
,
MatType
.
CV_32FC1
);
//进行匹配(1母图,2模版子图,3返回的result,4匹配模式_这里的算法比opencv少,具体可以看opencv的相关资料说明)
//进行匹配(1母图,2模版子图,3返回的result,4匹配模式_这里的算法比opencv少,具体可以看opencv的相关资料说明)
Cv2
.
MatchTemplate
(
searchMat
,
markMat
,
result
,
TemplateMatchModes
.
CCoeffNormed
);
Cv2
.
MatchTemplate
(
searchMat
,
markMat
,
result
,
TemplateMatchModes
.
CCoeffNormed
);
...
...
AOI/match/AoiTemplateMethod.cs
查看文件 @
0b7e7fc
...
@@ -58,13 +58,15 @@ namespace AOI
...
@@ -58,13 +58,15 @@ namespace AOI
//搜索区域
//搜索区域
Image
searchImage
=
GetRoiImage
(
imageToCheck
,
RoiPath
,
needCut
);
Image
searchImage
=
GetRoiImage
(
imageToCheck
,
RoiPath
,
needCut
);
cutImg
=
searchImage
;
cutImg
=
searchImage
;
try
{
//searchImage = imageToCheck;
//searchImage = imageToCheck;
if
(
templateImage
!=
null
&&
searchImage
!=
null
)
if
(
templateImage
!=
null
&&
searchImage
!=
null
)
{
{
Mat
searchMat
=
ImageUtil
.
ToMat
(
new
Bitmap
(
searchImage
));
Mat
searchMat
=
ImageUtil
.
ToMat
(
new
Bitmap
(
searchImage
));
Mat
templateMat
=
ImageUtil
.
ToMat
(
new
Bitmap
(
templateImage
));
Mat
templateMat
=
ImageUtil
.
ToMat
(
new
Bitmap
(
templateImage
));
Mat
result
=
new
Mat
(
searchMat
.
Cols
-
templateMat
.
Cols
+
1
,
searchMat
.
Rows
-
templateMat
.
Col
s
+
1
,
MatType
.
CV_32FC1
);
Mat
result
=
new
Mat
(
searchMat
.
Cols
-
templateMat
.
Cols
+
1
,
searchMat
.
Rows
-
templateMat
.
Row
s
+
1
,
MatType
.
CV_32FC1
);
//进行匹配(1母图,2模版子图,3返回的result,4匹配模式_这里的算法比opencv少,具体可以看opencv的相关资料说明)
//进行匹配(1母图,2模版子图,3返回的result,4匹配模式_这里的算法比opencv少,具体可以看opencv的相关资料说明)
Cv2
.
MatchTemplate
(
searchMat
,
templateMat
,
result
,
TemplateMatchModes
.
CCoeffNormed
);
Cv2
.
MatchTemplate
(
searchMat
,
templateMat
,
result
,
TemplateMatchModes
.
CCoeffNormed
);
...
@@ -77,6 +79,10 @@ namespace AOI
...
@@ -77,6 +79,10 @@ namespace AOI
Cv2
.
MinMaxLoc
(
result
,
out
double
minVal
,
out
double
maxVal
,
out
OpenCvSharp
.
Point
minLocation
,
out
OpenCvSharp
.
Point
maxLocation
);
Cv2
.
MinMaxLoc
(
result
,
out
double
minVal
,
out
double
maxVal
,
out
OpenCvSharp
.
Point
minLocation
,
out
OpenCvSharp
.
Point
maxLocation
);
return
maxVal
*
100
;
return
maxVal
*
100
;
}
}
}
catch
(
Exception
ex
)
{
Console
.
Write
(
ex
.
ToString
());
}
return
0
;
return
0
;
}
}
}
}
...
...
AccAOI/FrmAoiSetting.cs
查看文件 @
0b7e7fc
...
@@ -224,6 +224,10 @@ namespace AccAOI
...
@@ -224,6 +224,10 @@ namespace AccAOI
Project
.
methodMap
.
Add
(
methodInfo
.
MethodName
,
methodInfo
);
Project
.
methodMap
.
Add
(
methodInfo
.
MethodName
,
methodInfo
);
ShowAoi
(
methodInfo
);
ShowAoi
(
methodInfo
);
aoiList
.
ItemAdd
(
aoiControl
.
TitleName
);
aoiList
.
ItemAdd
(
aoiControl
.
TitleName
);
if
(
imageBox1
.
Visible
.
Equals
(
false
))
{
btnImageChange_Click
(
null
,
null
);
}
}
}
private
void
ShowAoi
(
AoiMethod
method
)
private
void
ShowAoi
(
AoiMethod
method
)
{
{
...
@@ -310,6 +314,10 @@ namespace AccAOI
...
@@ -310,6 +314,10 @@ namespace AccAOI
}
}
}
}
}
}
if
(
imageBox1
.
Visible
.
Equals
(
false
))
{
btnImageChange_Click
(
null
,
null
);
}
}
}
}
}
...
@@ -332,6 +340,10 @@ namespace AccAOI
...
@@ -332,6 +340,10 @@ namespace AccAOI
ShowAoi
(
method
);
ShowAoi
(
method
);
}
}
}
}
if
(
imageBox1
.
Visible
.
Equals
(
false
))
{
btnImageChange_Click
(
null
,
null
);
}
}
}
}
}
...
...
AccAOI/control/AioMarkControl.Designer.cs
查看文件 @
0b7e7fc
...
@@ -60,7 +60,6 @@
...
@@ -60,7 +60,6 @@
this
.
panResult
.
Controls
.
Add
(
this
.
btnOpenImage
);
this
.
panResult
.
Controls
.
Add
(
this
.
btnOpenImage
);
this
.
panResult
.
Controls
.
Add
(
this
.
btnTest
);
this
.
panResult
.
Controls
.
Add
(
this
.
btnTest
);
this
.
panResult
.
Controls
.
Add
(
this
.
lblResult
);
this
.
panResult
.
Controls
.
Add
(
this
.
lblResult
);
this
.
panResult
.
Size
=
new
System
.
Drawing
.
Size
(
298
,
197
);
//
//
// flatLabel1
// flatLabel1
//
//
...
@@ -184,7 +183,7 @@
...
@@ -184,7 +183,7 @@
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
312
,
700
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
312
,
833
);
this
.
Name
=
"AioMarkControl"
;
this
.
Name
=
"AioMarkControl"
;
this
.
TitleName
=
"Mark设置"
;
this
.
TitleName
=
"Mark设置"
;
this
.
panParam
.
ResumeLayout
(
false
);
this
.
panParam
.
ResumeLayout
(
false
);
...
...
AccAOI/control/AioMarkControl.cs
查看文件 @
0b7e7fc
...
@@ -41,7 +41,18 @@ namespace AccAOI.control
...
@@ -41,7 +41,18 @@ namespace AccAOI.control
}
}
return
AoiInfo
;
return
AoiInfo
;
}
}
public
override
void
ShowAoiInfo
()
{
if
(
this
.
AoiInfo
is
AoiMarkMethod
)
{
AoiMarkMethod
method
=
(
AoiMarkMethod
)
AoiInfo
;
trackBarSamePercent
.
Value
=
(
int
)
method
.
SamePercent
;
IsShowOk
=
true
;
UpdateImage
();
}
}
private
void
btnTest_Click
(
object
sender
,
EventArgs
e
)
private
void
btnTest_Click
(
object
sender
,
EventArgs
e
)
{
{
if
(
this
.
AoiInfo
is
AoiMarkMethod
)
if
(
this
.
AoiInfo
is
AoiMarkMethod
)
...
...
AccAOI/control/AioTempMatchControl.Designer.cs
查看文件 @
0b7e7fc
...
@@ -54,7 +54,6 @@
...
@@ -54,7 +54,6 @@
this
.
panResult
.
Controls
.
Add
(
this
.
btnOpenImage
);
this
.
panResult
.
Controls
.
Add
(
this
.
btnOpenImage
);
this
.
panResult
.
Controls
.
Add
(
this
.
btnTest
);
this
.
panResult
.
Controls
.
Add
(
this
.
btnTest
);
this
.
panResult
.
Controls
.
Add
(
this
.
lblResult
);
this
.
panResult
.
Controls
.
Add
(
this
.
lblResult
);
this
.
panResult
.
Size
=
new
System
.
Drawing
.
Size
(
298
,
197
);
//
//
// lblResult
// lblResult
//
//
...
@@ -145,12 +144,12 @@
...
@@ -145,12 +144,12 @@
this
.
txtSamePercent
.
Text
=
"50"
;
this
.
txtSamePercent
.
Text
=
"50"
;
this
.
txtSamePercent
.
TextChanged
+=
new
System
.
EventHandler
(
this
.
txtSamePercent_TextChanged
);
this
.
txtSamePercent
.
TextChanged
+=
new
System
.
EventHandler
(
this
.
txtSamePercent_TextChanged
);
//
//
// AioMatchControl
// Aio
Temp
MatchControl
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
312
,
700
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
312
,
833
);
this
.
Name
=
"AioMatchControl"
;
this
.
Name
=
"Aio
Temp
MatchControl"
;
this
.
TitleName
=
"模板匹配"
;
this
.
TitleName
=
"模板匹配"
;
this
.
panParam
.
ResumeLayout
(
false
);
this
.
panParam
.
ResumeLayout
(
false
);
this
.
panParam
.
PerformLayout
();
this
.
panParam
.
PerformLayout
();
...
...
AccAOI/control/AioTempMatchControl.cs
查看文件 @
0b7e7fc
...
@@ -40,7 +40,18 @@ namespace AccAOI.control
...
@@ -40,7 +40,18 @@ namespace AccAOI.control
}
}
return
AoiInfo
;
return
AoiInfo
;
}
}
public
override
void
ShowAoiInfo
()
{
if
(
this
.
AoiInfo
is
AoiTemplateMethod
)
{
AoiTemplateMethod
method
=
(
AoiTemplateMethod
)
AoiInfo
;
trackBarSamePercent
.
Value
=
(
int
)
method
.
SamePercent
;
IsShowOk
=
true
;
UpdateImage
();
}
}
private
void
btnTest_Click
(
object
sender
,
EventArgs
e
)
private
void
btnTest_Click
(
object
sender
,
EventArgs
e
)
{
{
if
(
this
.
AoiInfo
is
AoiTemplateMethod
)
if
(
this
.
AoiInfo
is
AoiTemplateMethod
)
...
...
AccAOI/control/AoiBlobControl.Designer.cs
查看文件 @
0b7e7fc
...
@@ -44,23 +44,26 @@
...
@@ -44,23 +44,26 @@
this
.
btnUpdate
=
new
Asa
.
Theme
.
FlatButton
();
this
.
btnUpdate
=
new
Asa
.
Theme
.
FlatButton
();
this
.
flatLabel7
=
new
Asa
.
Theme
.
FlatLabel
();
this
.
flatLabel7
=
new
Asa
.
Theme
.
FlatLabel
();
this
.
txtNumResult
=
new
Asa
.
Theme
.
FlatText
();
this
.
txtNumResult
=
new
Asa
.
Theme
.
FlatText
();
this
.
lblList
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
panResult
.
SuspendLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
trackBarThresh
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
trackBarThresh
)).
BeginInit
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
// panParam
// panParam
//
//
this
.
panParam
.
Location
=
new
System
.
Drawing
.
Point
(
2
,
319
);
this
.
panParam
.
Location
=
new
System
.
Drawing
.
Point
(
2
,
319
);
this
.
panParam
.
Size
=
new
System
.
Drawing
.
Size
(
302
,
1
46
);
this
.
panParam
.
Size
=
new
System
.
Drawing
.
Size
(
302
,
1
28
);
//
//
// panResult
// panResult
//
//
this
.
panResult
.
Location
=
new
System
.
Drawing
.
Point
(
2
,
471
);
this
.
panResult
.
Controls
.
Add
(
this
.
lblList
);
this
.
panResult
.
Size
=
new
System
.
Drawing
.
Size
(
302
,
216
);
this
.
panResult
.
Location
=
new
System
.
Drawing
.
Point
(
2
,
450
);
this
.
panResult
.
Size
=
new
System
.
Drawing
.
Size
(
302
,
370
);
//
//
// flatLabel1
// flatLabel1
//
//
this
.
flatLabel1
.
Inside
=
false
;
this
.
flatLabel1
.
Inside
=
false
;
this
.
flatLabel1
.
Location
=
new
System
.
Drawing
.
Point
(
14
,
35
8
);
this
.
flatLabel1
.
Location
=
new
System
.
Drawing
.
Point
(
14
,
35
0
);
this
.
flatLabel1
.
Name
=
"flatLabel1"
;
this
.
flatLabel1
.
Name
=
"flatLabel1"
;
this
.
flatLabel1
.
Size
=
new
System
.
Drawing
.
Size
(
42
,
30
);
this
.
flatLabel1
.
Size
=
new
System
.
Drawing
.
Size
(
42
,
30
);
this
.
flatLabel1
.
TabIndex
=
8
;
this
.
flatLabel1
.
TabIndex
=
8
;
...
@@ -70,7 +73,7 @@
...
@@ -70,7 +73,7 @@
// trackBarThresh
// trackBarThresh
//
//
this
.
trackBarThresh
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))));
this
.
trackBarThresh
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))));
this
.
trackBarThresh
.
Location
=
new
System
.
Drawing
.
Point
(
63
,
3
64
);
this
.
trackBarThresh
.
Location
=
new
System
.
Drawing
.
Point
(
63
,
3
56
);
this
.
trackBarThresh
.
Maximum
=
255
;
this
.
trackBarThresh
.
Maximum
=
255
;
this
.
trackBarThresh
.
Minimum
=
-
1
;
this
.
trackBarThresh
.
Minimum
=
-
1
;
this
.
trackBarThresh
.
Name
=
"trackBarThresh"
;
this
.
trackBarThresh
.
Name
=
"trackBarThresh"
;
...
@@ -83,7 +86,7 @@
...
@@ -83,7 +86,7 @@
// lblthresh
// lblthresh
//
//
this
.
lblthresh
.
Inside
=
false
;
this
.
lblthresh
.
Inside
=
false
;
this
.
lblthresh
.
Location
=
new
System
.
Drawing
.
Point
(
265
,
35
8
);
this
.
lblthresh
.
Location
=
new
System
.
Drawing
.
Point
(
265
,
35
0
);
this
.
lblthresh
.
Name
=
"lblthresh"
;
this
.
lblthresh
.
Name
=
"lblthresh"
;
this
.
lblthresh
.
Size
=
new
System
.
Drawing
.
Size
(
30
,
30
);
this
.
lblthresh
.
Size
=
new
System
.
Drawing
.
Size
(
30
,
30
);
this
.
lblthresh
.
TabIndex
=
10
;
this
.
lblthresh
.
TabIndex
=
10
;
...
@@ -92,7 +95,7 @@
...
@@ -92,7 +95,7 @@
// flatLabel3
// flatLabel3
//
//
this
.
flatLabel3
.
Inside
=
false
;
this
.
flatLabel3
.
Inside
=
false
;
this
.
flatLabel3
.
Location
=
new
System
.
Drawing
.
Point
(
14
,
508
);
this
.
flatLabel3
.
Location
=
new
System
.
Drawing
.
Point
(
14
,
484
);
this
.
flatLabel3
.
Name
=
"flatLabel3"
;
this
.
flatLabel3
.
Name
=
"flatLabel3"
;
this
.
flatLabel3
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
30
);
this
.
flatLabel3
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
30
);
this
.
flatLabel3
.
TabIndex
=
13
;
this
.
flatLabel3
.
TabIndex
=
13
;
...
@@ -101,7 +104,7 @@
...
@@ -101,7 +104,7 @@
// chkwhiteOnBlack
// chkwhiteOnBlack
//
//
this
.
chkwhiteOnBlack
.
Inside
=
false
;
this
.
chkwhiteOnBlack
.
Inside
=
false
;
this
.
chkwhiteOnBlack
.
Location
=
new
System
.
Drawing
.
Point
(
125
,
4
19
);
this
.
chkwhiteOnBlack
.
Location
=
new
System
.
Drawing
.
Point
(
125
,
4
05
);
this
.
chkwhiteOnBlack
.
Name
=
"chkwhiteOnBlack"
;
this
.
chkwhiteOnBlack
.
Name
=
"chkwhiteOnBlack"
;
this
.
chkwhiteOnBlack
.
Size
=
new
System
.
Drawing
.
Size
(
62
,
30
);
this
.
chkwhiteOnBlack
.
Size
=
new
System
.
Drawing
.
Size
(
62
,
30
);
this
.
chkwhiteOnBlack
.
TabIndex
=
15
;
this
.
chkwhiteOnBlack
.
TabIndex
=
15
;
...
@@ -110,7 +113,7 @@
...
@@ -110,7 +113,7 @@
// flatLabel2
// flatLabel2
//
//
this
.
flatLabel2
.
Inside
=
false
;
this
.
flatLabel2
.
Inside
=
false
;
this
.
flatLabel2
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
4
19
);
this
.
flatLabel2
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
4
05
);
this
.
flatLabel2
.
Name
=
"flatLabel2"
;
this
.
flatLabel2
.
Name
=
"flatLabel2"
;
this
.
flatLabel2
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
30
);
this
.
flatLabel2
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
30
);
this
.
flatLabel2
.
TabIndex
=
16
;
this
.
flatLabel2
.
TabIndex
=
16
;
...
@@ -121,7 +124,7 @@
...
@@ -121,7 +124,7 @@
//
//
this
.
txtminArea
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
txtminArea
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
txtminArea
.
Inside
=
false
;
this
.
txtminArea
.
Inside
=
false
;
this
.
txtminArea
.
Location
=
new
System
.
Drawing
.
Point
(
98
,
508
);
this
.
txtminArea
.
Location
=
new
System
.
Drawing
.
Point
(
98
,
484
);
this
.
txtminArea
.
Name
=
"txtminArea"
;
this
.
txtminArea
.
Name
=
"txtminArea"
;
this
.
txtminArea
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
txtminArea
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
txtminArea
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
30
);
this
.
txtminArea
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
30
);
...
@@ -132,7 +135,7 @@
...
@@ -132,7 +135,7 @@
//
//
this
.
txtmaxArea
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
txtmaxArea
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
txtmaxArea
.
Inside
=
false
;
this
.
txtmaxArea
.
Inside
=
false
;
this
.
txtmaxArea
.
Location
=
new
System
.
Drawing
.
Point
(
205
,
508
);
this
.
txtmaxArea
.
Location
=
new
System
.
Drawing
.
Point
(
205
,
484
);
this
.
txtmaxArea
.
Name
=
"txtmaxArea"
;
this
.
txtmaxArea
.
Name
=
"txtmaxArea"
;
this
.
txtmaxArea
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
txtmaxArea
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
txtmaxArea
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
30
);
this
.
txtmaxArea
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
30
);
...
@@ -142,7 +145,7 @@
...
@@ -142,7 +145,7 @@
// flatLabel5
// flatLabel5
//
//
this
.
flatLabel5
.
Inside
=
false
;
this
.
flatLabel5
.
Inside
=
false
;
this
.
flatLabel5
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
514
);
this
.
flatLabel5
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
490
);
this
.
flatLabel5
.
Name
=
"flatLabel5"
;
this
.
flatLabel5
.
Name
=
"flatLabel5"
;
this
.
flatLabel5
.
Size
=
new
System
.
Drawing
.
Size
(
24
,
25
);
this
.
flatLabel5
.
Size
=
new
System
.
Drawing
.
Size
(
24
,
25
);
this
.
flatLabel5
.
TabIndex
=
19
;
this
.
flatLabel5
.
TabIndex
=
19
;
...
@@ -151,7 +154,7 @@
...
@@ -151,7 +154,7 @@
// flatLabel4
// flatLabel4
//
//
this
.
flatLabel4
.
Inside
=
false
;
this
.
flatLabel4
.
Inside
=
false
;
this
.
flatLabel4
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
5
57
);
this
.
flatLabel4
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
5
26
);
this
.
flatLabel4
.
Name
=
"flatLabel4"
;
this
.
flatLabel4
.
Name
=
"flatLabel4"
;
this
.
flatLabel4
.
Size
=
new
System
.
Drawing
.
Size
(
24
,
39
);
this
.
flatLabel4
.
Size
=
new
System
.
Drawing
.
Size
(
24
,
39
);
this
.
flatLabel4
.
TabIndex
=
23
;
this
.
flatLabel4
.
TabIndex
=
23
;
...
@@ -161,7 +164,7 @@
...
@@ -161,7 +164,7 @@
//
//
this
.
txtmaxNum
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
txtmaxNum
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
txtmaxNum
.
Inside
=
false
;
this
.
txtmaxNum
.
Inside
=
false
;
this
.
txtmaxNum
.
Location
=
new
System
.
Drawing
.
Point
(
205
,
5
57
);
this
.
txtmaxNum
.
Location
=
new
System
.
Drawing
.
Point
(
205
,
5
26
);
this
.
txtmaxNum
.
Name
=
"txtmaxNum"
;
this
.
txtmaxNum
.
Name
=
"txtmaxNum"
;
this
.
txtmaxNum
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
txtmaxNum
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
txtmaxNum
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
30
);
this
.
txtmaxNum
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
30
);
...
@@ -172,7 +175,7 @@
...
@@ -172,7 +175,7 @@
//
//
this
.
txtminNum
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
txtminNum
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
txtminNum
.
Inside
=
false
;
this
.
txtminNum
.
Inside
=
false
;
this
.
txtminNum
.
Location
=
new
System
.
Drawing
.
Point
(
98
,
5
57
);
this
.
txtminNum
.
Location
=
new
System
.
Drawing
.
Point
(
98
,
5
26
);
this
.
txtminNum
.
Name
=
"txtminNum"
;
this
.
txtminNum
.
Name
=
"txtminNum"
;
this
.
txtminNum
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
txtminNum
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
txtminNum
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
30
);
this
.
txtminNum
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
30
);
...
@@ -182,7 +185,7 @@
...
@@ -182,7 +185,7 @@
// flatLabel6
// flatLabel6
//
//
this
.
flatLabel6
.
Inside
=
false
;
this
.
flatLabel6
.
Inside
=
false
;
this
.
flatLabel6
.
Location
=
new
System
.
Drawing
.
Point
(
14
,
5
57
);
this
.
flatLabel6
.
Location
=
new
System
.
Drawing
.
Point
(
14
,
5
26
);
this
.
flatLabel6
.
Name
=
"flatLabel6"
;
this
.
flatLabel6
.
Name
=
"flatLabel6"
;
this
.
flatLabel6
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
30
);
this
.
flatLabel6
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
30
);
this
.
flatLabel6
.
TabIndex
=
20
;
this
.
flatLabel6
.
TabIndex
=
20
;
...
@@ -192,7 +195,7 @@
...
@@ -192,7 +195,7 @@
//
//
this
.
btnUpdate
.
ImageSize
=
new
System
.
Drawing
.
Size
(
0
,
0
);
this
.
btnUpdate
.
ImageSize
=
new
System
.
Drawing
.
Size
(
0
,
0
);
this
.
btnUpdate
.
Inside
=
false
;
this
.
btnUpdate
.
Inside
=
false
;
this
.
btnUpdate
.
Location
=
new
System
.
Drawing
.
Point
(
189
,
613
);
this
.
btnUpdate
.
Location
=
new
System
.
Drawing
.
Point
(
189
,
571
);
this
.
btnUpdate
.
Name
=
"btnUpdate"
;
this
.
btnUpdate
.
Name
=
"btnUpdate"
;
this
.
btnUpdate
.
Size
=
new
System
.
Drawing
.
Size
(
90
,
30
);
this
.
btnUpdate
.
Size
=
new
System
.
Drawing
.
Size
(
90
,
30
);
this
.
btnUpdate
.
StateColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))));
this
.
btnUpdate
.
StateColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))));
...
@@ -203,7 +206,7 @@
...
@@ -203,7 +206,7 @@
// flatLabel7
// flatLabel7
//
//
this
.
flatLabel7
.
Inside
=
false
;
this
.
flatLabel7
.
Inside
=
false
;
this
.
flatLabel7
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
613
);
this
.
flatLabel7
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
571
);
this
.
flatLabel7
.
Name
=
"flatLabel7"
;
this
.
flatLabel7
.
Name
=
"flatLabel7"
;
this
.
flatLabel7
.
Size
=
new
System
.
Drawing
.
Size
(
83
,
30
);
this
.
flatLabel7
.
Size
=
new
System
.
Drawing
.
Size
(
83
,
30
);
this
.
flatLabel7
.
TabIndex
=
43
;
this
.
flatLabel7
.
TabIndex
=
43
;
...
@@ -214,17 +217,30 @@
...
@@ -214,17 +217,30 @@
this
.
txtNumResult
.
Enabled
=
false
;
this
.
txtNumResult
.
Enabled
=
false
;
this
.
txtNumResult
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
txtNumResult
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
txtNumResult
.
Inside
=
false
;
this
.
txtNumResult
.
Inside
=
false
;
this
.
txtNumResult
.
Location
=
new
System
.
Drawing
.
Point
(
98
,
613
);
this
.
txtNumResult
.
Location
=
new
System
.
Drawing
.
Point
(
98
,
571
);
this
.
txtNumResult
.
Name
=
"txtNumResult"
;
this
.
txtNumResult
.
Name
=
"txtNumResult"
;
this
.
txtNumResult
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
txtNumResult
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
txtNumResult
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
30
);
this
.
txtNumResult
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
30
);
this
.
txtNumResult
.
TabIndex
=
42
;
this
.
txtNumResult
.
TabIndex
=
42
;
//
//
// lblList
//
this
.
lblList
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
lblList
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
this
.
lblList
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
lblList
.
Location
=
new
System
.
Drawing
.
Point
(
14
,
168
);
this
.
lblList
.
Name
=
"lblList"
;
this
.
lblList
.
Size
=
new
System
.
Drawing
.
Size
(
269
,
191
);
this
.
lblList
.
TabIndex
=
0
;
this
.
lblList
.
Text
=
"面积列表:"
;
//
// AoiBlobControl
// AoiBlobControl
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
312
,
699
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
312
,
833
);
this
.
Controls
.
Add
(
this
.
flatLabel7
);
this
.
Controls
.
Add
(
this
.
flatLabel7
);
this
.
Controls
.
Add
(
this
.
txtNumResult
);
this
.
Controls
.
Add
(
this
.
txtNumResult
);
this
.
Controls
.
Add
(
this
.
btnUpdate
);
this
.
Controls
.
Add
(
this
.
btnUpdate
);
...
@@ -261,6 +277,7 @@
...
@@ -261,6 +277,7 @@
this
.
Controls
.
SetChildIndex
(
this
.
btnUpdate
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
btnUpdate
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
txtNumResult
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
txtNumResult
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
flatLabel7
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
flatLabel7
,
0
);
this
.
panResult
.
ResumeLayout
(
false
);
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
trackBarThresh
)).
EndInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
trackBarThresh
)).
EndInit
();
this
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
this
.
PerformLayout
();
this
.
PerformLayout
();
...
@@ -285,5 +302,6 @@
...
@@ -285,5 +302,6 @@
private
Asa
.
Theme
.
FlatButton
btnUpdate
;
private
Asa
.
Theme
.
FlatButton
btnUpdate
;
private
Asa
.
Theme
.
FlatLabel
flatLabel7
;
private
Asa
.
Theme
.
FlatLabel
flatLabel7
;
private
Asa
.
Theme
.
FlatText
txtNumResult
;
private
Asa
.
Theme
.
FlatText
txtNumResult
;
private
System
.
Windows
.
Forms
.
Label
lblList
;
}
}
}
}
AccAOI/control/AoiBlobControl.cs
查看文件 @
0b7e7fc
...
@@ -89,6 +89,7 @@ namespace AccAOI.control
...
@@ -89,6 +89,7 @@ namespace AccAOI.control
{
{
try
try
{
{
lblList
.
Text
=
"面积列表:"
;
Image
BaseImage
=
GetImg
();
Image
BaseImage
=
GetImg
();
if
(
BaseImage
==
null
||
currPath
==
null
)
if
(
BaseImage
==
null
||
currPath
==
null
)
{
{
...
@@ -112,6 +113,17 @@ namespace AccAOI.control
...
@@ -112,6 +113,17 @@ namespace AccAOI.control
this
.
CutImage
=
cutImage
;
this
.
CutImage
=
cutImage
;
}
}
}
}
list
=
(
from
m
in
list
orderby
m
.
Area
descending
select
m
).
ToList
<
CvBlob
>
();
string
text
=
"编号"
.
PadLeft
(
5
,
' '
)
+
"面积↓"
.
PadLeft
(
8
,
' '
)
+
"X坐标"
.
PadLeft
(
10
,
' '
)
+
"Y坐标"
.
PadLeft
(
10
,
' '
);
int
index
=
1
;
foreach
(
CvBlob
cv
in
list
)
{
text
+=
"\r\n"
+
index
.
ToString
().
PadLeft
(
5
,
' '
)+
cv
.
Area
.
ToString
().
PadLeft
(
12
,
' '
)+
Math
.
Round
(
cv
.
Centroid
.
X
,
2
).
ToString
().
PadLeft
(
12
,
' '
)
+
Math
.
Round
(
cv
.
Centroid
.
Y
,
2
).
ToString
().
PadLeft
(
12
,
' '
);
index
++;
}
lblList
.
Text
=
text
;
GC
.
Collect
();
GC
.
Collect
();
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论