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
5f21462e
Commit
5f21462e
authored
Jul 12, 2015
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Landmark class (from RCR)
parent
bfaaa13c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
0 deletions
+71
-0
CMakeLists.txt
CMakeLists.txt
+1
-0
include/eos/core/Landmark.hpp
include/eos/core/Landmark.hpp
+70
-0
No files found.
CMakeLists.txt
View file @
5f21462e
...
@@ -46,6 +46,7 @@ set(CEREAL_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/3rdparty/cereal-1.1.1/include")
...
@@ -46,6 +46,7 @@ set(CEREAL_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/3rdparty/cereal-1.1.1/include")
# Header files:
# Header files:
set
(
HEADERS
set
(
HEADERS
include/eos/core/Landmark.hpp
include/eos/core/LandmarkMapper.hpp
include/eos/core/LandmarkMapper.hpp
include/eos/morphablemodel/PcaModel.hpp
include/eos/morphablemodel/PcaModel.hpp
include/eos/morphablemodel/MorphableModel.hpp
include/eos/morphablemodel/MorphableModel.hpp
...
...
include/eos/core/Landmark.hpp
0 → 100644
View file @
5f21462e
/*
* Eos - A 3D Morphable Model fitting library written in modern C++11/14.
*
* File: include/eos/core/Landmark.hpp
*
* Copyright 2014, 2015 Patrik Huber
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#ifndef LANDMARK_HPP_
#define LANDMARK_HPP_
#include <string>
#include <vector>
namespace
eos
{
namespace
core
{
/**
* Representation of a landmark, consisting of a landmark name and
* coordinates of the given type. Usually, the type would be cv::Vec2f.
*/
template
<
class
LandmarkType
>
struct
Landmark
{
std
::
string
name
;
LandmarkType
coordinates
;
};
/**
* A trivial collection of landmarks that somehow belong together.
*/
template
<
class
LandmarkType
>
using
LandmarkCollection
=
std
::
vector
<
Landmark
<
LandmarkType
>>
;
/**
* Filters the given LandmarkCollection and returns a new LandmarkCollection
* containing all landmarks whose name matches the one given by \p filter.
*
* @param[in] landmarks The input LandmarkCollection to be filtered.
* @param[in] filter A landmark name (identifier) by which the given LandmarkCollection is filtered.
* @return A new, filtered LandmarkCollection.
*/
template
<
class
T
>
LandmarkCollection
<
T
>
filter
(
const
LandmarkCollection
<
T
>&
landmarks
,
const
std
::
vector
<
std
::
string
>&
filter
)
{
LandmarkCollection
<
T
>
filtered_landmarks
;
using
std
::
begin
;
using
std
::
end
;
std
::
copy_if
(
begin
(
landmarks
),
end
(
landmarks
),
std
::
back_inserter
(
filtered_landmarks
),
[
&
](
const
Landmark
<
T
>&
lm
)
{
return
std
::
find
(
begin
(
filter
),
end
(
filter
),
lm
.
name
)
!=
end
(
filter
);
}
);
return
filtered_landmarks
;
};
}
/* namespace core */
}
/* namespace eos */
#endif
/* LANDMARK_HPP_ */
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