資源簡介
完整工程項目,保證運行正常,這是我們大作業的工程項目
代碼片段和文件信息
//?3D_Reconstruct.cpp?:?定義控制臺應用程序的入口點。
//
#if?1?
/*
*?eos?-?A?3D?Morphable?Model?fitting?library?written?in?modern?C++11/14.
*
*?File:?examples/fit-model.cpp
*
*?Copyright?2016?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.
*/
#include?“eos/core/Landmark.hpp“
#include?“eos/core/LandmarkMapper.hpp“
#include?“eos/morphablemodel/MorphableModel.hpp“
#include?“eos/morphablemodel/Blendshape.hpp“
#include?“eos/fitting/fitting.hpp“
#include?“eos/render/utils.hpp“
#include?“eos/render/texture_extraction.hpp“
#include?“opencv2/core/core.hpp“
#include?“opencv2/highgui/highgui.hpp“
#include?“boost/program_options.hpp“
#include?“boost/filesystem.hpp“
#include?
#include?
#include?
using?namespace?eos;
namespace?po?=?boost::program_options;
namespace?fs?=?boost::filesystem;
using?eos::core::Landmark;
using?eos::core::LandmarkCollection;
using?cv::Mat;
using?cv::Vec2f;
using?cv::Vec3f;
using?cv::Vec4f;
using?std::cout;
using?std::endl;
using?std::vector;
using?std::string;
/**
*?Reads?an?ibug?.pts?landmark?file?and?returns?an?ordered?vector?with
*?the?68?2D?landmark?coordinates.
*
*?@param[in]?filename?Path?to?a?.pts?file.
*?@return?An?ordered?vector?with?the?68?ibug?landmarks.
*/
LandmarkCollection?read_pts_landmarks(std::string?filename)
{
using?std::getline;
using?cv::Vec2f;
using?std::string;
LandmarkCollection?landmarks;
landmarks.reserve(68);
std::ifstream?file(filename);
if?(!file.is_open())?{
throw?std::runtime_error(string(“Could?not?open?landmark?file:?“?+?filename));
}
string?line;
//?Skip?the?first?3?lines?they‘re?header?lines:
getline(file?line);?//?‘version:?1‘
getline(file?line);?//?‘n_points?:?68‘
getline(file?line);?//?‘{‘
int?ibugId?=?1;
while?(getline(file?line))
{
if?(line?==?“}“)?{?//?end?of?the?file
break;
}
std::stringstream?lineStream(line);
Landmark?landmark;
landmark.name?=?std::to_string(ibugId);
if?(!(lineStream?>>?landmark.coordinates[0]?>>?landmark.coordinates[1]))?{
throw?std::runtime_error(string(“Landmark?format?error?while?parsing?the?line:?“?+?line));
}
//?From?the?iBug?website:
//?“Please?note?that?the?re-annotated?data?for?this?challenge?are?saved?in?the?Matlab?convention?of?1?being
//?the?first?index?i.e.?the?coordinates?of?the?top?left?pixel?in?an?image?are?x=1?y=1.“
//?==>?So?we?shift?every?point?by?1:
landmark.co
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-11-30?19:11??Face_3D_Reconstruction\
?????目錄???????????0??2017-11-30?19:11??Face_3D_Reconstruction\3D_Reconstruct\
?????文件?????????234??2017-11-30?19:11??Face_3D_Reconstruction\3D_Reconstruct\stdafx.h
?????目錄???????????0??2018-10-26?14:35??__MACOSX\
?????目錄???????????0??2018-10-26?14:35??__MACOSX\Face_3D_Reconstruction\
?????目錄???????????0??2018-10-26?14:35??__MACOSX\Face_3D_Reconstruction\3D_Reconstruct\
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\3D_Reconstruct\._stdafx.h
?????文件???????44214??2017-11-30?19:11??Face_3D_Reconstruction\3D_Reconstruct\3D_Reconstruct.cpp
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\3D_Reconstruct\._3D_Reconstruct.cpp
?????文件????????1309??2017-11-30?19:11??Face_3D_Reconstruction\3D_Reconstruct\3D_Reconstruct.sln
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\3D_Reconstruct\._3D_Reconstruct.sln
?????文件???????11349??2017-11-30?19:11??Face_3D_Reconstruction\3D_Reconstruct\3D_Reconstruct.vcxproj
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\3D_Reconstruct\._3D_Reconstruct.vcxproj
?????文件???????????0??2017-11-30?19:11??Face_3D_Reconstruction\3D_Reconstruct\.keep
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\3D_Reconstruct\._.keep
?????文件?????????240??2017-11-30?19:11??Face_3D_Reconstruction\3D_Reconstruct\targetver.h
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\3D_Reconstruct\._targetver.h
?????文件???????10235??2017-11-30?19:11??Face_3D_Reconstruction\3D_Reconstruct\helpers.hpp
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\3D_Reconstruct\._helpers.hpp
?????文件?????????218??2017-11-30?19:11??Face_3D_Reconstruction\3D_Reconstruct\stdafx.cpp
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\3D_Reconstruct\._stdafx.cpp
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\._3D_Reconstruct
?????目錄???????????0??2017-11-30?19:11??Face_3D_Reconstruction\share2\
?????文件?????1942719??2017-11-30?19:11??Face_3D_Reconstruction\share2\sfm_3448_edge_topology.json
?????目錄???????????0??2018-10-26?14:35??__MACOSX\Face_3D_Reconstruction\share2\
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\share2\._sfm_3448_edge_topology.json
?????文件???????47562??2017-11-30?19:11??Face_3D_Reconstruction\share2\reference.obj
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\share2\._reference.obj
?????文件?????????719??2017-11-30?19:11??Face_3D_Reconstruction\share2\model_contours.json
?????文件?????????212??2017-11-30?19:11??__MACOSX\Face_3D_Reconstruction\share2\._model_contours.json
?????文件????????3248??2017-11-30?19:11??Face_3D_Reconstruction\share2\ibug_to_sfm.txt
............此處省略65個文件信息
評論
共有 條評論