質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
openFrameworks

openFrameworksは、C++で記述されたライブラリ群です。既存のライブラリの設定なしで使用できるため「糊」のようなツールキットと呼ばれています。簡単なコードだけで様々なグラフィックスやインタラクションをデザインすることが可能です。

Q&A

解決済

1回答

2359閲覧

OpenFrameWorksでofxcvを使いたい

kokawa2003

総合スコア217

openFrameworks

openFrameworksは、C++で記述されたライブラリ群です。既存のライブラリの設定なしで使用できるため「糊」のようなツールキットと呼ばれています。簡単なコードだけで様々なグラフィックスやインタラクションをデザインすることが可能です。

0グッド

0クリップ

投稿2018/09/05 06:33

編集2018/09/05 07:29

OpenFramwWorksを使い始めたのですがofxcvをAddonで入れてリンクしたいのですができません。
環境は
OpenFrameWorks 0.10.0 OS:Ubuntu 16.04 で OpenCVに自前でコンパイルした.3.3.0を入れています。
とりあえずofxopencvは入れてコンパイルできたのでOpenCVは問題ないと考えています。
またこのエラーですがコンパイルにQtCreaterを使っていますがQtCreatorでコンパイルした時だけ起きて普通にターミナルからmakeしたときは起こりません。よってqtからするときとmakeの時とでリンクの設定が違う(もしくは違うOpenCVを見ている)と考えられますがなぜそうなのかさっぱり分かりません。そのあたりをチェックする方法も分かりません。お教えいただけませんか?

エラーはこのようなものでFileStorageのLINKエラーなのですが回避方法を知っている人はお教え下さい。
/usr/local/include/opencv2/core/persistence.hpp:1201: error: undefined reference to 'cv::operator<<(cv::FileStorage&, cv::String const&)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Calibration.cpp:116: error: undefined reference to 'cv::FileStorage::FileStorage(cv::String const&, int, cv::String const&)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Calibration.cpp:136: error: undefined reference to 'cv::FileStorage::FileStorage(cv::String const&, int, cv::String const&)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Calibration.cpp:324: error: undefined reference to 'cv::cornerSubPix(cv::InputArray const&, cv::InputOutputArray const&, cv::Size<int>, cv::Size<int>, cv::TermCriteria)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Calibration.cpp:370: error: undefined reference to 'cv::calibrateCamera(cv::_InputArray const&, cv::InputArray const&, cv::Size<int>, cv::_InputOutputArray const&, cv::_InputOutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int, cv::TermCriteria)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Calibration.cpp:450: error: undefined reference to 'cv::stereoCalibrate(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputOutputArray const&, cv::_InputOutputArray const&, cv::_InputOutputArray const&, cv::InputOutputArray const&, cv::Size<int>, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int, cv::TermCriteria)'
/usr/local/include/opencv2/core/persistence.hpp:1189: error: undefined reference to 'cv::error(int, cv::String const&, char const*, char const*, int)'
/usr/local/include/opencv2/core/persistence.hpp:1190: error: undefined reference to 'cv::write(cv::FileStorage&, cv::String const&, cv::Mat const&)'
/usr/local/include/opencv2/core/persistence.hpp:1189: error: undefined reference to 'cv::error(int, cv::String const&, char const*, char const*, int)'
/usr/local/include/opencv2/core/persistence.hpp:1190: error: undefined reference to 'cv::write(cv::FileStorage&, cv::String const&, int)'
/usr/local/include/opencv2/core/persistence.hpp:1189: error: undefined reference to 'cv::error(int, cv::String const&, char const*, char const*, int)'
/usr/local/include/opencv2/core/persistence.hpp:1190: error: undefined reference to 'cv::write(cv::FileStorage&, cv::String const&, float)'
/usr/local/include/opencv2/core/persistence.hpp:1189: error: undefined reference to 'cv::error(int, cv::String const&, char const*, char const*, int)'
/usr/local/include/opencv2/core/persistence.hpp:1246: error: undefined reference to 'cv::read(cv::FileNode const&, int&, int)'
/usr/local/include/opencv2/core/persistence.hpp:1246: error: undefined reference to 'cv::read(cv::FileNode const&, float&, float)'
/usr/local/include/opencv2/core/persistence.hpp:1079: error: undefined reference to 'cv::internal::WriteStructContext::WriteStructContext(cv::FileStorage&, cv::String const&, int, cv::String const&)'
/usr/local/include/opencv2/core/persistence.hpp:1079: error: undefined reference to 'cv::internal::WriteStructContext::~WriteStructContext()'
/usr/local/include/opencv2/core/persistence.hpp:1079: error: undefined reference to 'cv::internal::WriteStructContext::~WriteStructContext()'
/usr/local/include/opencv2/core/cvstd.hpp:601: error: undefined reference to 'cv::String::allocate(unsigned long)'
/usr/local/include/opencv2/core/cvstd.hpp:647: error: undefined reference to 'cv::String::deallocate()'
/usr/local/include/opencv2/core/cvstd.hpp:655: error: undefined reference to 'cv::String::deallocate()'
/usr/local/include/opencv2/core/cvstd.inl.hpp:83: error: undefined reference to 'cv::String::allocate(unsigned long)'
/usr/local/include/opencv2/core/persistence.hpp:854: error: undefined reference to 'cv::FileNodeIterator::readRaw(cv::String const&, unsigned char*, unsigned long)'
/usr/local/include/opencv2/core/persistence.hpp:820: error: undefined reference to 'cv::FileStorage::writeRaw(cv::String const&, unsigned char const*, unsigned long)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/ContourFinder.cpp:70: error: undefined reference to 'cv::findContours(cv::_InputOutputArray const&, cv::OutputArray const&, int, int, cv::Point<int>)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Flow.cpp:133: error: undefined reference to 'cv::calcOpticalFlowPyrLK(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputOutputArray const&, cv::_OutputArray const&, cv::OutputArray const&, cv::Size<int>, int, cv::TermCriteria, int, double)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Flow.cpp:272: error: undefined reference to 'cv::calcOpticalFlowFarneback(cv::InputArray const&, cv::InputArray const&, cv::InputOutputArray const&, double, int, int, int, int, double, int)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Kalman.cpp:44: error: undefined reference to 'cv::setIdentity(cv::InputOutputArray const&, cv::Scalar<double> const&)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Kalman.cpp:45: error: undefined reference to 'cv::setIdentity(cv::InputOutputArray const&, cv::Scalar<double> const&)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Kalman.cpp:46: error: undefined reference to 'cv::setIdentity(cv::InputOutputArray const&, cv::Scalar<double> const&)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Kalman.cpp:47: error: undefined reference to 'cv::setIdentity(cv::InputOutputArray const&, cv::Scalar<double> const&)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/ObjectFinder.cpp:22: error: undefined reference to 'cv::CascadeClassifier::load(cv::String const&)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/ObjectFinder.cpp:56: error: undefined reference to 'cv::CascadeClassifier::detectMultiScale(cv::InputArray const&, std::vector<cv::Rect<int>, std::allocator<cv::Rect
<int> > >&, double, int, int, cv::Size
<int>, cv::Size
<int>)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/RunningBackground.cpp:35: error: undefined reference to 'cv::accumulateWeighted(cv::_InputArray const&, cv::_InputOutputArray const&, double, cv::_InputArray const&)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/RunningBackground.cpp:38: error: undefined reference to 'cv::accumulateWeighted(cv::_InputArray const&, cv::_InputOutputArray const&, double, cv::_InputArray const&)'
/usr/local/include/opencv2/core/persistence.hpp:1201: error: undefined reference to 'cv::operator<<(cv::FileStorage&, cv::String const&)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Wrappers.cpp:9: error: undefined reference to 'cv::FileStorage::FileStorage(cv::String const&, int, cv::String const&)'
/media/kokawa2003/2ef39caa-192e-4e36-8eed-1919c6c9791f/openFrameworks/addons/ofxCv/libs/ofxCv/src/Wrappers.cpp:14: error: undefined reference to 'cv::FileStorage::FileStorage(cv::String const&, int, cv::String const&)'
/usr/local/include/opencv2/core/persistence.hpp:1190: error: undefined reference to 'cv::write(cv::FileStorage&, cv::String const&, cv::Mat const&)'
collect2: error: ld returned 1 exit status
Process failed with exit code 1.

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

解決しました。OpenCVに自前でコンパイルしたもの(3.3.0)とAPT(2.???)で入れたものと2つあってAPTの方をアンインストールすると解決しました。

投稿2018/09/05 07:48

kokawa2003

総合スコア217

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問