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
b19c6765
Commit
b19c6765
authored
Aug 26, 2015
by
Lluis Gomez-Bigorda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Win x64 and iOS warnings
parent
7cd6dbb0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
ocr_beamsearch_decoder.cpp
modules/text/src/ocr_beamsearch_decoder.cpp
+10
-10
No files found.
modules/text/src/ocr_beamsearch_decoder.cpp
View file @
b19c6765
...
...
@@ -211,7 +211,7 @@ public:
if
(
recognition_probabilities
[
i
][
j
]
>
best_p
)
{
best_p
=
recognition_probabilities
[
i
][
j
];
best_idx
=
j
;
best_idx
=
(
int
)
j
;
}
}
...
...
@@ -261,8 +261,8 @@ public:
{
beamSearch_node
node
;
node
.
segmentation
.
push_back
(
i
);
node
.
segmentation
.
push_back
(
j
);
node
.
segmentation
.
push_back
(
(
int
)
i
);
node
.
segmentation
.
push_back
(
(
int
)
j
);
node
.
score
=
score_segmentation
(
node
.
segmentation
,
out_sequence
);
vector
<
vector
<
int
>
>
childs
=
generate_childs
(
node
.
segmentation
);
node
.
expanded
=
true
;
...
...
@@ -320,7 +320,7 @@ private:
vector
<
vector
<
int
>
>
childs
;
for
(
size_t
i
=
segmentation
[
segmentation
.
size
()
-
1
]
+
1
;
i
<
oversegmentation
.
size
();
i
++
)
{
int
seg_point
=
i
;
int
seg_point
=
(
int
)
i
;
if
(
find
(
segmentation
.
begin
(),
segmentation
.
end
(),
seg_point
)
==
segmentation
.
end
())
{
vector
<
int
>
child
=
segmentation
;
...
...
@@ -368,16 +368,16 @@ private:
// in other cases we do it because the overlapping between two chars is too large
// TODO Add more heuristics (e.g. penalize large inter-character variance)
Mat
interdist
(
segmentation
.
size
()
-
1
,
1
,
CV_32F
,
1
);
Mat
interdist
(
(
int
)
segmentation
.
size
()
-
1
,
1
,
CV_32F
,
1
);
for
(
size_t
i
=
0
;
i
<
segmentation
.
size
()
-
1
;
i
++
)
{
interdist
.
at
<
float
>
(
i
,
0
)
=
oversegmentation
[
segmentation
[
i
+
1
]]
*
step_size
-
oversegmentation
[
segmentation
[
i
]]
*
step_size
;
if
((
float
)
interdist
.
at
<
float
>
(
i
,
0
)
/
win_size
>
2.25
)
// TODO explain how did you set this thrs
interdist
.
at
<
float
>
(
i
,
0
)
=
(
float
)
oversegmentation
[
segmentation
[(
int
)
i
+
1
]]
*
step_size
-
(
float
)
oversegmentation
[
segmentation
[(
int
)
i
]]
*
step_size
;
if
((
float
)
interdist
.
at
<
float
>
(
(
int
)
i
,
0
)
/
win_size
>
2.25
)
// TODO explain how did you set this thrs
{
return
-
DBL_MAX
;
}
if
((
float
)
interdist
.
at
<
float
>
(
i
,
0
)
/
win_size
<
0.15
)
// TODO explain how did you set this thrs
if
((
float
)
interdist
.
at
<
float
>
(
(
int
)
i
,
0
)
/
win_size
<
0.15
)
// TODO explain how did you set this thrs
{
return
-
DBL_MAX
;
}
...
...
@@ -517,7 +517,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
);
window_size
=
4
*
patch_size
;
step_size
=
4
;
quad_size
=
12
;
...
...
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