这个开启了还是没作用啊,cpu还是只有一颗核心工作
我是这么设置的。在使用opencv-haar程序训练分类器时是可以的,未开启时CPU占用率只有50%,打开后CPU占用率达到100%
打不开啊,而且我的环境是VS2010+opencv2.43
Step 4: Edit and replace the lines 49 to 58 in file ~/opencv-2.4.6.1/cmake/OpenCVFindLibsPerf.cmake( for other versions of OpenCV, search for the OpenMP part).
# — OpenMP —
if(NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
include (FindOpenMP) # — since cmake version 2.6.3
if (OPENMP_FOUND)
set (HAVE_OPENMP TRUE)
set (CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}”)
set (CMAKE_C_FLAGS “${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}”)
else()
set ( HAVE_OPENMP FALSE)
endif()
else()
set(HAVE_OPENMP 0)
endif()
Step 5: Run CMake GUI, press Configure and check whether OpenMP is enabled or not. If OpenMP is enabled, press Generate to save the configured source to ~/opencv-2.4.6.1/build/ directory, else recheck which step you have missed.
Step 6: Now, we are going to build the configured source.
In order to test that you can collect your own negative and positive data set, create samples and follow the tutorial here. For me, it works like wow :)