LoginSignup
5

More than 5 years have passed since last update.

opencvのサンプルコードをビルドする方法 ヽ(゚ー゚*ヽ)(ノ*゚ー゚)ノわぁい

Posted at

忘れぬようにメモ :smile: OpenCV は便利なサンプルコードも一緒に配布されているので何か試したい時に便利 :thumbsup: というわけで個別にサンプルをビルドしようとしたら失敗したので調査 :pencil:

この記事では以下の絵文字を大事な個所で使用中

  • :exclamation: 注意点
  • :boom: 予期せぬ例外やエラーメッセージ
  • :sunny: 解決方法・お役立ち情報

ビルド環境

  • Ubuntu 12.04

サンプルをビルドする

普通にビルドするとサンプル(examples内で配布されているもの)はビルドされないのでcmakeするときのオプションを指定

:sunny: ビルド時の cmake でオプションを指定する

cmake -D BUILD_EXAMPLES=ON .

このときコンソール上に

--   Tests and samples:
--     Tests:                     YES
--     Perfomance tests:          YES
--     C/C++ Examples:            YES

となっていればOK

:boom: 失敗例

--   Tests and samples:
--     Tests:                     YES
--     Perfomance tests:          YES
--     C/C++ Examples:            NO

のようにNOになっていたら何か間違っている。

:exclamation: ちなみに BUILD_SAMPLES だとうまくいかなかった。

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5