Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
AccAOI
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 286377ea
由
SK
编写于
2019-06-20 09:28:00 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge branch 'master' of
https://gitee.com/sunky045/AccAOI
2 个父辈
c8488e39
1fad1fd0
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
107 行增加
和
14 行删除
AccAOI/FrmAoiSetting.cs
AccAOI/control/ABaseControl.Designer.cs
AccAOI/control/ABaseControl.cs
AccAOI/control/AoiBlobControl.Designer.cs
AccAOI/control/AoiBlobControl.cs
AccAOI/control/AoiRgbControl.Designer.cs
AccAOI/control/AoiRgbControl.cs
dll/Asa.Theme.dll
AccAOI/FrmAoiSetting.cs
查看文件 @
286377e
...
...
@@ -15,7 +15,7 @@ namespace AccAOI
public
partial
class
FrmAoiSetting
:
Asa
.
Theme
.
FlatForm
{
private
control
.
ABaseControl
aoiControl
=
null
;
p
rivate
Image
Img
=
null
;
p
ublic
Image
Img
=
null
;
private
AoiProject
Project
=
null
;
public
FrmAoiSetting
()
{
...
...
AccAOI/control/ABaseControl.Designer.cs
查看文件 @
286377e
此文件的差异被折叠,
点击展开。
AccAOI/control/ABaseControl.cs
查看文件 @
286377e
...
...
@@ -24,6 +24,15 @@ namespace AccAOI.control
get
{
return
panControl
.
Text
;
}
set
{
panControl
.
Text
=
value
;
}
}
public
Image
GetImg
()
{
if
(
this
.
Parent
!=
null
&&
this
.
Parent
is
FrmAoiSetting
)
{
return
((
FrmAoiSetting
)
this
.
Parent
).
Img
;
}
return
null
;
}
/// <summary>
/// 区域类型,1=矩形,2=圆形
/// </summary>
...
...
@@ -32,14 +41,23 @@ namespace AccAOI.control
/// 区域信息
/// </summary>
public
GraphicsPath
currPath
=
null
;
public
ImageBox
BImageBox
;
public
AoiMethod
AoiInfo
;
/// <summary>
/// 未处理的小图
/// </summary>
protected
Image
BaseImage
=
null
;
public
void
Set
Image
(
Image
image
)
public
void
Set
CurrPath
(
GraphicsPath
path
)
{
this
.
aoiImage
.
Image
=
image
;
BaseImage
=
image
;
this
.
currPath
=
path
;
UpdateImage
();
}
public
virtual
void
UpdateImage
()
{
}
public
virtual
void
ShowAoiInfo
()
{
...
...
AccAOI/control/AoiBlobControl.Designer.cs
查看文件 @
286377e
...
...
@@ -101,15 +101,16 @@
// chkwhiteOnBlack
//
this
.
chkwhiteOnBlack
.
Inside
=
false
;
this
.
chkwhiteOnBlack
.
Location
=
new
System
.
Drawing
.
Point
(
1
51
,
405
);
this
.
chkwhiteOnBlack
.
Location
=
new
System
.
Drawing
.
Point
(
1
25
,
419
);
this
.
chkwhiteOnBlack
.
Name
=
"chkwhiteOnBlack"
;
this
.
chkwhiteOnBlack
.
Size
=
new
System
.
Drawing
.
Size
(
62
,
30
);
this
.
chkwhiteOnBlack
.
TabIndex
=
15
;
this
.
chkwhiteOnBlack
.
CheckedChanged
+=
new
Asa
.
Theme
.
Event
.
ValueChanged
(
this
.
chkwhiteOnBlack_CheckedChanged
);
//
// flatLabel2
//
this
.
flatLabel2
.
Inside
=
false
;
this
.
flatLabel2
.
Location
=
new
System
.
Drawing
.
Point
(
1
4
,
405
);
this
.
flatLabel2
.
Location
=
new
System
.
Drawing
.
Point
(
1
2
,
419
);
this
.
flatLabel2
.
Name
=
"flatLabel2"
;
this
.
flatLabel2
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
30
);
this
.
flatLabel2
.
TabIndex
=
16
;
...
...
AccAOI/control/AoiBlobControl.cs
查看文件 @
286377e
...
...
@@ -23,6 +23,7 @@ namespace AccAOI.control
{
int
value
=
trackBarThresh
.
Value
;
lblthresh
.
Text
=
value
.
ToString
();
UpdateImage
();
}
private
AoiBlobMethod
MethodBlob
=
null
;
public
override
void
ShowAoiInfo
()
...
...
@@ -74,8 +75,12 @@ namespace AccAOI.control
}
return
AoiInfo
;
}
p
rivat
e
void
UpdateImage
()
p
ublic
overrid
e
void
UpdateImage
()
{
if
(
BaseImage
==
null
)
{
return
;
}
GetAoiInfo
();
Image
outImage
=
null
;
List
<
CvBlob
>
list
=
new
List
<
CvBlob
>();
...
...
@@ -89,5 +94,10 @@ namespace AccAOI.control
{
UpdateImage
();
}
private
void
chkwhiteOnBlack_CheckedChanged
(
object
sender
)
{
UpdateImage
();
}
}
}
AccAOI/control/AoiRgbControl.Designer.cs
查看文件 @
286377e
此文件的差异被折叠,
点击展开。
AccAOI/control/AoiRgbControl.cs
查看文件 @
286377e
...
...
@@ -8,6 +8,7 @@ using System.Text;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
AOI
;
using
Asa.Theme
;
namespace
AccAOI.control
{
...
...
@@ -23,12 +24,18 @@ namespace AccAOI.control
if
(
this
.
AoiInfo
is
AoiMethodRgb
)
{
methodRgb
=
(
AoiMethodRgb
)
AoiInfo
;
txtMinR
.
Text
=
methodRgb
.
minR
.
ToString
();
txtMaxR
.
Text
=
methodRgb
.
maxR
.
ToString
();
txtMinG
.
Text
=
methodRgb
.
minG
.
ToString
();
txtMaxG
.
Text
=
methodRgb
.
maxG
.
ToString
();
txtMaxB
.
Text
=
methodRgb
.
maxB
.
ToString
();
txtMinB
.
Text
=
methodRgb
.
minB
.
ToString
();
//txtMinR.Text = methodRgb.minR.ToString();
//txtMaxR.Text = methodRgb.maxR.ToString();
//txtMinG.Text = methodRgb.minG.ToString();
// txtMaxG.Text = methodRgb.maxG.ToString();
// txtMaxB.Text = methodRgb.maxB.ToString();
// txtMinB.Text = methodRgb.minB.ToString();
SetTbValue
(
tbMinR
,
methodRgb
.
minR
);
SetTbValue
(
tbMaxR
,
methodRgb
.
maxR
);
SetTbValue
(
tbMinG
,
methodRgb
.
minG
);
SetTbValue
(
tbMaxG
,
methodRgb
.
maxG
);
SetTbValue
(
tbMaxB
,
methodRgb
.
maxB
);
SetTbValue
(
tbMinB
,
methodRgb
.
minB
);
txtminRate
.
Text
=
methodRgb
.
minRate
.
ToString
();
txtmaxRate
.
Text
=
methodRgb
.
maxRate
.
ToString
();
}
...
...
@@ -46,6 +53,12 @@ namespace AccAOI.control
methodRgb
.
maxG
=
FormUtil
.
GetIntValue
(
txtMaxG
);
methodRgb
.
maxB
=
FormUtil
.
GetIntValue
(
txtMaxB
);
methodRgb
.
minB
=
FormUtil
.
GetIntValue
(
txtMinB
);
SetTbValue
(
tbMinR
,
methodRgb
.
minR
);
SetTbValue
(
tbMaxR
,
methodRgb
.
maxR
);
SetTbValue
(
tbMinG
,
methodRgb
.
minG
);
SetTbValue
(
tbMaxG
,
methodRgb
.
maxG
);
SetTbValue
(
tbMaxB
,
methodRgb
.
maxB
);
SetTbValue
(
tbMinB
,
methodRgb
.
minB
);
methodRgb
.
minRate
=
FormUtil
.
GetIntValue
(
txtminRate
);
methodRgb
.
maxRate
=
FormUtil
.
GetIntValue
(
txtmaxRate
);
if
(
currPath
!=
null
)
...
...
@@ -59,8 +72,12 @@ namespace AccAOI.control
p
rivat
e
void
UpdateImage
()
p
ublic
overrid
e
void
UpdateImage
()
{
if
(
BaseImage
==
null
)
{
return
;
}
GetAoiInfo
();
Image
cutImg
=
null
;
Image
dstCutImg
=
null
;
...
...
@@ -79,5 +96,52 @@ namespace AccAOI.control
{
UpdateImage
();
}
private
void
tbMinR_ValueChanged
(
object
sender
,
EventArgs
e
)
{
SetText
(
txtMinR
,
tbMinR
.
Value
);
}
private
void
tbMaxR_ValueChanged
(
object
sender
,
EventArgs
e
)
{
SetText
(
txtMaxR
,
tbMaxR
.
Value
);
}
private
void
tbMinG_ValueChanged
(
object
sender
,
EventArgs
e
)
{
SetText
(
txtMinG
,
tbMinG
.
Value
);
}
private
void
tbMaxG_ValueChanged
(
object
sender
,
EventArgs
e
)
{
SetText
(
txtMaxG
,
tbMaxG
.
Value
);
}
private
void
tbMinB_ValueChanged
(
object
sender
,
EventArgs
e
)
{
SetText
(
txtMinB
,
tbMinB
.
Value
);
}
private
void
tbMaxB_ValueChanged
(
object
sender
,
EventArgs
e
)
{
SetText
(
txtMaxB
,
tbMaxB
.
Value
);
}
private
void
SetText
(
FlatText
text
,
int
value
)
{
if
(
text
.
Text
.
ToString
().
Equals
(
value
.
ToString
()))
{
return
;
}
text
.
Text
=
value
.
ToString
();
}
private
void
SetTbValue
(
TrackBar
tb
,
int
value
)
{
if
(
tb
.
Value
.
Equals
(
value
.
ToString
()))
{
return
;
}
tb
.
Value
=
value
;
}
}
}
dll/Asa.Theme.dll
查看文件 @
286377e
此文件类型无法预览
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论