Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
顾剑亮
/
SmartScan
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 537f8e08
由
张东亮
编写于
2023-03-16 11:10:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
ocr程序到不开问题
1 个父辈
4ee377f3
全部展开
显示空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
29 行增加
和
41 行删除
BLL/MaterialEdit.cs
BLL/PaddleOCRHelper.cs
BLL/bin/Debug/BLL.dll
BLL/bin/Debug/BLL.pdb
BLL/obj/Debug/BLL.csproj.AssemblyReference.cache
BLL/obj/Debug/BLL.dll
BLL/obj/Debug/BLL.pdb
DAL/obj/Debug/DAL.csproj.AssemblyReference.cache
SmartScan/Form/FrmCodeOCR.cs
SmartScan/Program.cs
SmartScan/bin/Debug/BLL.dll
SmartScan/bin/Debug/BLL.pdb
SmartScan/bin/Debug/Logs/SmartScan.log
SmartScan/bin/Debug/Logs/VisionLib.log
SmartScan/bin/Debug/SmartScan.exe
SmartScan/bin/Debug/SmartScan.pdb
SmartScan/obj/Debug/SmartScan.csproj.AssemblyReference.cache
SmartScan/obj/Debug/SmartScan.exe
SmartScan/obj/Debug/SmartScan.pdb
paddleOCR/service/Service.cs
BLL/MaterialEdit.cs
查看文件 @
537f8e0
...
@@ -430,25 +430,6 @@ namespace BLL
...
@@ -430,25 +430,6 @@ namespace BLL
if
(
algro
)
if
(
algro
)
{
{
codeOcr
=
PaddleOCRHelper
.
StartTest
(
"..\\ocr.jpg"
);
codeOcr
=
PaddleOCRHelper
.
StartTest
(
"..\\ocr.jpg"
);
if
(
string
.
IsNullOrEmpty
(
codeOcr
))
{
#
region
ocrr
文字提取开始
//ocr匹配调用
var
resp
=
namedPipeClient
.
Request
(
"..\\ocr.jpg"
);
//ocr结果
var
lp
=
JsonConvert
.
DeserializeObject
<
List
<
TextBlock
>>(
resp
);
double
maxbox
=
0
;
foreach
(
var
l
in
lp
)
{
var
boxa
=
l
.
CalculateArea
(
l
.
BoxPoints
);
if
(
boxa
>
maxbox
)
{
maxbox
=
boxa
;
codeOcr
=
l
.
Text
;
}
}
#
endregion
ocr
文字提取结束
}
}
}
else
else
{
{
...
...
BLL/PaddleOCRHelper.cs
查看文件 @
537f8e0
...
@@ -17,7 +17,7 @@ namespace BLL
...
@@ -17,7 +17,7 @@ namespace BLL
{
{
public
class
PaddleOCRHelper
public
class
PaddleOCRHelper
{
{
static
string
baseUrl
=
ConfigHelper
.
Config
.
Get
(
"PaddleServiceBase"
,
"http://
192.168.101.12
:8090/paddle/getOcr"
);
static
string
baseUrl
=
ConfigHelper
.
Config
.
Get
(
"PaddleServiceBase"
,
"http://
localhost
:8090/paddle/getOcr"
);
/// <summary>
/// <summary>
/// 开始检测
/// 开始检测
/// </summary>
/// </summary>
...
@@ -30,8 +30,19 @@ namespace BLL
...
@@ -30,8 +30,19 @@ namespace BLL
string
ocr
=
""
;
string
ocr
=
""
;
if
(!
AppIsRun
())
if
(!
AppIsRun
())
{
{
var
onnxexe
=
".\\paddle\\paddleOCR.exe"
;
try
Process
.
Start
(
onnxexe
);
{
var
paddle
=
"paddleOCR.exe"
;
Process
process
=
new
Process
();
process
.
StartInfo
=
new
ProcessStartInfo
();
process
.
StartInfo
.
FileName
=
paddle
;
process
.
StartInfo
.
WorkingDirectory
=
".\\paddle"
;
process
.
Start
();
}
catch
(
Exception
ex
)
{
LogNet
.
log
.
Error
(
"打开paddleOCR失败"
,
ex
);
}
}
}
if
(
AppIsRun
())
if
(
AppIsRun
())
{
{
...
...
BLL/bin/Debug/BLL.dll
查看文件 @
537f8e0
此文件类型无法预览
BLL/bin/Debug/BLL.pdb
查看文件 @
537f8e0
此文件类型无法预览
BLL/obj/Debug/BLL.csproj.AssemblyReference.cache
查看文件 @
537f8e0
此文件类型无法预览
BLL/obj/Debug/BLL.dll
查看文件 @
537f8e0
此文件类型无法预览
BLL/obj/Debug/BLL.pdb
查看文件 @
537f8e0
此文件类型无法预览
DAL/obj/Debug/DAL.csproj.AssemblyReference.cache
查看文件 @
537f8e0
此文件类型无法预览
SmartScan/Form/FrmCodeOCR.cs
查看文件 @
537f8e0
...
@@ -220,21 +220,6 @@ namespace SmartScan
...
@@ -220,21 +220,6 @@ namespace SmartScan
if
(
algro
)
if
(
algro
)
{
{
codeOcrs
=
PaddleOCRHelper
.
StartTest
(
"..\\ocrt.jpg"
);
codeOcrs
=
PaddleOCRHelper
.
StartTest
(
"..\\ocrt.jpg"
);
if
(
string
.
IsNullOrEmpty
(
codeOcrs
))
{
var
resp
=
Common
.
mateEdit
.
namedPipeClient
.
Request
(
"..\\ocrt.jpg"
);
var
lp
=
JsonConvert
.
DeserializeObject
<
List
<
TextBlock
>>(
resp
);
double
maxbox
=
0
;
foreach
(
var
l
in
lp
)
{
var
boxa
=
l
.
CalculateArea
(
l
.
BoxPoints
);
if
(
boxa
>
maxbox
)
{
maxbox
=
boxa
;
codeOcrs
=
l
.
Text
;
}
}
}
}
}
else
else
{
{
...
...
SmartScan/Program.cs
查看文件 @
537f8e0
...
@@ -45,9 +45,19 @@ namespace SmartScan
...
@@ -45,9 +45,19 @@ namespace SmartScan
var
onnxexe
=
"onnx\\OcrLiteOnnxForm.exe"
;
var
onnxexe
=
"onnx\\OcrLiteOnnxForm.exe"
;
Process
.
Start
(
onnxexe
);
Process
process1
=
Process
.
Start
(
onnxexe
);
var
paddle
=
".\\paddle\\paddleOCR.exe"
;
try
Process
.
Start
(
paddle
);
{
var
paddle
=
"paddleOCR.exe"
;
Process
process
=
new
Process
();
process
.
StartInfo
=
new
ProcessStartInfo
();
process
.
StartInfo
.
FileName
=
paddle
;
process
.
StartInfo
.
WorkingDirectory
=
".\\paddle"
;
process
.
Start
();
}
catch
(
Exception
ex
)
{
}
...
...
SmartScan/bin/Debug/BLL.dll
查看文件 @
537f8e0
此文件类型无法预览
SmartScan/bin/Debug/BLL.pdb
查看文件 @
537f8e0
此文件类型无法预览
SmartScan/bin/Debug/Logs/SmartScan.log
查看文件 @
537f8e0
此文件的差异被折叠,
点击展开。
SmartScan/bin/Debug/Logs/VisionLib.log
查看文件 @
537f8e0
此文件的差异被折叠,
点击展开。
SmartScan/bin/Debug/SmartScan.exe
查看文件 @
537f8e0
此文件类型无法预览
SmartScan/bin/Debug/SmartScan.pdb
查看文件 @
537f8e0
此文件类型无法预览
SmartScan/obj/Debug/SmartScan.csproj.AssemblyReference.cache
查看文件 @
537f8e0
此文件类型无法预览
SmartScan/obj/Debug/SmartScan.exe
查看文件 @
537f8e0
此文件类型无法预览
SmartScan/obj/Debug/SmartScan.pdb
查看文件 @
537f8e0
此文件类型无法预览
paddleOCR/service/Service.cs
查看文件 @
537f8e0
...
@@ -17,6 +17,7 @@ namespace DeviceLibrary
...
@@ -17,6 +17,7 @@ namespace DeviceLibrary
{
{
Result
result
=
new
Result
();
Result
result
=
new
Result
();
DateTime
dateTime
=
DateTime
.
Now
;
DateTime
dateTime
=
DateTime
.
Now
;
result
.
data
=
PaddleOCRHelper
.
StartCPlusOcr
(
imgPath
);
//if (string.IsNullOrEmpty(ver))
//if (string.IsNullOrEmpty(ver))
//{
//{
// result.data = PaddleOCRHelper.StartCPlusOcr(imgPath);
// result.data = PaddleOCRHelper.StartCPlusOcr(imgPath);
...
@@ -24,7 +25,7 @@ namespace DeviceLibrary
...
@@ -24,7 +25,7 @@ namespace DeviceLibrary
//else
//else
//if (ver.ToLower().Equals("python"))
//if (ver.ToLower().Equals("python"))
//{
//{
result
.
data
=
PaddleOCRHelper
.
StartPythonOcr
(
imgPath
);
//
result.data = PaddleOCRHelper.StartPythonOcr(imgPath);
//}
//}
//else if(ver.ToLower().Equals("cplus"))
//else if(ver.ToLower().Equals("cplus"))
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论