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
1481194b
Commit
1481194b
authored
Aug 03, 2015
by
Lluis Gomez-Bigorda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix w64 warnings
parent
2315f9ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
segmented_word_recognition.cpp
modules/text/samples/segmented_word_recognition.cpp
+3
-3
ocr_beamsearch_decoder.cpp
modules/text/src/ocr_beamsearch_decoder.cpp
+1
-1
ocr_hmm_decoder.cpp
modules/text/src/ocr_hmm_decoder.cpp
+3
-3
No files found.
modules/text/samples/segmented_word_recognition.cpp
View file @
1481194b
...
...
@@ -98,18 +98,18 @@ int main(int argc, char* argv[]) {
voc
,
transitionProbabilities
,
emissionProbabilities
);
std
::
string
output
;
double
t_r
=
getTickCount
();
double
t_r
=
(
double
)
getTickCount
();
ocrTes
->
run
(
mask
,
output
);
output
.
erase
(
remove
(
output
.
begin
(),
output
.
end
(),
'\n'
),
output
.
end
());
cout
<<
" OCR_Tesseract output
\"
"
<<
output
<<
"
\"
. Done in "
<<
((
double
)
getTickCount
()
-
t_r
)
*
1000
/
getTickFrequency
()
<<
" ms."
<<
endl
;
t_r
=
getTickCount
();
t_r
=
(
double
)
getTickCount
();
ocrNM
->
run
(
mask
,
output
);
cout
<<
" OCR_NM output
\"
"
<<
output
<<
"
\"
. Done in "
<<
((
double
)
getTickCount
()
-
t_r
)
*
1000
/
getTickFrequency
()
<<
" ms."
<<
endl
;
t_r
=
getTickCount
();
t_r
=
(
double
)
getTickCount
();
ocrCNN
->
run
(
image
,
mask
,
output
);
cout
<<
" OCR_CNN output
\"
"
<<
output
<<
"
\"
. Done in "
<<
((
double
)
getTickCount
()
-
t_r
)
*
1000
/
getTickFrequency
()
<<
" ms."
<<
endl
;
...
...
modules/text/src/ocr_beamsearch_decoder.cpp
View file @
1481194b
...
...
@@ -459,7 +459,7 @@ OCRBeamSearchClassifierCNN::OCRBeamSearchClassifierCNN (const string& filename)
nr_feature
=
weights
.
rows
;
nr_class
=
weights
.
cols
;
patch_size
=
sqrt
(
kernels
.
cols
);
patch_size
=
(
int
)
sqrt
(
kernels
.
cols
);
// algorithm internal parameters
window_size
=
32
;
quad_size
=
12
;
...
...
modules/text/src/ocr_hmm_decoder.cpp
View file @
1481194b
...
...
@@ -525,7 +525,7 @@ public:
char_center
.
x
+=
words_rect
[
w
].
x
;
char_center
.
y
+=
words_rect
[
w
].
y
;
int
win_size
=
max
(
contours_rect
.
at
(
i
).
width
,
contours_rect
.
at
(
i
).
height
);
win_size
+=
win_size
*
0.6
;
// add some pixels in the border TODO: is this a parameter for the user space?
win_size
+=
(
int
)(
win_size
*
0.6
)
;
// add some pixels in the border TODO: is this a parameter for the user space?
Rect
char_rect
=
Rect
(
char_center
.
x
-
win_size
/
2
,
char_center
.
y
-
win_size
/
2
,
win_size
,
win_size
);
char_rect
&=
Rect
(
0
,
0
,
image
.
cols
,
image
.
rows
);
Mat
tmp_image
;
...
...
@@ -969,9 +969,9 @@ void OCRHMMClassifierCNN::eval( InputArray _src, vector<int>& out_class, vector<
int
quad_id
=
1
;
for
(
int
q_x
=
0
;
q_x
<=
window_size
-
quad_size
;
q_x
=
q_x
+
(
quad_size
/
2
-
1
))
for
(
int
q_x
=
0
;
q_x
<=
window_size
-
quad_size
;
q_x
=
q_x
+
(
int
)(
quad_size
/
2
-
1
))
{
for
(
int
q_y
=
0
;
q_y
<=
window_size
-
quad_size
;
q_y
=
q_y
+
(
quad_size
/
2
-
1
))
for
(
int
q_y
=
0
;
q_y
<=
window_size
-
quad_size
;
q_y
=
q_y
+
(
int
)(
quad_size
/
2
-
1
))
{
Rect
quad_rect
=
Rect
(
q_x
,
q_y
,
quad_size
,
quad_size
);
quad
=
img
(
quad_rect
);
...
...
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