Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
part_of_F3_OCR
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
be642f44
authored
2022-09-07 18:01:37 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix dealername2
1 parent
3d68c2f1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
authorization_from/retriever.py
authorization_from/retriever.py
View file @
be642f4
...
...
@@ -105,15 +105,20 @@ class Retriever:
y_min_find
=
None
value
=
None
coordinates
=
None
for
(
x0
,
y0
,
_
,
_
,
x1
,
y1
,
_
,
_
),
text
in
go_res
.
values
():
cent_x
=
x0
+
((
x1
-
x0
)
/
2
)
cent_y
=
y0
+
((
y1
-
y0
)
/
2
)
for
(
x0
,
y0
,
x1
,
y1
,
x2
,
y2
,
x3
,
y3
),
text
in
go_res
.
values
():
new_x0
=
min
(
x0
,
x1
,
x2
,
x3
)
new_y0
=
min
(
y0
,
y1
,
y2
,
y3
)
new_x1
=
max
(
x0
,
x1
,
x2
,
x3
)
new_y1
=
max
(
y0
,
y1
,
y2
,
y3
)
cent_x
=
new_x0
+
((
new_x1
-
new_x0
)
/
2
)
cent_y
=
new_y0
+
((
new_y1
-
new_y0
)
/
2
)
if
x_min
<
cent_x
<
x_max
and
y_min
<
cent_y
<
y_max
:
if
y_min_find
is
None
or
y0
<
y_min_find
:
if
y_min_find
is
None
or
new_
y0
<
y_min_find
:
if
len
(
text
.
strip
())
>
0
:
y_min_find
=
y0
y_min_find
=
new_
y0
value
=
text
coordinates
=
(
x0
,
y0
,
x1
,
y1
)
coordinates
=
(
new_x0
,
new_y0
,
new_x1
,
new_
y1
)
return
value
,
coordinates
@staticmethod
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment