Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
GeneralClassLibrary
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1cbbaf0f
由
刘韬
编写于
2021-01-19 15:54:58 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
更新eyemDecode
1 个父辈
66950e28
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
20 行增加
和
8 行删除
CodeLibraryProject/CodeLibrary/FrmCodeDecode.Designer.cs
CodeLibraryProject/CodeLibrary/FrmCodeDecode.cs
CodeLibraryProject/CodeLibrary/camera/Basler.cs
CodeLibraryProject/CodeLibrary/camera/Common.cs
CodeLibraryProject/CodeLibrary/camera/HIK.cs
CodeLibraryProject/CodeLibrary/eyemDecode.cs
CodeLibraryProject/CodeLibrary/FrmCodeDecode.Designer.cs
查看文件 @
1cbbaf0
...
...
@@ -131,6 +131,7 @@
this
.
btnLearn
.
TabIndex
=
10
;
this
.
btnLearn
.
Text
=
"学习"
;
this
.
btnLearn
.
UseVisualStyleBackColor
=
true
;
this
.
btnLearn
.
Visible
=
false
;
this
.
btnLearn
.
Click
+=
new
System
.
EventHandler
(
this
.
btnLearn_Click
);
//
// btnDCode
...
...
@@ -186,6 +187,7 @@
this
.
cmbCount
.
Name
=
"cmbCount"
;
this
.
cmbCount
.
Size
=
new
System
.
Drawing
.
Size
(
66
,
25
);
this
.
cmbCount
.
TabIndex
=
16
;
this
.
cmbCount
.
Visible
=
false
;
//
// lblCount
//
...
...
@@ -196,6 +198,7 @@
this
.
lblCount
.
TabIndex
=
15
;
this
.
lblCount
.
Text
=
"条码数量:"
;
this
.
lblCount
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblCount
.
Visible
=
false
;
//
// btnCameraImage
//
...
...
@@ -260,6 +263,7 @@
this
.
cmbCodeType
.
Name
=
"cmbCodeType"
;
this
.
cmbCodeType
.
Size
=
new
System
.
Drawing
.
Size
(
154
,
25
);
this
.
cmbCodeType
.
TabIndex
=
23
;
this
.
cmbCodeType
.
Visible
=
false
;
this
.
cmbCodeType
.
SelectedIndexChanged
+=
new
System
.
EventHandler
(
this
.
cmbCodeType_SelectedIndexChanged
);
//
// label3
...
...
@@ -271,6 +275,7 @@
this
.
label3
.
TabIndex
=
22
;
this
.
label3
.
Text
=
"条码类型:"
;
this
.
label3
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
label3
.
Visible
=
false
;
//
// chbUseParam
//
...
...
@@ -319,6 +324,8 @@
// chbZxing
//
this
.
chbZxing
.
AutoSize
=
true
;
this
.
chbZxing
.
Checked
=
true
;
this
.
chbZxing
.
CheckState
=
System
.
Windows
.
Forms
.
CheckState
.
Checked
;
this
.
chbZxing
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbZxing
.
Location
=
new
System
.
Drawing
.
Point
(
792
,
16
);
this
.
chbZxing
.
Name
=
"chbZxing"
;
...
...
CodeLibraryProject/CodeLibrary/FrmCodeDecode.cs
查看文件 @
1cbbaf0
...
...
@@ -356,9 +356,9 @@ namespace CodeLibrary
//pictureBox1.Image = (Image)bitmap.Clone();
//HObject hoImage = HDCodeHelper.Bitmap2HObjectBpp24(bitmap);
HDCodeLearnHelper
.
DefaultImage
=
bitmap
;
HDCodeLearnHelper
.
DefaultBitmap
=
b
;
ShowImage
(
bitmap
);
}
HDCodeLearnHelper
.
DefaultBitmap
=
b
;
}
else
{
...
...
@@ -494,6 +494,7 @@ namespace CodeLibrary
private
void
FrmCodeDecode_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
HDLogUtil
.
info
(
"关闭所有相机"
);
Camera
.
_cam
.
CloseAll
();
}
...
...
CodeLibraryProject/CodeLibrary/camera/Basler.cs
查看文件 @
1cbbaf0
...
...
@@ -232,7 +232,7 @@ namespace CodeLibrary
{
return
CaptureOnImage
(
name
,
out
_
);
}
public
override
HObject
CaptureOnImage
(
string
name
,
out
Bitmap
bmp
)
public
override
HObject
CaptureOnImage
(
string
name
,
out
Bitmap
bmp
,
bool
nohalcon
=
false
)
{
HObject
hoImage
=
null
;
bmp
=
null
;
...
...
CodeLibraryProject/CodeLibrary/camera/Common.cs
查看文件 @
1cbbaf0
...
...
@@ -113,7 +113,7 @@ namespace CodeLibrary
// public abstract void GrabStop(int index);
public
abstract
Bitmap
GrabOneImage
(
string
name
);
public
abstract
HObject
CaptureOnImage
(
string
name
);
public
abstract
HObject
CaptureOnImage
(
string
name
,
out
Bitmap
bmp
);
public
abstract
HObject
CaptureOnImage
(
string
name
,
out
Bitmap
bmp
,
bool
nohalcon
=
false
);
}
}
CodeLibraryProject/CodeLibrary/camera/HIK.cs
查看文件 @
1cbbaf0
...
...
@@ -50,10 +50,13 @@ namespace CodeLibrary
{
if
(
cameraCurr
==
null
)
return
;
HDLogUtil
.
info
(
" cameraCurr.Length : "
+
cameraCurr
.
Length
.
ToString
());
for
(
int
i
=
0
;
i
<
cameraCurr
.
Length
;
i
++)
{
if
(
cameraCurr
[
i
]
!=
null
)
{
HDLogUtil
.
info
(
$
" cameraCurr[{i}] "
);
_isOpen
[
i
]
=
false
;
cameraCurr
[
i
].
MV_CC_CloseDevice_NET
();
cameraCurr
[
i
].
MV_CC_DestroyDevice_NET
();
...
...
@@ -351,7 +354,7 @@ namespace CodeLibrary
return
r
;
}
public
override
HObject
CaptureOnImage
(
string
name
,
out
Bitmap
bmp
)
public
override
HObject
CaptureOnImage
(
string
name
,
out
Bitmap
bmp
,
bool
nohalcon
=
false
)
{
HObject
hoImage
=
null
;
bmp
=
null
;
...
...
@@ -390,7 +393,8 @@ namespace CodeLibrary
+
"] , FrameNum["
+
Convert
.
ToString
(
FrameInfo
.
stFrameInfo
.
nFrameNum
)
+
"]"
);
//HObject ho_Imagetemp;
HOperatorSet
.
GenImage1
(
out
hoImage
,
"byte"
,
FrameInfo
.
stFrameInfo
.
nWidth
,
FrameInfo
.
stFrameInfo
.
nHeight
,
FrameInfo
.
pBufAddr
);
if
(!
nohalcon
)
HOperatorSet
.
GenImage1
(
out
hoImage
,
"byte"
,
FrameInfo
.
stFrameInfo
.
nWidth
,
FrameInfo
.
stFrameInfo
.
nHeight
,
FrameInfo
.
pBufAddr
);
try
{
...
...
CodeLibraryProject/CodeLibrary/eyemDecode.cs
查看文件 @
1cbbaf0
...
...
@@ -50,8 +50,7 @@ namespace CodeLibrary
eyemRect
.
iYs
=
0
;
eyemRect
.
iWidth
=
eyemImage
.
iWidth
;
eyemRect
.
iHeight
=
eyemImage
.
iHeight
;
string
codeType
=
"DataMatrix"
;
//QRCode
codeType
=
"QRCode"
;
string
codeType
=
"QR_CODE|DATA_MATRIX"
;
//QRCode
int
ipNum
;
EyemBarCode
*
tpResults
;
...
...
@@ -98,7 +97,7 @@ namespace CodeLibrary
}
}
[
DllImport
(
"eyemLib.dll"
,
CharSet
=
CharSet
.
None
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
private
static
extern
int
eyemDetectAndDecode
(
EyemImage
tpImage
,
EyemRect
tpRoi
,
string
fileName
,
string
strCodeType
,
out
DataCodeHandle
hObject
,
out
EyemBarCode
*
tpResults
,
out
int
ipNum
,
bool
bUseNiBlack
,
int
iBlockSize
,
int
iRangeC
,
int
iSymbolMin
,
int
iSymbolMax
,
double
dScaleUpAndDown
=
0.5
,
double
dToleErr
=
0.5
,
double
dMinorStep
=
1.0
);
private
static
extern
int
eyemDetectAndDecode
(
EyemImage
tpImage
,
EyemRect
tpRoi
,
string
fileName
,
string
strCodeType
,
out
DataCodeHandle
hObject
,
out
EyemBarCode
*
tpResults
,
out
int
ipNum
,
bool
bUseNiBlack
,
int
iBlockSize
,
int
iRangeC
,
int
iSymbolMin
,
int
iSymbolMax
,
double
dScaleUpAndDown
=
1
,
double
dToleErr
=
0.5
,
double
dMinorStep
=
1.0
);
/// <summary>
/// 读取图像
...
...
@@ -140,6 +139,7 @@ namespace CodeLibrary
[
StructLayout
(
LayoutKind
.
Sequential
)]
public
struct
EyemBarCode
{
public
double
dAngle
;
// 角度
public
int
iCenterX
;
// y坐标
public
int
iCenterY
;
// y坐标
public
IntPtr
hType
;
// 码类型
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论