Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
8e8daa22
P
PaddleOCR
项目概览
weixin_41840029
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
8e8daa22
编写于
7月 13, 2021
作者:
D
Double_V
提交者:
GitHub
7月 13, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3300 from LDOUBLEV/fix_bugbye
fix bugs
上级
2062b509
48568aa4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
15 deletion
+14
-15
deploy/cpp_infer/CMakeLists.txt
deploy/cpp_infer/CMakeLists.txt
+0
-1
deploy/cpp_infer/src/clipper.cpp
deploy/cpp_infer/src/clipper.cpp
+11
-11
deploy/cpp_infer/src/config.cpp
deploy/cpp_infer/src/config.cpp
+3
-3
未找到文件。
deploy/cpp_infer/CMakeLists.txt
浏览文件 @
8e8daa22
...
@@ -13,7 +13,6 @@ SET(TENSORRT_DIR "" CACHE PATH "Compile demo with TensorRT")
...
@@ -13,7 +13,6 @@ SET(TENSORRT_DIR "" CACHE PATH "Compile demo with TensorRT")
set
(
DEMO_NAME
"ocr_system"
)
set
(
DEMO_NAME
"ocr_system"
)
macro
(
safe_set_static_flag
)
macro
(
safe_set_static_flag
)
foreach
(
flag_var
foreach
(
flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
...
...
deploy/cpp_infer/src/clipper.cpp
浏览文件 @
8e8daa22
...
@@ -668,7 +668,7 @@ void DisposeOutPts(OutPt *&pp) {
...
@@ -668,7 +668,7 @@ void DisposeOutPts(OutPt *&pp) {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
inline
void
InitEdge
(
TEdge
*
e
,
TEdge
*
eNext
,
TEdge
*
ePrev
,
const
IntPoint
&
Pt
)
{
inline
void
InitEdge
(
TEdge
*
e
,
TEdge
*
eNext
,
TEdge
*
ePrev
,
const
IntPoint
&
Pt
)
{
std
::
memset
(
e
,
0
,
sizeof
(
TEdge
));
std
::
memset
(
e
,
int
(
0
)
,
sizeof
(
TEdge
));
e
->
Next
=
eNext
;
e
->
Next
=
eNext
;
e
->
Prev
=
ePrev
;
e
->
Prev
=
ePrev
;
e
->
Curr
=
Pt
;
e
->
Curr
=
Pt
;
...
@@ -1895,17 +1895,17 @@ void Clipper::InsertLocalMinimaIntoAEL(const cInt botY) {
...
@@ -1895,17 +1895,17 @@ void Clipper::InsertLocalMinimaIntoAEL(const cInt botY) {
TEdge
*
rb
=
lm
->
RightBound
;
TEdge
*
rb
=
lm
->
RightBound
;
OutPt
*
Op1
=
0
;
OutPt
*
Op1
=
0
;
if
(
!
lb
)
{
if
(
!
lb
||
!
rb
)
{
// nb: don't insert LB into either AEL or SEL
// nb: don't insert LB into either AEL or SEL
InsertEdgeIntoAEL
(
rb
,
0
);
InsertEdgeIntoAEL
(
rb
,
0
);
SetWindingCount
(
*
rb
);
SetWindingCount
(
*
rb
);
if
(
IsContributing
(
*
rb
))
if
(
IsContributing
(
*
rb
))
Op1
=
AddOutPt
(
rb
,
rb
->
Bot
);
Op1
=
AddOutPt
(
rb
,
rb
->
Bot
);
}
else
if
(
!
rb
)
{
//
} else if (!rb) {
InsertEdgeIntoAEL
(
lb
,
0
);
//
InsertEdgeIntoAEL(lb, 0);
SetWindingCount
(
*
lb
);
//
SetWindingCount(*lb);
if
(
IsContributing
(
*
lb
))
//
if (IsContributing(*lb))
Op1
=
AddOutPt
(
lb
,
lb
->
Bot
);
//
Op1 = AddOutPt(lb, lb->Bot);
InsertScanbeam
(
lb
->
Top
.
Y
);
InsertScanbeam
(
lb
->
Top
.
Y
);
}
else
{
}
else
{
InsertEdgeIntoAEL
(
lb
,
0
);
InsertEdgeIntoAEL
(
lb
,
0
);
...
@@ -2547,13 +2547,13 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge) {
...
@@ -2547,13 +2547,13 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge) {
if
(
dir
==
dLeftToRight
)
{
if
(
dir
==
dLeftToRight
)
{
maxIt
=
m_Maxima
.
begin
();
maxIt
=
m_Maxima
.
begin
();
while
(
maxIt
!=
m_Maxima
.
end
()
&&
*
maxIt
<=
horzEdge
->
Bot
.
X
)
while
(
maxIt
!=
m_Maxima
.
end
()
&&
*
maxIt
<=
horzEdge
->
Bot
.
X
)
maxIt
++
;
++
maxIt
;
if
(
maxIt
!=
m_Maxima
.
end
()
&&
*
maxIt
>=
eLastHorz
->
Top
.
X
)
if
(
maxIt
!=
m_Maxima
.
end
()
&&
*
maxIt
>=
eLastHorz
->
Top
.
X
)
maxIt
=
m_Maxima
.
end
();
maxIt
=
m_Maxima
.
end
();
}
else
{
}
else
{
maxRit
=
m_Maxima
.
rbegin
();
maxRit
=
m_Maxima
.
rbegin
();
while
(
maxRit
!=
m_Maxima
.
rend
()
&&
*
maxRit
>
horzEdge
->
Bot
.
X
)
while
(
maxRit
!=
m_Maxima
.
rend
()
&&
*
maxRit
>
horzEdge
->
Bot
.
X
)
maxRit
++
;
++
maxRit
;
if
(
maxRit
!=
m_Maxima
.
rend
()
&&
*
maxRit
<=
eLastHorz
->
Top
.
X
)
if
(
maxRit
!=
m_Maxima
.
rend
()
&&
*
maxRit
<=
eLastHorz
->
Top
.
X
)
maxRit
=
m_Maxima
.
rend
();
maxRit
=
m_Maxima
.
rend
();
}
}
...
@@ -2576,13 +2576,13 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge) {
...
@@ -2576,13 +2576,13 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge) {
while
(
maxIt
!=
m_Maxima
.
end
()
&&
*
maxIt
<
e
->
Curr
.
X
)
{
while
(
maxIt
!=
m_Maxima
.
end
()
&&
*
maxIt
<
e
->
Curr
.
X
)
{
if
(
horzEdge
->
OutIdx
>=
0
&&
!
IsOpen
)
if
(
horzEdge
->
OutIdx
>=
0
&&
!
IsOpen
)
AddOutPt
(
horzEdge
,
IntPoint
(
*
maxIt
,
horzEdge
->
Bot
.
Y
));
AddOutPt
(
horzEdge
,
IntPoint
(
*
maxIt
,
horzEdge
->
Bot
.
Y
));
maxIt
++
;
++
maxIt
;
}
}
}
else
{
}
else
{
while
(
maxRit
!=
m_Maxima
.
rend
()
&&
*
maxRit
>
e
->
Curr
.
X
)
{
while
(
maxRit
!=
m_Maxima
.
rend
()
&&
*
maxRit
>
e
->
Curr
.
X
)
{
if
(
horzEdge
->
OutIdx
>=
0
&&
!
IsOpen
)
if
(
horzEdge
->
OutIdx
>=
0
&&
!
IsOpen
)
AddOutPt
(
horzEdge
,
IntPoint
(
*
maxRit
,
horzEdge
->
Bot
.
Y
));
AddOutPt
(
horzEdge
,
IntPoint
(
*
maxRit
,
horzEdge
->
Bot
.
Y
));
maxRit
++
;
++
maxRit
;
}
}
}
}
};
};
...
...
deploy/cpp_infer/src/config.cpp
浏览文件 @
8e8daa22
...
@@ -21,10 +21,10 @@ std::vector<std::string> OCRConfig::split(const std::string &str,
...
@@ -21,10 +21,10 @@ std::vector<std::string> OCRConfig::split(const std::string &str,
std
::
vector
<
std
::
string
>
res
;
std
::
vector
<
std
::
string
>
res
;
if
(
""
==
str
)
if
(
""
==
str
)
return
res
;
return
res
;
char
*
strs
=
new
char
[
str
.
length
()
+
1
];
char
strs
[
str
.
length
()
+
1
];
std
::
strcpy
(
strs
,
str
.
c_str
());
std
::
strcpy
(
strs
,
str
.
c_str
());
char
*
d
=
new
char
[
delim
.
length
()
+
1
];
char
d
[
delim
.
length
()
+
1
];
std
::
strcpy
(
d
,
delim
.
c_str
());
std
::
strcpy
(
d
,
delim
.
c_str
());
char
*
p
=
std
::
strtok
(
strs
,
d
);
char
*
p
=
std
::
strtok
(
strs
,
d
);
...
@@ -61,4 +61,4 @@ void OCRConfig::PrintConfigInfo() {
...
@@ -61,4 +61,4 @@ void OCRConfig::PrintConfigInfo() {
std
::
cout
<<
"=======End of Paddle OCR inference config======"
<<
std
::
endl
;
std
::
cout
<<
"=======End of Paddle OCR inference config======"
<<
std
::
endl
;
}
}
}
// namespace PaddleOCR
}
// namespace PaddleOCR
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录