Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
AccAOI
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3324a83b
由
LN
编写于
2019-06-19 14:08:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
b28bbe41
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
71 行增加
和
19 行删除
AccAOI/AccAOI.csproj
AccAOI/FrmAoiSetting.Designer.cs
AccAOI/control/AoiBlobControl.Designer.cs
AccAOI/control/AoiBlobControl.cs
AccAOI/AccAOI.csproj
查看文件 @
3324a83
...
...
@@ -35,6 +35,21 @@
<Reference Include="Asa.Theme">
<HintPath>..\dll\Asa.Theme.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp.Blob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.Blob.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp.UserInterface">
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
...
...
AccAOI/FrmAoiSetting.Designer.cs
查看文件 @
3324a83
...
...
@@ -40,7 +40,7 @@ namespace AccAOI
this
.
btnGetCameraImg
=
new
Asa
.
Theme
.
FlatButton
();
this
.
comType
=
new
Asa
.
Theme
.
FlatCombo
();
this
.
panAoi
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
imageBox1
=
new
ImageBox
();
this
.
imageBox1
=
new
Cyotek
.
Windows
.
Forms
.
ImageBox
();
this
.
SuspendLayout
();
//
// aoiList
...
...
@@ -149,7 +149,7 @@ namespace AccAOI
//
this
.
panAoi
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
panAoi
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
4
)))),
((
int
)(((
byte
)(
4
)))),
((
int
)(((
byte
)(
4
)))));
this
.
panAoi
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
30
)))));
this
.
panAoi
.
Location
=
new
System
.
Drawing
.
Point
(
302
,
40
);
this
.
panAoi
.
Name
=
"panAoi"
;
this
.
panAoi
.
Size
=
new
System
.
Drawing
.
Size
(
317
,
592
);
...
...
@@ -160,7 +160,6 @@ namespace AccAOI
this
.
imageBox1
.
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.imageBox1.DragHandleSize = 9;
this
.
imageBox1
.
Location
=
new
System
.
Drawing
.
Point
(
625
,
40
);
this
.
imageBox1
.
Name
=
"imageBox1"
;
this
.
imageBox1
.
SelectionMode
=
Cyotek
.
Windows
.
Forms
.
ImageBoxSelectionMode
.
Rectangle
;
...
...
@@ -184,21 +183,9 @@ namespace AccAOI
this
.
Controls
.
Add
(
this
.
imageBox1
);
this
.
Controls
.
Add
(
this
.
aoiList
);
this
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
Minimized
=
true
;
this
.
Name
=
"FrmAoiSetting"
;
this
.
Text
=
"AOI"
;
this
.
Load
+=
new
System
.
EventHandler
(
this
.
FrmAoiSetting_Load
);
this
.
Controls
.
SetChildIndex
(
this
.
aoiList
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
imageBox1
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
btnOpenPro
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
btnSavePro
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
btnNewAoi
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
btnOpenImage
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
flatLabel1
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
cmbCameraList
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
btnGetCameraImg
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
comType
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
panAoi
,
0
);
this
.
ResumeLayout
(
false
);
}
...
...
AccAOI/control/AoiBlobControl.Designer.cs
查看文件 @
3324a83
...
...
@@ -41,6 +41,9 @@
this
.
txtmaxNum
=
new
Asa
.
Theme
.
FlatText
();
this
.
txtminNum
=
new
Asa
.
Theme
.
FlatText
();
this
.
flatLabel6
=
new
Asa
.
Theme
.
FlatLabel
();
this
.
btnUpdate
=
new
Asa
.
Theme
.
FlatButton
();
this
.
flatLabel7
=
new
Asa
.
Theme
.
FlatLabel
();
this
.
txtNumResult
=
new
Asa
.
Theme
.
FlatText
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
trackBarThresh
)).
BeginInit
();
this
.
SuspendLayout
();
//
...
...
@@ -180,11 +183,46 @@
this
.
flatLabel6
.
TabIndex
=
20
;
this
.
flatLabel6
.
Text
=
"数量判断:"
;
//
// btnUpdate
//
this
.
btnUpdate
.
ImageSize
=
new
System
.
Drawing
.
Size
(
0
,
0
);
this
.
btnUpdate
.
Inside
=
false
;
this
.
btnUpdate
.
Location
=
new
System
.
Drawing
.
Point
(
189
,
613
);
this
.
btnUpdate
.
Name
=
"btnUpdate"
;
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
.
TabIndex
=
41
;
this
.
btnUpdate
.
Text
=
"更新"
;
this
.
btnUpdate
.
Click
+=
new
System
.
EventHandler
(
this
.
btnUpdate_Click
);
//
// flatLabel7
//
this
.
flatLabel7
.
Inside
=
false
;
this
.
flatLabel7
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
613
);
this
.
flatLabel7
.
Name
=
"flatLabel7"
;
this
.
flatLabel7
.
Size
=
new
System
.
Drawing
.
Size
(
83
,
30
);
this
.
flatLabel7
.
TabIndex
=
43
;
this
.
flatLabel7
.
Text
=
"数量判断结果:"
;
//
// txtNumResult
//
this
.
txtNumResult
.
Enabled
=
false
;
this
.
txtNumResult
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
txtNumResult
.
Inside
=
false
;
this
.
txtNumResult
.
Location
=
new
System
.
Drawing
.
Point
(
98
,
613
);
this
.
txtNumResult
.
Name
=
"txtNumResult"
;
this
.
txtNumResult
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
txtNumResult
.
Size
=
new
System
.
Drawing
.
Size
(
74
,
30
);
this
.
txtNumResult
.
TabIndex
=
42
;
//
// AoiBlobControl
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
312
,
699
);
this
.
Controls
.
Add
(
this
.
flatLabel7
);
this
.
Controls
.
Add
(
this
.
txtNumResult
);
this
.
Controls
.
Add
(
this
.
btnUpdate
);
this
.
Controls
.
Add
(
this
.
flatLabel4
);
this
.
Controls
.
Add
(
this
.
txtmaxNum
);
this
.
Controls
.
Add
(
this
.
txtminNum
);
...
...
@@ -199,6 +237,7 @@
this
.
Controls
.
Add
(
this
.
trackBarThresh
);
this
.
Controls
.
Add
(
this
.
flatLabel1
);
this
.
Name
=
"AoiBlobControl"
;
this
.
Controls
.
SetChildIndex
(
this
.
aoiImage
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
panParam
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
panResult
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
flatLabel1
,
0
);
...
...
@@ -214,6 +253,9 @@
this
.
Controls
.
SetChildIndex
(
this
.
txtminNum
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
txtmaxNum
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
flatLabel4
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
btnUpdate
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
txtNumResult
,
0
);
this
.
Controls
.
SetChildIndex
(
this
.
flatLabel7
,
0
);
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
trackBarThresh
)).
EndInit
();
this
.
ResumeLayout
(
false
);
this
.
PerformLayout
();
...
...
@@ -235,5 +277,8 @@
private
Asa
.
Theme
.
FlatText
txtmaxNum
;
private
Asa
.
Theme
.
FlatText
txtminNum
;
private
Asa
.
Theme
.
FlatLabel
flatLabel6
;
private
Asa
.
Theme
.
FlatButton
btnUpdate
;
private
Asa
.
Theme
.
FlatLabel
flatLabel7
;
private
Asa
.
Theme
.
FlatText
txtNumResult
;
}
}
AccAOI/control/AoiBlobControl.cs
查看文件 @
3324a83
...
...
@@ -8,6 +8,7 @@ using System.Text;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
AOI
;
using
OpenCvSharp.Blob
;
namespace
AccAOI.control
{
...
...
@@ -77,12 +78,16 @@ namespace AccAOI.control
{
GetAoiInfo
();
Image
outImage
=
null
;
//
List<CvBlob> list = new List<CvBlob>();
//float blob = MethodBlob.GetBlobNum(BaseImage, out outImage,
out list);
//txtRate.Text = rate
.ToString();
List
<
CvBlob
>
list
=
new
List
<
CvBlob
>();
float
result
=
MethodBlob
.
GetBlobNum
(
BaseImage
,
out
outImage
,
out
list
);
txtNumResult
.
Text
=
result
.
ToString
();
this
.
aoiImage
.
Image
=
outImage
;
}
private
void
btnUpdate_Click
(
object
sender
,
EventArgs
e
)
{
UpdateImage
();
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论