- On fresh install of ubuntu download and install conda (I like to work with Conda)
- To get h264 videos working we need to install the codec. We also need to install ffmpeg for opencv. First the code
sudo apt-get install ubuntu-restricted-extras
-
Install and compile ffmpeg based on [https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu]{https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu}
-
Download and compile opencv 3. Good instructions here [http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/]{http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/} Most importantly note the cmake instructions I had to use
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON \
-D PYTHON3_PACKAGES_PATH = ~/anaconda3/lib/python3.5/site-packages ..
opencv has trouble finding certain external library files in the conda environment
For example error messages like
Determining if the include file /home/nick/anaconda3/include/libpng/png.h exists failed with the following output:
Change Dir: /home/nick/opencv/build/CMakeFiles/CMakeTmp
The answer to this can be found in this thread [https://github.com/opencv/opencv/issues/6027]{https://github.com/opencv/opencv/issues/6027}
Turn off the C_EXAMPLES
because we don't care about them (when installing into conda environment). Also note I had to manually place the location of the python 3 site packages. CMake was not recognizing them.
http://stackoverflow.com/questions/24400935/how-could-we-install-opencv-on-anaconda http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/ http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/
sudo mount -t vboxsf shared_folder ~/shared_folder
also add user to vboxsf group
sudo usermod -aG vboxsf $(whoami)
sudo reboot