Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ReelCounter
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 60a3f895
由
cuiya
编写于
2019-03-14 23:25:24 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
optimize
1 个父辈
86c5ac4c
全部展开
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
23 行增加
和
24 行删除
AccImage/ImageUtil.cs
Demo/MainForm.cs
Demo/MainForm.designer.cs
AccImage/ImageUtil.cs
查看文件 @
60a3f89
此文件的差异被折叠,
点击展开。
Demo/MainForm.cs
查看文件 @
60a3f89
...
@@ -119,6 +119,11 @@ namespace Acc.Demo
...
@@ -119,6 +119,11 @@ namespace Acc.Demo
sw
.
Start
();
sw
.
Start
();
int
itemFeature
=
int
.
Parse
(
textBoxFeature
.
Text
);
int
itemFeature
=
int
.
Parse
(
textBoxFeature
.
Text
);
Image
image
=
orginalImage
;
Image
image
=
orginalImage
;
if
(!
ImageUtil
.
selectB
)
{
itemFeature
=
ImageUtil
.
GetItemFeatureAuto
(
image
,
markX
,
markY
,
theshValue
);
}
ImageUtil
.
selectB
=
false
;
int
count
=
ImageUtil
.
CountItems
(
ref
image
,
itemFeature
,
theshValue
);
int
count
=
ImageUtil
.
CountItems
(
ref
image
,
itemFeature
,
theshValue
);
sw
.
Stop
();
sw
.
Stop
();
labelTime
.
Text
=
"耗时:"
+
sw
.
ElapsedMilliseconds
+
" ms"
;
labelTime
.
Text
=
"耗时:"
+
sw
.
ElapsedMilliseconds
+
" ms"
;
...
@@ -152,6 +157,7 @@ namespace Acc.Demo
...
@@ -152,6 +157,7 @@ namespace Acc.Demo
{
{
theshValue
=
int
.
Parse
(
textBoxThesh
.
Text
);
theshValue
=
int
.
Parse
(
textBoxThesh
.
Text
);
}
}
ImageUtil
.
selectB
=
true
;
int
feature
=
ImageUtil
.
GetItemFeature
(
orginalImage
,
markX
,
markY
,
theshValue
);
int
feature
=
ImageUtil
.
GetItemFeature
(
orginalImage
,
markX
,
markY
,
theshValue
);
labelFeature
.
Text
=
"特征值:"
+
feature
+
""
;
labelFeature
.
Text
=
"特征值:"
+
feature
+
""
;
textBoxFeature
.
Text
=
feature
+
""
;
textBoxFeature
.
Text
=
feature
+
""
;
...
...
Demo/MainForm.designer.cs
查看文件 @
60a3f89
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
{
{
this
.
components
=
new
System
.
ComponentModel
.
Container
();
this
.
components
=
new
System
.
ComponentModel
.
Container
();
System
.
ComponentModel
.
ComponentResourceManager
resources
=
new
System
.
ComponentModel
.
ComponentResourceManager
(
typeof
(
MainForm
));
System
.
ComponentModel
.
ComponentResourceManager
resources
=
new
System
.
ComponentModel
.
ComponentResourceManager
(
typeof
(
MainForm
));
this
.
imageBox
=
new
Cyotek
.
Windows
.
Forms
.
ImageBox
();
this
.
contextMenuStrip
=
new
System
.
Windows
.
Forms
.
ContextMenuStrip
(
this
.
components
);
this
.
contextMenuStrip
=
new
System
.
Windows
.
Forms
.
ContextMenuStrip
(
this
.
components
);
this
.
打开图片
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
打开图片
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
原图
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
原图
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
...
@@ -49,24 +48,11 @@
...
@@ -49,24 +48,11 @@
this
.
labelTime
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
labelTime
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
textBoxFeature
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
textBoxFeature
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
imageBox
=
new
Cyotek
.
Windows
.
Forms
.
ImageBox
();
this
.
contextMenuStrip
.
SuspendLayout
();
this
.
contextMenuStrip
.
SuspendLayout
();
this
.
panel1
.
SuspendLayout
();
this
.
panel1
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
// imageBox
//
this
.
imageBox
.
AllowDrop
=
true
;
this
.
imageBox
.
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
.
imageBox
.
Location
=
new
System
.
Drawing
.
Point
(
16
,
52
);
this
.
imageBox
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
4
,
4
,
4
,
4
);
this
.
imageBox
.
Name
=
"imageBox"
;
this
.
imageBox
.
Size
=
new
System
.
Drawing
.
Size
(
817
,
458
);
this
.
imageBox
.
TabIndex
=
0
;
this
.
imageBox
.
MouseDown
+=
new
System
.
Windows
.
Forms
.
MouseEventHandler
(
this
.
imageBox_MouseDown
);
//
// contextMenuStrip
// contextMenuStrip
//
//
this
.
contextMenuStrip
.
ImageScalingSize
=
new
System
.
Drawing
.
Size
(
20
,
20
);
this
.
contextMenuStrip
.
ImageScalingSize
=
new
System
.
Drawing
.
Size
(
20
,
20
);
...
@@ -145,6 +131,7 @@
...
@@ -145,6 +131,7 @@
this
.
buttonThesh
.
TabIndex
=
3
;
this
.
buttonThesh
.
TabIndex
=
3
;
this
.
buttonThesh
.
Text
=
"二值化"
;
this
.
buttonThesh
.
Text
=
"二值化"
;
this
.
buttonThesh
.
UseVisualStyleBackColor
=
true
;
this
.
buttonThesh
.
UseVisualStyleBackColor
=
true
;
this
.
buttonThesh
.
Visible
=
false
;
this
.
buttonThesh
.
Click
+=
new
System
.
EventHandler
(
this
.
buttonThesh_Click
);
this
.
buttonThesh
.
Click
+=
new
System
.
EventHandler
(
this
.
buttonThesh_Click
);
//
//
// textBoxThesh
// textBoxThesh
...
@@ -155,6 +142,7 @@
...
@@ -155,6 +142,7 @@
this
.
textBoxThesh
.
Size
=
new
System
.
Drawing
.
Size
(
60
,
25
);
this
.
textBoxThesh
.
Size
=
new
System
.
Drawing
.
Size
(
60
,
25
);
this
.
textBoxThesh
.
TabIndex
=
4
;
this
.
textBoxThesh
.
TabIndex
=
4
;
this
.
textBoxThesh
.
Text
=
"30"
;
this
.
textBoxThesh
.
Text
=
"30"
;
this
.
textBoxThesh
.
Visible
=
false
;
//
//
// checkBoxAutoThresh
// checkBoxAutoThresh
//
//
...
@@ -166,6 +154,7 @@
...
@@ -166,6 +154,7 @@
this
.
checkBoxAutoThresh
.
TabIndex
=
5
;
this
.
checkBoxAutoThresh
.
TabIndex
=
5
;
this
.
checkBoxAutoThresh
.
Text
=
"自动"
;
this
.
checkBoxAutoThresh
.
Text
=
"自动"
;
this
.
checkBoxAutoThresh
.
UseVisualStyleBackColor
=
true
;
this
.
checkBoxAutoThresh
.
UseVisualStyleBackColor
=
true
;
this
.
checkBoxAutoThresh
.
Visible
=
false
;
this
.
checkBoxAutoThresh
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
checkBoxAutoThresh_CheckedChanged
);
this
.
checkBoxAutoThresh
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
checkBoxAutoThresh_CheckedChanged
);
//
//
// panel1
// panel1
...
@@ -236,6 +225,7 @@
...
@@ -236,6 +225,7 @@
this
.
textBoxFeature
.
Size
=
new
System
.
Drawing
.
Size
(
60
,
25
);
this
.
textBoxFeature
.
Size
=
new
System
.
Drawing
.
Size
(
60
,
25
);
this
.
textBoxFeature
.
TabIndex
=
8
;
this
.
textBoxFeature
.
TabIndex
=
8
;
this
.
textBoxFeature
.
Text
=
"200"
;
this
.
textBoxFeature
.
Text
=
"200"
;
this
.
textBoxFeature
.
Visible
=
false
;
//
//
// label1
// label1
//
//
...
@@ -246,22 +236,26 @@
...
@@ -246,22 +236,26 @@
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
82
,
15
);
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
82
,
15
);
this
.
label1
.
TabIndex
=
9
;
this
.
label1
.
TabIndex
=
9
;
this
.
label1
.
Text
=
"元件特征:"
;
this
.
label1
.
Text
=
"元件特征:"
;
this
.
label1
.
Visible
=
false
;
//
//
//
button1
//
imageBox
//
//
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
263
,
18
);
this
.
imageBox
.
AllowDrop
=
true
;
this
.
button1
.
Name
=
"button1"
;
this
.
imageBox
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
23
);
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
this
.
button1
.
TabIndex
=
10
;
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
button1
.
Text
=
"button1"
;
this
.
imageBox
.
Location
=
new
System
.
Drawing
.
Point
(
16
,
52
);
this
.
button1
.
UseVisualStyleBackColor
=
true
;
this
.
imageBox
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
4
);
this
.
imageBox
.
Name
=
"imageBox"
;
this
.
imageBox
.
Size
=
new
System
.
Drawing
.
Size
(
817
,
458
);
this
.
imageBox
.
TabIndex
=
0
;
this
.
imageBox
.
MouseDown
+=
new
System
.
Windows
.
Forms
.
MouseEventHandler
(
this
.
imageBox_MouseDown
);
//
//
// MainForm
// MainForm
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
8F
,
15F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
8F
,
15F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
851
,
544
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
851
,
544
);
this
.
Controls
.
Add
(
this
.
button1
);
this
.
Controls
.
Add
(
this
.
label1
);
this
.
Controls
.
Add
(
this
.
label1
);
this
.
Controls
.
Add
(
this
.
textBoxFeature
);
this
.
Controls
.
Add
(
this
.
textBoxFeature
);
this
.
Controls
.
Add
(
this
.
panel1
);
this
.
Controls
.
Add
(
this
.
panel1
);
...
@@ -303,7 +297,6 @@
...
@@ -303,7 +297,6 @@
private
System
.
Windows
.
Forms
.
Label
label1
;
private
System
.
Windows
.
Forms
.
Label
label1
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
计数
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
计数
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
保存当前图片
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
保存当前图片
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
Button
button1
;
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论