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
9fbff009
Commit
9fbff009
authored
Jul 20, 2013
by
lluis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed compilation errors and warnings on builds 3298 and 4384
parent
6adba094
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
erfilter.cpp
modules/objdetect/src/erfilter.cpp
+8
-6
No files found.
modules/objdetect/src/erfilter.cpp
View file @
9fbff009
...
@@ -607,14 +607,14 @@ void ERFilterNM::er_merge(ERStat *parent, ERStat *child)
...
@@ -607,14 +607,14 @@ void ERFilterNM::er_merge(ERStat *parent, ERStat *child)
// child region done, we can calculate 1st stage features from the incrementally computable descriptors
// child region done, we can calculate 1st stage features from the incrementally computable descriptors
child
->
aspect_ratio
=
(
float
)(
child
->
bbox
[
2
]
-
child
->
bbox
[
0
]
+
1
)
/
(
child
->
bbox
[
3
]
-
child
->
bbox
[
1
]
+
1
);
child
->
aspect_ratio
=
(
float
)(
child
->
bbox
[
2
]
-
child
->
bbox
[
0
]
+
1
)
/
(
child
->
bbox
[
3
]
-
child
->
bbox
[
1
]
+
1
);
child
->
compactness
=
sqrt
(
child
->
area
)
/
child
->
perimeter
;
child
->
compactness
=
sqrt
(
(
float
)(
child
->
area
)
)
/
child
->
perimeter
;
child
->
num_holes
=
(
float
)(
1
-
child
->
euler
);
child
->
num_holes
=
(
float
)(
1
-
child
->
euler
);
vector
<
int
>
m_crossings
;
vector
<
int
>
m_crossings
;
m_crossings
.
push_back
(
child
->
crossings
->
at
((
int
)(
child
->
bbox
[
3
]
-
child
->
bbox
[
1
]
+
1
)
/
6
));
m_crossings
.
push_back
(
child
->
crossings
->
at
((
int
)(
child
->
bbox
[
3
]
-
child
->
bbox
[
1
]
+
1
)
/
6
));
m_crossings
.
push_back
(
child
->
crossings
->
at
((
int
)
3
*
(
child
->
bbox
[
3
]
-
child
->
bbox
[
1
]
+
1
)
/
6
));
m_crossings
.
push_back
(
child
->
crossings
->
at
((
int
)
3
*
(
child
->
bbox
[
3
]
-
child
->
bbox
[
1
]
+
1
)
/
6
));
m_crossings
.
push_back
(
child
->
crossings
->
at
((
int
)
5
*
(
child
->
bbox
[
3
]
-
child
->
bbox
[
1
]
+
1
)
/
6
));
m_crossings
.
push_back
(
child
->
crossings
->
at
((
int
)
5
*
(
child
->
bbox
[
3
]
-
child
->
bbox
[
1
]
+
1
)
/
6
));
sort
(
m_crossings
.
begin
(),
m_crossings
.
end
());
s
td
::
s
ort
(
m_crossings
.
begin
(),
m_crossings
.
end
());
child
->
med_crossings
=
(
float
)
m_crossings
.
at
(
1
);
child
->
med_crossings
=
(
float
)
m_crossings
.
at
(
1
);
// free unnecessary mem
// free unnecessary mem
...
@@ -784,8 +784,10 @@ ERStat* ERFilterNM::er_tree_filter ( cv::InputArray image, ERStat * stat, ERStat
...
@@ -784,8 +784,10 @@ ERStat* ERFilterNM::er_tree_filter ( cv::InputArray image, ERStat * stat, ERStat
if
(
p_next
==
(
int
)
contour_poly
.
size
())
if
(
p_next
==
(
int
)
contour_poly
.
size
())
p_next
=
0
;
p_next
=
0
;
double
angle_next
=
atan2
((
contour_poly
[
p_next
].
y
-
contour_poly
[
p
].
y
),(
contour_poly
[
p_next
].
x
-
contour_poly
[
p
].
x
));
double
angle_next
=
atan2
((
double
)(
contour_poly
[
p_next
].
y
-
contour_poly
[
p
].
y
),
double
angle_prev
=
atan2
((
contour_poly
[
p_prev
].
y
-
contour_poly
[
p
].
y
),(
contour_poly
[
p_prev
].
x
-
contour_poly
[
p
].
x
));
(
double
)(
contour_poly
[
p_next
].
x
-
contour_poly
[
p
].
x
));
double
angle_prev
=
atan2
((
double
)(
contour_poly
[
p_prev
].
y
-
contour_poly
[
p
].
y
),
(
double
)(
contour_poly
[
p_prev
].
x
-
contour_poly
[
p
].
x
));
if
(
angle_next
<
0
)
if
(
angle_next
<
0
)
angle_next
=
2.
*
CV_PI
+
angle_next
;
angle_next
=
2.
*
CV_PI
+
angle_next
;
...
@@ -813,12 +815,12 @@ ERStat* ERFilterNM::er_tree_filter ( cv::InputArray image, ERStat * stat, ERStat
...
@@ -813,12 +815,12 @@ ERStat* ERFilterNM::er_tree_filter ( cv::InputArray image, ERStat * stat, ERStat
vector
<
Point
>
hull
;
vector
<
Point
>
hull
;
cv
::
convexHull
(
contours
[
0
],
hull
,
false
);
cv
::
convexHull
(
contours
[
0
],
hull
,
false
);
hull_area
=
contourArea
(
hull
);
hull_area
=
(
int
)
contourArea
(
hull
);
}
}
stat
->
hole_area_ratio
=
(
float
)
holes_area
/
stat
->
area
;
stat
->
hole_area_ratio
=
(
float
)
holes_area
/
stat
->
area
;
stat
->
convex_hull_ratio
=
(
float
)
hull_area
/
contourArea
(
contours
[
0
]);
stat
->
convex_hull_ratio
=
(
float
)
hull_area
/
(
float
)
contourArea
(
contours
[
0
]);
stat
->
num_inflexion_points
=
(
float
)
num_inflexion_points
;
stat
->
num_inflexion_points
=
(
float
)
num_inflexion_points
;
...
...
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