-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HOWTO: OpenCV 2 & OpenCV 3 #4
Comments
VC Version Number & Prebuild
|
Ubuntuprerequisites: sudo apt-get install --assume-yes build-essential cmake git
sudo apt-get install --assume-yes build-essential pkg-config unzip ffmpeg qtbase5-dev python-dev python3-dev python-numpy python3-numpy
sudo apt-get install --assume-yes libopencv-dev libgtk-3-dev libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev
sudo apt-get install --assume-yes libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
sudo apt-get install --assume-yes libv4l-dev libtbb-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev
sudo apt-get install --assume-yes libvorbis-dev libxvidcore-dev v4l-utils CV3cmake, make. CV2cmake, make. UsageWhen you want opencv 2,: export OpenCV2_DIR=/home/tzx/Downloads/archive/opencv-2.4.13/build
cd ~/git/cmake-templates/opencv
mkdir build && cd build
cmake ..
make When you want opencv 3: cd ~/git/cmake-templates/opencv3
mkdir build && cd build
export OpenCV2_DIR=/home/tzx/Downloads/archive/opencv-3.1/build
cmake ..
make I installed OpenCV 3 and added these lines to my
Refs |
In my case, better not configure CUDA to the WONT_INSTALL opencv 2. |
I just set OpenCV_DIR in CMakeLists.txt where my OpenCVConfig.cmake locates. |
@JingeTu Like this: |
Windows
When you
find_package( OpenCV REQUIRED )
in CMakeLists.txt, it just look forOpenCVConfig.cmake
underOpenCV_DIR
, akainclude( $ENV{OpenCV_DIR}/OpenCVConfig.cmake )
.If you want to use OpenCV2 & OpenCV3 in your system at the same time. Here is my solution:
1.
First goto OpenCV official download page, download
opencv-2.4.x.exe
andopencv-3.1.x.exe
.2.
Second, extract them, set these two proper environment variables:
OpenCV2_DIR
->D:\OpenCV\build
OpenCV3_DIR
->D:\OpenCV3\build
OpenCV_DIR
->%OpenCV_DIR%
or%OpenCV3_DIR%
(which you prefer)add to
PATH
:%OpenCV2_DIR%\x64\vc10\bin
(for VS2010 generated exe)%OpenCV3_DIR%\x64\vc14\bin
(for VS2015 generated exe)reboot may needed.
3.
Last, generated VS2010, VS2015 project to use OpenCV 2, OpenCV 3 with CMake, respectively.
You can see opencv2 / opencv3 examples in:
The text was updated successfully, but these errors were encountered: