Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
daa24484
Commit
daa24484
authored
Oct 26, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
text: filter CNN detection results
- instead of validation checks
parent
8fde8d74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
text_detectorCNN.cpp
modules/text/src/text_detectorCNN.cpp
+17
-14
No files found.
modules/text/src/text_detectorCNN.cpp
View file @
daa24484
...
@@ -29,26 +29,29 @@ protected:
...
@@ -29,26 +29,29 @@ protected:
{
{
for
(
int
k
=
0
;
k
<
nbrTextBoxes
;
k
++
)
for
(
int
k
=
0
;
k
<
nbrTextBoxes
;
k
++
)
{
{
float
x_min
=
buffer
[
k
*
nCol
+
3
]
*
inputShape
.
width
;
float
confidence_
=
buffer
[
k
*
nCol
+
2
]
;
float
y_min
=
buffer
[
k
*
nCol
+
4
]
*
inputShape
.
height
;
if
(
confidence_
<=
FLT_EPSILON
)
continue
;
float
x_m
ax
=
buffer
[
k
*
nCol
+
5
]
*
inputShape
.
width
;
float
x_m
in_f
=
buffer
[
k
*
nCol
+
3
]
*
inputShape
.
width
;
float
y_m
ax
=
buffer
[
k
*
nCol
+
6
]
*
inputShape
.
height
;
float
y_m
in_f
=
buffer
[
k
*
nCol
+
4
]
*
inputShape
.
height
;
CV_CheckLT
(
x_min
,
x_max
,
""
)
;
float
x_max_f
=
buffer
[
k
*
nCol
+
5
]
*
inputShape
.
width
;
CV_CheckLT
(
y_min
,
y_max
,
""
)
;
float
y_max_f
=
buffer
[
k
*
nCol
+
6
]
*
inputShape
.
height
;
x_min
=
std
::
max
(
0.
f
,
x_min
);
int
x_min
=
cvRound
(
std
::
max
(
0.
f
,
x_min_f
)
);
y_min
=
std
::
max
(
0.
f
,
y_min
);
int
y_min
=
cvRound
(
std
::
max
(
0.
f
,
y_min_f
)
);
x_max
=
std
::
min
(
inputShape
.
width
-
1.
f
,
x_max
);
int
x_max
=
std
::
min
(
inputShape
.
width
-
1
,
cvRound
(
x_max_f
)
);
y_max
=
std
::
min
(
inputShape
.
height
-
1.
f
,
y_max
);
int
y_max
=
std
::
min
(
inputShape
.
height
-
1
,
cvRound
(
y_max_f
)
);
i
nt
wd
=
cvRound
(
x_max
-
x_min
)
;
i
f
(
x_min
>=
x_max
)
continue
;
i
nt
ht
=
cvRound
(
y_max
-
y_min
)
;
i
f
(
y_min
>=
y_max
)
continue
;
Bbox
.
push_back
(
Rect
(
cvRound
(
x_min
),
cvRound
(
y_min
),
wd
,
ht
));
int
wd
=
x_max
-
x_min
;
confidence
.
push_back
(
buffer
[
k
*
nCol
+
2
]);
int
ht
=
y_max
-
y_min
;
Bbox
.
push_back
(
Rect
(
x_min
,
y_min
,
wd
,
ht
));
confidence
.
push_back
(
confidence_
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment