Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
43e7e6e4
Commit
43e7e6e4
authored
Jul 23, 2013
by
lluis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed extra cv:: scope qualifiers for better readability
parent
2087d460
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
erfilter.hpp
modules/objdetect/include/opencv2/objdetect/erfilter.hpp
+5
-5
erfilter.cpp
modules/objdetect/src/erfilter.cpp
+12
-12
No files found.
modules/objdetect/include/opencv2/objdetect/erfilter.hpp
View file @
43e7e6e4
...
@@ -119,7 +119,7 @@ public:
...
@@ -119,7 +119,7 @@ public:
Extracts the component tree (if needed) and filter the extremal regions (ER's) by using a given classifier.
Extracts the component tree (if needed) and filter the extremal regions (ER's) by using a given classifier.
*/
*/
class
CV_EXPORTS
ERFilter
:
public
cv
::
Algorithm
class
CV_EXPORTS
ERFilter
:
public
Algorithm
{
{
public
:
public
:
...
@@ -138,11 +138,11 @@ public:
...
@@ -138,11 +138,11 @@ public:
\param image is the input image
\param image is the input image
\param regions is output for the first stage, input/output for the second one.
\param regions is output for the first stage, input/output for the second one.
*/
*/
virtual
void
run
(
cv
::
InputArray
image
,
std
::
vector
<
ERStat
>&
regions
)
=
0
;
virtual
void
run
(
InputArray
image
,
std
::
vector
<
ERStat
>&
regions
)
=
0
;
//! set/get methods to set the algorithm properties,
//! set/get methods to set the algorithm properties,
virtual
void
setCallback
(
const
cv
::
Ptr
<
ERFilter
::
Callback
>&
cb
)
=
0
;
virtual
void
setCallback
(
const
Ptr
<
ERFilter
::
Callback
>&
cb
)
=
0
;
virtual
void
setThresholdDelta
(
int
thresholdDelta
)
=
0
;
virtual
void
setThresholdDelta
(
int
thresholdDelta
)
=
0
;
virtual
void
setMinArea
(
float
minArea
)
=
0
;
virtual
void
setMinArea
(
float
minArea
)
=
0
;
virtual
void
setMaxArea
(
float
maxArea
)
=
0
;
virtual
void
setMaxArea
(
float
maxArea
)
=
0
;
...
@@ -176,7 +176,7 @@ public:
...
@@ -176,7 +176,7 @@ public:
\param nonMaxSuppression Whenever non-maximum suppression is done over the branch probabilities
\param nonMaxSuppression Whenever non-maximum suppression is done over the branch probabilities
\param minProbability The minimum probability difference between local maxima and local minima ERs
\param minProbability The minimum probability difference between local maxima and local minima ERs
*/
*/
CV_EXPORTS
cv
::
Ptr
<
ERFilter
>
createERFilterNM1
(
const
cv
::
Ptr
<
ERFilter
::
Callback
>&
cb
=
NULL
,
CV_EXPORTS
Ptr
<
ERFilter
>
createERFilterNM1
(
const
Ptr
<
ERFilter
::
Callback
>&
cb
=
NULL
,
int
thresholdDelta
=
1
,
float
minArea
=
0.000025
,
int
thresholdDelta
=
1
,
float
minArea
=
0.000025
,
float
maxArea
=
0.13
,
float
minProbability
=
0.2
,
float
maxArea
=
0.13
,
float
minProbability
=
0.2
,
bool
nonMaxSuppression
=
true
,
bool
nonMaxSuppression
=
true
,
...
@@ -195,7 +195,7 @@ CV_EXPORTS cv::Ptr<ERFilter> createERFilterNM1(const cv::Ptr<ERFilter::Callback>
...
@@ -195,7 +195,7 @@ CV_EXPORTS cv::Ptr<ERFilter> createERFilterNM1(const cv::Ptr<ERFilter::Callback>
if omitted tries to load a default classifier from file trained_classifierNM2.xml
if omitted tries to load a default classifier from file trained_classifierNM2.xml
\param minProbability The minimum probability P(er|character) allowed for retreived ER's
\param minProbability The minimum probability P(er|character) allowed for retreived ER's
*/
*/
CV_EXPORTS
cv
::
Ptr
<
ERFilter
>
createERFilterNM2
(
const
cv
::
Ptr
<
ERFilter
::
Callback
>&
cb
=
NULL
,
CV_EXPORTS
Ptr
<
ERFilter
>
createERFilterNM2
(
const
Ptr
<
ERFilter
::
Callback
>&
cb
=
NULL
,
float
minProbability
=
0.85
);
float
minProbability
=
0.85
);
}
}
...
...
modules/objdetect/src/erfilter.cpp
View file @
43e7e6e4
...
@@ -82,14 +82,14 @@ public:
...
@@ -82,14 +82,14 @@ public:
// the key method. Takes image on input, vector of ERStat is output for the first stage,
// the key method. Takes image on input, vector of ERStat is output for the first stage,
// input/output - for the second one.
// input/output - for the second one.
void
run
(
cv
::
InputArray
image
,
std
::
vector
<
ERStat
>&
regions
);
void
run
(
InputArray
image
,
std
::
vector
<
ERStat
>&
regions
);
protected
:
protected
:
int
thresholdDelta
;
int
thresholdDelta
;
float
maxArea
;
float
maxArea
;
float
minArea
;
float
minArea
;
cv
::
Ptr
<
ERFilter
::
Callback
>
classifier
;
Ptr
<
ERFilter
::
Callback
>
classifier
;
// count of the rejected/accepted regions
// count of the rejected/accepted regions
int
num_rejected_regions
;
int
num_rejected_regions
;
...
@@ -98,7 +98,7 @@ protected:
...
@@ -98,7 +98,7 @@ protected:
public
:
public
:
// set/get methods to set the algorithm properties,
// set/get methods to set the algorithm properties,
void
setCallback
(
const
cv
::
Ptr
<
ERFilter
::
Callback
>&
cb
);
void
setCallback
(
const
Ptr
<
ERFilter
::
Callback
>&
cb
);
void
setThresholdDelta
(
int
thresholdDelta
);
void
setThresholdDelta
(
int
thresholdDelta
);
void
setMinArea
(
float
minArea
);
void
setMinArea
(
float
minArea
);
void
setMaxArea
(
float
maxArea
);
void
setMaxArea
(
float
maxArea
);
...
@@ -111,10 +111,10 @@ private:
...
@@ -111,10 +111,10 @@ private:
// pointer to the input/output regions vector
// pointer to the input/output regions vector
std
::
vector
<
ERStat
>
*
regions
;
std
::
vector
<
ERStat
>
*
regions
;
// image mask used for feature calculations
// image mask used for feature calculations
cv
::
Mat
region_mask
;
Mat
region_mask
;
// extract the component tree and store all the ER regions
// extract the component tree and store all the ER regions
void
er_tree_extract
(
cv
::
InputArray
image
);
void
er_tree_extract
(
InputArray
image
);
// accumulate a pixel into an ER
// accumulate a pixel into an ER
void
er_add_pixel
(
ERStat
*
parent
,
int
x
,
int
y
,
int
non_boundary_neighbours
,
void
er_add_pixel
(
ERStat
*
parent
,
int
x
,
int
y
,
int
non_boundary_neighbours
,
int
non_boundary_neighbours_horiz
,
int
non_boundary_neighbours_horiz
,
...
@@ -126,7 +126,7 @@ private:
...
@@ -126,7 +126,7 @@ private:
// copy extracted regions into the output vector
// copy extracted regions into the output vector
ERStat
*
er_save
(
ERStat
*
er
,
ERStat
*
parent
,
ERStat
*
prev
);
ERStat
*
er_save
(
ERStat
*
er
,
ERStat
*
parent
,
ERStat
*
prev
);
// recursively walk the tree and filter (remove) regions using the callback classifier
// recursively walk the tree and filter (remove) regions using the callback classifier
ERStat
*
er_tree_filter
(
cv
::
InputArray
image
,
ERStat
*
stat
,
ERStat
*
parent
,
ERStat
*
prev
);
ERStat
*
er_tree_filter
(
InputArray
image
,
ERStat
*
stat
,
ERStat
*
parent
,
ERStat
*
prev
);
// recursively walk the tree selecting only regions with local maxima probability
// recursively walk the tree selecting only regions with local maxima probability
ERStat
*
er_tree_nonmax_suppression
(
ERStat
*
er
,
ERStat
*
parent
,
ERStat
*
prev
);
ERStat
*
er_tree_nonmax_suppression
(
ERStat
*
er
,
ERStat
*
parent
,
ERStat
*
prev
);
};
};
...
@@ -184,7 +184,7 @@ ERFilterNM::ERFilterNM()
...
@@ -184,7 +184,7 @@ ERFilterNM::ERFilterNM()
// the key method. Takes image on input, vector of ERStat is output for the first stage,
// the key method. Takes image on input, vector of ERStat is output for the first stage,
// input/output for the second one.
// input/output for the second one.
void
ERFilterNM
::
run
(
cv
::
InputArray
image
,
std
::
vector
<
ERStat
>&
_regions
)
void
ERFilterNM
::
run
(
InputArray
image
,
std
::
vector
<
ERStat
>&
_regions
)
{
{
// assert correct image type
// assert correct image type
...
@@ -222,7 +222,7 @@ void ERFilterNM::run( cv::InputArray image, std::vector<ERStat>& _regions )
...
@@ -222,7 +222,7 @@ void ERFilterNM::run( cv::InputArray image, std::vector<ERStat>& _regions )
// extract the component tree and store all the ER regions
// extract the component tree and store all the ER regions
// uses the algorithm described in
// uses the algorithm described in
// Linear time maximally stable extremal regions, D Nistér, H Stewénius – ECCV 2008
// Linear time maximally stable extremal regions, D Nistér, H Stewénius – ECCV 2008
void
ERFilterNM
::
er_tree_extract
(
cv
::
InputArray
image
)
void
ERFilterNM
::
er_tree_extract
(
InputArray
image
)
{
{
Mat
src
=
image
.
getMat
();
Mat
src
=
image
.
getMat
();
...
@@ -749,7 +749,7 @@ ERStat* ERFilterNM::er_save( ERStat *er, ERStat *parent, ERStat *prev )
...
@@ -749,7 +749,7 @@ ERStat* ERFilterNM::er_save( ERStat *er, ERStat *parent, ERStat *prev )
}
}
// recursively walk the tree and filter (remove) regions using the callback classifier
// recursively walk the tree and filter (remove) regions using the callback classifier
ERStat
*
ERFilterNM
::
er_tree_filter
(
cv
::
InputArray
image
,
ERStat
*
stat
,
ERStat
*
parent
,
ERStat
*
prev
)
ERStat
*
ERFilterNM
::
er_tree_filter
(
InputArray
image
,
ERStat
*
stat
,
ERStat
*
parent
,
ERStat
*
prev
)
{
{
Mat
src
=
image
.
getMat
();
Mat
src
=
image
.
getMat
();
// assert correct image type
// assert correct image type
...
@@ -820,7 +820,7 @@ ERStat* ERFilterNM::er_tree_filter ( cv::InputArray image, ERStat * stat, ERStat
...
@@ -820,7 +820,7 @@ ERStat* ERFilterNM::er_tree_filter ( cv::InputArray image, ERStat * stat, ERStat
{
{
vector
<
Point
>
hull
;
vector
<
Point
>
hull
;
c
v
::
c
onvexHull
(
contours
[
0
],
hull
,
false
);
convexHull
(
contours
[
0
],
hull
,
false
);
hull_area
=
(
int
)
contourArea
(
hull
);
hull_area
=
(
int
)
contourArea
(
hull
);
}
}
...
@@ -1072,7 +1072,7 @@ double ERClassifierNM2::eval(const ERStat& stat)
...
@@ -1072,7 +1072,7 @@ double ERClassifierNM2::eval(const ERStat& stat)
\param nonMaxSuppression Whenever non-maximum suppression is done over the branch probabilities
\param nonMaxSuppression Whenever non-maximum suppression is done over the branch probabilities
\param minProbability The minimum probability difference between local maxima and local minima ERs
\param minProbability The minimum probability difference between local maxima and local minima ERs
*/
*/
Ptr
<
ERFilter
>
createERFilterNM1
(
const
cv
::
Ptr
<
ERFilter
::
Callback
>&
cb
,
int
thresholdDelta
,
Ptr
<
ERFilter
>
createERFilterNM1
(
const
Ptr
<
ERFilter
::
Callback
>&
cb
,
int
thresholdDelta
,
float
minArea
,
float
maxArea
,
float
minProbability
,
float
minArea
,
float
maxArea
,
float
minProbability
,
bool
nonMaxSuppression
,
float
minProbabilityDiff
)
bool
nonMaxSuppression
,
float
minProbabilityDiff
)
{
{
...
@@ -1111,7 +1111,7 @@ Ptr<ERFilter> createERFilterNM1(const cv::Ptr<ERFilter::Callback>& cb, int thres
...
@@ -1111,7 +1111,7 @@ Ptr<ERFilter> createERFilterNM1(const cv::Ptr<ERFilter::Callback>& cb, int thres
if omitted tries to load a default classifier from file trained_classifierNM2.xml
if omitted tries to load a default classifier from file trained_classifierNM2.xml
\param minProbability The minimum probability P(er|character) allowed for retreived ER's
\param minProbability The minimum probability P(er|character) allowed for retreived ER's
*/
*/
Ptr
<
ERFilter
>
createERFilterNM2
(
const
cv
::
Ptr
<
ERFilter
::
Callback
>&
cb
,
float
minProbability
)
Ptr
<
ERFilter
>
createERFilterNM2
(
const
Ptr
<
ERFilter
::
Callback
>&
cb
,
float
minProbability
)
{
{
CV_Assert
(
(
minProbability
>=
0.
)
&&
(
minProbability
<=
1.
)
);
CV_Assert
(
(
minProbability
>=
0.
)
&&
(
minProbability
<=
1.
)
);
...
...
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