dependence
yum install cmake
yum install python-devel numpy
yum install gcc gcc-c++
yum install gtk2-devel
yum install libdc1394-devel
-------------------how to install ffmpeg on fedora--------------------------------------------------------------------------------------------------
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install ffmpeg ffmpeg-devel
来源:https://tecadmin.net/install-ffmpeg-on-fedora/;
---------------------------------------------------------------------------------------------------------------------------------------------------------------
yum install gstreamer-plugins-base-devel
yum install libpng-devel
yum install libjpeg-turbo-devel
yum install jasper-devel
yum install openexr-devel
yum install libtiff-devel
yum install libwebp-devel
yum install tbb-devel //if you need TBB ,add -D WITH_TBB=ON;
yum install eigen3-devel //OpenCV uses another library Eigen for optimized mathematical operations. if you want to use it, don't forget to to add -D WITH_EIGEN=ON;
yum install doxygen //if you want to build offline documentation that you need not access the internet always if any question,don't forget to add -D BUILD_DOCS=ON;
来源:https://docs.opencv.org/master/dd/dd5/tutorial_py_setup_in_fedora.html;
CMake
cmake
D CMAKE_BUILD_TYPE=RELEASE
D CMAKE_INSTALL_PREFIX=/usr/local
-D WITH_TBB=ON
-D WITH_V4L=ON
-D WITH_OPENGL=ON
-D BUILD_TIFF=ON
-D OPENCV_EXTRA_MODULES_PATH=/home/li/opencv/opencv_contrib/modules
-D WITH_EIGEN=ON
-D BUILD_EXAMPLES=OFF
-D OPENCV_ENABLE_NONFREE:BOOL=ON ..
-------------then-----------------------------
make -j8
sudo make install
sudo sh -c 'echo "/usr/local/lib" >> /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
转载来源:https://www.jianshu.com/p/5edff54264f9
CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(opencv)
FIND_PACKAGE( OpenCV REQUIRED )
aux_source_directory(source DIR_SRCS)
add_executable(test ${DIR_SRCS})
target_link_libraries(test ${OpenCV_LIBS})