Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
AccAOI
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit aa6345ce
由
SK
编写于
2019-06-21 11:16:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
Mark点设置
1 个父辈
d4ca7d6b
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
78 行增加
和
5 行删除
AOI/mark/AoiMarkMethod.cs
AccAOI/control/AioMarkControl.Designer.cs
AOI/mark/AoiMarkMethod.cs
查看文件 @
aa6345c
...
@@ -20,10 +20,26 @@ namespace AOI
...
@@ -20,10 +20,26 @@ namespace AOI
/// </summary>
/// </summary>
public
GraphicsPath
SearchPath
;
public
GraphicsPath
SearchPath
;
/// <summary>
/// 根据Mark点校正相机获取的图片
/// </summary>
/// <param name="standardImage">标准图片</param>
/// <param name="imageToCheck">相机获取的图片</param>
/// <returns></returns>
public
override
ResultBean
Check
(
Image
standardImage
,
Image
imageToCheck
)
public
override
ResultBean
Check
(
Image
standardImage
,
Image
imageToCheck
)
{
{
ResultBean
resultBean
=
new
ResultBean
();
ResultBean
resultBean
=
new
ResultBean
();
resultBean
.
standardRoiImage
=
standardImage
;
resultBean
.
standardRoiImage
=
standardImage
;
Image
resultImage
=
FixImage
(
standardImage
,
imageToCheck
);
if
(
resultImage
!=
null
)
{
resultBean
.
result
=
true
;
}
return
resultBean
;
}
public
Image
FixImage
(
Image
standardImage
,
Image
imageToCheck
)
{
bool
needCut
=
false
;
bool
needCut
=
false
;
//标准图中的Mart区域
//标准图中的Mart区域
Image
markImage
=
GetRoiImage
(
standardImage
,
RoiPath
,
needCut
);
Image
markImage
=
GetRoiImage
(
standardImage
,
RoiPath
,
needCut
);
...
@@ -32,15 +48,14 @@ namespace AOI
...
@@ -32,15 +48,14 @@ namespace AOI
if
(
markImage
!=
null
&&
searchImage
!=
null
)
if
(
markImage
!=
null
&&
searchImage
!=
null
)
{
{
var
affine
=
GetAffineMat
(
markImage
,
searchImage
);
var
affine
=
GetAffineMat
(
markImage
,
searchImage
);
if
(
affine
!=
null
)
if
(
affine
!=
null
)
{
{
var
matToCheck
=
ImageUtil
.
ToMat
(
imageToCheck
);
var
matToCheck
=
ImageUtil
.
ToMat
(
imageToCheck
);
var
fixedMat
=
FixImage
(
affine
,
matToCheck
);
var
fixedMat
=
FixImage
(
affine
,
matToCheck
);
resultBean
.
result
=
true
;
return
ImageUtil
.
ToImage
(
fixedMat
);
resultBean
.
currentRoiImage
=
ImageUtil
.
ToImage
(
fixedMat
);
}
}
}
}
return
resultBean
;
return
null
;
}
}
/// <summary>
/// <summary>
...
...
AccAOI/control/AioMarkControl.Designer.cs
查看文件 @
aa6345c
...
@@ -28,12 +28,63 @@
...
@@ -28,12 +28,63 @@
/// </summary>
/// </summary>
private
void
InitializeComponent
()
private
void
InitializeComponent
()
{
{
this
.
flatLabel1
=
new
Asa
.
Theme
.
FlatLabel
();
this
.
flatTextSearch
=
new
Asa
.
Theme
.
FlatText
();
this
.
flatLabel2
=
new
Asa
.
Theme
.
FlatLabel
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
panParam
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
// panParam
//
this
.
panParam
.
Controls
.
Add
(
this
.
label1
);
this
.
panParam
.
Controls
.
Add
(
this
.
flatLabel2
);
this
.
panParam
.
Controls
.
Add
(
this
.
flatTextSearch
);
this
.
panParam
.
Controls
.
Add
(
this
.
flatLabel1
);
//
// panResult
// panResult
//
//
this
.
panResult
.
Size
=
new
System
.
Drawing
.
Size
(
298
,
197
);
this
.
panResult
.
Size
=
new
System
.
Drawing
.
Size
(
298
,
197
);
//
//
// flatLabel1
//
this
.
flatLabel1
.
Inside
=
false
;
this
.
flatLabel1
.
Location
=
new
System
.
Drawing
.
Point
(
9
,
33
);
this
.
flatLabel1
.
Name
=
"flatLabel1"
;
this
.
flatLabel1
.
Size
=
new
System
.
Drawing
.
Size
(
80
,
30
);
this
.
flatLabel1
.
TabIndex
=
0
;
this
.
flatLabel1
.
Text
=
"搜索区域:"
;
//
// flatTextSearch
//
this
.
flatTextSearch
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
9F
);
this
.
flatTextSearch
.
Inside
=
false
;
this
.
flatTextSearch
.
Location
=
new
System
.
Drawing
.
Point
(
170
,
33
);
this
.
flatTextSearch
.
Name
=
"flatTextSearch"
;
this
.
flatTextSearch
.
Size
=
new
System
.
Drawing
.
Size
(
95
,
30
);
this
.
flatTextSearch
.
TabIndex
=
1
;
this
.
flatTextSearch
.
Text
=
"2"
;
//
// flatLabel2
//
this
.
flatLabel2
.
Inside
=
false
;
this
.
flatLabel2
.
Location
=
new
System
.
Drawing
.
Point
(
104
,
33
);
this
.
flatLabel2
.
Name
=
"flatLabel2"
;
this
.
flatLabel2
.
Size
=
new
System
.
Drawing
.
Size
(
65
,
30
);
this
.
flatLabel2
.
TabIndex
=
2
;
this
.
flatLabel2
.
Text
=
"Mark区域x"
;
//
// label1
//
this
.
label1
.
AutoSize
=
true
;
this
.
label1
.
Font
=
new
System
.
Drawing
.
Font
(
"黑体"
,
18F
,
System
.
Drawing
.
FontStyle
.
Bold
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label1
.
ForeColor
=
System
.
Drawing
.
Color
.
Red
;
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
70
,
92
);
this
.
label1
.
Name
=
"label1"
;
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
162
,
24
);
this
.
label1
.
TabIndex
=
4
;
this
.
label1
.
Text
=
"Mark区域无效"
;
//
// AioMarkControl
// AioMarkControl
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
@@ -41,10 +92,17 @@
...
@@ -41,10 +92,17 @@
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
312
,
700
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
312
,
700
);
this
.
Name
=
"AioMarkControl"
;
this
.
Name
=
"AioMarkControl"
;
this
.
TitleName
=
"Mark设置"
;
this
.
TitleName
=
"Mark设置"
;
this
.
panParam
.
ResumeLayout
(
false
);
this
.
panParam
.
PerformLayout
();
this
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
}
}
#
endregion
#
endregion
private
Asa
.
Theme
.
FlatLabel
flatLabel2
;
private
Asa
.
Theme
.
FlatText
flatTextSearch
;
private
Asa
.
Theme
.
FlatLabel
flatLabel1
;
private
System
.
Windows
.
Forms
.
Label
label1
;
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论