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
278c3580
Commit
278c3580
authored
Aug 01, 2014
by
lluis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix warnings of MSVC
parent
007b1d9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
+13
-15
webcam_demo.cpp
modules/text/samples/webcam_demo.cpp
+12
-14
erfilter.cpp
modules/text/src/erfilter.cpp
+1
-1
No files found.
modules/text/samples/webcam_demo.cpp
View file @
278c3580
...
...
@@ -42,6 +42,7 @@ public:
er_filter2
[
c
]
->
run
(
channels
[
c
],
regions
[
c
]);
}
}
Parallel_extractCSER
&
operator
=
(
const
Parallel_extractCSER
&
a
);
};
...
...
@@ -80,7 +81,7 @@ int main(int argc, char* argv[])
vector
<
Ptr
<
ERFilter
>
>
er_filters2
;
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
Ptr
<
ERFilter
>
er_filter1
=
createERFilterNM1
(
loadClassifierNM1
(
"trained_classifierNM1.xml"
),
8
,
0.00015
,
0.13
,
0.2
,
true
,
0.1
);
Ptr
<
ERFilter
>
er_filter1
=
createERFilterNM1
(
loadClassifierNM1
(
"trained_classifierNM1.xml"
),
8
,
0.00015
f
,
0.13
f
,
0.2
f
,
true
,
0.1
f
);
Ptr
<
ERFilter
>
er_filter2
=
createERFilterNM2
(
loadClassifierNM2
(
"trained_classifierNM2.xml"
),
0.5
);
er_filters1
.
push_back
(
er_filter1
);
er_filters2
.
push_back
(
er_filter2
);
...
...
@@ -105,12 +106,9 @@ int main(int argc, char* argv[])
return
-
1
;
}
while
(
1
)
while
(
cap
.
read
(
frame
)
)
{
double
t_all
=
getTickCount
();
cap
.
read
(
frame
);
double
t_all
=
(
double
)
getTickCount
();
if
(
downsize
)
resize
(
frame
,
frame
,
Size
(
320
,
240
));
...
...
@@ -133,7 +131,7 @@ int main(int argc, char* argv[])
{
case
0
:
{
parallel_for_
(
cv
::
Range
(
0
,
channels
.
size
()),
Parallel_extractCSER
(
channels
,
regions
,
er_filters1
,
er_filters2
));
parallel_for_
(
cv
::
Range
(
0
,
(
int
)
channels
.
size
()),
Parallel_extractCSER
(
channels
,
regions
,
er_filters1
,
er_filters2
));
break
;
}
case
1
:
...
...
@@ -181,8 +179,8 @@ int main(int argc, char* argv[])
frame
.
copyTo
(
out_img
);
float
scale_img
=
600.
/
frame
.
rows
;
float
scale_font
=
(
2
-
scale_img
)
/
1.4
;
float
scale_img
=
(
float
)(
600.
f
/
frame
.
rows
)
;
float
scale_font
=
(
float
)(
2
-
scale_img
)
/
1.4
f
;
vector
<
string
>
words_detection
;
string
output
;
...
...
@@ -203,13 +201,13 @@ int main(int argc, char* argv[])
vector
<
float
>
confidences
;
float
min_confidence1
,
min_confidence2
;
float
min_confidence1
=
0.
f
,
min_confidence2
=
0.
f
;
if
(
RECOGNITION
==
0
)
{
ocr_tess
->
run
(
group_img
,
output
,
&
boxes
,
&
words
,
&
confidences
,
OCR_LEVEL_WORD
);
min_confidence1
=
51.
;
min_confidence2
=
60.
;
min_confidence1
=
51.
f
;
min_confidence2
=
60.
f
;
}
output
.
erase
(
remove
(
output
.
begin
(),
output
.
end
(),
'\n'
),
output
.
end
());
...
...
@@ -230,9 +228,9 @@ int main(int argc, char* argv[])
continue
;
words_detection
.
push_back
(
words
[
j
]);
rectangle
(
out_img
,
boxes
[
j
].
tl
(),
boxes
[
j
].
br
(),
Scalar
(
255
,
0
,
255
),
3
);
Size
word_size
=
getTextSize
(
words
[
j
],
FONT_HERSHEY_SIMPLEX
,
scale_font
,
3
*
scale_font
,
NULL
);
Size
word_size
=
getTextSize
(
words
[
j
],
FONT_HERSHEY_SIMPLEX
,
(
double
)
scale_font
,
(
int
)(
3
*
scale_font
)
,
NULL
);
rectangle
(
out_img
,
boxes
[
j
].
tl
()
-
Point
(
3
,
word_size
.
height
+
3
),
boxes
[
j
].
tl
()
+
Point
(
word_size
.
width
,
0
),
Scalar
(
255
,
0
,
255
),
-
1
);
putText
(
out_img
,
words
[
j
],
boxes
[
j
].
tl
()
-
Point
(
1
,
1
),
FONT_HERSHEY_SIMPLEX
,
scale_font
,
Scalar
(
255
,
255
,
255
),
3
*
scale_font
);
putText
(
out_img
,
words
[
j
],
boxes
[
j
].
tl
()
-
Point
(
1
,
1
),
FONT_HERSHEY_SIMPLEX
,
scale_font
,
Scalar
(
255
,
255
,
255
),
(
int
)(
3
*
scale_font
)
);
}
}
...
...
modules/text/src/erfilter.cpp
View file @
278c3580
...
...
@@ -4099,7 +4099,7 @@ void MSERsToERStats(InputArray image, vector<vector<Point> > &contours, vector<v
{
ERStat
cser
;
cser
.
area
=
contours
[
i
].
size
();
cser
.
area
=
(
int
)
contours
[
i
].
size
();
cser
.
rect
=
boundingRect
(
contours
[
i
]);
float
avg_intensity
=
0
;
...
...
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