Monday, December 17, 2018

Mixed installation and usage of opencv 2&3 (windows & linux)

System: Windows

Architecture: x64
Compiler: Visual studio
https://www.learnopencv.com/install-opencv3-on-windows/

Linux

To keep both opencv2 and opencv3
1. Uninstall opencv2 and opencv3, remove or lib and include files in /usr/ or /usr/local/
2. Install in local directory

The default install folder of OpenCV is /usr/local/. You can install OpenCV 3.1 to a separate location, say /home/your_username/opencv_3.1 with CMake option
cmake -D CMAKE_INSTALL_PREFIX=/home/your_username/opencv_3.1
To build your project with OpenCV 3.1 using CMake, add
set(OpenCV_DIR /home/your_username/opencv_3.1/share/OpenCV)
to your CMakeLists.txt, after project(projName). You can also link the corresponding libraries/headers manually or with IDE.

Manuall settings for OpenCV directory

When you manually set opencv directory, if you have problems in cmake


CMake Warning at C:/opencv-2.4.9/build/install/OpenCVConfig.cmake:165 (message):
  Found OpenCV Windows Pack but it has not binaries compatible with your
  configuration.

  You should manually point CMake variable OpenCV_DIR to your build of OpenCV
  library.
Call Stack (most recent call first):
  CMakeLists.txt:79 (find_package)


CMake Error at CMakeLists.txt:79 (find_package):
  Found package configuration file:

    C:/opencv-2.4.9/build/install/OpenCVConfig.cmake

  but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
  NOT FOUND.

There is a problem in opencv 2.4.8 in build/install/OpenCVConfig.cmake, so you should set the OpenCV_DIR as the build directory, and also set the OPCV_FOUND to true.
In the cmake file, add the following lines

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
SET("OpenCV_DIR" "C:\\opencv-2.4.9\\build\\")
find_package(OpenCV REQUIRED)
set(OpenCV_FOUND TRUE)
if (NOT OpenCV_FOUND)
    message(FATAL_ERROR "OpenCV library not found")
else()
 include_directories(${OpenCV_INCLUDE_DIRS})
 include_directories(${OpenCV2_INCLUDE_DIRS})
 link_directories(${OpenCV_LIB_DIR})
endif()


Tuesday, December 11, 2018

Update cmake version without default setting in ubuntu


  1. Check your current version with cmake --version
  2. Uninstall it with sudo apt remove cmake
  3. Visit https://cmake.org/download/ and download the latest binaries
    • In my case cmake-3.6.2-Linux-x86_64.sh is sufficient
  4. chmod +x /path/to/cmake-3.6.2-Linux-x86_64.sh (use your own file location here, but chmod makes the script executable)
  5. sudo /path/to/cmake-3.6.2-Linux-x86_64.sh (you'll need to press y twice)
    The script installs to /opt/cmake-3.6.2-Linux-x86_64 so in order to get the cmakecommand, make a symbolic link:
  6. sudo ln -s /opt/cmake-3.6.2-Linux-x86_64/bin/* /usr/local/bin
    Test your results with cmake --version

Wednesday, December 5, 2018

Egomotion


The goal of estimating the egomotion of a camera is to determine the 3D motion of that camera within the environment using a sequence of images taken by the camera.

6D-Vision helps to resolve the issue: from a few stationary 3D points one can determine the complete motion state of the vehicle (rotation and translation) precisely.

A lot current works assume that the scenes they are interested in are mostly rigid, i.e., the scene appearance change across different frames is dominated by the camera motion.

Depth camera survey

source



Depth Camera Categories