「PythonはC++よりどれくらい遅いのか」ということを気にするOpenCVユーザーは、使っているDLLやcv2.pydのビルドの中身を気にしよう。マルチコアのCPUを使っているのに、使っているdllの中身がそれを活かせないdllになっていることはありませんか?
#include <opencv2/core/core.hpp>
#include <iostream>
int main(int argc, const char* argv[])
{
// ビルド情報を表示する
std::cout << cv::getBuildInformation() << std::endl;
return 0;
}
cmake_minimum_required(VERSION 2.8)
add_executable(buildInfo buildInfo.cpp)
find_package(OpenCV REQUIRED)
if(OpenCV_FOUND)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(buildInfo ${OpenCV_LIBS})
endif(OpenCV_FOUND)
参考
[CMakeLists.txt から始めよう] http://qiita.com/nonbiri15/items/c77c046f0e10f8140cfe
Pythonの使用しているcv2.pydの条件は
次のようにしてわかります。
>>> import cv2
>>> print cv2.getBuildInformation()
General configuration for OpenCV 2.4.11 =====================================
Platform:
Host: Windows 6.2 AMD64
CMake: 3.1.1
CMake generator: Visual Studio 9 2008
CMake build tool: C:/Program Files (x86)/Microsoft Visual Studio 9.0/Common7/IDE/devenv.com
MSVC: 1500
C/C++:
Built as dynamic libs?: YES
C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/cl.exe (ver 15.0.30729.1)
C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /EHa /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast /wd4251 /MD /O2 /Ob2 /D NDEBUG /Zi
C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /EHa /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast /wd4251 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
C Compiler: C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/cl.exe
C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast /MD /O2 /Ob2 /D NDEBUG /Zi
C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
Linker flags (Release): /machine:X86 /INCREMENTAL:NO /debug
Linker flags (Debug): /machine:X86 /debug /INCREMENTAL:YES
Precompiled headers: YES
OpenCV modules:
To be built: core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib python stitching superres ts videostab
Disabled: world
Disabled by dependency: -
Unavailable: androidcamera dynamicuda java viz
Windows RT support: NO
GUI:
QT: NO
Win32 UI: YES
OpenGL support: YES (glu32 opengl32)
VTK support: NO
Media I/O:
ZLib: build (ver 1.2.7)
JPEG: build (ver 62)
PNG: build (ver 1.5.12)
TIFF: build (ver 42 - 4.0.2)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
Video I/O:
Video for Windows: YES
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: YES (prebuilt binaries)
codec: YES (ver 55.18.102)
format: YES (ver 55.12.100)
util: YES (ver 52.38.100)
swscale: YES (ver 2.3.100)
gentoo-style: YES
OpenNI: NO
OpenNI PrimeSensor Modules: NO
PvAPI: NO
GigEVisionSDK: NO
DirectShow: YES
Media Foundation: NO
XIMEA: NO
Intel PerC: NO
Other third-party libraries:
Use IPP: 8.1.1 [8.1.1]
at: C:/Program Files (x86)/intel/Composer XE/ipp
Use Eigen: NO
Use TBB: YES (ver 4.2 interface 7005)
Use OpenMP: NO
Use GCD NO
Use Concurrency NO
Use C=: NO
Use Cuda: NO
Use OpenCL: YES
OpenCL:
Version: dynamic
Include path: D:/Build/OpenCV/opencv-2.4.11/3rdparty/include/opencl/1.2
Use AMD FFT: NO
Use AMD BLAS: NO
Python:
Interpreter: X:/Python27/python.exe (ver 2.7.9)
Libraries: X:/Python27/libs/python27.lib (ver 2.7.9+)
numpy: X:/Python27/lib/site-packages/numpy/core/include (ver 1.8.2)
packages path: X:/Python27/Lib/site-packages
Java:
ant: NO
JNI: X:/Java18/include X:/Java18/include/win32 X:/Java18/include
Java tests: NO
Documentation:
Build Documentation: NO
Sphinx: NO
PdfLaTeX compiler: NO
Doxygen: NO
Tests and samples:
Tests: YES
Performance tests: YES
C/C++ Examples: NO
Install path: D:/Build/OpenCV/OpenCV-2.4.11-vc9-x32/install