我已经下载了最新版本的64位开放框架,并运行以下脚本,
sudo ./install_dependencies.sh
sudo ./install_codeblocks.sh
sudo ./install_codecs.sh
sudo ./compileOF.sh
所有脚本都成功运行。然后我跑了testAllExamples.sh
,我没有遇到任何问题。
我下载并复制了#c; ofxCv"和" ofxFaceTracker"进入addons文件夹。
我的意图是编译Facesubstitution代码。 我下载了facesubstitution-master的来源,并尝试编译" Facesubstituion"项目在里面。它显示以下错误。
有人可以帮我解决以下错误。
/home/hub/Downloads/of_v0.8.3_linux64_release/addons/ofxOpenCv/libs/opencv/lib/linux64/libopencv_core.a(system.o): In function `cv::tempfile(char const*)':
system.cpp:(.text._ZN2cv8tempfileEPKc+0x2f): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/home/hub/Downloads/of_v0.8.3_linux64_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofURLFileLoader.o): In function `ofURLFileLoader::ofURLFileLoader()':
ofURLFileLoader.cpp:(.text+0x2686): undefined reference to `Poco::Net::HTTPSStreamFactory::registerFactory()'
ofURLFileLoader.cpp:(.text+0x269d): undefined reference to `Poco::Net::KeyConsoleHandler::KeyConsoleHandler(bool)'
ofURLFileLoader.cpp:(.text+0x26e1): undefined reference to `Poco::Net::ConsoleCertificateHandler::ConsoleCertificateHandler(bool)'
ofURLFileLoader.cpp:(.text+0x2767): undefined reference to `Poco::Net::Context::Context(Poco::Net::Context::Usage, std::string const&, Poco::Net::Context::VerificationMode, int, bool, std::string const&)'
ofURLFileLoader.cpp:(.text+0x27ec): undefined reference to `Poco::Net::SSLManager::instance()'
ofURLFileLoader.cpp:(.text+0x280c): undefined reference to `Poco::Net::SSLManager::initializeClient(Poco::SharedPtr<Poco::Net::PrivateKeyPassphraseHandler, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Net::PrivateKeyPassphraseHandler> >, Poco::SharedPtr<Poco::Net::InvalidCertificateHandler, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Net::InvalidCertificateHandler> >, Poco::AutoPtr<Poco::Net::Context>)'
/home/hub/Downloads/of_v0.8.3_linux64_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofURLFileLoader.o): In function `ofURLFileLoader::handleRequest(ofHttpRequest)':
ofURLFileLoader.cpp:(.text+0x370e): undefined reference to `Poco::Net::HTTPSClientSession::HTTPSClientSession(std::string const&, unsigned short)'
/home/hub/Downloads/of_v0.8.3_linux64_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofURLFileLoader.o): In function `ofURLFileLoaderShutdown()':
ofURLFileLoader.cpp:(.text+0x354c): undefined reference to `Poco::Net::uninitializeSSL()'
/home/hub/Downloads/of_v0.8.3_linux64_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofGstVideoGrabber.o): In function `ofPixelFormatFromGstFormat(std::string)':
ofGstVideoGrabber.cpp:(.text+0x108): undefined reference to `gst_video_format_from_string'
/home/hub/Downloads/of_v0.8.3_linux64_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofGstVideoGrabber.o): In function `ofGstVideoGrabber::listDevices()':
ofGstVideoGrabber.cpp:(.text+0x21cd): undefined reference to `gst_video_format_from_string'
/home/hub/Downloads/of_v0.8.3_linux64_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofGstVideoGrabber.o): In function `add_video_format(ofGstDevice&, ofGstVideoFormat&, _GstStructure&, int)':
ofGstVideoGrabber.cpp:(.text+0x2fb2): undefined reference to `gst_video_format_from_string'
ofGstVideoGrabber.cpp:(.text+0x3678): undefined reference to `gst_video_format_from_string'
ofGstVideoGrabber.cpp:(.text+0x3728): undefined reference to `gst_video_format_from_string'
/home/hub/Downloads/of_v0.8.3_linux64_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofGstVideoGrabber.o):ofGstVideoGrabber.cpp:(.text+0x3880): more undefined references to `gst_video_format_from_string' follow
/home/hub/Downloads/of_v0.8.3_linux64_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofGstUtils.o): In function `on_new_buffer_from_source(_GstAppSink*, void*)':
ofGstUtils.cpp:(.text+0xf0): undefined reference to `gst_app_sink_pull_sample'
/home/hub/Downloads/of_v0.8.3_linux64_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofGstUtils.o): In function `ofGstVideoUtils::update()':
ofGstUtils.cpp:(.text+0x2e7): undefined reference to `gst_app_sink_pull_sample'
ofGstUtils.cpp:(.text+0x2f2): undefined reference to `gst_sample_get_buffer'
ofGstUtils.cpp:(.text+0x339): undefined reference to `gst_buffer_map'
ofGstUtils.cpp:(.text+0x38a): undefined reference to `gst_buffer_unmap'
/home/hub/Downloads/of_v0.8.3_linux64_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofGstUtils.o): In function `ofGstVideoUtils::preroll_cb(_GstSample*)':
ofGstUtils.cpp:(.text+0x4a42): undefined reference to `gst_sample_get_buffer'
ofGstUtils.cpp:(.text+0x4a5c): undefined reference to `gst_buffer_map'
ofGstUtils.cpp:(.text+0x4afb): undefined reference to `gst_buffer_unmap'
ofGstUtils.cpp:(.text+0x4c21): undefined reference to `gst_sample_get_caps'
ofGstUtils.cpp:(.text+0x4c2e): undefined reference to `gst_video_info_init'
ofGstUtils.cpp:(.text+0x4c3b): undefined reference to `gst_video_info_from_caps'
ofGstUtils.cpp:(.text+0x4c55): undefined reference to `gst_video_frame_map'
ofGstUtils.cpp:(.text+0x4c6a): undefined reference to `gst_video_frame_unmap'
/home/hub/Downloads/of_v0.8.3_linux64_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofGstUtils.o): In function `ofGstVideoUtils::buffer_cb(_GstSample*)':
ofGstUtils.cpp:(.text+0x5132): undefined reference to `gst_sample_get_buffer'
ofGstUtils.cpp:(.text+0x514c): undefined reference to `gst_buffer_map'
ofGstUtils.cpp:(.text+0x51eb): undefined reference to `gst_buffer_unmap'
ofGstUtils.cpp:(.text+0x5311): undefined reference to `gst_sample_get_caps'
ofGstUtils.cpp:(.text+0x531e): undefined reference to `gst_video_info_init'
ofGstUtils.cpp:(.text+0x532b): undefined reference to `gst_video_info_from_caps'
ofGstUtils.cpp:(.text+0x5345): undefined reference to `gst_video_frame_map'
ofGstUtils.cpp:(.text+0x535a): undefined reference to `gst_video_frame_unmap'
obj/x86_64Release/src/testApp.o: In function `testApp::setup()':
testApp.cpp:(.text+0x92): undefined reference to `Clone::setup(int, int)'
obj/x86_64Release/src/testApp.o: In function `testApp::update()':
testApp.cpp:(.text+0x645): undefined reference to `Clone::setStrength(int)'
testApp.cpp:(.text+0x6a6): undefined reference to `Clone::update(ofTexture&, ofTexture&, ofTexture&)'
obj/x86_64Release/src/testApp.o: In function `testApp::draw()':
testApp.cpp:(.text+0x777): undefined reference to `Clone::draw(float, float)'
/home/hub/Downloads/of_v0.8.3_linux64_release/addons/ofxOpenCv/libs/opencv/lib/linux64/libopencv_imgproc.a(templmatch.o): In function `cv::crossCorr(cv::Mat const&, cv::Mat const&, cv::Mat&, cv::Size_<int>, int, cv::Point_<int>, double, int)':
templmatch.cpp:(.text._ZN2cv9crossCorrERKNS_3MatES2_RS0_NS_5Size_IiEEiNS_6Point_IiEEdi+0x39e): undefined reference to `cv::getOptimalDFTSize(int)'
templmatch.cpp:(.text._ZN2cv9crossCorrERKNS_3MatES2_RS0_NS_5Size_IiEEiNS_6Point_IiEEdi+0x3dd): undefined reference to `cv::getOptimalDFTSize(int)'
templmatch.cpp:(.text._ZN2cv9crossCorrERKNS_3MatES2_RS0_NS_5Size_IiEEiNS_6Point_IiEEdi+0xcd7): undefined reference to `cv::dft(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
templmatch.cpp:(.text._ZN2cv9crossCorrERKNS_3MatES2_RS0_NS_5Size_IiEEiNS_6Point_IiEEdi+0x19bb): undefined reference to `cv::dft(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
templmatch.cpp:(.text._ZN2cv9crossCorrERKNS_3MatES2_RS0_NS_5Size_IiEEiNS_6Point_IiEEdi+0x1a6f): undefined reference to `cv::mulSpectrums(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, int, bool)'
templmatch.cpp:(.text._ZN2cv9crossCorrERKNS_3MatES2_RS0_NS_5Size_IiEEiNS_6Point_IiEEdi+0x1ab6): undefined reference to `cv::dft(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
/home/hub/Downloads/of_v0.8.3_linux64_release/addons/ofxOpenCv/libs/opencv/lib/linux64/libopencv_legacy.a(compat.o): In function `cvHoughLines':
compat.cpp:(.text.cvHoughLines+0x44): undefined reference to `cvHoughLines2'
/home/hub/Downloads/of_v0.8.3_linux64_release/addons/ofxOpenCv/libs/opencv/lib/linux64/libopencv_legacy.a(compat.o): In function `cvHoughLinesP':
compat.cpp:(.text.cvHoughLinesP+0x4a): undefined reference to `cvHoughLines2'
/home/hub/Downloads/of_v0.8.3_linux64_release/addons/ofxOpenCv/libs/opencv/lib/linux64/libopencv_legacy.a(compat.o): In function `cvHoughLinesSDiv':
compat.cpp:(.text.cvHoughLinesSDiv+0x48): undefined reference to `cvHoughLines2'
/home/hub/Downloads/of_v0.8.3_linux64_release/addons/ofxOpenCv/libs/opencv/lib/linux64/libopencv_legacy.a(compat.o): In function `cvCalcEMD':
compat.cpp:(.text.cvCalcEMD+0x9d): undefined reference to `cvCalcEMD2'
/home/hub/Downloads/of_v0.8.3_linux64_release/addons/ofxOpenCv/libs/opencv/lib/linux64/libopencv_calib3d.a(calibinit.o): In function `cv::findCirclesGrid(cv::_InputArray const&, cv::Size_<int>, cv::_OutputArray const&, int, cv::Ptr<cv::FeatureDetector> const&)':
calibinit.cpp:(.text._ZN2cv15findCirclesGridERKNS_11_InputArrayENS_5Size_IiEERKNS_12_OutputArrayEiRKNS_3PtrINS_15FeatureDetectorEEE+0x164): undefined reference to `cv::FeatureDetector::detect(cv::Mat const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat const&) const'
/home/hub/Downloads/of_v0.8.3_linux64_release/addons/ofxOpenCv/libs/opencv/lib/linux64/libopencv_calib3d.a(circlesgrid.o): In function `cv::findCirclesGridDefault(cv::_InputArray const&, cv::Size_<int>, cv::_OutputArray const&, int)':
circlesgrid.cpp:(.text._ZN2cv22findCirclesGridDefaultERKNS_11_InputArrayENS_5Size_IiEERKNS_12_OutputArrayEi+0x30): undefined reference to `cv::SimpleBlobDetector::Params::Params()'
circlesgrid.cpp:(.text._ZN2cv22findCirclesGridDefaultERKNS_11_InputArrayENS_5Size_IiEERKNS_12_OutputArrayEi+0x48): undefined reference to `cv::SimpleBlobDetector::SimpleBlobDetector(cv::SimpleBlobDetector::Params const&)'
/home/hub/Downloads/of_v0.8.3_linux64_release/addons/ofxOpenCv/libs/opencv/lib/linux64/libopencv_calib3d.a(circlesgrid.o): In function `CirclesGridClusterFinder::parsePatternPoints(std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > > const&, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > > const&, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >&)':
circlesgrid.cpp:(.text._ZN24CirclesGridClusterFinder18parsePatternPointsERKSt6vectorIN2cv6Point_IfEESaIS3_EES7_RS5_+0x28): undefined reference to `cv::flann::LinearIndexParams::LinearIndexParams()'
circlesgrid.cpp:(.text._ZN24CirclesGridClusterFinder18parsePatternPointsERKSt6vectorIN2cv6Point_IfEESaIS3_EES7_RS5_+0x13c): undefined reference to `cv::flann::Index::Index(cv::_InputArray const&, cv::flann::IndexParams const&, cvflann::flann_distance_t)'
circlesgrid.cpp:(.text._ZN24CirclesGridClusterFinder18parsePatternPointsERKSt6vectorIN2cv6Point_IfEESaIS3_EES7_RS5_+0x3ef): undefined reference to `cv::flann::SearchParams::SearchParams(int, float, bool)'
circlesgrid.cpp:(.text._ZN24CirclesGridClusterFinder18parsePatternPointsERKSt6vectorIN2cv6Point_IfEESaIS3_EES7_RS5_+0x4d4): undefined reference to `cv::flann::Index::knnSearch(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int, cv::flann::SearchParams const&)'
circlesgrid.cpp:(.text._ZN24CirclesGridClusterFinder18parsePatternPointsERKSt6vectorIN2cv6Point_IfEESaIS3_EES7_RS5_+0x4e1): undefined reference to `cv::flann::IndexParams::~IndexParams()'
circlesgrid.cpp:(.text._ZN24CirclesGridClusterFinder18parsePatternPointsERKSt6vectorIN2cv6Point_IfEESaIS3_EES7_RS5_+0x60b): undefined reference to `cv::flann::Index::~Index()'
circlesgrid.cpp:(.text._ZN24CirclesGridClusterFinder18parsePatternPointsERKSt6vectorIN2cv6Point_IfEESaIS3_EES7_RS5_+0x618): undefined reference to `cv::flann::IndexParams::~IndexParams()'
circlesgrid.cpp:(.text._ZN24CirclesGridClusterFinder18parsePatternPointsERKSt6vectorIN2cv6Point_IfEESaIS3_EES7_RS5_+0x692): undefined reference to `cv::flann::Index::~Index()'
circlesgrid.cpp:(.text._ZN24CirclesGridClusterFinder18parsePatternPointsERKSt6vectorIN2cv6Point_IfEESaIS3_EES7_RS5_+0x69f): undefined reference to `cv::flann::IndexParams::~IndexParams()'
circlesgrid.cpp:(.text._ZN24CirclesGridClusterFinder18parsePatternPointsERKSt6vectorIN2cv6Point_IfEESaIS3_EES7_RS5_+0x6b7): undefined reference to `cv::flann::IndexParams::~IndexParams()'
circlesgrid.cpp:(.text._ZN24CirclesGridClusterFinder18parsePatternPointsERKSt6vectorIN2cv6Point_IfEESaIS3_EES7_RS5_+0x6fc): undefined reference to `cv::flann::Index::~Index()'
collect2: error: ld returned 1 exit status
make: *** [bin/FaceSubstitution] Error 1
答案 0 :(得分:0)
我可以让它发挥作用。简而言之,解决方案是:使用openFrameworks中的projectGenerator!
我按照以下步骤在Ubuntu 14.04 [使用OpenCV 2.4.9]上成功启动了FaceSubstitution应用程序:
安装openFrameworks。
下载of_v0.8.3_linux64_release.tar.gz并随处提取。
从 of_v0.8.3_linux64_release / scripts / linux / ubuntu
文件夹运行以下安装脚本install_dependencies.sh,install_codecs.sh
从 of_v0.8.3_linux64_release / scripts / linux /
文件夹运行以下编译脚本compileOF.sh,compilePG.sh
安装xCV。
只需从git克隆到 of_v0.8.3_linux64_release / addons 。
cd of_v0.8.3_linux64_release / addons&amp;&amp; git clone https://github.com/kylemcdonald/ofxCv.git
安装xFaceTracker。
再次从git克隆到 of_v0.8.3_linux64_release / addons 。
git clone https://github.com/kylemcdonald/ofxFaceTracker.git
随时随地下载FaceSubstitution。
从 of_v0.8.3_linux64_release / projectGenerator 运行projectGenerator。
为CloningWrapper和FaceSubstitution创建一个新项目。选择所有的插件(我们可能只需要与错误消息相关的插件,但是简单地将所有/仅编译时间设置为更长/ /)不会造成伤害。
将源文件从下载的FaceSubstitution文件夹分别复制到这些新创建的文件夹中。
编译CloningWrapper( make )并更改FaceSubstitution的config.make文件,如下所示:
PROJECT_LDFLAGS = [CloningWrapper的路径] /obj/linux64/Release/Clone.o
PROJECT_CFLAGS = -I [CloningWrapper的路径] / src
编译FaceSubstitution( make )。它现在应该是成功的。
将 of_v0.8.3_linux64_release / addons / ofxFaceTracker / libs / FaceTracker / model 文件夹复制到 [路径到FaceSubstitution] / bin / data 和< em> face.jpg 文件到 [FaceSubstitution的路径] / bin / data / faces 。
如果您的网络摄像头已连接且功能正常,您可以启动该应用程序。 ( make run )
我希望它也适合你。