Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ReelCounter
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 60a3f895
由
cuiya
编写于
2019-03-14 23:25:24 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
optimize
1 个父辈
86c5ac4c
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
196 行增加
和
51 行删除
AccImage/ImageUtil.cs
Demo/MainForm.cs
Demo/MainForm.designer.cs
AccImage/ImageUtil.cs
查看文件 @
60a3f89
...
@@ -12,6 +12,7 @@ namespace Acc.Img
...
@@ -12,6 +12,7 @@ namespace Acc.Img
public
class
ImageUtil
public
class
ImageUtil
{
{
public
static
bool
selectB
=
false
;
/// <summary>
/// <summary>
/// 读取图片,,支持格式*.raw,*.bmp;*.gif;*.jpg;*.png
/// 读取图片,,支持格式*.raw,*.bmp;*.gif;*.jpg;*.png
/// </summary>
/// </summary>
...
@@ -28,7 +29,6 @@ namespace Acc.Img
...
@@ -28,7 +29,6 @@ namespace Acc.Img
if
(
images
!=
null
)
if
(
images
!=
null
)
{
{
image
=
images
[
1
];
image
=
images
[
1
];
string
ss
=
"改版10"
;
}
}
}
}
else
else
...
@@ -119,6 +119,84 @@ namespace Acc.Img
...
@@ -119,6 +119,84 @@ namespace Acc.Img
}
}
return
0
;
return
0
;
}
}
public
static
int
GetItemFeatureAuto
(
Image
image
,
int
markX
=
-
1
,
int
markY
=
-
1
,
int
thresh
=
-
1
,
bool
inv
=
true
)
{
Mat
imageMat
=
BitmapConverter
.
ToMat
(
new
Bitmap
(
image
));
List
<
CvBlob
>
blobList
=
GetBlobs
(
imageMat
,
thresh
,
inv
);
List
<
int
>
sampleList
=
new
List
<
int
>();
CvBlob
srcBlob
=
new
CvBlob
();
srcBlob
.
Area
=
-
1
;
int
blobCount
=
blobList
.
Count
;
int
selectIndex
=
blobCount
/
2
+
blobCount
/
16
;
for
(
int
i
=
0
;
i
<
blobList
.
Count
;
i
++)
{
if
(
srcBlob
.
Area
==
-
1
)
{
srcBlob
=
blobList
[
i
];
if
(
srcBlob
.
Area
<
40
)
{
srcBlob
.
Area
=
-
1
;
}
}
else
{
if
(
blobList
[
i
].
Area
<
srcBlob
.
Area
&&
blobList
[
i
].
Area
>
40
)
{
srcBlob
=
blobList
[
i
];
}
}
}
//srcBlob.Area += (int)(srcBlob.Area * 0.2);
for
(
int
i
=
0
;
i
<
blobList
.
Count
;
i
++)
{
if
(
srcBlob
.
Area
<
blobList
[
i
].
Area
)
{
double
num
=
(
double
)
blobList
[
i
].
Area
/
srcBlob
.
Area
;
if
(
num
<
2
)
{
sampleList
.
Add
(
blobList
[
i
].
Area
);
}
}
if
(
sampleList
.
Count
==
blobList
.
Count
-
1
||
i
==
blobList
.
Count
-
1
)
{
int
nums
=
0
;
for
(
int
j
=
0
;
j
<
sampleList
.
Count
;
j
++)
{
nums
+=
sampleList
[
j
];
}
double
area
=
(
double
)
nums
/
sampleList
.
Count
;
double
ss
=
area
*
0.35
;
int
areaI
=
(
int
)
Math
.
Round
(
area
+
ss
);
//int sss = (int)Math.Round(areaI);
return
areaI
;
}
}
//if (markX != -1 && markY != -1)
//{
// //查找标记的Blob
// int markIndex = -1;
// for (int i = 0; i < blobCount; i++)
// {
// CvBlob blob = blobList[i];
// if (blob.Rect.Contains(new OpenCvSharp.Point(markX, markY)))
// {
// if (markIndex == -1 || blobList[i].Area < blobList[markIndex].Area)
// {
// markIndex = i;
// }
// }
// }
// if (markIndex != -1)
// {
// int area = blobList[markIndex].Area;
// area = area * 5 / 3 - 23;
// return area;
// }
//}
return
srcBlob
.
Area
;
}
/// <summary>
/// <summary>
/// 根据元器件特征统计图片中的元器件数量
/// 根据元器件特征统计图片中的元器件数量
...
@@ -131,14 +209,17 @@ namespace Acc.Img
...
@@ -131,14 +209,17 @@ namespace Acc.Img
public
static
int
CountItems
(
ref
Image
image
,
int
itemFeature
,
int
thresh
=
-
1
,
bool
inv
=
true
)
public
static
int
CountItems
(
ref
Image
image
,
int
itemFeature
,
int
thresh
=
-
1
,
bool
inv
=
true
)
{
{
Mat
imageMat
=
BitmapConverter
.
ToMat
(
new
Bitmap
(
image
));
Mat
imageMat
=
BitmapConverter
.
ToMat
(
new
Bitmap
(
image
));
Mat
grayMat
=
BitmapConverter
.
ToMat
(
new
Bitmap
(
image
));
Cv2
.
CvtColor
(
grayMat
,
grayMat
,
ColorConversionCodes
.
RGBA2RGB
);
Cv2
.
Threshold
(
imageMat
,
imageMat
,
0
,
255
,
ThresholdTypes
.
Binary
);
List
<
CvBlob
>
blobList
=
GetBlobs
(
imageMat
,
thresh
,
inv
);
List
<
CvBlob
>
blobList
=
GetBlobs
(
imageMat
,
thresh
,
inv
);
int
itemArea
=
(
itemFeature
+
23
)
*
3
/
5
;
int
itemArea
=
(
itemFeature
+
23
)
*
3
/
5
;
if
(
itemArea
<=
0
)
if
(
itemArea
<=
0
)
{
{
itemArea
=
3
;
itemArea
=
3
;
}
}
int
totalCount
=
CountBlobs
(
blobList
,
itemArea
,
ref
image
Mat
);
int
totalCount
=
CountBlobs
(
blobList
,
itemArea
,
ref
gray
Mat
);
image
=
BitmapConverter
.
ToBitmap
(
image
Mat
);
image
=
BitmapConverter
.
ToBitmap
(
gray
Mat
);
return
totalCount
;
return
totalCount
;
}
}
...
@@ -304,31 +385,67 @@ namespace Acc.Img
...
@@ -304,31 +385,67 @@ namespace Acc.Img
}
}
return
Math
.
Sqrt
(
avgArea
);
return
Math
.
Sqrt
(
avgArea
);
}
}
/// <summary>
/// 获取Blob个数
/// </summary>
/// <param name="blobList"></param>
/// <param name="avgArea"></param>
/// <param name="srcMat"></param>
/// <returns></returns>
private
static
int
CountBlobs
(
List
<
CvBlob
>
blobList
,
int
avgArea
,
ref
Mat
srcMat
)
private
static
int
CountBlobs
(
List
<
CvBlob
>
blobList
,
int
avgArea
,
ref
Mat
srcMat
)
{
{
List
<
CvBlob
>
filterBlobList
=
blobList
.
Where
(
b
=>
b
.
Area
>
0.3
*
avgArea
).
ToList
();
//
List<CvBlob> filterBlobList = blobList.Where(b => b.Area > 0.3 * avgArea).ToList();
List
<
CvBlob
>
filterBlobList
=
blobList
.
Where
(
b
=>
b
.
Area
>
0
).
ToList
();
if
(
blobList
.
Count
==
0
)
if
(
blobList
.
Count
==
0
)
{
{
return
0
;
return
0
;
}
}
CvBlob
markBlob
=
null
;
//
CvBlob markBlob = null;
double
labelStep
=
GetLabelStep
(
blobList
,
avgArea
,
out
markBlob
);
//
double labelStep = GetLabelStep(blobList, avgArea, out markBlob);
string
[]
labels
=
new
string
[
filterBlobList
.
Count
];
//
string[] labels = new string[filterBlobList.Count];
double
markBlobX
=
markBlob
.
Centroid
.
X
;
//double markBlobX = markBlob.Centroid.X;
double
markBlobY
=
markBlob
.
Centroid
.
Y
;
//double markBlobY = markBlob.Centroid.Y;
LabelBlobsInCircle
(
ref
labels
,
filterBlobList
,
markBlobX
,
markBlobY
,
labelStep
);
//LabelBlobsInCircle(ref labels, filterBlobList, markBlobX, markBlobY, labelStep);
//int totalCount = 0;
//for (int i = 0; i < labels.Length; i++)
//{
// if (labels[i] != null)
// {
// CvBlob blob = filterBlobList[i];
// Scalar color = Scalar.Red;
// int count = BlobHasItem(avgArea, blob);
// if (count > 0)
// {
// if (count == 1)
// {
// color = Scalar.Green;
// }
// else if (count == 2)
// {
// color = Scalar.Blue;
// //Cv2.PutText(srcMat, count + "", blob.Centroid, HersheyFonts.HersheySimplex, 0.5, color);
// }
// else if (count >= 3)
// {
// color = Scalar.Red;
// Point2d center = blob.Centroid;
// Cv2.PutText(srcMat, count + "", new OpenCvSharp.Point(center.X, center.Y), HersheyFonts.HersheySimplex, 0.5, color);
// }
// totalCount = totalCount + count;
// blob.Contour.Render(srcMat, color);
// }
// }
//}
int
totalCount
=
0
;
int
totalCount
=
0
;
for
(
int
i
=
0
;
i
<
labels
.
Length
;
i
++
)
for
each
(
CvBlob
blob
in
filterBlobList
)
{
{
if
(
labels
[
i
]
!=
null
)
{
CvBlob
blob
=
filterBlobList
[
i
];
Scalar
color
=
Scalar
.
Red
;
Scalar
color
=
Scalar
.
Red
;
if
(
blob
.
MaxX
-
blob
.
MinX
>
450
&&
blob
.
MaxY
-
blob
.
MinY
>
450
)
continue
;
int
count
=
BlobHasItem
(
avgArea
,
blob
);
int
count
=
BlobHasItem
(
avgArea
,
blob
);
if
(
count
>
0
)
if
(
count
>
0
)
{
{
...
@@ -347,12 +464,10 @@ namespace Acc.Img
...
@@ -347,12 +464,10 @@ namespace Acc.Img
Point2d
center
=
blob
.
Centroid
;
Point2d
center
=
blob
.
Centroid
;
Cv2
.
PutText
(
srcMat
,
count
+
""
,
new
OpenCvSharp
.
Point
(
center
.
X
,
center
.
Y
),
HersheyFonts
.
HersheySimplex
,
0.5
,
color
);
Cv2
.
PutText
(
srcMat
,
count
+
""
,
new
OpenCvSharp
.
Point
(
center
.
X
,
center
.
Y
),
HersheyFonts
.
HersheySimplex
,
0.5
,
color
);
}
}
totalCount
=
totalCount
+
count
;
totalCount
=
totalCount
+
count
;
blob
.
Contour
.
Render
(
srcMat
,
color
);
blob
.
Contour
.
Render
(
srcMat
,
color
);
}
}
}
}
}
string
countText
=
"Count: "
+
totalCount
;
string
countText
=
"Count: "
+
totalCount
;
int
baseLine
=
0
;
int
baseLine
=
0
;
OpenCvSharp
.
Size
textSize
=
Cv2
.
GetTextSize
(
countText
,
HersheyFonts
.
HersheySimplex
,
1
,
1
,
out
baseLine
);
OpenCvSharp
.
Size
textSize
=
Cv2
.
GetTextSize
(
countText
,
HersheyFonts
.
HersheySimplex
,
1
,
1
,
out
baseLine
);
...
@@ -375,6 +490,18 @@ namespace Acc.Img
...
@@ -375,6 +490,18 @@ namespace Acc.Img
{
{
Mat
dst
=
new
Mat
();
Mat
dst
=
new
Mat
();
Cv2
.
CvtColor
(
imageMat
,
dst
,
ColorConversionCodes
.
RGB2GRAY
);
Cv2
.
CvtColor
(
imageMat
,
dst
,
ColorConversionCodes
.
RGB2GRAY
);
//if (selectB)
//{
// //全局二值化
// Cv2.Threshold(dst, dst, 30, 255, ThresholdTypes.Binary);
//}
//else
//{
// //全局二值化
// Cv2.Threshold(dst, dst, 0, 255, ThresholdTypes.Binary);
//}
if
(
selectB
)
{
if
(
thresh
==
-
1
)
if
(
thresh
==
-
1
)
{
{
//自动局部二值化
//自动局部二值化
...
@@ -383,13 +510,34 @@ namespace Acc.Img
...
@@ -383,13 +510,34 @@ namespace Acc.Img
else
else
{
{
//全局二值化
//全局二值化
Cv2
.
Threshold
(
dst
,
dst
,
thresh
,
255
,
ThresholdTypes
.
Binary
);
Cv2
.
Threshold
(
dst
,
dst
,
0
,
255
,
ThresholdTypes
.
Binary
);
}
}
if
(
inv
)
if
(
inv
)
{
{
Cv2
.
Threshold
(
dst
,
dst
,
thresh
,
255
,
ThresholdTypes
.
BinaryInv
|
ThresholdTypes
.
Otsu
);
Cv2
.
Threshold
(
dst
,
dst
,
0
,
150
,
ThresholdTypes
.
BinaryInv
);
}
}
}
else
{
Cv2
.
Threshold
(
dst
,
dst
,
0
,
255
,
ThresholdTypes
.
Binary
);
Cv2
.
Threshold
(
dst
,
dst
,
0
,
150
,
ThresholdTypes
.
BinaryInv
);
}
//if (thresh == -1)
//{
// //自动局部二值化
// Binarizer.Sauvola(dst, dst, 21, 0.2, 32);
//}
//else
//{
// //全局二值化
// Cv2.Threshold(dst, dst, 0, 255, ThresholdTypes.Binary);
//}
//if (inv)
//{
// Cv2.Threshold(dst, dst, 0, thresh, ThresholdTypes.BinaryInv | ThresholdTypes.Otsu);
//}
return
dst
;
return
dst
;
}
}
/// <summary>
/// <summary>
...
@@ -404,14 +552,12 @@ namespace Acc.Img
...
@@ -404,14 +552,12 @@ namespace Acc.Img
Cv2
.
CvtColor
(
imageMat
,
imageMat
,
ColorConversionCodes
.
RGBA2BGR
);
Cv2
.
CvtColor
(
imageMat
,
imageMat
,
ColorConversionCodes
.
RGBA2BGR
);
//Cv2.CvtColor(imageMat, imageMat, ColorConversionCodes.RGB2GRAY);
//Cv2.CvtColor(imageMat, imageMat, ColorConversionCodes.RGB2GRAY);
Mat
dst
=
Threshhold
(
imageMat
,
thresh
,
inv
);
Mat
dst
=
Threshhold
(
imageMat
,
thresh
,
inv
);
Mat
k1
=
Mat
.
Ones
(
new
OpenCvSharp
.
Size
(
1
,
1
),
MatType
.
CV_8UC1
);
Mat
k1
=
Mat
.
Ones
(
new
OpenCvSharp
.
Size
(
3
,
3
),
MatType
.
CV_8UC1
);
Cv2
.
MorphologyEx
(
dst
,
dst
,
MorphTypes
.
Open
,
k1
);
Cv2
.
MorphologyEx
(
dst
,
dst
,
MorphTypes
.
Open
,
k1
);
CvBlobs
blobs
=
new
CvBlobs
();
CvBlobs
blobs
=
new
CvBlobs
();
blobs
.
Label
(
dst
);
blobs
.
Label
(
dst
);
List
<
CvBlob
>
blobList
=
blobs
.
Values
.
Where
(
b
=>
b
.
Area
>
3
).
ToList
();
List
<
CvBlob
>
blobList
=
blobs
.
Values
.
Where
(
b
=>
b
.
Area
>
0
).
ToList
();
return
blobList
;
return
blobList
;
}
}
...
@@ -432,7 +578,7 @@ namespace Acc.Img
...
@@ -432,7 +578,7 @@ namespace Acc.Img
}
}
if
(
blobArea
<
minArea
)
if
(
blobArea
<
minArea
)
{
{
return
0
;
return
1
;
}
}
//if (blobArea >= 0.5 * averageArea && blobArea <= 1.5 * averageArea)
//if (blobArea >= 0.5 * averageArea && blobArea <= 1.5 * averageArea)
//{
//{
...
@@ -451,11 +597,11 @@ namespace Acc.Img
...
@@ -451,11 +597,11 @@ namespace Acc.Img
{
{
count
=
1
;
count
=
1
;
}
}
if
(
count
<=
50
)
if
(
count
<=
50
00
)
{
{
return
count
;
return
count
;
}
}
return
-
1
;
return
1
;
}
}
/// <summary>
/// <summary>
...
...
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
请
注册
或
登录
后发表评论