Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Richard Torenvliet
eos
Commits
32eb834e
Commit
32eb834e
authored
Nov 26, 2016
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
select_contour now returns both contours for the interval +-7.5° yaw
parent
3162a3d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
include/eos/fitting/contour_correspondence.hpp
include/eos/fitting/contour_correspondence.hpp
+13
-6
No files found.
include/eos/fitting/contour_correspondence.hpp
View file @
32eb834e
...
...
@@ -225,6 +225,8 @@ std::tuple<std::vector<cv::Vec2f>, std::vector<cv::Vec4f>, std::vector<int>> get
* have different size.
* Correspondence can be established using get_nearest_contour_correspondences().
*
* If the yaw angle is between +-7.5°, both contours will be selected.
*
* Note: Maybe rename to find_nearest_contour_points, to highlight that there is (potentially a lot) computational cost involved?
*
* @param[in] yaw_angle Yaw angle in degrees.
...
...
@@ -234,16 +236,21 @@ std::tuple<std::vector<cv::Vec2f>, std::vector<cv::Vec4f>, std::vector<int>> get
*/
std
::
pair
<
std
::
vector
<
std
::
string
>
,
std
::
vector
<
int
>>
select_contour
(
float
yaw_angle
,
const
ContourLandmarks
&
contour_landmarks
,
const
ModelContour
&
model_contour
)
{
using
std
::
begin
;
using
std
::
end
;
std
::
vector
<
int
>
model_contour_indices
;
std
::
vector
<
std
::
string
>
contour_landmark_identifiers
;
if
(
yaw_angle
>=
0.0
f
)
{
// positive yaw = subject looking to the left
model_contour_indices
=
model_contour
.
right_contour
;
// ==> we use the right cnt-lms
contour_landmark_identifiers
=
contour_landmarks
.
right_contour
;
if
(
yaw_angle
>=
-
7.5
f
)
{
// positive yaw = subject looking to the left
// ==> we use the right cnt-lms
model_contour_indices
.
insert
(
end
(
model_contour_indices
),
begin
(
model_contour
.
right_contour
),
end
(
model_contour
.
right_contour
));
contour_landmark_identifiers
.
insert
(
end
(
contour_landmark_identifiers
),
begin
(
contour_landmarks
.
right_contour
),
end
(
contour_landmarks
.
right_contour
));
}
else
{
model_contour_indices
=
model_contour
.
left_contour
;
contour_landmark_identifiers
=
contour_landmarks
.
left_contour
;
if
(
yaw_angle
<=
7.5
f
)
{
// ==> we use the left cnt-lms
model_contour_indices
.
insert
(
end
(
model_contour_indices
),
begin
(
model_contour
.
left_contour
),
end
(
model_contour
.
left_contour
));
contour_landmark_identifiers
.
insert
(
end
(
contour_landmark_identifiers
),
begin
(
contour_landmarks
.
left_contour
),
end
(
contour_landmarks
.
left_contour
));
}
// Note there's an overlap between the angles - if a subject is between +- 7.5°, both contours get added.
return
std
::
make_pair
(
contour_landmark_identifiers
,
model_contour_indices
);
};
...
...
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