Commit 5eaa520f authored by Patrik Huber's avatar Patrik Huber

Added documentation, added @brief

Additionally: Using '//' for the forward declarations so they don't get picked up by doxygen
parent 6a3ed55d
...@@ -30,23 +30,23 @@ namespace eos { ...@@ -30,23 +30,23 @@ namespace eos {
namespace core { namespace core {
/** /**
* Representation of a landmark, consisting of a landmark name and * @brief Representation of a landmark, consisting of a landmark name and
* coordinates of the given type. Usually, the type would be cv::Vec2f. * coordinates of the given type. Usually, the type would be \c cv::Vec2f.
*/ */
template<class LandmarkType> template<class LandmarkType>
struct Landmark struct Landmark
{ {
std::string name; std::string name; ///< Name of the landmark, often used as identifier.
LandmarkType coordinates; LandmarkType coordinates; ///< The position or coordinates of the landmark.
}; };
/** /**
* A trivial collection of landmarks that somehow belong together. * @brief A trivial collection of landmarks that belong together.
*/ */
template<class LandmarkType> using LandmarkCollection = std::vector<Landmark<LandmarkType>>; template<class LandmarkType> using LandmarkCollection = std::vector<Landmark<LandmarkType>>;
/** /**
* Filters the given LandmarkCollection and returns a new LandmarkCollection * @brief Filters the given LandmarkCollection and returns a new LandmarkCollection
* containing all landmarks whose name matches the one given by \p filter. * containing all landmarks whose name matches the one given by \p filter.
* *
* @param[in] landmarks The input LandmarkCollection to be filtered. * @param[in] landmarks The input LandmarkCollection to be filtered.
......
...@@ -38,27 +38,39 @@ namespace eos { ...@@ -38,27 +38,39 @@ namespace eos {
namespace core { namespace core {
/** /**
* Represents a mapping from one kind of landmarks * @brief Represents a mapping from one kind of landmarks
* to a different format. Mappings are stored in a * to a different format (e.g. model vertices).
* file (see share/ for an example for ibug landmarks). *
* When fitting the 3D model to an image, a correspondence must
* be known from the 2D image landmarks to 3D vertex points in
* the Morphable Model. The 3D model defines all its points in
* the form of vertex ids.
* These mappings are stored in a file, see the \c share/ folder for
* an example for mapping 2D ibug landmarks to 3D model vertex indices.
*
* The LandmarkMapper thus has two main use cases:
* - Mapping 2D landmark points to 3D vertices
* - Converting one set of 2D landmarks into another set of 2D
* landmarks with different identifiers.
*/ */
class LandmarkMapper { class LandmarkMapper {
public: public:
/** /**
* Constructs a new landmark mapper that performs an identity mapping, * @brief Constructs a new landmark mapper that performs an identity
* that is, its output is the same as the input. * mapping, that is, its output is the same as the input.
*
*/ */
LandmarkMapper() = default; LandmarkMapper() = default;
/** /**
* Constructs a new landmark mapper from a mappings-file. * @brief Constructs a new landmark mapper from a file containing
* mappings from one set of landmark identifiers to another.
*
* In case the file contains no mappings, a landmark mapper * In case the file contains no mappings, a landmark mapper
* that performs an identity mapping is constructed. * that performs an identity mapping is constructed.
* *
* @param[in] filename A file with landmark mappings. * @param[in] filename A file with landmark mappings.
* @throws runtime_error exception if there is an error * @throws runtime_error if there is an error loading
* loading the mappings from the file. * the mappings from the file.
*/ */
LandmarkMapper(boost::filesystem::path filename) LandmarkMapper(boost::filesystem::path filename)
{ {
...@@ -87,7 +99,7 @@ public: ...@@ -87,7 +99,7 @@ public:
}; };
/** /**
* Converts the given landmark name to the mapped name. * @brief Converts the given landmark name to the mapped name.
* *
* @param[in] landmark_name A landmark name to convert. * @param[in] landmark_name A landmark name to convert.
* @return The mapped landmark name if a mapping exists, an empty optional otherwise. * @return The mapped landmark name if a mapping exists, an empty optional otherwise.
...@@ -113,7 +125,7 @@ public: ...@@ -113,7 +125,7 @@ public:
}; };
/** /**
* Returns the number of loaded landmark mappings. * @brief Returns the number of loaded landmark mappings.
* *
* @return The number of landmark mappings. * @return The number of landmark mappings.
*/ */
......
...@@ -34,9 +34,7 @@ ...@@ -34,9 +34,7 @@
#include <vector> #include <vector>
#include <array> #include <array>
/** // Forward declaration of an internal function
* Forward declaration of an internal function
*/
namespace eos { namespace morphablemodel { namespace detail { namespace eos { namespace morphablemodel { namespace detail {
eos::render::Mesh sample_to_mesh(cv::Mat shape, cv::Mat color, std::vector<std::array<int, 3>> tvi, std::vector<std::array<int, 3>> tci, std::vector<cv::Vec2f> texture_coordinates = std::vector<cv::Vec2f>()); eos::render::Mesh sample_to_mesh(cv::Mat shape, cv::Mat color, std::vector<std::array<int, 3>> tvi, std::vector<std::array<int, 3>> tci, std::vector<cv::Vec2f> texture_coordinates = std::vector<cv::Vec2f>());
} } } } } }
......
...@@ -37,14 +37,12 @@ ...@@ -37,14 +37,12 @@
namespace eos { namespace eos {
namespace morphablemodel { namespace morphablemodel {
/** // Forward declarations of free functions
* Forward declarations of free functions
*/
cv::Mat normalise_pca_basis(cv::Mat unnormalisedBasis, cv::Mat eigenvalues); cv::Mat normalise_pca_basis(cv::Mat unnormalisedBasis, cv::Mat eigenvalues);
cv::Mat unnormalise_pca_basis(cv::Mat normalisedBasis, cv::Mat eigenvalues); cv::Mat unnormalise_pca_basis(cv::Mat normalisedBasis, cv::Mat eigenvalues);
/** /**
* This class represents a PCA-model that consists of: * @brief This class represents a PCA-model that consists of:
* - a mean vector (y x z) * - a mean vector (y x z)
* - a PCA basis matrix (unnormalised and normalised) * - a PCA basis matrix (unnormalised and normalised)
* - a PCA variance vector. * - a PCA variance vector.
......
...@@ -38,9 +38,7 @@ ...@@ -38,9 +38,7 @@
namespace eos { namespace eos {
namespace morphablemodel { namespace morphablemodel {
/** // Forward declaration
* Forward declarations
*/
std::vector<cv::Vec2f> load_isomap(boost::filesystem::path isomap_file); std::vector<cv::Vec2f> load_isomap(boost::filesystem::path isomap_file);
/** /**
......
...@@ -27,14 +27,13 @@ ...@@ -27,14 +27,13 @@
#include "opencv2/core/core.hpp" #include "opencv2/core/core.hpp"
/** /**
* Serialisation for OpenCV cv::Mat matrices for the serialisation * @brief Serialisation of OpenCV \c cv::Mat matrices for the serialisation
* library cereal (http://uscilab.github.io/cereal/index.html). * library cereal (http://uscilab.github.io/cereal/index.html).
*/ */
namespace cv { namespace cv {
/** /**
* Serialise a cv::Mat using cereal. * @brief Serialise a cv::Mat using cereal.
* *
* Supports all types of matrices as well as non-contiguous ones. * Supports all types of matrices as well as non-contiguous ones.
* *
...@@ -69,7 +68,7 @@ void save(Archive& ar, const cv::Mat& mat) ...@@ -69,7 +68,7 @@ void save(Archive& ar, const cv::Mat& mat)
}; };
/** /**
* De-serialise a cv::Mat using cereal. * @brief De-serialise a cv::Mat using cereal.
* *
* Supports all types of matrices as well as non-contiguous ones. * Supports all types of matrices as well as non-contiguous ones.
* *
...@@ -101,7 +100,7 @@ void load(Archive& ar, cv::Mat& mat) ...@@ -101,7 +100,7 @@ void load(Archive& ar, cv::Mat& mat)
}; };
/** /**
* Serialisation for a cv::Vec2f using cereal. * @brief Serialisation of a cv::Vec2f using cereal.
* *
* @param[in] ar The archive to (de)serialise. * @param[in] ar The archive to (de)serialise.
* @param[in] vec The vector to (de)serialise. * @param[in] vec The vector to (de)serialise.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment