LoginSignup
0
0

More than 5 years have passed since last update.

Ubuntu16.04にOpenCVSharpをインストールした

Last updated at Posted at 2016-09-27

Ubuntu16.04.2でOpenCVSharpをビルドしようとしたらエラー出たのでメモ。

とりあえずチュートリアルを参考に
Tutorial for Ubuntu 14.04

#
sudo apt-get install mono-complete

#
sudo apt-get install cmake libgtk2.0-dev libv4l-dev libavcodec-dev libavformat-dev libswscale-dev
cd
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.10/opencv-2.4.10.zip
unzip opencv-2.4.10.zip
cd opencv-2.4.10
cmake .
make -j 4
sudo make install

#
cd
git clone https://github.com/shimat/opencvsharp.git
cd opencvsharp/src
cmake .
make -j 4 #ここでエラー
sudo make install
エラー内容
In file included from /home/test/opencvsharp/src/OpenCvSharpExtern/calib3d.h:4:0,
                 from /home/test/opencvsharp/src/OpenCvSharpExtern/calib3d.cpp:1:
/home/test/opencvsharp/src/OpenCvSharpExtern/include_opencv.h:13:39: fatal error: opencv2/calib3d/calib3d_c.h: そのようなファイルやディレクトリはありません
compilation terminated.

ヘッダーファイルが無いらしいけどopencvsharp/lib/opencv/include配下にはファイルがあったので、こけてるmakefileを確認すると、

opencvsharp/src/OpenCvSharpExtern/CMakeFiles/OpenCvSharpExtern.dir/flags.make
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5

# compile CXX with /usr/bin/c++
CXX_FLAGS = -fPIC

CXX_DEFINES = -DOpenCvSharpExtern_EXPORTS

CXX_INCLUDES =

となっていたので以下のように修正。

CXX_INCLUDES = -I/home/test/opencvsharp/lib/opencv/include

make -j 4を再度実行するとビルドが通りインストールも成功したっぽい。
「DO NOT EDIT!」とか書いてあったけど良かったんだろうか。

0
0
0

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
0
0