Top/project/FingerVision/Software/OpenCV
English | Japanese
English | Japanese

Menu

  • Top
  • Akihiko Yamaguchi 山口 明彦
  • Project プロジェクト
  • Text テキスト
  • Recent articles 最近の記事
  • Articles 記事一覧 (a to z)
  • Search 検索

FingerVision †

  • Concept
  • Videos
  • Publication
  • Manufacturing
  • Software
  • Integration
  • Team
Access: 1/1286 - Admin

OpenCV Version

2.4.8 vs. 2.4.13 †

The both standalone and ROS programs are compiled and tested with OpenCV 2.4.8 and 2.4.13. 2.4.8 is the version available as binary on Ubuntu 16.04, which is good for quick installation. However 2.4.8 does not provide cv::fisheye. If you build the programs with 2.4.8, the image rectification with cv::fisheye (methods for fisheye lens) is not available.

OpenCV 2.4.13 provides cv::fisheye. Building with OpenCV 2.4.13, you can use the image rectification with cv::fisheye.

↑

Do we need 2.4.13? †

No. As far as we tested, 2.4.8 works.

↑

Using 2.4.13 (Optional) †

This section describes the way to install OpenCV 2.4.13 in user space (home directory; ${HOME}/.local) to keep the system version, and build the ROS package fingervision with it. For this purpose, we build OpenCV from source.

↑

Installing OpenCV from Source †

$ sudo apt-get -f install libv4l-0 libv4l-dev
$ git clone --branch 2.4 --depth 1 https://github.com/Itseez/opencv.git
$ cd opencv
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=$HOME/.local ..
$ make -j8
$ make install
↑

Editing CMakeLists.txt of fingervision †

In default, OpenCV 2.x is searched by CMake, which will not find 2.4.13 installed above. For using 2.4.13, we need to edit fingervision/fingervision/CMakeLists.txt.

Edit the section of finding an OpenCV package as follows:

# ++++OPENCV-2.x++++
# find_package(OpenCV 2 REQUIRED)
# message("OpenCV_INCLUDE_DIRS: ${OpenCV_INCLUDE_DIRS}")
# message("OpenCV_LIBRARIES: ${OpenCV_LIBRARIES}")
# ++++OPENCV-2.4.13++++
# NOTE: Install OpenCV 2.4.13 on ~/.local from source which includes cv::fisheye
# We don't use opencv found by any prior running of find_package
unset(OpenCV_CONFIG_PATH CACHE)
unset(OpenCV_DIR CACHE)
set(TMP_PREFIX_PATH ${CMAKE_PREFIX_PATH})
set(CMAKE_PREFIX_PATH "$ENV{HOME}/.local")
find_package(OpenCV 2.4.13 REQUIRED)
# restore CMAKE_PREFIX_PATH and other cached variables
# in order to avoid other packages find this opencv.
set(CMAKE_PREFIX_PATH ${TMP_PREFIX_PATH})
unset(OpenCV_CONFIG_PATH CACHE)
unset(OpenCV_DIR CACHE)
message("OpenCV_INCLUDE_DIRS: ${OpenCV_INCLUDE_DIRS}")
message("OpenCV_LIBRARIES: ${OpenCV_LIBRARIES}")
# ----OPENCV----





Last-modified:2018-08-17 (Fri) 02:10:30 (1624d)
Link: project/FingerVision/Software(1547d) project/FingerVision/Software/Installation(1622d)
Site admin: Akihiko Yamaguchi.
Written by: Akihiko Yamaguchi.
System: PukiWiki 1.5.0. PHP 5.2.17. HTML conversion time: 0.065 sec.