cmake opencv openCV_DIR路径设置问题

http://bbs.csdn.net/wap/topics/390607744#
跟这个问题一样 但还是不知道怎么操作解决 怎么能把openCV_DIR路径换到我编译到的opencv3.0.0/build中

2个回答

fanhongyuan21
威小廉 具体怎么操作呢
接近 4 年之前 回复

// for install opencv samples , 应该在安装的目录下 即(install/share/OpenCv)
1、find_package(OpenCV REQUIRED)中的OpenCV一定要遵循该大小写。
  因为该句话是根据OpenCV作为前缀自动去/usr/local/share/OpenCV(如果你的opencv安装时,默认前缀设置为:/usr/local时)文件夹中去找OpenCVConfig.cmake,OpenCV-config.cmake 两个文件,进而确定你要引入的opencv头文件和库函数在哪里。

2、自定义引入相应opencv版本
  如果你有很多的opencv版本,尤其是一个是opencv2.x.x一个是opencv3.x.x,因为2和3在数据结构上有相对较大的变化,所以如果引入错误的版本可能导致程序的无法运行。因为find_package找默认路径下的OpenCV,但是很多时候安装多个版本的库的时候都会make install在opt目录下。、
  安装在opt的文件中会有share文件夹,这里面就有咱们需要的OpenCV文件夹,所以如果要自己有选择的控制版本,则在find_package这句话前面去设置opencv的OpenCV文件夹在哪里,添加set(OpenCV_DIR /opt/opencv-2.4.11/share/OpenCV)这句话。因为我的opencv2.4.11版本install在/opt/opencv-2.4.11文件夹下。这个可以根据你install的位置去变化。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
【已经解决】 Win10环境下采用CMake编译OpenCV项目,提示无法找到opencv
1. 安装过OpenCV 4.1 win pack版本,同时安装的Intel Sensor SDK第三方软件中有opencv 3.4版本。 都按照操作要求添加了环境变量路径。 2. 采用CMake编译一个文件出现一直提示错误,这个错误应该是很多人都遇到过的。 CMakeLists.txt文件内容如下: cmake_minimum_required(VERSION 3.10) project(CvTrack) set(CMAKE_BUILD_TYPE Debug) set(OpenCV_DIR "D:/opencv/build") find_package(OpenCV REQUIRED) add_executable(CvTracking "main.cpp") target_link_libraries(CvTrack ${OpenCV_LIBS}) ********************************************************************************************************************************************************** 产生的错误提示: Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18362. OpenCV ARCH: x86 OpenCV RUNTIME: vc14 OpenCV STATIC: OFF CMake Warning at D:/opencv/build/OpenCVConfig.cmake:166 (message): Found OpenCV Windows Pack but it has no 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:15 (find_package) CMake Error at CMakeLists.txt:15 (find_package): Found package configuration file: D:/opencv/build/OpenCVConfig.cmake but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND. ![图片说明](https://img-ask.csdn.net/upload/201912/09/1575860198_340992.png) 安装目录如下: ![图片说明](https://img-ask.csdn.net/upload/201912/09/1575860277_399662.png) ![图片说明](https://img-ask.csdn.net/upload/201912/09/1575860289_707476.png) 请问,这个问题如何解决呢?? /==/==/==/==/==/==/==/==/==/==/==/==/==/==/==/==/==/== 解决方法: 主要原因:根据提示,OpenCVConfig.cmake文件有问题;实际在OpenCV 4.1 wind pack安装版本中,OpenCVConfig.cmake在其它路径下也有一个文件,修改路径即。 其次原因:设定的工程名为CvTrack,在add\_excuatable中的TargetName不对应。所以:重新修正了一下CMakeLists.txt: cmake_minimum_required(VERSION 3.10) project(CvTrack) set(OpenCV_DIR "D:/opencv/build/x64/vc15/lib") # 错误修正 find_package(OpenCV REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS}) add_executable(CvTrack "main.cpp") # 错误修正 target_link_libraries(CvTrack ${OpenCV_LIBS})
opencv3.2与opencv 2.8 切换的问题
我的ubuntu系统原来安装了opencv2.8,现在由于实际需要,安装了opencv3.2。但是,opencv2.8还得继续保留。利用pkg-config --modversion opencv 查看opencv的版本,显示是3.2.0。原来(opencv2.8下),CMakeList文件是这样写的。 project(test) find_package(OpenCV REQUIRED) add_executable(test src/test.cpp) target_link_libraries(test ${OpenCV_LIBS}) cmake_minimum_required(VERSION 2.8) 我使用opencv3.2编译的时候,按照要求,我把路径给加上了。 project(test) find_package(OpenCV REQUIRED) set(OpenCV_DIR "/usr/local/opencv320/share/OpenCV") INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS}) add_executable(test src/test.cpp) target_link_libraries(test ${OpenCV_LIBS}) cmake_minimum_required(VERSION 3.2) 但是显示错误:要求的opencv版本太高,当前运行版本为2.8。但是我用 pkg-config --modversion opencv 查看版本,显示的是3.2.0
opencv3.1.0交叉编译出错
我在给mini2440移植opencv3.1.0的时候,make编译opencv过程中出错了。log如下: CMakeFiles/opencv_perf_core.dir/perf/perf_math.cpp.obj: In function `cv::Mat::~Mat()': perf_math.cpp.text._ZN2cv3MatD1Ev[cv::Mat::~Mat()]+0x1c): undefined reference to `__sync_fetch_and_add_4' CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj: In function `Size_MatType_CmpType_compare:erfTestBody()': perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x30c): undefined reference to `__sync_fetch_and_add_4' perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x378): undefined reference to `__sync_fetch_and_add_4' perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x3ec): undefined reference to `__sync_fetch_and_add_4' CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj: In function `Size_MatType_CmpType_compareScalar:erfTestBody()': perf_compare.cpp.text._ZN34Size_MatType_CmpType_compareScalar12PerfTestBodyEv+0x32c): undefined reference to `__sync_fetch_and_add_4' CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj:perf_compare.cpp.text._ZN34Size_MatType_CmpType_compareScalar12PerfTestBodyEv+0x3a0): more undefined references to `__sync_fetch_and_add_4' follow collect2: ld returned 1 exit status make[2]: *** [bin/opencv_perf_core] Error 1 make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2 make: *** [all] Error 2 我用的是Ubuntu14.04,32位虚拟机。 查网上说是CMAKE_C_FLAGS要设为-march=armv4t 可是我安装提示设置了CMAKE_C_FLAGS 和 CMAKE_CXX_FLAGS的值,错误还是没有消失。 我试过了opencv3.1。0和opencv3.2.0了,都会出现这个问题。因为项目需求要用到opencv3 所以只能自己编译最新版,,泪奔 有大神遇到过这个问题吗?
在ubuntu下配置opencv,cmake成功了,而make时候报错
1 [ 6%] Generating precomp.hpp.gch/opencv_core_Release.gch 2 In file included from /usr/include/c++/6/bits/stl_algo.h:59:0, 3 from /usr/include/c++/6/algorithm:62, 4 from /opt/opencv/opencv-3.1.0/modules/core/include/opencv2/core/base.hpp:53, 5 from /opt/opencv/opencv-3.1.0/modules/core/include/opencv2/core.hpp:54, 6 from /opt/opencv/opencv-3.1.0/modules/core/include/opencv2/core/utility.hpp:52, 7 from /opt/opencv/build/modules/core/precomp.hpp:49: 8 /usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: 没有那个文件或目录 9 #include_next <stdlib.h> 10 ^ 11 compilation terminated. 12 modules/core/CMakeFiles/pch_Generate_opencv_core.dir/build.make:62: recipe for target 'modules/core/precomp.hpp.gch/opencv_core_Release.gch' failed 13 make[2]: *** [modules/core/precomp.hpp.gch/opencv_core_Release.gch] Error 1 14 CMakeFiles/Makefile2:1178: recipe for target 'modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all' failed 15 make[1]: *** [modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all] Error 2 16 Makefile:160: recipe for target 'all' failed 17 make: *** [all] Error 2 ![图片说明](https://img-ask.csdn.net/upload/201703/03/1488542516_717767.png)
ubantu16 安装opencv3.2 在 cmake时出项很多问题
FP16: Feature disabled -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3") -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") -- Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package): By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Core", but CMake did not find one. Could not find a package configuration file provided by "Qt5Core" with any of the following names: Qt5CoreConfig.cmake qt5core-config.cmake Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set "Qt5Core_DIR" to a directory containing one of the above files. If "Qt5Core" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package): By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Gui", but CMake did not find one. Could not find a package configuration file provided by "Qt5Gui" with any of the following names: Qt5GuiConfig.cmake qt5gui-config.cmake Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set "Qt5Gui_DIR" to a directory containing one of the above files. If "Qt5Gui" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package): By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Widgets", but CMake did not find one. Could not find a package configuration file provided by "Qt5Widgets" with any of the following names: Qt5WidgetsConfig.cmake qt5widgets-config.cmake Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set "Qt5Widgets_DIR" to a directory containing one of the above files. If "Qt5Widgets" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package): By not providing "FindQt5Test.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Test", but CMake did not find one. Could not find a package configuration file provided by "Qt5Test" with any of the following names: Qt5TestConfig.cmake qt5test-config.cmake Add the installation prefix of "Qt5Test" to CMAKE_PREFIX_PATH or set "Qt5Test_DIR" to a directory containing one of the above files. If "Qt5Test" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:22 (find_package): By not providing "FindQt5Concurrent.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Concurrent", but CMake did not find one. Could not find a package configuration file provided by "Qt5Concurrent" with any of the following names: Qt5ConcurrentConfig.cmake qt5concurrent-config.cmake Add the installation prefix of "Qt5Concurrent" to CMAKE_PREFIX_PATH or set "Qt5Concurrent_DIR" to a directory containing one of the above files. If "Qt5Concurrent" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) -- Looking for Q_WS_X11 -- Looking for Q_WS_X11 - found -- Looking for Q_WS_WIN -- Looking for Q_WS_WIN - not found -- Looking for Q_WS_QWS -- Looking for Q_WS_QWS - not found -- Looking for Q_WS_MAC -- Looking for Q_WS_MAC - not found -- Found Qt4: /usr/bin/qmake (found version "4.8.7") -- Checking for module 'gstreamer-base-1.0' -- No package 'gstreamer-base-1.0' found -- Checking for module 'gstreamer-video-1.0' -- No package 'gstreamer-video-1.0' found -- Checking for module 'gstreamer-app-1.0' -- No package 'gstreamer-app-1.0' found -- Checking for module 'gstreamer-riff-1.0' -- No package 'gstreamer-riff-1.0' found -- Checking for module 'gstreamer-pbutils-1.0' -- No package 'gstreamer-pbutils-1.0' found -- Checking for module 'gstreamer-base-0.10' -- Found gstreamer-base-0.10, version 0.10.36 -- Checking for module 'gstreamer-video-0.10' -- Found gstreamer-video-0.10, version 0.10.36 -- Checking for module 'gstreamer-app-0.10' -- Found gstreamer-app-0.10, version 0.10.36 -- Checking for module 'gstreamer-riff-0.10' -- Found gstreamer-riff-0.10, version 0.10.36 -- Checking for module 'gstreamer-pbutils-0.10' -- Found gstreamer-pbutils-0.10, version 0.10.36 -- Checking for module 'libxine' -- No package 'libxine' found -- Looking for linux/videodev.h -- Looking for linux/videodev.h - not found -- Looking for linux/videodev2.h -- Looking for linux/videodev2.h - found -- Looking for sys/videoio.h -- Looking for sys/videoio.h - not found -- Checking for module 'libavresample' -- No package 'libavresample' found -- Checking for module 'libgphoto2' -- No package 'libgphoto2' found -- Found TBB: /usr/lib/x86_64-linux-gnu/libtbb.so CMake Error at cmake/OpenCVFindIPP.cmake:243 (include): include could not find load file: ...................... CMake Warning at CMakeLists.txt:1356 (message): The source directory is the same as binary directory. "make clean" may damage the source tree -- Configuring incomplete, errors occurred! See also "/home/zyz/文档/opencv-3.2.0/CMakeFiles/CMakeOutput.log". See also "/home/zyz/文档/opencv-3.2.0/CMakeFiles/CMakeError.log".
opencv配置成功后,进行测试时出错
CMake Warning at /home/obvious/opencv/cmake/OpenCVConfig.cmake:166 (message): Found OpenCV Windows Pack but it has no 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:10 (find_package) CMake Error at CMakeLists.txt:10 (find_package): Found package configuration file: /home/obvious/opencv/cmake/OpenCVConfig.cmake but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND. ![图片说明](https://img-ask.csdn.net/upload/201703/05/1488699720_108187.png)
求教,cmake找不到库,帮帮忙,感激
1.cmake老是提示找不到boost库![图片说明](https://img-ask.csdn.net/upload/201505/20/1432082094_997788.png) 2.我增加了link_directories(F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0/lib64-msvc-10.0)还是没有用 3.cmakelist.text 主 ``` project(superviseddescent) cmake_minimum_required(VERSION 2.8.7) set(superviseddescent_VERSION_MAJOR 0) set(superviseddescent_VERSION_MINOR 3) set(superviseddescent_VERSION_PATCH 0) set (BOOST_ROOT,"F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0") set(Boost_LIBRARIES,"F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0/lib64-msvc-10.0") message(STATUS "BOOST_ROOT: ${BOOST_ROOT}") # g++ needs a compiler flag to enable C++11 support include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-std=c++11 HAS_CXX11_FLAG) if (HAS_CXX11_FLAG) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() # All the options for building the library. Can be changed on the command-line or in initial_cache.cmake. message(STATUS "Options:") option(BUILD_TESTS "Builds the unit tests." ON) message(STATUS "BUILD_TESTS: ${BUILD_TESTS}") option(BUILD_EXAMPLES "Build the example applications." ON) message(STATUS "BUILD_EXAMPLES: ${BUILD_EXAMPLES}") option(BUILD_DOCUMENTATION "Build the library documentation." ON) message(STATUS "BUILD_DOCUMENTATION: ${BUILD_DOCUMENTATION}") # Build a CPack driven installer package: include(InstallRequiredSystemLibraries) # This module will include any runtime libraries that are needed by the project for the current platform set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_PACKAGE_VERSION_MAJOR "${superviseddescent_VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MINOR "${superviseddescent_VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_PATCH "${superviseddescent_VERSION_PATCH}") include(CPack) #set(Boost_USE_STATIC_LIBS OFF) # Find dependencies: find_package(OpenCV 2.4.3 REQUIRED core) message(STATUS "OpenCV include dir found at ${OpenCV_INCLUDE_DIRS}") message(STATUS "xxxxxxBoost found at ${Boost_INCLUDE_DIRS}") message(STATUS "OpenCV lib dir found at ${OpenCV_LIB_DIR}") link_directories(F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0/lib64-msvc-10.0) link_directories(F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_02/bin/vc10/lib) find_package(Boost 1.48.0 COMPONENTS system serialization REQUIRED) if(Boost_FOUND) #message(STATUS "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa ${Boost_INCLUDE_DIRS}/bin/vc10/lib") message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}") else(Boost_FOUND) message(FATAL_ERROR "Boost not found") endif() message(STATUS "xxxxxxxxxxxxxxxxxxxxxxxx ${Boost_LIBRARIES}") set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) find_package(Eigen3 REQUIRED) message(STATUS "Eigen3 found: ${EIGEN3_FOUND}") message(STATUS "Eigen3 include dir found at ${EIGEN3_INCLUDE_DIR}") message(STATUS "Eigen3 version: ${EIGEN3_VERSION}") # Source and header files set(HEADERS include/superviseddescent/superviseddescent.hpp include/superviseddescent/regressors.hpp include/superviseddescent/matserialisation.hpp include/superviseddescent/utils/ThreadPool.h ) # Add header includes: include_directories("include") include_directories(${Boost_INCLUDE_DIRS}) include_directories(${OpenCV_INCLUDE_DIRS}) include_directories(${EIGEN3_INCLUDE_DIR}) # The install target: install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include) if(BUILD_TESTS) message(STATUS "Configuring gtest-1.7.0...") set(gtest_force_shared_crt ON CACHE BOOL "Use shared (DLL) run-time lib (CRT) even when Google Test is built as static lib.") # THIS IS NEWEST add_subdirectory(3rdparty/gtest-1.7.0) message(STATUS "Finished configuring gtest.") enable_testing() # Enables CTest add_custom_target(check-dbg COMMAND ${CMAKE_CTEST_COMMAND} -V -C Debug) # to get detailed output on VS add_custom_target(check-rel COMMAND ${CMAKE_CTEST_COMMAND} -V -C Release) add_subdirectory(test) endif() if(BUILD_EXAMPLES) add_subdirectory(examples) endif() if(BUILD_DOCUMENTATION) add_subdirectory(doc) endif() ``` cmakelist.text 子文件夹 ``` # Unit tests # ========== # Note: All the variables in here are inherited from the parent CMakeLists find_package(OpenCV 2.4.3 REQUIRED core) message(STATUS "OpenCV include dir found at ${OpenCV_INCLUDE_DIRS}") message(STATUS "OpenCV lib dir found at ${OpenCV_LIB_DIR}") message(STATUS "OpenCV lib dir aaaaaat ${OpenCV_LIB_DIR}") include_directories(${gtest_SOURCE_DIR}/include) set(TEST_LINREG1D test_LinearRegressor1D) add_executable(${TEST_LINREG1D} test_LinearRegressor1D.cpp) #link_directories(${BOOST_ROOT}/bin/vc10/lib) target_link_libraries(${TEST_LINREG1D} ${OpenCV_LIBS} ${Boost_LIBRARIES} gtest_main gtest) add_test(${TEST_LINREG1D} ${TEST_LINREG1D}) # Syntax: testname exename set(TEST_LINREGND test_LinearRegressorND) add_executable(${TEST_LINREGND} test_LinearRegressorND.cpp) target_link_libraries(${TEST_LINREGND} ${OpenCV_LIBS} ${Boost_LIBRARIES} gtest_main gtest) add_test(${TEST_LINREGND} ${TEST_LINREGND}) set(TEST_SDO test_SupervisedDescentOptimiser) add_executable(${TEST_SDO} test_SupervisedDescentOptimiser.cpp) target_link_libraries(${TEST_SDO} ${OpenCV_LIBS} ${Boost_LIBRARIES} gtest_main gtest) add_test(${TEST_SDO} ${TEST_SDO}) ``` 4.目录如下![图片说明](https://img-ask.csdn.net/upload/201505/20/1432082538_83078.png) 5.boost目录![图片说明](https://img-ask.csdn.net/upload/201505/20/1432082621_906489.png) 6.boost库![图片说明](https://img-ask.csdn.net/upload/201505/20/1432082701_66544.png)
windows环境下codeblocks17.12 用cmake配置opencv3.4.7出现如下错误
试了好多次了,参考了不少博主的文章编译,还是有错 ``` F:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `CMakeFiles\opencv_core.dir/objects.a(vs_version.rc.obj)' is incompatible with i386:x86-64 output collect2.exe: error: ld returned 1 exit status modules\core\CMakeFiles\opencv_core.dir\build.make:1843: recipe for target 'bin/libopencv_core340.dll' failed mingw32-make[2]: *** [bin/libopencv_core340.dll] Error 1 CMakeFiles\Makefile2:1686: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed mingw32-make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 Makefile:161: recipe for target 'all' failed mingw32-make: *** [all] Error 2 ```
CMakeLists编译出错,如何使用?
cmake_minimum_required(VERSION 2.8 FATAL_ERROR) project(kinect_capture) set(FREENECT_DIR "c:/code/libfreenect") set(FREENECT_BUILD_DIR "c:/code/libfreenect_build") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${FREENECT_DIR}/cmake_modules/") #Boost set(BOOST_ROOT "c:/code/boost_1_47_0") set(BOOST_LIBRARYDIR "C:/code/boost_1_47_0/stage/lib") set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) find_package(Boost COMPONENTS date_time) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${BOOST_LIBRARYDIR}) #VTK #find_package(VTK) #if(VTK_FOUND) # INCLUDE(${VTK_USE_FILE}) #endif() f #PCL #find_package(PCL 1.1 COMPONENTS common visualization) #include_directories(${PCL_INCLUDE_DIRS}) #link_directories(${PCL_LIBRARY_DIRS}) #add_definitions(${PCL_DEFINITIONS}) #OpenCV set(OpenCV_DIR "C:/code/OpenCV2.2/build") find_package(OpenCV COMPONENTS filesystem) include_directories(${OpenCV_INCLUDE_DIRS}) link_directories(${OpenCV_LIB_DIR}) #OpenGL find_package(OpenGL REQUIRED) find_package(GLUT REQUIRED) include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${USB_INCLUDE_DIRS}) #include_directories("C:/code/glew-1.7.0/include") #include_directories("C:/code/glew-1.7.0/lib") #Glui include_directories("C:/code/glui-2.35/src/include") link_directories("c:/code/glui-2.35/src/msvc/lib") #PTHREAD set(THREADS_PTHREADS_INCLUDE_DIR "c:/code/pthreads-2-8-0/include") set(THREADS_PTHREADS_WIN32_LIBRARY "c:/code/pthreads-2-8-0/lib/pthreadVC2.lib") set(THREADS_USE_PTHREADS_WIN32 true) find_package(Threads REQUIRED) include_directories(${THREADS_PTHREADS_INCLUDE_DIR}) #USB set(LIBUSB_1_INCLUDE_DIR "C:/code/libusb-1.2.5.0/include") set(LIBUSB_1_LIBRARY "C:/code/libusb-1.2.5.0/lib/msvc/libusb.lib") find_package(libusb-1.0 REQUIRED) include_directories(${LIBUSB_1_INCLUDE_DIRS}) include_directories("${FREENECT_DIR}/platform/windows") include_directories("${FREENECT_DIR}/platform/windows/libusb10emu") #Freenect include_directories("${FREENECT_DIR}/include") #set(FREENECT_LIBRARY_DIR optimized "${FREENECT_BUILD_DIR}/lib/Release/" debug "${FREENECT_BUILD_DIR}/lib/Debug/") set(FREENECT_LIBRARY_DIR "${FREENECT_BUILD_DIR}/lib/") link_directories(${FREENECT_LIBRARY_DIR}) set(FREENECT_LIBRARIES "freenect.lib") #Files file(GLOB_RECURSE INCS "*.h") set(SRCS kinect_capture.cpp kinect_capture_app.cpp kinect_calibration.cpp freenect_module.cpp ) #Build add_executable (kinect_capture ${SRCS} ${INCS}) target_link_libraries (kinect_capture ${FREENECT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${LIBUSB_1_LIBRARIES} ${OpenCV_LIBS} ${Boost_LIBRARIES}) #${PCL_LIBRARIES} ${VTK_LIBRARIES} 这是cmakelist的全部内容,#Boost,#VTK,#PCL,#OpenCV,#OpenGL,#Glui,#PTHREAD,#Freenect这些在电脑里都要有吗??
ubuntu 安装配置c++的opencv 报错
我在ubuntu 上打算安装和配置c++的Opencv, 下载了opencv3.1.0版本的代码,然后也手动的下载了ippicv_linux_20151201.tgz。创建build文件夹后Cmake命令已经可以编译过去了。 但是在执行make命令的时候,经常会报错: ``` [ 15%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/opencl_kernels_core.cpp.o [ 15%] Linking CXX shared library ../../lib/libopencv_core.so /usr/bin/ld: CMakeFiles/opencv_core.dir/src/va_intel.cpp.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC CMakeFiles/opencv_core.dir/src/va_intel.cpp.o: 无法添加符号: 错误的值 collect2: error: ld returned 1 exit status modules/core/CMakeFiles/opencv_core.dir/build.make:1382: recipe for target 'lib/libopencv_core.so.3.1.0' failed make[2]: *** [lib/libopencv_core.so.3.1.0] Error 1 CMakeFiles/Makefile2:1420: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 Makefile:160: recipe for target 'all' failed make: *** [all] Error 2 ``` 有时候在33%进度的时候报这个错误,有时候就在15%时候报。我整整试了一整天,查遍了各种解决方法都无济于事。请大侠们帮忙解决下吧。跪谢。 是否有直接加载已经编译好的库的方式,可以快速实现配置,因为我急需要用Opencv实现代码。感谢各位大侠了。
Android studio JNI 使用 CMakeLists 如何让import的so库 生成到输出目录?
引入第三方so 通过 ``` add_library(Opencv SHARED IMPORTED) set_target_properties(AlgInterface PROPERTIES IMPORTED_LOCATION ${opencvpath}) ``` 链接so ``` target_link_libraries(myso Opencv) ``` 设置输出目录 ``` set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../jniLibs/${ANDROID_ABI}) ``` 输出目录中只有myso 没有 opencv ,如何让opencv同时生成到 输出目录呢 Android.mk中 可以直接构建库 ``` LOCAL_MODULE := Opencv LOCAL_SRC_FILES := $(LOCAL_PATH)/libopencv.so ``` 但是CMakeLists中 add_library 源文件不能是so CMakeLists中有什么类似的方式么 或者其他好的办法
通过MakeFile文件了解项目目录结构,编写CMake的CMakelist.txt文件方法。
主项目: CC = gcc CFLAGS += -O3 BIN_DIR = ./bin SRC_DIR = ./src DOC_DIR = ./docs INC_DIR = ./include LIB_DIR = ./lib BIN = siftfeat match dspfeat all: $(BIN) libopensift.a docs docs: doxygen Doxyfile libopensift.a: make -C $(SRC_DIR) $@ $(BIN): make -C $(SRC_DIR) $@ clean: make -C $(SRC_DIR) $@; \ make -C $(INC_DIR) $@; \ distclean: clean rm -f $(LIB_DIR)/* rm -f $(BIN_DIR)/* docsclean: rm -rf $(DOC_DIR)/html/ .PHONY: docs clean docsclean libopensift.a scr文件: CC = gcc CFLAGS += BIN_DIR = ../bin INC_DIR = ../include LIB_DIR = ../lib INCL = -I$(INC_DIR) `pkg-config --cflags opencv gtk+-2.0` LIBS = -L$(LIB_DIR) -lopensift -lm `pkg-config --libs opencv gtk+-2.0` OBJ = imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o BIN = siftfeat match dspfeat all: $(BIN) libopensift.a libopensift.a: $(OBJ) ar rc $(LIB_DIR)/$@ $(OBJ) ranlib $(LIB_DIR)/$@ siftfeat: libopensift.a siftfeat.c $(CC) $(CFLAGS) $(INCL) siftfeat.c -o $(BIN_DIR)/$@ $(LIBS) match: libopensift.a match.c $(CC) $(CFLAGS) $(INCL) match.c -o $(BIN_DIR)/$@ $(LIBS) dspfeat: libopensift.a dspfeat.c $(CC) $(CFLAGS) $(INCL) dspfeat.c -o $(BIN_DIR)/$@ $(LIBS) imgfeatures.o: imgfeatures.c $(INC_DIR)/imgfeatures.h $(CC) $(CFLAGS) $(INCL) -c imgfeatures.c -o $@ utils.o: utils.c $(INC_DIR)/utils.h $(CC) $(CFLAGS) $(INCL) -c utils.c -o $@ sift.o: sift.c $(INC_DIR)/sift.h $(CC) $(CFLAGS) $(INCL) -c sift.c -o $@ kdtree.o: kdtree.c $(INC_DIR)/kdtree.h $(CC) $(CFLAGS) $(INCL) -c kdtree.c -o $@ minpq.o: minpq.c $(INC_DIR)/minpq.h $(CC) $(CFLAGS) $(INCL) -c minpq.c -o $@ xform.o: xform.c $(INC_DIR)/xform.h $(CC) $(CFLAGS) $(INCL) -c xform.c -o $@ clean: rm -f *~ *.o core .PHONY: clean include文件: clean: rm -f *~ .PHONY: clean
WINDOWS下用Cmake弄CodeBlocks + OPenCV 3.3配置时出错
![图片说明](https://img-ask.csdn.net/upload/201709/01/1504234665_410763.png) ![图片说明](https://img-ask.csdn.net/upload/201709/01/1504234672_719273.png) 这个文件 Building RC object modules/core/CMakeFiles/opencv_core.dir/vs_version.rc. obj 有没有大神救救我...
为什么Opencv3.4.0使用make编译时出现错误?
环境:Debian(Raspiberry Pi Buster) cmake version: 3.0.2 gcc version: 8.2.0 python version: 3.7.2 make version: 4.2.1 本来计划用opencv基于python进行图像辨别 在使用cmake配置完成后使用make命令编译: ``` sudo make ``` 编译到大约90%时,出现如下错误: ``` #这是之前很多条控制台信息中的warning warning: cast between incompatible function types from ‘PyObject* (*)(PyObject*, PyObject*, PyObject*)’ {aka ‘_object* (*)(_object*, _object*, _object*)’} to ‘PyCFunction’ {aka ‘_object* (*)(_object*, _object*)’} [-Wcast-function-type] ``` ``` #make错误,退出 make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/build.make:56: modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:21149: modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2 make: *** [Makefile:138: all] Error 2 ``` 如图(图1中使用了make -i选项忽略错误,继续编译剩余部分,但open_cv python3没有成功编译): ![图片说明](https://img-ask.csdn.net/upload/201908/11/1565498546_278259.png) (图2显示了make的错误) ![图片说明](https://img-ask.csdn.net/upload/201908/11/1565499335_385379.png) ``` #忽略错误后出现的c++error c++: error: Cmakefiles/opencv_python3.dir/__/src2/cv2.cpp.o No such file or dictionary ``` 在网上看到的编译错误的例子都和这个有所区别,没有能够很好地解决问题。有的说这是gcc编译器的问题 希望各位大佬们能够帮忙分析一下错误的原因,因为我的项目急需配置好opencv,也没有其它更好的替代,谢谢~
opencv配置在qt5.6上的问题
通过cmake 3.7.2 Configure OpenCV3.2的source文件遇到以下问题: Make Error at D:/pack/opencv/cmake-3.7.2-64位/cmake-3.7.2-win64-x64/share/cmake-3.7/Modules/CMakeTestCXXCompiler.cmake:44 (message): The C++ compiler "D:/qtcreator/Tools/mingw492_32/bin/g++.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: D:/pack/opencv/release/CMakeFiles/CMakeTmp Run Build Command:"D:/qtcreator/Tools/mingw492_32/bin/mingw32-make.exe" "cmTC_97ee7/fast" D:/qtcreator/Tools/mingw492_32/bin/mingw32-make.exe -f CMakeFiles\cmTC_97ee7.dir\build.make CMakeFiles/cmTC_97ee7.dir/build mingw32-make.exe[1]: Entering directory 'D:/pack/opencv/release/CMakeFiles/CMakeTmp' CMakeFiles\cmTC_97ee7.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_97ee7.dir/testCXXCompiler.cxx.obj' failed process_begin: CreateProcess(NULL, D:\pack\opencv\cmake-3.7.2-64位\cmake-3.7.2-win64-x64\bin\cmake.exe -E cmake_echo_color --switch= --progress-dir=D:\pack\opencv\release\CMakeFiles\CMakeTmp\CMakeFiles --progress-num=1 "Building CXX object CMakeFiles/cmTC_97ee7.dir/testCXXCompiler.cxx.obj", ...) failed. make (e=2): 系统找不到指定的文件。 mingw32-make.exe[1]: *** [CMakeFiles/cmTC_97ee7.dir/testCXXCompiler.cxx.obj] Error 2 mingw32-make.exe[1]: Leaving directory 'D:/pack/opencv/release/CMakeFiles/CMakeTmp' makefile:125: recipe for target 'cmTC_97ee7/fast' failed mingw32-make.exe: *** [cmTC_97ee7/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:98 (project)
谁能帮忙看一下OpenCV 3.4.1源码的类型转换编译错误?
环境: 1. Ubuntu 12.04 LTS 2. cmake 3.5.1 3. OpenCV 3.4.1源码 4. Arm Cortex-A7 NXP i.MX6Q 5. 已经sudo为root 执行过程 cd opencv-3.4.1 mkdir build cd build cmakd -D CMAKE_BUILD_TYPE=Relase -D CMAKE_INSTALL_PREFIX=/usr/local .. make make install 出错提示: [ 0%] Built target gen-pkgconfig [ 9%] Built target libwebp [ 14%] Built target IlmImf [ 20%] Built target libprotobuf [ 23%] Built target carotene_objs [ 24%] Built target tegra_hal [ 24%] Built target opencv_ts_pch_dephelp [ 24%] Built target pch_Generate_opencv_ts [ 25%] Built target opencv_core_pch_dephelp [ 25%] Built target pch_Generate_opencv_core [ 31%] Built target opencv_core [ 31%] Built target opencv_imgproc_pch_dephelp [ 31%] Built target pch_Generate_opencv_imgproc [ 31%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/smooth.cpp.o /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth1N(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2676:31: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2676:31: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth1N1(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2693:24: error: conversion from ‘const {anonymous}::ufixedpoint16’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2693:24: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:289:22: note: {anonymous}::ufixedpoint16::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:288:22: note: {anonymous}::ufixedpoint16::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:287:22: note: {anonymous}::ufixedpoint16::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth3N(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2740:71: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2740:71: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth5N(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2816:109: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2816:109: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2919:18: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2914:23: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] make[2]: *** [modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/smooth.cpp.o] Error 1 make[1]: *** [modules/imgproc/CMakeFiles/opencv_imgproc.dir/all] Error 2 make: *** [all] Error 2 说明: 关键之处是 /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2919:18: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous 类型转换错误。 请教各位大侠,这个错误出在哪里,如何解决呢? 谢谢!
跪求cmake交叉编译出错原因!!!
Linking CXX shared library ../../lib/libopencv_core.so /opt/EmbedSky/4.4.6/lib/gcc/arm-embedsky-linux-gnueabi/4.4.6/../../../../arm-embedsky-linux-gnueabi/bin/ld: ../../3rdparty/lib/libzlib.a(inflate.c.obj): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC ../../3rdparty/lib/libzlib.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [lib/libopencv_core.so] 错误 1 make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] 错误 2 make: *** [all] 错误 2 请问这是什么错误啊? opencv路径及版本:/usr/local/ Opencv2.4.1 cmake路径及版本:/usr/local/ cmake-2.8.12.2-Linux-i386 用户:root
linux安装opencv,执行cmake .报错
CMakeError.log内容: cc1plus: 警告:命令行选项“-Wmissing-prototypes”对 C/ObjC 是有效的,但对 C++ 无效 cc1plus: 警告:命令行选项“-Wstrict-prototypes”对 C/ObjC 是有效的,但对 C++ 无效 cc1plus: 警告:命令行选项“-Wno-missing-declarations”对 C/ObjC 是有效的,但对 C++ 无效 cc1plus: 错误:无法识别的命令行选项“-Wno-misleading-indentation” make[1]: *** [CMakeFiles/cmTC_16c2d.dir/src.cxx.o] 错误 1 make[1]: Leaving directory `/home/d5000/fujian/opencv-3.2.0/CMakeFiles/CMakeTmp' make: *** [cmTC_16c2d/fast] 错误 2
OpenCV4Android求大神解决
Build command failed. Error while executing process D:\AS\sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build E:\lichao\study\android\code\OpenCV4AndroidFace\app\.externalNativeBuild\cmake\debug\arm64-v8a --target opencv341} [1/2] Building CXX object CMakeFiles/opencv341.dir/src/main/cpp/DetectionBasedTracker_jni.cpp.o FAILED: D:\AS\sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android --gcc-toolchain=D:/AS/sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64 --sysroot=D:/AS/sdk/ndk-bundle/sysroot -Dopencv341_EXPORTS -I../../../../src/main/cpp/include -isystem D:/AS/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem D:/AS/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include -isystem D:/AS/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystem D:/AS/sdk/ndk-bundle/sysroot/usr/include/aarch64-linux-android -D__ANDROID_API__=21 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -frtti -fexceptions -std=gnu++11 -fexceptions -frtti -O2 -DNDEBUG -fPIC -MD -MT CMakeFiles/opencv341.dir/src/main/cpp/DetectionBasedTracker_jni.cpp.o -MF CMakeFiles\opencv341.dir\src\main\cpp\DetectionBasedTracker_jni.cpp.o.d -o CMakeFiles/opencv341.dir/src/main/cpp/DetectionBasedTracker_jni.cpp.o -c E:\lichao\study\android\code\OpenCV4AndroidFace\app\src\main\cpp\DetectionBasedTracker_jni.cpp E:\lichao\study\android\code\OpenCV4AndroidFace\app\src\main\cpp\DetectionBasedTracker_jni.cpp:1:10: error: 'DetectionBasedTracker_jni.h' file not found with <angled> include; use "quotes" instead #include <DetectionBasedTracker_jni.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "DetectionBasedTracker_jni.h" 1 error generated. ninja: build stopped: subcommand failed.
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
Python 植物大战僵尸代码实现(2):植物卡片选择和种植
这篇文章要介绍的是: - 上方植物卡片栏的实现。 - 点击植物卡片,鼠标切换为植物图片。 - 鼠标移动时,判断当前在哪个方格中,并显示半透明的植物作为提示。
死磕YOLO系列,YOLOv1 的大脑、躯干和手脚
YOLO 是我非常喜欢的目标检测算法,堪称工业级的目标检测,能够达到实时的要求,它帮我解决了许多实际问题。 这就是 YOLO 的目标检测效果。它定位了图像中物体的位置,当然,也能预测物体的类别。 之前我有写博文介绍过它,但是每次重新读它的论文,我都有新的收获,为此我准备写一个系列的文章来详尽分析它。这是第一篇,从它的起始 YOLOv1 讲起。 YOLOv1 的论文地址:https://www.c
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
记一次腾讯面试:进程之间究竟有哪些通信方式?如何通信? ---- 告别死记硬背
有一次面试的时候,被问到进程之间有哪些通信方式,不过由于之前没深入思考且整理过,说的并不好。想必大家也都知道进程有哪些通信方式,可是我猜很多人都是靠着”背“来记忆的,所以今天的这篇文章,讲给大家详细着讲解他们是如何通信的,让大家尽量能够理解他们之间的区别、优缺点等,这样的话,以后面试官让你举例子,你也能够顺手拈来。 1、管道 我们来看一条 Linux 的语句 netstat -tulnp | gr...
20行Python代码爬取王者荣耀全英雄皮肤
引言 王者荣耀大家都玩过吧,没玩过的也应该听说过,作为时下最火的手机MOBA游戏,咳咳,好像跑题了。我们今天的重点是爬取王者荣耀所有英雄的所有皮肤,而且仅仅使用20行Python代码即可完成。 准备工作 爬取皮肤本身并不难,难点在于分析,我们首先得得到皮肤图片的url地址,话不多说,我们马上来到王者荣耀的官网: 我们点击英雄资料,然后随意地选择一位英雄,接着F12打开调试台,找到英雄原皮肤的图片
网络(8)-HTTP、Socket、TCP、UDP的区别和联系
TCP/IP协议是传输层协议,主要解决数据如何在网络中传输,而HTTP是应用层协议,主要解决如何包装数据。 一、TCP与UDP的不同 1. 是否需要建立连接。 UDP在传送数据之前不需要先建立连接;TCP则提供面向连接的服务; 2. 是否需要给出确认 对方的传输层在收到UDP报文后,不需要给出任何确认,而 TCP需要给出确认报文,要提供可靠的、面向连接的传输服务。 3.虽然UDP不提供可靠交...
简明易理解的@SpringBootApplication注解源码解析(包含面试提问)
欢迎关注文章系列 ,关注我 《提升能力,涨薪可待》 《面试知识,工作可待》 《实战演练,拒绝996》 欢迎关注我博客,原创技术文章第一时间推出 也欢迎关注公 众 号【Ccww笔记】,同时推出 如果此文对你有帮助、喜欢的话,那就点个赞呗,点个关注呗! 《提升能力,涨薪可待篇》- @SpringBootApplication注解源码解析 一、@SpringBootApplication 的作用是什
防劝退!数据结构和算法难理解?可视化动画带你轻松透彻理解!
大家好,我是 Rocky0429,一个连数据结构和算法都不会的蒟蒻… 学过数据结构和算法的都知道这玩意儿不好学,没学过的经常听到这样的说法还没学就觉得难,其实难吗?真难! 难在哪呢?当年我还是个小蒟蒻,初学数据结构和算法的时候,在忍着枯燥看完定义原理,之后想实现的时候,觉得它们的过程真的是七拐八绕,及其难受。 在简单的链表、栈和队列这些我还能靠着在草稿上写写画画理解过程,但是到了数论、图...
西游记团队中如果需要裁掉一个人,会先裁掉谁?
2019年互联网寒冬,大批企业开始裁员,下图是网上流传的一张截图: 裁员不可避免,那如何才能做到不管大环境如何变化,自身不受影响呢? 我们先来看一个有意思的故事,如果西游记取经团队需要裁员一名,会裁掉谁呢,为什么? 西游记团队组成: 1.唐僧 作为团队teamleader,有很坚韧的品性和极高的原则性,不达目的不罢休,遇到任何问题,都没有退缩过,又很得上司支持和赏识(直接得到唐太宗的任命,既给
开挂的人生!那些当选院士,又是ACM/IEEE 双料Fellow的华人学者们
昨日,2019年两院院士正式官宣,一时间抢占了各大媒体头条。 朋友圈也是一片沸腾,奔走相告,赶脚比自己中了大奖还嗨皮! 谁叫咱家导师就是这么厉害呢!!! 而就在最近,新一年度的IEEE/ACM Fellow也将正式公布。 作为学术届的顶级荣誉,不自然地就会将院士与Fellow作比较,到底哪个含金量更高呢? 学术君认为,同样是专业机构对学者的认可,考量标准不一,自然不能一概而论。 但...
聊聊C语言和指针的本质
坐着绿皮车上海到杭州,24块钱,很宽敞,在火车上非正式地聊几句。 很多编程语言都以 “没有指针” 作为自己的优势来宣传,然而,对于C语言,指针却是与生俱来的。 那么,什么是指针,为什么大家都想避开指针。 很简单, 指针就是地址,当一个地址作为一个变量存在时,它就被叫做指针,该变量的类型,自然就是指针类型。 指针的作用就是,给出一个指针,取出该指针指向地址处的值。为了理解本质,我们从计算机模型说起...
Python语言高频重点汇总
Python语言高频重点汇总 GitHub面试宝典仓库——点这里跳转 文章目录Python语言高频重点汇总**GitHub面试宝典仓库——点这里跳转**1. 函数-传参2. 元类3. @staticmethod和@classmethod两个装饰器4. 类属性和实例属性5. Python的自省6. 列表、集合、字典推导式7. Python中单下划线和双下划线8. 格式化字符串中的%和format9.
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
代码详解:如何用Python快速制作美观、炫酷且有深度的图表
全文共12231字,预计学习时长35分钟生活阶梯(幸福指数)与人均GDP(金钱)正相关的正则图本文将探讨三种用Python可视化数据的不同方法。以可视化《2019年世界幸福报告》的数据为例,本文用Gapminder和Wikipedia的信息丰富了《世界幸福报告》数据,以探索新的数据关系和可视化方法。《世界幸福报告》试图回答世界范围内影响幸福的因素。报告根据对“坎特里尔阶梯问题”的回答来确定幸...
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
(经验分享)作为一名普通本科计算机专业学生,我大学四年到底走了多少弯路
今年正式步入了大四,离毕业也只剩半年多的时间,回想一下大学四年,感觉自己走了不少弯路,今天就来分享一下自己大学的学习经历,也希望其他人能不要走我走错的路。 (一)初进校园 刚进入大学的时候自己完全就相信了高中老师的话:“进入大学你们就轻松了”。因此在大一的时候自己学习的激情早就被抛地一干二净,每天不是在寝室里玩游戏就是出门游玩,不过好在自己大学时买的第一台笔记本性能并不是很好,也没让我彻底沉...
如何写一篇技术博客,谈谈我的看法
前言 只有光头才能变强。 文本已收录至我的GitHub精选文章,欢迎Star:https://github.com/ZhongFuCheng3y/3y 我一直推崇学技术可以写技术博客去沉淀自己的知识,因为知识点实在是太多太多了,通过自己的博客可以帮助自己快速回顾自己学过的东西。 我最开始的时候也是只记笔记,认为自己能看得懂就好。但如果想验证自己是不是懂了,可以写成技术博客。在写技术博客的...
字节跳动面试官这样问消息队列:分布式事务、重复消费、顺序消费,我整理了一下
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式和人才交流群,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸...
面试还搞不懂redis,快看看这40道面试题(含答案和思维导图)
Redis 面试题 1、什么是 Redis?. 2、Redis 的数据类型? 3、使用 Redis 有哪些好处? 4、Redis 相比 Memcached 有哪些优势? 5、Memcache 与 Redis 的区别都有哪些? 6、Redis 是单进程单线程的? 7、一个字符串类型的值能存储最大容量是多少? 8、Redis 的持久化机制是什么?各自的优缺点? 9、Redis 常见性...
大学四年自学走来,这些珍藏的「实用工具/学习网站」我全贡献出来了
知乎高赞:文中列举了互联网一线大厂程序员都在用的工具集合,涉及面非常广,小白和老手都可以进来看看,或许有新收获。
互联网公司的裁员,能玩出多少种花样?
裁员,也是一门学问,可谓博大精深!以下,是互联网公司的裁员的多种方法:-正文开始-135岁+不予续签的理由:千禧一代网感更强。95后不予通过试用期的理由:已婚已育员工更有责任心。2通知接下来要过苦日子,让一部分不肯同甘共苦的员工自己走人,以“兄弟”和“非兄弟”来区别员工。3强制996。员工如果平衡不了工作和家庭,可在离婚或离职里二选一。4不布置任何工作,但下班前必须提交千字工作日报。5不给活干+...
【设计模式】单例模式的八种写法分析
网上泛滥流传单例模式的写法种类,有说7种的,也有说6种的,当然也不排除说5种的,他们说的有错吗?其实没有对与错,刨根问底,写法终究是写法,其本质精髓大体一致!因此完全没必要去追究写法的多少,有这个时间还不如跟着宜春去网吧偷耳机、去田里抓青蛙得了,一天天的....
《面试宝典》:检验是否为合格的初中级程序员的面试知识点,你都知道了吗?查漏补缺
欢迎关注文章系列,一起学习 《提升能力,涨薪可待篇》 《面试知识,工作可待篇》 《实战演练,拒绝996篇》 也欢迎关注公 众 号【Ccww笔记】,原创技术文章第一时间推出 如果此文对你有帮助、喜欢的话,那就点个赞呗,点个关注呗! 《面试知识,工作可待篇》-Java笔试面试基础知识大全 前言 是不是感觉找工作面试是那么难呢? 在找工作面试应在学习的基础进行总结面试知识点,工作也指日可待,欢...
关于研发效能提升的思考
研发效能提升是最近比较热门的一个话题,本人根据这几年的工作心得,做了一些思考总结,由于个人深度有限,暂且抛转引入。 三要素 任何生产力的提升都离不开这三个因素:人、流程和工具,少了其中任何一个因素都无法实现。 人,即思想,也就是古人说的“道”,道不同不相为谋,是制高点,也是高层建筑的基石。 流程,即方法,也是古人说的“法”。研发效能的提升,也就是要提高投入产出比,既要增加产出,也要减...
微博推荐算法简述
在介绍微博推荐算法之前,我们先聊一聊推荐系统和推荐算法。有这样一些问题:推荐系统适用哪些场景?用来解决什么问题、具有怎样的价值?效果如何衡量? 推荐系统诞生很早,但真正被大家所重视,缘起于以”facebook”为代表的社会化网络的兴起和以“淘宝“为代表的电商的繁荣,”选择“的时代已经来临,信息和物品的极大丰富,让用户如浩瀚宇宙中的小点,无所适从。推荐系统迎来爆发的机会,变得离用户更近: 快...
相关热词 c#判断数字不得为负数 c#帧和帧协议 c#算偏移值 c# 在枚举中 c#6 字符串 插值 c#程序中的占位符标签 c#监听数组变化 c# vlc c#索引实现 c# 局域网广播通信
立即提问