#pragma once

#include <vector>

#include <graphene/geometry/Point_set.h>
#include <graphene/types.h>
#include <graphene/surface_mesh/algorithms/headtemplatefittingtools/utility/Agi_camera.h>


using namespace graphene;


struct Pointset_correspondence
{
    size_t pointset_index;
    float  distance_to_landmark;
    float  distance_to_camera;
    bool   is_valid;
};

bool find_landmarks_swenninger(const geometry::Point_set &pointset,
                               const utility::Agi_camera &camera,
                               const std::vector<Vec2i> &facial_features,
                               std::vector<unsigned int> &out_landmarks,
                               const std::string& fn_landmark_validity = "");

bool find_landmarks_twaltema(const geometry::Point_set &pointset,
                             const utility::Agi_camera &camera,
                             const std::vector<Vec2i> &facial_features,
                             std::vector<unsigned int> &out_landmarks );

float get_median(std::vector<float> samples);
