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
071eb5a7
Commit
071eb5a7
authored
Aug 27, 2014
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #69 from thorikawa/fix-usage-text
Fix key name to switch between MSER/CSER regions.
parents
1ce15227
d9d8db3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
webcam_demo.cpp
modules/text/samples/webcam_demo.cpp
+7
-7
No files found.
modules/text/samples/webcam_demo.cpp
View file @
071eb5a7
...
...
@@ -59,9 +59,9 @@ private:
public
:
Parallel_OCR
(
vector
<
Mat
>
&
_detections
,
vector
<
string
>
&
_outputs
,
vector
<
vector
<
Rect
>
>
&
_boxes
,
vector
<
vector
<
string
>
>
&
_words
,
vector
<
vector
<
float
>
>
&
_confidences
,
vector
<
vector
<
string
>
>
&
_words
,
vector
<
vector
<
float
>
>
&
_confidences
,
vector
<
Ptr
<
T
>
>
&
_ocrs
)
:
detections
(
_detections
),
outputs
(
_outputs
),
boxes
(
_boxes
),
words
(
_words
),
:
detections
(
_detections
),
outputs
(
_outputs
),
boxes
(
_boxes
),
words
(
_words
),
confidences
(
_confidences
),
ocrs
(
_ocrs
)
{}
...
...
@@ -87,7 +87,7 @@ int main(int argc, char* argv[])
cout
<<
endl
<<
argv
[
0
]
<<
endl
<<
endl
;
cout
<<
"A demo program of End-to-end Scene Text Detection and Recognition using webcam."
<<
endl
<<
endl
;
cout
<<
" Usage: "
<<
argv
[
0
]
<<
" [camera_index]"
<<
endl
<<
endl
;
cout
<<
" Press '
e
' to switch between MSER/CSER regions."
<<
endl
;
cout
<<
" Press '
r
' to switch between MSER/CSER regions."
<<
endl
;
cout
<<
" Press 'g' to switch between Horizontal and Arbitrary oriented grouping."
<<
endl
;
cout
<<
" Press 'o' to switch between OCRTesseract/OCRHMMDecoder recognition."
<<
endl
;
cout
<<
" Press 's' to scale down frame size to 320x240."
<<
endl
;
...
...
@@ -140,7 +140,7 @@ int main(int argc, char* argv[])
vector
<
Ptr
<
OCRHMMDecoder
>
>
decoders
;
for
(
int
o
=
0
;
o
<
num_ocrs
;
o
++
)
{
decoders
.
push_back
(
OCRHMMDecoder
::
create
(
loadOCRHMMClassifierNM
(
"OCRHMM_knn_model_data.xml.gz"
),
decoders
.
push_back
(
OCRHMMDecoder
::
create
(
loadOCRHMMClassifierNM
(
"OCRHMM_knn_model_data.xml.gz"
),
voc
,
transition_p
,
emission_p
));
}
cout
<<
" Done!"
<<
endl
;
...
...
@@ -236,7 +236,7 @@ int main(int argc, char* argv[])
float
scale_font
=
(
float
)(
2
-
scale_img
)
/
1.4
f
;
vector
<
string
>
words_detection
;
float
min_confidence1
=
0.
f
,
min_confidence2
=
0.
f
;
if
(
RECOGNITION
==
0
)
{
min_confidence1
=
51.
f
;
min_confidence2
=
60.
f
;
...
...
@@ -261,9 +261,9 @@ int main(int argc, char* argv[])
vector
<
vector
<
Rect
>
>
boxes
((
int
)
detections
.
size
());
vector
<
vector
<
string
>
>
words
((
int
)
detections
.
size
());
vector
<
vector
<
float
>
>
confidences
((
int
)
detections
.
size
());
// parallel process detections in batches of ocrs.size() (== num_ocrs)
for
(
int
i
=
0
;
i
<
(
int
)
detections
.
size
();
i
=
i
+
(
int
)
num_ocrs
)
for
(
int
i
=
0
;
i
<
(
int
)
detections
.
size
();
i
=
i
+
(
int
)
num_ocrs
)
{
Range
r
;
if
(
i
+
(
int
)
num_ocrs
<=
(
int
)
detections
.
size
())
...
...
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