Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
NS100
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3017d4ea
由
贾鹏旭
编写于
2023-10-30 09:58:17 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.添加ns200配置是否识别完成通过http更换标签内容
2.无条码信息也进行模板匹配
1 个父辈
afd92bce
显示空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
119 行增加
和
73 行删除
BLL/Camera.cs
BLL/Config.cs
BLL/Extension.cs
BLL/Extension/Item_General.cs
BLL/Extension/Item_KaiFa.cs
BLL/MaterialEdit.cs
Model/IExtension.cs
SmartScan/Form/FrmLoading.cs
SmartScan/Form/FrmRetrospect.cs
SmartScan/ScanWork.cs
SmartScan/SetControl/UsrMaterialTemplate.cs
SmartScan/WebCallWork.cs
paddleOCR/App.config
paddleOCR/PaddleSharpAPI.cs
paddleOCR/packages.config
paddleOCR/paddleOCR.csproj
BLL/Camera.cs
查看文件 @
3017d4e
...
@@ -122,6 +122,7 @@ namespace BLL
...
@@ -122,6 +122,7 @@ namespace BLL
{
{
cameraVision
.
Open
();
cameraVision
.
Open
();
result
=
cameraVision
.
GetImage
();
result
=
cameraVision
.
GetImage
();
barcodeInfos
=
Camera
.
GetBarCode
(
result
[
0
]);
cameraVision
.
Close
();
cameraVision
.
Close
();
}
}
return
result
;
return
result
;
...
...
BLL/Config.cs
查看文件 @
3017d4e
...
@@ -311,6 +311,8 @@ namespace BLL
...
@@ -311,6 +311,8 @@ namespace BLL
/// </summary>
/// </summary>
[
MyConfigComment
(
"软件后台运行"
)]
[
MyConfigComment
(
"软件后台运行"
)]
public
static
MyConfig
<
bool
>
Backgrounder
;
public
static
MyConfig
<
bool
>
Backgrounder
;
[
MyConfigComment
(
"是否http替换条码内容"
)]
public
static
MyConfig
<
bool
>
isReplaceData
;
[
MyConfigComment
(
"数据源类型"
)]
[
MyConfigComment
(
"数据源类型"
)]
public
static
MyConfig
<
string
>
DataSource_Type
;
public
static
MyConfig
<
string
>
DataSource_Type
;
...
...
BLL/Extension.cs
查看文件 @
3017d4e
...
@@ -262,6 +262,10 @@ namespace BLL
...
@@ -262,6 +262,10 @@ namespace BLL
currentExtension
.
Update
();
currentExtension
.
Update
();
}
}
public
Dictionary
<
string
,
string
>
ReplaceData
(
Dictionary
<
string
,
string
>
dic
)
{
return
General
.
ReplaceData
(
dic
);
}
private
void
LoadRow
(
object
row
)
private
void
LoadRow
(
object
row
)
{
{
object
[]
cols
=
(
object
[])
row
;
object
[]
cols
=
(
object
[])
row
;
...
...
BLL/Extension/Item_General.cs
查看文件 @
3017d4e
...
@@ -158,7 +158,8 @@ namespace BLL
...
@@ -158,7 +158,8 @@ namespace BLL
errmsg
=
""
;
errmsg
=
""
;
if
(!
string
.
IsNullOrEmpty
(
config
.
HttpReelID
))
if
(!
string
.
IsNullOrEmpty
(
config
.
HttpReelID
))
{
{
if
(!
GetHttpReelID
(
key
,
out
errmsg
))
Dictionary
<
string
,
object
>
pairs
=
new
Dictionary
<
string
,
object
>();
if
(!
GetHttpReelID
(
key
,
out
errmsg
,
out
pairs
))
{
{
LogNet
.
log
.
Error
(
"GetHttpReelID:"
+
errmsg
);
LogNet
.
log
.
Error
(
"GetHttpReelID:"
+
errmsg
);
return
false
;
return
false
;
...
@@ -289,14 +290,20 @@ namespace BLL
...
@@ -289,14 +290,20 @@ namespace BLL
else
else
lastkey
.
Add
(
extensions
[
i
].
Key
,
extensions
[
i
].
Control
.
Text
);
lastkey
.
Add
(
extensions
[
i
].
Key
,
extensions
[
i
].
Control
.
Text
);
}
}
//var keys =new List<string>(lastkey.Keys);
Printing
?.
Invoke
(
lastkey
);
Printing
?.
Invoke
(
lastkey
);
SaveRetrospect
?.
Invoke
(
lastkey
);
}
}
private
bool
GetHttpReelID
(
Dictionary
<
string
,
string
>
key
,
out
string
errmsg
)
/// <summary>
///
/// </summary>
/// <param name="key"></param>
/// <param name="errmsg"></param>
/// <param name="dic">返回请求后,替换完成的键值对</param>
/// <returns></returns>
private
bool
GetHttpReelID
(
Dictionary
<
string
,
string
>
key
,
out
string
errmsg
,
out
Dictionary
<
string
,
object
>
dic
)
{
{
errmsg
=
""
;
errmsg
=
""
;
dic
=
null
;
string
url
=
config
.
HttpReelID
;
string
url
=
config
.
HttpReelID
;
string
json
=
Http
.
PostJson
(
url
,
null
,
key
);
string
json
=
Http
.
PostJson
(
url
,
null
,
key
);
if
(
json
==
""
)
if
(
json
==
""
)
...
@@ -308,7 +315,7 @@ namespace BLL
...
@@ -308,7 +315,7 @@ namespace BLL
return
false
;
return
false
;
}
}
JavaScriptSerializer
serializer
=
new
();
JavaScriptSerializer
serializer
=
new
();
Dictionary
<
string
,
object
>
dic
;
//
Dictionary<string, object> dic;
try
try
{
{
dic
=
(
Dictionary
<
string
,
object
>)
serializer
.
DeserializeObject
(
json
);
dic
=
(
Dictionary
<
string
,
object
>)
serializer
.
DeserializeObject
(
json
);
...
@@ -552,17 +559,25 @@ namespace BLL
...
@@ -552,17 +559,25 @@ namespace BLL
{
{
if
(
extensions
!=
null
&&
!
extensions
[
0
].
Control
.
InvokeRequired
)
if
(
extensions
!=
null
&&
!
extensions
[
0
].
Control
.
InvokeRequired
)
{
{
//自动打印and模板匹配成功,只负责打印标签
if
(
config
.
AutoPrint
&&
match
)
if
(
config
.
AutoPrint
&&
match
)
{
{
//if (CanPrint())
PrintLabel
(
null
,
EventArgs
.
Empty
);
PrintLabel
(
null
,
EventArgs
.
Empty
);
}
}
}
}
else
//进行追溯配置保存
SaveRetrospect
?.
Invoke
(
key
);
}
public
Dictionary
<
string
,
string
>
ReplaceData
(
Dictionary
<
string
,
string
>
key
)
{
string
err
=
null
;
Dictionary
<
string
,
object
>
dic
=
new
Dictionary
<
string
,
object
>();
if
(!
GetHttpReelID
(
key
,
out
err
,
out
dic
))
{
{
//PrintLabel(null, EventArgs.Empty)
;
return
key
;
}
}
SaveRetrospect
?.
Invoke
(
key
);
return
dic
?.
ToDictionary
(
a
=>
a
.
Key
,
a
=>
a
.
Value
.
ToString
()
);
}
}
}
}
}
}
...
...
BLL/Extension/Item_KaiFa.cs
查看文件 @
3017d4e
...
@@ -18,7 +18,6 @@ namespace BLL
...
@@ -18,7 +18,6 @@ namespace BLL
public
class
KaiFa
:
IExtension
public
class
KaiFa
:
IExtension
{
{
public
event
IExtension
.
PrintDelegate
Printing
;
public
event
IExtension
.
PrintDelegate
Printing
;
public
event
IExtension
.
PrintDelegate
SaveRetrospect
;
public
event
IExtension
.
PrintDelegate
SaveRetrospect
;
private
Config
config
;
private
Config
config
;
private
int
reelID
=
0
;
private
int
reelID
=
0
;
...
@@ -51,6 +50,7 @@ namespace BLL
...
@@ -51,6 +50,7 @@ namespace BLL
this
.
extensions
=
extensions
;
this
.
extensions
=
extensions
;
ReadReelID
();
ReadReelID
();
}
}
static
bool
mesResult
=
false
;
static
bool
mesResult
=
false
;
public
bool
SetKey
(
string
[]
originalCode
,
Dictionary
<
string
,
string
>
key
,
bool
hasMatch
,
out
string
errmsg
)
public
bool
SetKey
(
string
[]
originalCode
,
Dictionary
<
string
,
string
>
key
,
bool
hasMatch
,
out
string
errmsg
)
{
{
...
@@ -101,9 +101,6 @@ namespace BLL
...
@@ -101,9 +101,6 @@ namespace BLL
{
{
}
}
private
bool
CanPrint
()
private
bool
CanPrint
()
{
{
int
index
=
extensions
.
FindIndex
(
match
=>
match
.
Control
.
Name
==
"TxtPart"
);
int
index
=
extensions
.
FindIndex
(
match
=>
match
.
Control
.
Name
==
"TxtPart"
);
...
@@ -327,7 +324,5 @@ namespace BLL
...
@@ -327,7 +324,5 @@ namespace BLL
//业务数据
//业务数据
public
object
Data
{
get
;
set
;
}
public
object
Data
{
get
;
set
;
}
}
}
}
}
}
}
BLL/MaterialEdit.cs
查看文件 @
3017d4e
...
@@ -154,7 +154,10 @@ namespace BLL
...
@@ -154,7 +154,10 @@ namespace BLL
if
(
Config
.
Func_EnabledOCR
)
if
(
Config
.
Func_EnabledOCR
)
{
{
//保存需要识别ocr的区域
//保存需要识别ocr的区域
CurrntBitmap
?.
Save
(
@"ocr.jpg"
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Jpeg
);
//CurrntBitmap?.Save(@"ocr.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
string
currentDirectory
=
System
.
Windows
.
Forms
.
Application
.
StartupPath
;
string
filePath
=
System
.
IO
.
Path
.
Combine
(
currentDirectory
,
"ocr.jpg"
);
CurrntBitmap
?.
Save
(
filePath
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Jpeg
);
regOcrCodes
=
OcrRecognize
(
"..\\ocr.jpg"
);
regOcrCodes
=
OcrRecognize
(
"..\\ocr.jpg"
);
LogNet
.
log
.
Info
(
$
"OCR 识别结果:{regOcrCodes}"
);
LogNet
.
log
.
Info
(
$
"OCR 识别结果:{regOcrCodes}"
);
}
}
...
@@ -206,8 +209,6 @@ namespace BLL
...
@@ -206,8 +209,6 @@ namespace BLL
return
false
;
return
false
;
}
}
private
MaterialTemplate
LoadFile
(
string
filePath
,
string
imgPath
)
private
MaterialTemplate
LoadFile
(
string
filePath
,
string
imgPath
)
{
{
MaterialTemplate
temp
=
new
();
MaterialTemplate
temp
=
new
();
...
@@ -752,20 +753,6 @@ namespace BLL
...
@@ -752,20 +753,6 @@ namespace BLL
return
key
;
return
key
;
}
}
//====================================
//====================================
public
int
FindPrimaryCode
(
List
<
MaterialCode
>
code
)
public
int
FindPrimaryCode
(
List
<
MaterialCode
>
code
)
{
{
//bool find = false;
//bool find = false;
...
@@ -898,13 +885,10 @@ namespace BLL
...
@@ -898,13 +885,10 @@ namespace BLL
//}
//}
/// <summary>
/// <summary>
/// 物料模板名称
/// 物料模板名称
/// </summary>
/// </summary>
/// <summary>
/// <summary>
/// 物料模板总数
/// 物料模板总数
/// </summary>
/// </summary>
...
@@ -1031,16 +1015,6 @@ namespace BLL
...
@@ -1031,16 +1015,6 @@ namespace BLL
// }
// }
//}
//}
/// <summary>
/// <summary>
/// 另存为
/// 另存为
/// </summary>
/// </summary>
...
@@ -1153,11 +1127,5 @@ namespace BLL
...
@@ -1153,11 +1127,5 @@ namespace BLL
// temp.Image.Save(temp.ImagePath, System.Drawing.Imaging.ImageFormat.Jpeg);
// temp.Image.Save(temp.ImagePath, System.Drawing.Imaging.ImageFormat.Jpeg);
//}
//}
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
Model/IExtension.cs
查看文件 @
3017d4e
SmartScan/Form/FrmLoading.cs
查看文件 @
3017d4e
using
System
;
using
BLL
;
using
Model
;
using
Model
;
using
System.Threading
;
using
System
;
using
System.Windows.Forms
;
using
BLL
;
using
System.Diagnostics
;
using
System.Diagnostics
;
using
System.IO
;
using
System.IO
;
using
System.Threading
;
using
System.Windows.Forms
;
namespace
SmartScan
namespace
SmartScan
{
{
...
...
SmartScan/Form/FrmRetrospect.cs
查看文件 @
3017d4e
...
@@ -279,6 +279,10 @@ namespace SmartScan
...
@@ -279,6 +279,10 @@ namespace SmartScan
{
{
value
=
pairs
[
item
].
ToString
();
value
=
pairs
[
item
].
ToString
();
}
}
if
(
value
.
StartsWith
(
"<OCR>"
))
{
value
=
value
.
Replace
(
"<OCR>"
,
""
);
}
value
=
value
.
Replace
(
"\"\""
,
"\"\"\"\""
);
value
=
value
.
Replace
(
"\"\""
,
"\"\"\"\""
);
lines
.
Add
(
"\""
+
value
+
"\""
);
lines
.
Add
(
"\""
+
value
+
"\""
);
}
}
...
...
SmartScan/ScanWork.cs
查看文件 @
3017d4e
...
@@ -286,7 +286,8 @@ namespace SmartScan
...
@@ -286,7 +286,8 @@ namespace SmartScan
private
bool
MatchingTemplate
()
private
bool
MatchingTemplate
()
{
{
LogNet
.
log
.
Info
(
"Work MatchingTemplate"
);
LogNet
.
log
.
Info
(
"Work MatchingTemplate"
);
if
(
workCodeInfo
.
Count
==
0
)
return
false
;
//没有条码也继续进行模板匹配
//if (workCodeInfo.Count == 0) return false;
originalCodeText
=
Camera
.
GetBarCodeText
(
workCodeInfo
);
originalCodeText
=
Camera
.
GetBarCodeText
(
workCodeInfo
);
bool
rtn
=
BLLCommon
.
mateEdit
.
MatchingTemplate
(
workCodeInfo
,
BLLCommon
.
config
.
DefaultMaterialName
,
false
,
out
string
mateName
,
out
workCodeKeyword
,
out
originalCodeIsUsed
);
bool
rtn
=
BLLCommon
.
mateEdit
.
MatchingTemplate
(
workCodeInfo
,
BLLCommon
.
config
.
DefaultMaterialName
,
false
,
out
string
mateName
,
out
workCodeKeyword
,
out
originalCodeIsUsed
);
...
@@ -346,8 +347,5 @@ namespace SmartScan
...
@@ -346,8 +347,5 @@ namespace SmartScan
new
FaceMessageBox
(
""
,
text
,
MessageBoxButtons
.
OK
).
ShowDialog
();
new
FaceMessageBox
(
""
,
text
,
MessageBoxButtons
.
OK
).
ShowDialog
();
}
}
}
}
}
}
}
}
SmartScan/SetControl/UsrMaterialTemplate.cs
查看文件 @
3017d4e
...
@@ -64,6 +64,7 @@ namespace SmartScan
...
@@ -64,6 +64,7 @@ namespace SmartScan
private
string
[]
FormatCode
()
private
string
[]
FormatCode
()
{
{
List
<
string
>
item
=
new
();
List
<
string
>
item
=
new
();
for
(
int
i
=
0
;
i
<
mateCopy
[
mateIndex
].
Code
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
mateCopy
[
mateIndex
].
Code
.
Count
;
i
++)
{
{
item
.
Add
(
FormatCode
(
i
));
item
.
Add
(
FormatCode
(
i
));
...
@@ -227,6 +228,7 @@ namespace SmartScan
...
@@ -227,6 +228,7 @@ namespace SmartScan
mateCopy
[
mateIndex
].
ImagePath
=
""
;
mateCopy
[
mateIndex
].
ImagePath
=
""
;
mateCopy
[
mateIndex
].
Image
=
bmp
;
mateCopy
[
mateIndex
].
Image
=
bmp
;
ImgShow
.
Image
=
bmp
;
ImgShow
.
Image
=
bmp
;
iscamp
=
true
;
}
}
private
void
BtnLocalImage_Click
(
object
sender
,
EventArgs
e
)
private
void
BtnLocalImage_Click
(
object
sender
,
EventArgs
e
)
...
@@ -243,8 +245,9 @@ namespace SmartScan
...
@@ -243,8 +245,9 @@ namespace SmartScan
mateCopy
[
mateIndex
].
ImagePath
=
""
;
mateCopy
[
mateIndex
].
ImagePath
=
""
;
mateCopy
[
mateIndex
].
Image
=
bmp
;
mateCopy
[
mateIndex
].
Image
=
bmp
;
ImgShow
.
Image
=
bmp
;
ImgShow
.
Image
=
bmp
;
iscamp
=
false
;
}
}
public
bool
iscamp
=
true
;
private
void
BtnScanCode_Click
(
object
sender
,
EventArgs
e
)
private
void
BtnScanCode_Click
(
object
sender
,
EventArgs
e
)
{
{
if
(
mateIndex
==
-
1
)
return
;
if
(
mateIndex
==
-
1
)
return
;
...
@@ -256,7 +259,8 @@ namespace SmartScan
...
@@ -256,7 +259,8 @@ namespace SmartScan
return
;
return
;
}
}
List
<
BarcodeInfo
>
info
=
null
;
List
<
BarcodeInfo
>
info
=
null
;
if
(
Camera
.
useIDCamera
)
if
(
iscamp
&&
Camera
.
useIDCamera
)
{
{
Bitmap
[]
result
=
Camera
.
CaptureAndGetCode
(
out
info
);
Bitmap
[]
result
=
Camera
.
CaptureAndGetCode
(
out
info
);
if
(
result
.
Length
==
0
)
return
;
if
(
result
.
Length
==
0
)
return
;
...
@@ -270,6 +274,7 @@ namespace SmartScan
...
@@ -270,6 +274,7 @@ namespace SmartScan
info
=
Camera
.
GetBarCode
(
bmp
);
info
=
Camera
.
GetBarCode
(
bmp
);
}
}
//info = Camera.GetBarCode(bmp);
LstCode
.
Items
.
Clear
();
LstCode
.
Items
.
Clear
();
ImgShow
.
CodeCenterClear
();
ImgShow
.
CodeCenterClear
();
mateCopy
[
mateIndex
].
Match
.
Clear
();
mateCopy
[
mateIndex
].
Match
.
Clear
();
...
@@ -458,8 +463,17 @@ namespace SmartScan
...
@@ -458,8 +463,17 @@ namespace SmartScan
if
(
bmp
==
null
)
return
;
if
(
bmp
==
null
)
return
;
LstCode
.
Items
.
Clear
();
LstCode
.
Items
.
Clear
();
//保存需要识别ocr的区域
//保存需要识别ocr的区域
bmp
?.
Save
(
@"ocrt.jpg"
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Jpeg
);
//bmp?.Save(@"ocrt.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
string
currentDirectory
=
System
.
Windows
.
Forms
.
Application
.
StartupPath
;
string
filePath
=
System
.
IO
.
Path
.
Combine
(
currentDirectory
,
"ocrt.jpg"
);
bmp
?.
Save
(
filePath
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Jpeg
);
string
[]
regOcrCodes
=
PaddleOCRHelper
.
StartTest
(
"..\\ocrt.jpg"
).
Split
(
';'
);
string
[]
regOcrCodes
=
PaddleOCRHelper
.
StartTest
(
"..\\ocrt.jpg"
).
Split
(
';'
);
var
entity
=
mateCopy
[
mateIndex
].
Code
.
Where
(
a
=>
a
.
CodeType
.
Equals
(
Setting_Str
.
OCR
)).
ToList
();
foreach
(
var
item
in
entity
)
{
mateCopy
[
mateIndex
].
Code
.
Remove
(
item
);
}
int
startidx
=
BLLCommon
.
mateMaxCodeID
+
1
;
int
startidx
=
BLLCommon
.
mateMaxCodeID
+
1
;
foreach
(
var
ocr
in
regOcrCodes
)
foreach
(
var
ocr
in
regOcrCodes
)
{
{
...
...
SmartScan/WebCallWork.cs
查看文件 @
3017d4e
...
@@ -82,6 +82,15 @@ namespace SmartScan
...
@@ -82,6 +82,15 @@ namespace SmartScan
LogNet
.
log
.
Info
(
"Work scan is done"
);
LogNet
.
log
.
Info
(
"Work scan is done"
);
List
<
KeyValuePair
<
string
,
string
>>
result
=
new
List
<
KeyValuePair
<
string
,
string
>>();
List
<
KeyValuePair
<
string
,
string
>>
result
=
new
List
<
KeyValuePair
<
string
,
string
>>();
#
region
判断是否需要请求
http
替换数据
if
(
BLL
.
Config
.
isReplaceData
)
{
Dictionary
<
string
,
string
>
keyValues
=
new
Dictionary
<
string
,
string
>();
workCodeKeyword
=
BLLCommon
.
extension
.
ReplaceData
(
workCodeKeyword
);
}
#
endregion
foreach
(
var
wc
in
workCodeKeyword
)
foreach
(
var
wc
in
workCodeKeyword
)
{
{
result
.
Add
(
new
KeyValuePair
<
string
,
string
>(
wc
.
Key
,
wc
.
Value
));
result
.
Add
(
new
KeyValuePair
<
string
,
string
>(
wc
.
Key
,
wc
.
Value
));
...
...
paddleOCR/App.config
查看文件 @
3017d4e
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
configuration
>
<
startup
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.8"
/>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.8"
/>
</
startup
>
</
startup
>
<
runtime
>
<
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"log4net"
publicKeyToken
=
"669e0ddf0bb1aa2a"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-2.0.15.0"
newVersion
=
"2.0.15.0"
/>
</
dependentAssembly
>
</
assemblyBinding
>
</
runtime
>
</
configuration
>
</
configuration
>
paddleOCR/PaddleSharpAPI.cs
查看文件 @
3017d4e
...
@@ -80,6 +80,7 @@ namespace paddleOCR
...
@@ -80,6 +80,7 @@ namespace paddleOCR
int
flag
;
int
flag
;
log
.
Info
(
$
"准备读取图像:{imgPath}"
);
log
.
Info
(
$
"准备读取图像:{imgPath}"
);
flag
=
VisionAPI
.
eyemImageRead
(
imgPath
,
-
1
,
out
image
);
flag
=
VisionAPI
.
eyemImageRead
(
imgPath
,
-
1
,
out
image
);
log
.
Info
(
$
"图像通道为:{image.iChannels}"
);
log
.
Info
(
$
"读取图像:{imgPath},rtnCode={flag}"
);
log
.
Info
(
$
"读取图像:{imgPath},rtnCode={flag}"
);
///实例分割
///实例分割
///
///
...
@@ -295,9 +296,9 @@ namespace paddleOCR
...
@@ -295,9 +296,9 @@ namespace paddleOCR
EyemImage
image
=
new
EyemImage
();
EyemImage
image
=
new
EyemImage
();
EyemImage
tpDstImg
=
new
EyemImage
();
EyemImage
tpDstImg
=
new
EyemImage
();
int
flag
;
int
flag
;
log
.
Info
(
$
"OCRHandleRewrite:
OCRHandleRewrite:
准备读取图像:{imgPath}"
);
log
.
Info
(
$
"OCRHandleRewrite:准备读取图像:{imgPath}"
);
flag
=
VisionAPI
.
eyemImageRead
(
imgPath
,
-
1
,
out
image
);
flag
=
VisionAPI
.
eyemImageRead
(
imgPath
,
-
1
,
out
image
);
log
.
Info
(
$
"OCRHandleRewrite:读取图像:{imgPath},rtnCode={flag}"
);
log
.
Info
(
$
"OCRHandleRewrite:读取图像:{imgPath},rtnCode={flag}
,通道数为{image.iChannels}
"
);
///实例分割
///实例分割
{
{
RotateBox
container
=
new
RotateBox
();
RotateBox
container
=
new
RotateBox
();
...
@@ -431,7 +432,7 @@ namespace paddleOCR
...
@@ -431,7 +432,7 @@ namespace paddleOCR
string
[]
strs
=
stringLists
.
ToArray
();
string
[]
strs
=
stringLists
.
ToArray
();
foreach
(
string
str
in
strs
)
foreach
(
string
str
in
strs
)
{
{
if
(
string
.
IsNullOr
Empty
(
str
))
continue
;
if
(
string
.
IsNullOr
WhiteSpace
(
str
))
continue
;
result
+=
str
+
";"
;
result
+=
str
+
";"
;
}
}
if
(
result
.
EndsWith
(
";"
))
if
(
result
.
EndsWith
(
";"
))
...
...
paddleOCR/packages.config
查看文件 @
3017d4e
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
packages
>
<
package
id
=
"log4net"
version
=
"2.0.15"
targetFramework
=
"net472"
/>
<
package
id
=
"log4net"
version
=
"2.0.15"
targetFramework
=
"net472"
/>
<
package
id
=
"PaddleOCRSharp"
version
=
"2.3.0"
targetFramework
=
"net472"
requireReinstallation
=
"true"
/>
<
package
id
=
"Newtonsoft.Json"
version
=
"12.0.1"
targetFramework
=
"net48"
/>
<
package
id
=
"PaddleOCRSharp"
version
=
"2.3.0"
targetFramework
=
"net48"
/>
</
packages
>
</
packages
>
\ No newline at end of file
\ No newline at end of file
paddleOCR/paddleOCR.csproj
查看文件 @
3017d4e
...
@@ -15,6 +15,21 @@
...
@@ -15,6 +15,21 @@
<TargetFrameworkProfile />
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<PlatformTarget>x64</PlatformTarget>
...
@@ -79,12 +94,11 @@
...
@@ -79,12 +94,11 @@
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\SmartScan\bin\Debug\Newtonsoft.Json.dll</HintPath>
</Reference>
</Reference>
<Reference Include="PaddleOCRSharp, Version=2.3.0.0, Culture=neutral, processorArchitecture=AMD64">
<Reference Include="PaddleOCRSharp, Version=2.3.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\PaddleOCRSharp.2.3.0\lib\net4
72
\PaddleOCRSharp.dll</HintPath>
<HintPath>..\packages\PaddleOCRSharp.2.3.0\lib\net4
8
\PaddleOCRSharp.dll</HintPath>
</Reference>
</Reference>
<Reference Include="System">
<Reference Include="System">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll</HintPath>
...
@@ -159,11 +173,23 @@
...
@@ -159,11 +173,23 @@
<Name>Model</Name>
<Name>Model</Name>
</ProjectReference>
</ProjectReference>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8 %28x86 和 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\PaddleOCRSharp.2.3.0\build\PaddleOCRSharp.targets" Condition="Exists('..\packages\PaddleOCRSharp.2.3.0\build\PaddleOCRSharp.targets')" />
<Import Project="..\packages\PaddleOCRSharp.2.3.0\build\PaddleOCRSharp.targets" Condition="Exists('..\packages\PaddleOCRSharp.2.3.0\build\PaddleOCRSharp.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<PropertyGroup>
<ErrorText>
This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
</ErrorText>
<ErrorText>
这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。
</ErrorText>
</PropertyGroup>
</PropertyGroup>
<Error Condition="!Exists('..\packages\PaddleOCRSharp.2.3.0\build\PaddleOCRSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PaddleOCRSharp.2.3.0\build\PaddleOCRSharp.targets'))" />
<Error Condition="!Exists('..\packages\PaddleOCRSharp.2.3.0\build\PaddleOCRSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PaddleOCRSharp.2.3.0\build\PaddleOCRSharp.targets'))" />
</Target>
</Target>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论