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
786876c0
Commit
786876c0
authored
Jul 30, 2014
by
lluis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds The exhaustive search algorithm and updates the previous grouping code
parent
890073a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
8 deletions
+23
-8
erfilter.hpp
modules/text/include/opencv2/text/erfilter.hpp
+13
-3
textdetection.cpp
modules/text/samples/textdetection.cpp
+10
-5
erfilter.cpp
modules/text/src/erfilter.cpp
+0
-0
No files found.
modules/text/include/opencv2/text/erfilter.hpp
View file @
786876c0
...
...
@@ -239,6 +239,12 @@ enum { ERFILTER_NM_RGBLGrad = 0,
CV_EXPORTS
void
computeNMChannels
(
InputArray
_src
,
OutputArrayOfArrays
_channels
,
int
_mode
=
ERFILTER_NM_RGBLGrad
);
// erGrouping operation modes
enum
{
ERGROUPING_ORIENTATION_HORIZ
=
0
,
ERGROUPING_ORIENTATION_ANY
=
1
};
/*!
Find groups of Extremal Regions that are organized as text blocks. This function implements
the grouping algorithm described in:
...
...
@@ -260,9 +266,13 @@ CV_EXPORTS void computeNMChannels(InputArray _src, OutputArrayOfArrays _channels
\param minProbability The minimum probability for accepting a group
\param groups The output of the algorithm are stored in this parameter as list of rectangles.
*/
CV_EXPORTS
void
erGrouping
(
InputArrayOfArrays
src
,
std
::
vector
<
std
::
vector
<
ERStat
>
>
&
regions
,
const
std
::
string
&
filename
,
float
minProbablity
,
std
::
vector
<
Rect
>
&
groups
);
CV_EXPORTS
void
erGrouping
(
InputArray
img
,
InputArrayOfArrays
channels
,
std
::
vector
<
std
::
vector
<
ERStat
>
>
&
regions
,
std
::
vector
<
std
::
vector
<
Vec2i
>
>
&
groups
,
std
::
vector
<
Rect
>
&
groups_rects
,
int
method
=
ERGROUPING_ORIENTATION_HORIZ
,
const
std
::
string
&
filename
=
std
::
string
(),
float
minProbablity
=
0.5
);
}
}
...
...
modules/text/samples/textdetection.cpp
View file @
786876c0
...
...
@@ -59,11 +59,16 @@ int main(int argc, const char * argv[])
// Detect character groups
cout
<<
"Grouping extracted ERs ... "
;
vector
<
Rect
>
groups
;
erGrouping
(
channels
,
regions
,
"trained_classifier_erGrouping.xml"
,
0.5
,
groups
);
cout
<<
"image size "
<<
src
.
cols
<<
"x"
<<
src
.
rows
<<
endl
;
vector
<
vector
<
Vec2i
>
>
region_groups
;
vector
<
Rect
>
groups_boxes
;
erGrouping
(
src
,
channels
,
regions
,
region_groups
,
groups_boxes
,
ERGROUPING_ORIENTATION_HORIZ
);
//erGrouping(src, channels, regions, region_groups, groups_boxes, ERGROUPING_ORIENTATION_ANY, "./trained_classifier_erGrouping.xml", 0.5);
// draw groups
groups_draw
(
src
,
groups
);
cout
<<
"image size "
<<
src
.
cols
<<
"x"
<<
src
.
rows
<<
endl
;
groups_draw
(
src
,
groups_boxes
);
cout
<<
"image size "
<<
src
.
cols
<<
"x"
<<
src
.
rows
<<
endl
;
imshow
(
"grouping"
,
src
);
cout
<<
"Done!"
<<
endl
<<
endl
;
...
...
@@ -75,9 +80,9 @@ int main(int argc, const char * argv[])
er_filter1
.
release
();
er_filter2
.
release
();
regions
.
clear
();
if
(
!
groups
.
empty
())
if
(
!
groups
_boxes
.
empty
())
{
groups
.
clear
();
groups
_boxes
.
clear
();
}
}
...
...
modules/text/src/erfilter.cpp
View file @
786876c0
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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