mirror of
https://github.com/opencv/opencv.git
synced 2026-11-10 02:35:59 -06:00
Compare commits
377 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05b9c991dd | ||
|
|
46be47cb4b | ||
|
|
4eb9b9d6cf | ||
|
|
53494ba397 | ||
|
|
15678efe84 | ||
|
|
8399568edf | ||
|
|
0566ab4d3d | ||
|
|
df63060e4d | ||
|
|
4175916b2a | ||
|
|
d649f47eeb | ||
|
|
d014cb8fb4 | ||
|
|
c45492371a | ||
|
|
719149877e | ||
|
|
ee36717db4 | ||
|
|
c48777a1c3 | ||
|
|
0ccc903647 | ||
|
|
41fd711ab0 | ||
|
|
4b885e2067 | ||
|
|
4f6f6e8cac | ||
|
|
6ef0253fb7 | ||
|
|
f7b5e6544f | ||
|
|
648facccd6 | ||
|
|
709e8e8e07 | ||
|
|
734bf8babd | ||
|
|
4880858119 | ||
|
|
cea9a97434 | ||
|
|
b3eee49451 | ||
|
|
60906d9175 | ||
|
|
d6a88397b4 | ||
|
|
8fe79738ce | ||
|
|
86aabf704f | ||
|
|
f9aa148ba9 | ||
|
|
358e59e91b | ||
|
|
b94963d381 | ||
|
|
e79c875fe2 | ||
|
|
24be7b26cd | ||
|
|
0206f419c1 | ||
|
|
1e038e2837 | ||
|
|
4aa9f83100 | ||
|
|
1acc1085d2 | ||
|
|
83fe2f3b16 | ||
|
|
1e27b07e29 | ||
|
|
4293a54447 | ||
|
|
edce617a58 | ||
|
|
51d3138dff | ||
|
|
83cdd43a4c | ||
|
|
58e7d9f32f | ||
|
|
f22d9a232d | ||
|
|
4ec1930949 | ||
|
|
bc72f4d2a2 | ||
|
|
08d8faf9da | ||
|
|
f9268d34dc | ||
|
|
6e22be4100 | ||
|
|
ce07840e9f | ||
|
|
6b7d890f34 | ||
|
|
9941c6710d | ||
|
|
e8dd31aacd | ||
|
|
d6a7e8f84f | ||
|
|
b633c73c46 | ||
|
|
529bd41751 | ||
|
|
27c1bd2762 | ||
|
|
069f3d8d9a | ||
|
|
2509fa8080 | ||
|
|
5a5c82bb1d | ||
|
|
26f5d2d639 | ||
|
|
b674cd8571 | ||
|
|
8c91a1af71 | ||
|
|
037ffcdf99 | ||
|
|
22a3cf0fba | ||
|
|
0cea828a10 | ||
|
|
bc741ab25f | ||
|
|
64c94cb22c | ||
|
|
d449ba104a | ||
|
|
6da7c50fb5 | ||
|
|
442082eb0f | ||
|
|
92fc763925 | ||
|
|
459e7d4a80 | ||
|
|
400fea8626 | ||
|
|
a9687a341e | ||
|
|
ae9d24d433 | ||
|
|
8c60498673 | ||
|
|
1ae71fe205 | ||
|
|
be530bd085 | ||
|
|
80d0593dbd | ||
|
|
66145ea06c | ||
|
|
dd71bef6f5 | ||
|
|
e719bee2b8 | ||
|
|
63ae0eeba5 | ||
|
|
34c630faf4 | ||
|
|
3a6d248bee | ||
|
|
ea0c9b7f5c | ||
|
|
cc08e00876 | ||
|
|
fffac2f085 | ||
|
|
dfe7c98090 | ||
|
|
f3ee1c3d2f | ||
|
|
917b883cf0 | ||
|
|
a63576e76d | ||
|
|
de431609db | ||
|
|
5d5527d03e | ||
|
|
4088013251 | ||
|
|
88a883e68e | ||
|
|
8660e048bc | ||
|
|
d4087f19a2 | ||
|
|
12c25b9310 | ||
|
|
e88253ccad | ||
|
|
f44de302a0 | ||
|
|
b7c97f6e30 | ||
|
|
e8d2a9752b | ||
|
|
10849d1c7a | ||
|
|
17ca7f9545 | ||
|
|
658282fcbe | ||
|
|
ee270d1a18 | ||
|
|
740b1f235e | ||
|
|
a118577a57 | ||
|
|
ce503c64bf | ||
|
|
00a180185e | ||
|
|
1c639befe6 | ||
|
|
b1899e5489 | ||
|
|
6f292d8036 | ||
|
|
f07e9e7c5f | ||
|
|
2784fd7b27 | ||
|
|
c289c8a700 | ||
|
|
13c058ecf8 | ||
|
|
df0c43321d | ||
|
|
8f10ca5180 | ||
|
|
9f04222a75 | ||
|
|
060e58d080 | ||
|
|
b5936648ca | ||
|
|
f2cf9dd8bf | ||
|
|
7069b4b761 | ||
|
|
0e3553130a | ||
|
|
c34fc180a7 | ||
|
|
77d04a2622 | ||
|
|
1d01c49a06 | ||
|
|
def17f2baa | ||
|
|
72cfff4c59 | ||
|
|
45dd18955f | ||
|
|
b0b199ee8a | ||
|
|
894724eaf0 | ||
|
|
7a78559708 | ||
|
|
3bc952ed34 | ||
|
|
9dea590ada | ||
|
|
3dcddad88a | ||
|
|
39754bd6f9 | ||
|
|
0a1ff0d42d | ||
|
|
e38ba1999b | ||
|
|
6ce03b0484 | ||
|
|
2153453fd1 | ||
|
|
eb7ff99f80 | ||
|
|
098d4e6174 | ||
|
|
632b21e090 | ||
|
|
2cf16db683 | ||
|
|
00300baa53 | ||
|
|
d8a4d3a2eb | ||
|
|
3e1586a1c6 | ||
|
|
fa2cd93ecf | ||
|
|
7b551af424 | ||
|
|
11c7053b0f | ||
|
|
8752414718 | ||
|
|
3509018bd6 | ||
|
|
1966e7cea9 | ||
|
|
2b31055914 | ||
|
|
b5dbe9e04b | ||
|
|
c962a9d61c | ||
|
|
adb2040980 | ||
|
|
14ee306b9e | ||
|
|
df136339ff | ||
|
|
bd9d3dd561 | ||
|
|
9ce9fc3361 | ||
|
|
3ff1620086 | ||
|
|
8db6d9f9b2 | ||
|
|
368bac7af6 | ||
|
|
19ceab13f2 | ||
|
|
790f53f12a | ||
|
|
f7f194e5dd | ||
|
|
eab7603096 | ||
|
|
838961a289 | ||
|
|
fb568755a1 | ||
|
|
0bbd768d9d | ||
|
|
f20af817d4 | ||
|
|
34a390fbc2 | ||
|
|
059bf1d9e5 | ||
|
|
773616ee04 | ||
|
|
429ab8ebee | ||
|
|
d39e73365c | ||
|
|
f8801cfdb8 | ||
|
|
fc1d38ced8 | ||
|
|
a13db7c8fa | ||
|
|
6b09345232 | ||
|
|
41154b30de | ||
|
|
5ac8444c22 | ||
|
|
70c1b700d9 | ||
|
|
19b88a17bf | ||
|
|
81acc5e73e | ||
|
|
26cb0ce1d5 | ||
|
|
20641b4a0b | ||
|
|
51663f5612 | ||
|
|
95ebdf4069 | ||
|
|
2cfd635e9e | ||
|
|
7537521f53 | ||
|
|
7c43daccba | ||
|
|
38904c9a11 | ||
|
|
094d7c4926 | ||
|
|
37a754621a | ||
|
|
bef34093aa | ||
|
|
d5ead208b7 | ||
|
|
935f973575 | ||
|
|
7539156109 | ||
|
|
a4239f972b | ||
|
|
10aec14a4d | ||
|
|
1253c2101b | ||
|
|
8fe4ab280b | ||
|
|
dda3b534ad | ||
|
|
1c025be068 | ||
|
|
514f1fae95 | ||
|
|
8a2de2ecca | ||
|
|
d45ce086c1 | ||
|
|
3b4f65b186 | ||
|
|
6f892b10ff | ||
|
|
16a11cfb27 | ||
|
|
1b0297d92b | ||
|
|
75fba08042 | ||
|
|
4c5593b633 | ||
|
|
06f6f74e61 | ||
|
|
59aa516ca5 | ||
|
|
0537747f79 | ||
|
|
ddc9be9170 | ||
|
|
fbc91c5ee9 | ||
|
|
901dc3b878 | ||
|
|
e59912f803 | ||
|
|
a19cc6cb64 | ||
|
|
514e97223c | ||
|
|
d650efc069 | ||
|
|
96a4a7b339 | ||
|
|
bd314bf955 | ||
|
|
2427c03625 | ||
|
|
7a8bd31657 | ||
|
|
fd759223fa | ||
|
|
923698d700 | ||
|
|
8a4f35704a | ||
|
|
2509b7954e | ||
|
|
d764af5318 | ||
|
|
6b23cb5b02 | ||
|
|
b8f5fcf3f9 | ||
|
|
623a02c69f | ||
|
|
c1541c9e79 | ||
|
|
70a4de20d7 | ||
|
|
9631cb6de9 | ||
|
|
f6283432ff | ||
|
|
8ac3ddf421 | ||
|
|
60b59eeb73 | ||
|
|
cf00349b5b | ||
|
|
b8283edfca | ||
|
|
b197ec9413 | ||
|
|
78e16a906b | ||
|
|
4037a4f227 | ||
|
|
e69d2c1bb1 | ||
|
|
5c77784ac9 | ||
|
|
0a90a36a1f | ||
|
|
c47190ef90 | ||
|
|
198cd1a40d | ||
|
|
4746a710bb | ||
|
|
3e55d705cc | ||
|
|
56f791679b | ||
|
|
68d1110cde | ||
|
|
e08b075db0 | ||
|
|
66221a32b9 | ||
|
|
c0456df611 | ||
|
|
85f92fabbd | ||
|
|
239704f986 | ||
|
|
7973594a01 | ||
|
|
f70d63e4c9 | ||
|
|
26d3a1a036 | ||
|
|
04d293d2c4 | ||
|
|
cdf4e4e0b5 | ||
|
|
e3f450cffb | ||
|
|
8b99a1e850 | ||
|
|
7703b63cae | ||
|
|
4fd1960425 | ||
|
|
3f927abb4d | ||
|
|
83cefcb92a | ||
|
|
327d9f274b | ||
|
|
0e1717c14c | ||
|
|
f5ded41016 | ||
|
|
2b106db02f | ||
|
|
13bb236ad5 | ||
|
|
8f6f9c3e58 | ||
|
|
0a698bf145 | ||
|
|
cc237b7aba | ||
|
|
f95ff0a352 | ||
|
|
4e2ec7b97d | ||
|
|
2e79dde357 | ||
|
|
cebf109d39 | ||
|
|
428fb72625 | ||
|
|
3b7acf2657 | ||
|
|
01f8645bc8 | ||
|
|
be88b20154 | ||
|
|
84da6ca265 | ||
|
|
19b3064706 | ||
|
|
8e944cfe70 | ||
|
|
fe76b2116a | ||
|
|
b8de81749c | ||
|
|
1b7c5b201d | ||
|
|
98915e06bc | ||
|
|
3bdd9626f3 | ||
|
|
15f4292a1f | ||
|
|
ee7c74ceeb | ||
|
|
af7c614438 | ||
|
|
411629a57d | ||
|
|
54ea5bbac7 | ||
|
|
28e0d3d771 | ||
|
|
9007a02302 | ||
|
|
fb326a58fc | ||
|
|
f1873bbca1 | ||
|
|
6770c04073 | ||
|
|
c38e4f9639 | ||
|
|
376993be4c | ||
|
|
df6bce372b | ||
|
|
185059959b | ||
|
|
1e2fb6de30 | ||
|
|
3314bc94b6 | ||
|
|
0bf7350615 | ||
|
|
f02ce90559 | ||
|
|
b8e3d3f791 | ||
|
|
96121a66c5 | ||
|
|
a81efdbb25 | ||
|
|
d6e0ef2710 | ||
|
|
dee584ee15 | ||
|
|
834705490e | ||
|
|
ef4eadd5d3 | ||
|
|
46e423d217 | ||
|
|
6773914144 | ||
|
|
8af626d295 | ||
|
|
eda6360fa3 | ||
|
|
93120775cd | ||
|
|
405227d531 | ||
|
|
daedc6f454 | ||
|
|
eff53e95f9 | ||
|
|
3727168b50 | ||
|
|
e4dee5b372 | ||
|
|
1f421fce01 | ||
|
|
05d9375759 | ||
|
|
73b34e3f85 | ||
|
|
50579d2524 | ||
|
|
5beb887247 | ||
|
|
3cc9502c90 | ||
|
|
8b0fc04d93 | ||
|
|
581a3e444d | ||
|
|
5e02b20482 | ||
|
|
33ae64201c | ||
|
|
a57030a0cd | ||
|
|
eba6754b06 | ||
|
|
8b57893e40 | ||
|
|
4248f82211 | ||
|
|
0ac61240c5 | ||
|
|
5852a913a8 | ||
|
|
800d53f76b | ||
|
|
0be2752366 | ||
|
|
0fb629915f | ||
|
|
9a0d06247a | ||
|
|
760b718981 | ||
|
|
99a00d3dd9 | ||
|
|
befcbf56fe | ||
|
|
f0de1a08b8 | ||
|
|
07db81a4bb | ||
|
|
2c38be079e | ||
|
|
e9edfd1c54 | ||
|
|
641bb7ac6b | ||
|
|
c88fa27b1d | ||
|
|
114579c33b | ||
|
|
fa15769f39 | ||
|
|
56d943388d | ||
|
|
5304e9f259 | ||
|
|
0b1df62215 | ||
|
|
3b0108e4c1 | ||
|
|
e1b2f593d6 | ||
|
|
d57a7008f1 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,6 +4,5 @@
|
||||
.*.swp
|
||||
.DS_Store
|
||||
.sw[a-z]
|
||||
/modules/refman.rst
|
||||
tags
|
||||
tegra/
|
||||
|
||||
2
3rdparty/ffmpeg/make.bat
vendored
2
3rdparty/ffmpeg/make.bat
vendored
@@ -1,2 +1,2 @@
|
||||
set path=c:\dev\msys32\bin;%path% & gcc -Wall -shared -o opencv_ffmpeg.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat -lavcodec -lavdevice -lswscale -lavutil -liconv -lws2_32
|
||||
set path=c:\dev\msys32\bin;%path% & gcc -Wall -shared -o opencv_ffmpeg.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat -lavcodec -lavdevice -lswscale -lavutil -lws2_32
|
||||
set path=c:\dev\msys64\bin;%path% & gcc -m64 -Wall -shared -o opencv_ffmpeg_64.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat64 -lavcodec64 -lavdevice64 -lswscale64 -lavutil64 -lws2_32
|
||||
BIN
3rdparty/ffmpeg/opencv_ffmpeg.dll
vendored
BIN
3rdparty/ffmpeg/opencv_ffmpeg.dll
vendored
Binary file not shown.
502
3rdparty/include/MultiMon.h
vendored
502
3rdparty/include/MultiMon.h
vendored
@@ -1,502 +0,0 @@
|
||||
//=============================================================================
|
||||
//
|
||||
// multimon.h -- Stub module that fakes multiple monitor apis on Win32 OSes
|
||||
// without them.
|
||||
//
|
||||
// By using this header your code will get back default values from
|
||||
// GetSystemMetrics() for new metrics, and the new multimonitor APIs
|
||||
// will act like only one display is present on a Win32 OS without
|
||||
// multimonitor APIs.
|
||||
//
|
||||
// Exactly one source must include this with COMPILE_MULTIMON_STUBS defined.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" { // Assume C declarations for C++
|
||||
#endif // __cplusplus
|
||||
|
||||
//
|
||||
// If we are building with Win95/NT4 headers, we need to declare
|
||||
// the multimonitor-related metrics and APIs ourselves.
|
||||
//
|
||||
#ifndef SM_CMONITORS
|
||||
|
||||
#define SM_XVIRTUALSCREEN 76
|
||||
#define SM_YVIRTUALSCREEN 77
|
||||
#define SM_CXVIRTUALSCREEN 78
|
||||
#define SM_CYVIRTUALSCREEN 79
|
||||
#define SM_CMONITORS 80
|
||||
#define SM_SAMEDISPLAYFORMAT 81
|
||||
|
||||
// HMONITOR is already declared if WINVER >= 0x0500 in windef.h
|
||||
// This is for components built with an older version number.
|
||||
//
|
||||
#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
|
||||
DECLARE_HANDLE(HMONITOR);
|
||||
#define HMONITOR_DECLARED
|
||||
#endif
|
||||
|
||||
#define MONITOR_DEFAULTTONULL 0x00000000
|
||||
#define MONITOR_DEFAULTTOPRIMARY 0x00000001
|
||||
#define MONITOR_DEFAULTTONEAREST 0x00000002
|
||||
|
||||
#define MONITORINFOF_PRIMARY 0x00000001
|
||||
|
||||
typedef struct tagMONITORINFO
|
||||
{
|
||||
DWORD cbSize;
|
||||
RECT rcMonitor;
|
||||
RECT rcWork;
|
||||
DWORD dwFlags;
|
||||
} MONITORINFO, *LPMONITORINFO;
|
||||
|
||||
#ifndef CCHDEVICENAME
|
||||
#define CCHDEVICENAME 32
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
typedef struct tagMONITORINFOEXA : public tagMONITORINFO
|
||||
{
|
||||
CHAR szDevice[CCHDEVICENAME];
|
||||
} MONITORINFOEXA, *LPMONITORINFOEXA;
|
||||
typedef struct tagMONITORINFOEXW : public tagMONITORINFO
|
||||
{
|
||||
WCHAR szDevice[CCHDEVICENAME];
|
||||
} MONITORINFOEXW, *LPMONITORINFOEXW;
|
||||
#ifdef UNICODE
|
||||
typedef MONITORINFOEXW MONITORINFOEX;
|
||||
typedef LPMONITORINFOEXW LPMONITORINFOEX;
|
||||
#else
|
||||
typedef MONITORINFOEXA MONITORINFOEX;
|
||||
typedef LPMONITORINFOEXA LPMONITORINFOEX;
|
||||
#endif // UNICODE
|
||||
#else // ndef __cplusplus
|
||||
typedef struct tagMONITORINFOEXA
|
||||
{
|
||||
MONITORINFO;
|
||||
CHAR szDevice[CCHDEVICENAME];
|
||||
} MONITORINFOEXA, *LPMONITORINFOEXA;
|
||||
typedef struct tagMONITORINFOEXW
|
||||
{
|
||||
MONITORINFO;
|
||||
WCHAR szDevice[CCHDEVICENAME];
|
||||
} MONITORINFOEXW, *LPMONITORINFOEXW;
|
||||
#ifdef UNICODE
|
||||
typedef MONITORINFOEXW MONITORINFOEX;
|
||||
typedef LPMONITORINFOEXW LPMONITORINFOEX;
|
||||
#else
|
||||
typedef MONITORINFOEXA MONITORINFOEX;
|
||||
typedef LPMONITORINFOEXA LPMONITORINFOEX;
|
||||
#endif // UNICODE
|
||||
#endif
|
||||
|
||||
typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM);
|
||||
|
||||
#ifndef DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
|
||||
typedef struct _DISPLAY_DEVICEA {
|
||||
DWORD cb;
|
||||
CHAR DeviceName[32];
|
||||
CHAR DeviceString[128];
|
||||
DWORD StateFlags;
|
||||
CHAR DeviceID[128];
|
||||
CHAR DeviceKey[128];
|
||||
} DISPLAY_DEVICEA, *PDISPLAY_DEVICEA, *LPDISPLAY_DEVICEA;
|
||||
typedef struct _DISPLAY_DEVICEW {
|
||||
DWORD cb;
|
||||
WCHAR DeviceName[32];
|
||||
WCHAR DeviceString[128];
|
||||
DWORD StateFlags;
|
||||
WCHAR DeviceID[128];
|
||||
WCHAR DeviceKey[128];
|
||||
} DISPLAY_DEVICEW, *PDISPLAY_DEVICEW, *LPDISPLAY_DEVICEW;
|
||||
#ifdef UNICODE
|
||||
typedef DISPLAY_DEVICEW DISPLAY_DEVICE;
|
||||
typedef PDISPLAY_DEVICEW PDISPLAY_DEVICE;
|
||||
typedef LPDISPLAY_DEVICEW LPDISPLAY_DEVICE;
|
||||
#else
|
||||
typedef DISPLAY_DEVICEA DISPLAY_DEVICE;
|
||||
typedef PDISPLAY_DEVICEA PDISPLAY_DEVICE;
|
||||
typedef LPDISPLAY_DEVICEA LPDISPLAY_DEVICE;
|
||||
#endif // UNICODE
|
||||
|
||||
#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP 0x00000001
|
||||
#define DISPLAY_DEVICE_MULTI_DRIVER 0x00000002
|
||||
#define DISPLAY_DEVICE_PRIMARY_DEVICE 0x00000004
|
||||
#define DISPLAY_DEVICE_MIRRORING_DRIVER 0x00000008
|
||||
#define DISPLAY_DEVICE_VGA_COMPATIBLE 0x00000010
|
||||
#endif
|
||||
|
||||
#endif // SM_CMONITORS
|
||||
|
||||
#undef GetMonitorInfo
|
||||
#undef GetSystemMetrics
|
||||
#undef MonitorFromWindow
|
||||
#undef MonitorFromRect
|
||||
#undef MonitorFromPoint
|
||||
#undef EnumDisplayMonitors
|
||||
#undef EnumDisplayDevices
|
||||
|
||||
//
|
||||
// Define COMPILE_MULTIMON_STUBS to compile the stubs;
|
||||
// otherwise, you get the declarations.
|
||||
//
|
||||
#ifdef COMPILE_MULTIMON_STUBS
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Implement the API stubs.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _MULTIMON_USE_SECURE_CRT
|
||||
#if defined(__GOT_SECURE_LIB__) && __GOT_SECURE_LIB__ >= 200402L
|
||||
#define _MULTIMON_USE_SECURE_CRT 1
|
||||
#else
|
||||
#define _MULTIMON_USE_SECURE_CRT 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MULTIMON_FNS_DEFINED
|
||||
|
||||
int (WINAPI* g_pfnGetSystemMetrics)(int) = NULL;
|
||||
HMONITOR (WINAPI* g_pfnMonitorFromWindow)(HWND, DWORD) = NULL;
|
||||
HMONITOR (WINAPI* g_pfnMonitorFromRect)(LPCRECT, DWORD) = NULL;
|
||||
HMONITOR (WINAPI* g_pfnMonitorFromPoint)(POINT, DWORD) = NULL;
|
||||
BOOL (WINAPI* g_pfnGetMonitorInfo)(HMONITOR, LPMONITORINFO) = NULL;
|
||||
BOOL (WINAPI* g_pfnEnumDisplayMonitors)(HDC, LPCRECT, MONITORENUMPROC, LPARAM) = NULL;
|
||||
BOOL (WINAPI* g_pfnEnumDisplayDevices)(PVOID, DWORD, PDISPLAY_DEVICE,DWORD) = NULL;
|
||||
BOOL g_fMultiMonInitDone = FALSE;
|
||||
BOOL g_fMultimonPlatformNT = FALSE;
|
||||
|
||||
#endif
|
||||
|
||||
BOOL IsPlatformNT()
|
||||
{
|
||||
OSVERSIONINFOA osvi = {0};
|
||||
osvi.dwOSVersionInfoSize = sizeof(osvi);
|
||||
GetVersionExA((OSVERSIONINFOA*)&osvi);
|
||||
return (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId);
|
||||
}
|
||||
|
||||
BOOL InitMultipleMonitorStubs(void)
|
||||
{
|
||||
HMODULE hUser32;
|
||||
if (g_fMultiMonInitDone)
|
||||
{
|
||||
return g_pfnGetMonitorInfo != NULL;
|
||||
}
|
||||
|
||||
g_fMultimonPlatformNT = IsPlatformNT();
|
||||
hUser32 = GetModuleHandle(TEXT("USER32"));
|
||||
if (hUser32 &&
|
||||
(*(FARPROC*)&g_pfnGetSystemMetrics = GetProcAddress(hUser32,"GetSystemMetrics")) != NULL &&
|
||||
(*(FARPROC*)&g_pfnMonitorFromWindow = GetProcAddress(hUser32,"MonitorFromWindow")) != NULL &&
|
||||
(*(FARPROC*)&g_pfnMonitorFromRect = GetProcAddress(hUser32,"MonitorFromRect")) != NULL &&
|
||||
(*(FARPROC*)&g_pfnMonitorFromPoint = GetProcAddress(hUser32,"MonitorFromPoint")) != NULL &&
|
||||
(*(FARPROC*)&g_pfnEnumDisplayMonitors = GetProcAddress(hUser32,"EnumDisplayMonitors")) != NULL &&
|
||||
#ifdef UNICODE
|
||||
(*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesW")) != NULL &&
|
||||
(*(FARPROC*)&g_pfnGetMonitorInfo = g_fMultimonPlatformNT ? GetProcAddress(hUser32,"GetMonitorInfoW") :
|
||||
GetProcAddress(hUser32,"GetMonitorInfoA")) != NULL
|
||||
#else
|
||||
(*(FARPROC*)&g_pfnGetMonitorInfo = GetProcAddress(hUser32,"GetMonitorInfoA")) != NULL &&
|
||||
(*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesA")) != NULL
|
||||
#endif
|
||||
) {
|
||||
g_fMultiMonInitDone = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_pfnGetSystemMetrics = NULL;
|
||||
g_pfnMonitorFromWindow = NULL;
|
||||
g_pfnMonitorFromRect = NULL;
|
||||
g_pfnMonitorFromPoint = NULL;
|
||||
g_pfnGetMonitorInfo = NULL;
|
||||
g_pfnEnumDisplayMonitors = NULL;
|
||||
g_pfnEnumDisplayDevices = NULL;
|
||||
|
||||
g_fMultiMonInitDone = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// fake implementations of Monitor APIs that work with the primary display
|
||||
// no special parameter validation is made since these run in client code
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
int WINAPI
|
||||
xGetSystemMetrics(int nIndex)
|
||||
{
|
||||
if (InitMultipleMonitorStubs())
|
||||
return g_pfnGetSystemMetrics(nIndex);
|
||||
|
||||
switch (nIndex)
|
||||
{
|
||||
case SM_CMONITORS:
|
||||
case SM_SAMEDISPLAYFORMAT:
|
||||
return 1;
|
||||
|
||||
case SM_XVIRTUALSCREEN:
|
||||
case SM_YVIRTUALSCREEN:
|
||||
return 0;
|
||||
|
||||
case SM_CXVIRTUALSCREEN:
|
||||
nIndex = SM_CXSCREEN;
|
||||
break;
|
||||
|
||||
case SM_CYVIRTUALSCREEN:
|
||||
nIndex = SM_CYSCREEN;
|
||||
break;
|
||||
}
|
||||
|
||||
return GetSystemMetrics(nIndex);
|
||||
}
|
||||
|
||||
#define xPRIMARY_MONITOR ((HMONITOR)0x12340042)
|
||||
|
||||
HMONITOR WINAPI
|
||||
xMonitorFromPoint(POINT ptScreenCoords, DWORD dwFlags)
|
||||
{
|
||||
if (InitMultipleMonitorStubs())
|
||||
return g_pfnMonitorFromPoint(ptScreenCoords, dwFlags);
|
||||
|
||||
if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) ||
|
||||
((ptScreenCoords.x >= 0) &&
|
||||
(ptScreenCoords.x < GetSystemMetrics(SM_CXSCREEN)) &&
|
||||
(ptScreenCoords.y >= 0) &&
|
||||
(ptScreenCoords.y < GetSystemMetrics(SM_CYSCREEN))))
|
||||
{
|
||||
return xPRIMARY_MONITOR;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
HMONITOR WINAPI
|
||||
xMonitorFromRect(LPCRECT lprcScreenCoords, DWORD dwFlags)
|
||||
{
|
||||
if (InitMultipleMonitorStubs())
|
||||
return g_pfnMonitorFromRect(lprcScreenCoords, dwFlags);
|
||||
|
||||
if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) ||
|
||||
((lprcScreenCoords->right > 0) &&
|
||||
(lprcScreenCoords->bottom > 0) &&
|
||||
(lprcScreenCoords->left < GetSystemMetrics(SM_CXSCREEN)) &&
|
||||
(lprcScreenCoords->top < GetSystemMetrics(SM_CYSCREEN))))
|
||||
{
|
||||
return xPRIMARY_MONITOR;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
HMONITOR WINAPI
|
||||
xMonitorFromWindow(HWND hWnd, DWORD dwFlags)
|
||||
{
|
||||
WINDOWPLACEMENT wp;
|
||||
|
||||
if (InitMultipleMonitorStubs())
|
||||
return g_pfnMonitorFromWindow(hWnd, dwFlags);
|
||||
|
||||
if (dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST))
|
||||
return xPRIMARY_MONITOR;
|
||||
|
||||
if (IsIconic(hWnd) ?
|
||||
GetWindowPlacement(hWnd, &wp) :
|
||||
GetWindowRect(hWnd, &wp.rcNormalPosition)) {
|
||||
|
||||
return xMonitorFromRect(&wp.rcNormalPosition, dwFlags);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BOOL WINAPI
|
||||
xGetMonitorInfo(HMONITOR hMonitor, __inout LPMONITORINFO lpMonitorInfo)
|
||||
{
|
||||
RECT rcWork;
|
||||
|
||||
if (InitMultipleMonitorStubs())
|
||||
{
|
||||
BOOL f = g_pfnGetMonitorInfo(hMonitor, lpMonitorInfo);
|
||||
#ifdef UNICODE
|
||||
if (f && !g_fMultimonPlatformNT && (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX)))
|
||||
{
|
||||
MultiByteToWideChar(CP_ACP, 0,
|
||||
(LPSTR)((MONITORINFOEX*)lpMonitorInfo)->szDevice, -1,
|
||||
((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)));
|
||||
}
|
||||
#endif
|
||||
return f;
|
||||
}
|
||||
|
||||
if ((hMonitor == xPRIMARY_MONITOR) &&
|
||||
lpMonitorInfo &&
|
||||
(lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) &&
|
||||
SystemParametersInfoA(SPI_GETWORKAREA, 0, &rcWork, 0))
|
||||
{
|
||||
lpMonitorInfo->rcMonitor.left = 0;
|
||||
lpMonitorInfo->rcMonitor.top = 0;
|
||||
lpMonitorInfo->rcMonitor.right = GetSystemMetrics(SM_CXSCREEN);
|
||||
lpMonitorInfo->rcMonitor.bottom = GetSystemMetrics(SM_CYSCREEN);
|
||||
lpMonitorInfo->rcWork = rcWork;
|
||||
lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY;
|
||||
|
||||
if (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX))
|
||||
{
|
||||
#ifdef UNICODE
|
||||
MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, ((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)));
|
||||
#else // UNICODE
|
||||
#if _MULTIMON_USE_SECURE_CRT
|
||||
strncpy_s(((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)), TEXT("DISPLAY"), (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)) - 1);
|
||||
#else
|
||||
lstrcpyn(((MONITORINFOEX*)lpMonitorInfo)->szDevice, TEXT("DISPLAY"), (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)));
|
||||
#endif // _MULTIMON_USE_SECURE_CRT
|
||||
#endif // UNICODE
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL WINAPI
|
||||
xEnumDisplayMonitors(
|
||||
HDC hdcOptionalForPainting,
|
||||
LPCRECT lprcEnumMonitorsThatIntersect,
|
||||
MONITORENUMPROC lpfnEnumProc,
|
||||
LPARAM dwData)
|
||||
{
|
||||
RECT rcLimit;
|
||||
|
||||
if (InitMultipleMonitorStubs()) {
|
||||
return g_pfnEnumDisplayMonitors(
|
||||
hdcOptionalForPainting,
|
||||
lprcEnumMonitorsThatIntersect,
|
||||
lpfnEnumProc,
|
||||
dwData);
|
||||
}
|
||||
|
||||
if (!lpfnEnumProc)
|
||||
return FALSE;
|
||||
|
||||
rcLimit.left = 0;
|
||||
rcLimit.top = 0;
|
||||
rcLimit.right = GetSystemMetrics(SM_CXSCREEN);
|
||||
rcLimit.bottom = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
if (hdcOptionalForPainting)
|
||||
{
|
||||
RECT rcClip;
|
||||
POINT ptOrg;
|
||||
|
||||
switch (GetClipBox(hdcOptionalForPainting, &rcClip))
|
||||
{
|
||||
default:
|
||||
if (!GetDCOrgEx(hdcOptionalForPainting, &ptOrg))
|
||||
return FALSE;
|
||||
|
||||
OffsetRect(&rcLimit, -ptOrg.x, -ptOrg.y);
|
||||
if (IntersectRect(&rcLimit, &rcLimit, &rcClip) &&
|
||||
(!lprcEnumMonitorsThatIntersect ||
|
||||
IntersectRect(&rcLimit, &rcLimit, lprcEnumMonitorsThatIntersect))) {
|
||||
|
||||
break;
|
||||
}
|
||||
//fall thru
|
||||
case NULLREGION:
|
||||
return TRUE;
|
||||
case ERROR:
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
if ( lprcEnumMonitorsThatIntersect &&
|
||||
!IntersectRect(&rcLimit, &rcLimit, lprcEnumMonitorsThatIntersect)) {
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return lpfnEnumProc(
|
||||
xPRIMARY_MONITOR,
|
||||
hdcOptionalForPainting,
|
||||
&rcLimit,
|
||||
dwData);
|
||||
}
|
||||
|
||||
BOOL WINAPI
|
||||
xEnumDisplayDevices(
|
||||
PVOID Unused,
|
||||
DWORD iDevNum,
|
||||
__inout PDISPLAY_DEVICE lpDisplayDevice,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
if (InitMultipleMonitorStubs())
|
||||
return g_pfnEnumDisplayDevices(Unused, iDevNum, lpDisplayDevice, dwFlags);
|
||||
|
||||
if (Unused != NULL)
|
||||
return FALSE;
|
||||
|
||||
if (iDevNum != 0)
|
||||
return FALSE;
|
||||
|
||||
if (lpDisplayDevice == NULL || lpDisplayDevice->cb < sizeof(DISPLAY_DEVICE))
|
||||
return FALSE;
|
||||
|
||||
#ifdef UNICODE
|
||||
MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, lpDisplayDevice->DeviceName, (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)));
|
||||
MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, lpDisplayDevice->DeviceString, (sizeof(lpDisplayDevice->DeviceString)/sizeof(TCHAR)));
|
||||
#else // UNICODE
|
||||
#if _MULTIMON_USE_SECURE_CRT
|
||||
strncpy_s((LPTSTR)lpDisplayDevice->DeviceName, (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)), TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)) - 1);
|
||||
strncpy_s((LPTSTR)lpDisplayDevice->DeviceString, (sizeof(lpDisplayDevice->DeviceString)/sizeof(TCHAR)), TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)) - 1);
|
||||
#else
|
||||
lstrcpyn((LPTSTR)lpDisplayDevice->DeviceName, TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)));
|
||||
lstrcpyn((LPTSTR)lpDisplayDevice->DeviceString, TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceString)/sizeof(TCHAR)));
|
||||
#endif // _MULTIMON_USE_SECURE_CRT
|
||||
#endif // UNICODE
|
||||
|
||||
lpDisplayDevice->StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_PRIMARY_DEVICE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#undef xPRIMARY_MONITOR
|
||||
#undef COMPILE_MULTIMON_STUBS
|
||||
|
||||
#else // COMPILE_MULTIMON_STUBS
|
||||
|
||||
extern int WINAPI xGetSystemMetrics(int);
|
||||
extern HMONITOR WINAPI xMonitorFromWindow(HWND, DWORD);
|
||||
extern HMONITOR WINAPI xMonitorFromRect(LPCRECT, DWORD);
|
||||
extern HMONITOR WINAPI xMonitorFromPoint(POINT, DWORD);
|
||||
extern BOOL WINAPI xGetMonitorInfo(HMONITOR, LPMONITORINFO);
|
||||
extern BOOL WINAPI xEnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, LPARAM);
|
||||
extern BOOL WINAPI xEnumDisplayDevices(PVOID, DWORD, PDISPLAY_DEVICE, DWORD);
|
||||
|
||||
#endif // COMPILE_MULTIMON_STUBS
|
||||
|
||||
//
|
||||
// build defines that replace the regular APIs with our versions
|
||||
//
|
||||
#define GetSystemMetrics xGetSystemMetrics
|
||||
#define MonitorFromWindow xMonitorFromWindow
|
||||
#define MonitorFromRect xMonitorFromRect
|
||||
#define MonitorFromPoint xMonitorFromPoint
|
||||
#define GetMonitorInfo xGetMonitorInfo
|
||||
#define EnumDisplayMonitors xEnumDisplayMonitors
|
||||
#define EnumDisplayDevices xEnumDisplayDevices
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
|
||||
4
3rdparty/include/opencl/1.2/CL/cl_platform.h
vendored
4
3rdparty/include/opencl/1.2/CL/cl_platform.h
vendored
@@ -92,7 +92,7 @@ extern "C" {
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED __attribute__((deprecated))
|
||||
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||
#endif
|
||||
#elif _WIN32
|
||||
#elif defined(_WIN32)
|
||||
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
|
||||
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
|
||||
@@ -454,7 +454,7 @@ typedef unsigned int cl_GLenum;
|
||||
/* Define alignment keys */
|
||||
#if defined( __GNUC__ )
|
||||
#define CL_ALIGNED(_x) __attribute__ ((aligned(_x)))
|
||||
#elif defined( _WIN32) && (_MSC_VER)
|
||||
#elif defined( _WIN32) && defined(_MSC_VER)
|
||||
/* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements */
|
||||
/* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx */
|
||||
/* #include <crtdefs.h> */
|
||||
|
||||
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.2.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.3.3.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.3.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r3.0.1.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r3.0.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.3.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.3.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.4.0.so
vendored
Executable file
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.4.0.so
vendored
Executable file
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r2.2.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r2.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r2.3.3.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r2.3.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r3.0.1.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r3.0.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.3.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.3.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.4.0.so
vendored
Executable file
BIN
3rdparty/lib/armeabi/libnative_camera_r4.4.0.so
vendored
Executable file
Binary file not shown.
BIN
3rdparty/lib/libavcodec.a
vendored
BIN
3rdparty/lib/libavcodec.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libavdevice.a
vendored
BIN
3rdparty/lib/libavdevice.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libavformat.a
vendored
BIN
3rdparty/lib/libavformat.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libavutil.a
vendored
BIN
3rdparty/lib/libavutil.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libswscale.a
vendored
BIN
3rdparty/lib/libswscale.a
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/mips/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/mips/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/mips/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.3.0.so
vendored
BIN
3rdparty/lib/mips/libnative_camera_r4.3.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.4.0.so
vendored
Executable file
BIN
3rdparty/lib/mips/libnative_camera_r4.4.0.so
vendored
Executable file
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r2.3.3.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r2.3.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r3.0.1.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r3.0.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.3.0.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r4.3.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.4.0.so
vendored
Executable file
BIN
3rdparty/lib/x86/libnative_camera_r4.4.0.so
vendored
Executable file
Binary file not shown.
1
3rdparty/openexr/IlmImf/ImfAcesFile.cpp
vendored
1
3rdparty/openexr/IlmImf/ImfAcesFile.cpp
vendored
@@ -42,6 +42,7 @@
|
||||
#include <ImfRgbaFile.h>
|
||||
#include <ImfStandardAttributes.h>
|
||||
#include <Iex.h>
|
||||
#include <algorithm> // for std::max()
|
||||
|
||||
using namespace std;
|
||||
using namespace Imath;
|
||||
|
||||
1
3rdparty/openexr/IlmImf/ImfOutputFile.cpp
vendored
1
3rdparty/openexr/IlmImf/ImfOutputFile.cpp
vendored
@@ -58,6 +58,7 @@
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
#include <assert.h>
|
||||
#include <algorithm> // for std::max()
|
||||
|
||||
|
||||
namespace Imf {
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
#include <algorithm> // for std::max()
|
||||
|
||||
|
||||
namespace Imf {
|
||||
|
||||
1
3rdparty/openexr/IlmImf/ImfTiledMisc.cpp
vendored
1
3rdparty/openexr/IlmImf/ImfTiledMisc.cpp
vendored
@@ -43,6 +43,7 @@
|
||||
#include "Iex.h"
|
||||
#include <ImfMisc.h>
|
||||
#include <ImfChannelList.h>
|
||||
#include <algorithm> // for std::max()
|
||||
|
||||
|
||||
namespace Imf {
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
#include <fstream>
|
||||
#include <assert.h>
|
||||
#include <map>
|
||||
#include <algorithm> // for std::max()
|
||||
|
||||
|
||||
namespace Imf {
|
||||
|
||||
1
3rdparty/openexr/Imath/ImathMatrixAlgo.cpp
vendored
1
3rdparty/openexr/Imath/ImathMatrixAlgo.cpp
vendored
@@ -44,6 +44,7 @@
|
||||
|
||||
#include "ImathMatrixAlgo.h"
|
||||
#include <cmath>
|
||||
#include <algorithm> // for std::max()
|
||||
|
||||
#if defined(OPENEXR_DLL)
|
||||
#define EXPORT_CONST __declspec(dllexport)
|
||||
|
||||
72
3rdparty/openexr/fix_msvc2013_errors.patch
vendored
Normal file
72
3rdparty/openexr/fix_msvc2013_errors.patch
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
diff --git a/3rdparty/openexr/IlmImf/ImfAcesFile.cpp b/3rdparty/openexr/IlmImf/ImfAcesFile.cpp
|
||||
index de4bf83..9418b9d 100644
|
||||
--- a/3rdparty/openexr/IlmImf/ImfAcesFile.cpp
|
||||
+++ b/3rdparty/openexr/IlmImf/ImfAcesFile.cpp
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <ImfRgbaFile.h>
|
||||
#include <ImfStandardAttributes.h>
|
||||
#include <Iex.h>
|
||||
+#include <algorithm> // for std::max()
|
||||
|
||||
using namespace std;
|
||||
using namespace Imath;
|
||||
diff --git a/3rdparty/openexr/IlmImf/ImfOutputFile.cpp b/3rdparty/openexr/IlmImf/ImfOutputFile.cpp
|
||||
index 8831ec9..e69b92b 100644
|
||||
--- a/3rdparty/openexr/IlmImf/ImfOutputFile.cpp
|
||||
+++ b/3rdparty/openexr/IlmImf/ImfOutputFile.cpp
|
||||
@@ -58,6 +58,7 @@
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
#include <assert.h>
|
||||
+#include <algorithm> // for std::max()
|
||||
|
||||
|
||||
namespace Imf {
|
||||
diff --git a/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp b/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp
|
||||
index f7a12a3..5d8b522 100644
|
||||
--- a/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp
|
||||
+++ b/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp
|
||||
@@ -56,6 +56,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
+#include <algorithm> // for std::max()
|
||||
|
||||
|
||||
namespace Imf {
|
||||
diff --git a/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp b/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp
|
||||
index 57f52f1..9588e78 100644
|
||||
--- a/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp
|
||||
+++ b/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "Iex.h"
|
||||
#include <ImfMisc.h>
|
||||
#include <ImfChannelList.h>
|
||||
+#include <algorithm> // for std::max()
|
||||
|
||||
|
||||
namespace Imf {
|
||||
diff --git a/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp b/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp
|
||||
index 0882106..0bc3cb3 100644
|
||||
--- a/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp
|
||||
+++ b/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp
|
||||
@@ -63,6 +63,7 @@
|
||||
#include <fstream>
|
||||
#include <assert.h>
|
||||
#include <map>
|
||||
+#include <algorithm> // for std::max()
|
||||
|
||||
|
||||
namespace Imf {
|
||||
diff --git a/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp b/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp
|
||||
index f0d2ed6..7ddc649 100644
|
||||
--- a/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp
|
||||
+++ b/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp
|
||||
@@ -44,6 +44,7 @@
|
||||
|
||||
#include "ImathMatrixAlgo.h"
|
||||
#include <cmath>
|
||||
+#include <algorithm> // for std::max()
|
||||
|
||||
#if defined(OPENEXR_DLL)
|
||||
#define EXPORT_CONST __declspec(dllexport)
|
||||
@@ -127,9 +127,9 @@ endif()
|
||||
OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O" ON IF IOS)
|
||||
OCV_OPTION(WITH_CARBON "Use Carbon for UI instead of Cocoa" OFF IF APPLE )
|
||||
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
|
||||
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
|
||||
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
|
||||
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS AND NOT APPLE) )
|
||||
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
|
||||
OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF WIN32 )
|
||||
@@ -160,10 +160,10 @@ OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON
|
||||
OCV_OPTION(WITH_MSMF "Build HighGUI with Media Foundation support" OFF IF WIN32 )
|
||||
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE) )
|
||||
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
|
||||
OCV_OPTION(WITH_INTELPERC "Include Intel Perceptual Computing support" OFF IF WIN32 )
|
||||
|
||||
# OpenCV build components
|
||||
# ===================================================
|
||||
@@ -201,6 +201,7 @@ OCV_OPTION(INSTALL_TO_MANGLED_PATHS "Enables mangled install paths, that help wi
|
||||
|
||||
# OpenCV build options
|
||||
# ===================================================
|
||||
OCV_OPTION(ENABLE_DYNAMIC_CUDA "Enabled dynamic CUDA linkage" ON IF ANDROID )
|
||||
OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (NOT IOS) )
|
||||
OCV_OPTION(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) IF (CMAKE_VERSION VERSION_GREATER "2.8.0") )
|
||||
OCV_OPTION(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF IF CMAKE_COMPILER_IS_GNUCXX )
|
||||
@@ -214,9 +215,12 @@ OCV_OPTION(ENABLE_SSSE3 "Enable SSSE3 instructions"
|
||||
OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions" OFF IF ((CV_ICC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_AVX "Enable AVX instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_NEON "Enable NEON instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND ARM )
|
||||
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND ARM )
|
||||
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
|
||||
OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
|
||||
OCV_OPTION(ENABLE_WINRT_MODE "Build with Windows Runtime support" OFF IF WIN32 )
|
||||
OCV_OPTION(ENABLE_WINRT_MODE_NATIVE "Build with Windows Runtime native C++ support" OFF IF WIN32 )
|
||||
|
||||
# uncategorized options
|
||||
# ===================================================
|
||||
@@ -240,6 +244,15 @@ include(cmake/OpenCVVersion.cmake)
|
||||
# Save libs and executables in the same place
|
||||
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" CACHE PATH "Output directory for applications" )
|
||||
|
||||
if (ANDROID)
|
||||
if (ANDROID_ABI MATCHES "NEON")
|
||||
set(ENABLE_NEON ON)
|
||||
endif()
|
||||
if (ANDROID_ABI MATCHES "VFPV3")
|
||||
set(ENABLE_VFPV3 ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ANDROID OR WIN32)
|
||||
set(OPENCV_DOC_INSTALL_PATH doc)
|
||||
elseif(INSTALL_TO_MANGLED_PATHS)
|
||||
@@ -461,7 +474,11 @@ endif()
|
||||
# ----------------------------------------------------------------------------
|
||||
# Add CUDA libraries (needed for apps/tools, samples)
|
||||
# ----------------------------------------------------------------------------
|
||||
if(HAVE_CUDA)
|
||||
if(NOT HAVE_CUDA)
|
||||
set(ENABLE_DYNAMIC_CUDA OFF)
|
||||
endif()
|
||||
|
||||
if(HAVE_CUDA AND NOT ENABLE_DYNAMIC_CUDA)
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
||||
if(HAVE_CUBLAS)
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cublas_LIBRARY})
|
||||
@@ -470,6 +487,7 @@ if(HAVE_CUDA)
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cufft_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Solution folders:
|
||||
# ----------------------------------------------------------------------------
|
||||
@@ -649,7 +667,7 @@ endif()
|
||||
if(WIN32)
|
||||
status("")
|
||||
status(" Windows RT support:" HAVE_WINRT THEN YES ELSE NO)
|
||||
if (ENABLE_WINRT_MODE)
|
||||
if (ENABLE_WINRT_MODE OR ENABLE_WINRT_MODE_NATIVE)
|
||||
status(" Windows SDK v8.0:" ${WINDOWS_SDK_PATH})
|
||||
status(" Visual Studio 2012:" ${VISUAL_STUDIO_PATH})
|
||||
endif()
|
||||
@@ -829,6 +847,11 @@ if(DEFINED WITH_XINE)
|
||||
status(" Xine:" HAVE_XINE THEN "YES (ver ${ALIASOF_libxine_VERSION})" ELSE NO)
|
||||
endif(DEFINED WITH_XINE)
|
||||
|
||||
if(DEFINED WITH_INTELPERC)
|
||||
status(" Intel PerC:" HAVE_INTELPERC THEN "YES" ELSE NO)
|
||||
endif(DEFINED WITH_INTELPERC)
|
||||
|
||||
|
||||
# ========================== Other third-party libraries ==========================
|
||||
status("")
|
||||
status(" Other third-party libraries:")
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "HOGfeatures.h"
|
||||
#include "cascadeclassifier.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
CvHOGFeatureParams::CvHOGFeatureParams()
|
||||
{
|
||||
|
||||
@@ -20,33 +20,33 @@ class CvHOGEvaluator : public CvFeatureEvaluator
|
||||
public:
|
||||
virtual ~CvHOGEvaluator() {}
|
||||
virtual void init(const CvFeatureParams *_featureParams,
|
||||
int _maxSampleCount, Size _winSize );
|
||||
virtual void setImage(const Mat& img, uchar clsLabel, int idx);
|
||||
int _maxSampleCount, cv::Size _winSize );
|
||||
virtual void setImage(const cv::Mat& img, uchar clsLabel, int idx);
|
||||
virtual float operator()(int varIdx, int sampleIdx) const;
|
||||
virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const;
|
||||
virtual void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
|
||||
protected:
|
||||
virtual void generateFeatures();
|
||||
virtual void integralHistogram(const Mat &img, vector<Mat> &histogram, Mat &norm, int nbins) const;
|
||||
virtual void integralHistogram(const cv::Mat &img, std::vector<cv::Mat> &histogram, cv::Mat &norm, int nbins) const;
|
||||
class Feature
|
||||
{
|
||||
public:
|
||||
Feature();
|
||||
Feature( int offset, int x, int y, int cellW, int cellH );
|
||||
float calc( const vector<Mat> &_hists, const Mat &_normSum, size_t y, int featComponent ) const;
|
||||
void write( FileStorage &fs ) const;
|
||||
void write( FileStorage &fs, int varIdx ) const;
|
||||
float calc( const std::vector<cv::Mat> &_hists, const cv::Mat &_normSum, size_t y, int featComponent ) const;
|
||||
void write( cv::FileStorage &fs ) const;
|
||||
void write( cv::FileStorage &fs, int varIdx ) const;
|
||||
|
||||
Rect rect[N_CELLS]; //cells
|
||||
cv::Rect rect[N_CELLS]; //cells
|
||||
|
||||
struct
|
||||
{
|
||||
int p0, p1, p2, p3;
|
||||
} fastRect[N_CELLS];
|
||||
};
|
||||
vector<Feature> features;
|
||||
std::vector<Feature> features;
|
||||
|
||||
Mat normSum; //for nomalization calculation (L1 or L2)
|
||||
vector<Mat> hist;
|
||||
cv::Mat normSum; //for nomalization calculation (L1 or L2)
|
||||
std::vector<cv::Mat> hist;
|
||||
};
|
||||
|
||||
inline float CvHOGEvaluator::operator()(int varIdx, int sampleIdx) const
|
||||
@@ -57,7 +57,7 @@ inline float CvHOGEvaluator::operator()(int varIdx, int sampleIdx) const
|
||||
return features[featureIdx].calc( hist, normSum, sampleIdx, componentIdx);
|
||||
}
|
||||
|
||||
inline float CvHOGEvaluator::Feature::calc( const vector<Mat>& _hists, const Mat& _normSum, size_t y, int featComponent ) const
|
||||
inline float CvHOGEvaluator::Feature::calc( const std::vector<cv::Mat>& _hists, const cv::Mat& _normSum, size_t y, int featComponent ) const
|
||||
{
|
||||
float normFactor;
|
||||
float res;
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
using cv::Size;
|
||||
using cv::Mat;
|
||||
using cv::Point;
|
||||
using cv::FileStorage;
|
||||
using cv::Rect;
|
||||
using cv::Ptr;
|
||||
using cv::FileNode;
|
||||
using cv::Mat_;
|
||||
using cv::Range;
|
||||
using cv::FileNodeIterator;
|
||||
using cv::ParallelLoopBody;
|
||||
|
||||
|
||||
#include "boost.h"
|
||||
#include "cascadeclassifier.h"
|
||||
#include <queue>
|
||||
@@ -160,10 +173,10 @@ CvCascadeBoostParams::CvCascadeBoostParams( int _boostType,
|
||||
|
||||
void CvCascadeBoostParams::write( FileStorage &fs ) const
|
||||
{
|
||||
String boostTypeStr = boost_type == CvBoost::DISCRETE ? CC_DISCRETE_BOOST :
|
||||
string boostTypeStr = boost_type == CvBoost::DISCRETE ? CC_DISCRETE_BOOST :
|
||||
boost_type == CvBoost::REAL ? CC_REAL_BOOST :
|
||||
boost_type == CvBoost::LOGIT ? CC_LOGIT_BOOST :
|
||||
boost_type == CvBoost::GENTLE ? CC_GENTLE_BOOST : String();
|
||||
boost_type == CvBoost::GENTLE ? CC_GENTLE_BOOST : string();
|
||||
CV_Assert( !boostTypeStr.empty() );
|
||||
fs << CC_BOOST_TYPE << boostTypeStr;
|
||||
fs << CC_MINHITRATE << minHitRate;
|
||||
@@ -175,7 +188,7 @@ void CvCascadeBoostParams::write( FileStorage &fs ) const
|
||||
|
||||
bool CvCascadeBoostParams::read( const FileNode &node )
|
||||
{
|
||||
String boostTypeStr;
|
||||
string boostTypeStr;
|
||||
FileNode rnode = node[CC_BOOST_TYPE];
|
||||
rnode >> boostTypeStr;
|
||||
boost_type = !boostTypeStr.compare( CC_DISCRETE_BOOST ) ? CvBoost::DISCRETE :
|
||||
@@ -213,10 +226,10 @@ void CvCascadeBoostParams::printDefaults() const
|
||||
|
||||
void CvCascadeBoostParams::printAttrs() const
|
||||
{
|
||||
String boostTypeStr = boost_type == CvBoost::DISCRETE ? CC_DISCRETE_BOOST :
|
||||
string boostTypeStr = boost_type == CvBoost::DISCRETE ? CC_DISCRETE_BOOST :
|
||||
boost_type == CvBoost::REAL ? CC_REAL_BOOST :
|
||||
boost_type == CvBoost::LOGIT ? CC_LOGIT_BOOST :
|
||||
boost_type == CvBoost::GENTLE ? CC_GENTLE_BOOST : String();
|
||||
boost_type == CvBoost::GENTLE ? CC_GENTLE_BOOST : string();
|
||||
CV_Assert( !boostTypeStr.empty() );
|
||||
cout << "boostType: " << boostTypeStr << endl;
|
||||
cout << "minHitRate: " << minHitRate << endl;
|
||||
@@ -226,7 +239,7 @@ void CvCascadeBoostParams::printAttrs() const
|
||||
cout << "maxWeakCount: " << weak_count << endl;
|
||||
}
|
||||
|
||||
bool CvCascadeBoostParams::scanAttr( const String prmName, const String val)
|
||||
bool CvCascadeBoostParams::scanAttr( const string prmName, const string val)
|
||||
{
|
||||
bool res = true;
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ struct CvCascadeBoostParams : CvBoostParams
|
||||
CvCascadeBoostParams( int _boostType, float _minHitRate, float _maxFalseAlarm,
|
||||
double _weightTrimRate, int _maxDepth, int _maxWeakCount );
|
||||
virtual ~CvCascadeBoostParams() {}
|
||||
void write( FileStorage &fs ) const;
|
||||
bool read( const FileNode &node );
|
||||
void write( cv::FileStorage &fs ) const;
|
||||
bool read( const cv::FileNode &node );
|
||||
virtual void printDefaults() const;
|
||||
virtual void printAttrs() const;
|
||||
virtual bool scanAttr( const String prmName, const String val);
|
||||
virtual bool scanAttr( const std::string prmName, const std::string val);
|
||||
};
|
||||
|
||||
struct CvCascadeBoostTrainData : CvDTreeTrainData
|
||||
@@ -45,7 +45,7 @@ struct CvCascadeBoostTrainData : CvDTreeTrainData
|
||||
virtual void free_train_data();
|
||||
|
||||
const CvFeatureEvaluator* featureEvaluator;
|
||||
Mat valCache; // precalculated feature values (CV_32FC1)
|
||||
cv::Mat valCache; // precalculated feature values (CV_32FC1)
|
||||
CvMat _resp; // for casting
|
||||
int numPrecalcVal, numPrecalcIdx;
|
||||
};
|
||||
@@ -54,9 +54,9 @@ class CvCascadeBoostTree : public CvBoostTree
|
||||
{
|
||||
public:
|
||||
virtual CvDTreeNode* predict( int sampleIdx ) const;
|
||||
void write( FileStorage &fs, const Mat& featureMap );
|
||||
void read( const FileNode &node, CvBoost* _ensemble, CvDTreeTrainData* _data );
|
||||
void markFeaturesInMap( Mat& featureMap );
|
||||
void write( cv::FileStorage &fs, const cv::Mat& featureMap );
|
||||
void read( const cv::FileNode &node, CvBoost* _ensemble, CvDTreeTrainData* _data );
|
||||
void markFeaturesInMap( cv::Mat& featureMap );
|
||||
protected:
|
||||
virtual void split_node_data( CvDTreeNode* n );
|
||||
};
|
||||
@@ -70,10 +70,10 @@ public:
|
||||
virtual float predict( int sampleIdx, bool returnSum = false ) const;
|
||||
|
||||
float getThreshold() const { return threshold; }
|
||||
void write( FileStorage &fs, const Mat& featureMap ) const;
|
||||
bool read( const FileNode &node, const CvFeatureEvaluator* _featureEvaluator,
|
||||
void write( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
|
||||
bool read( const cv::FileNode &node, const CvFeatureEvaluator* _featureEvaluator,
|
||||
const CvCascadeBoostParams& _params );
|
||||
void markUsedFeaturesInMap( Mat& featureMap );
|
||||
void markUsedFeaturesInMap( cv::Mat& featureMap );
|
||||
protected:
|
||||
virtual bool set_params( const CvBoostParams& _params );
|
||||
virtual void update_weights( CvBoostTree* tree );
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <queue>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
static const char* stageTypes[] = { CC_BOOST };
|
||||
static const char* featureTypes[] = { CC_HAAR, CC_LBP, CC_HOG };
|
||||
@@ -24,10 +25,10 @@ CvCascadeParams::CvCascadeParams( int _stageType, int _featureType ) : stageType
|
||||
|
||||
void CvCascadeParams::write( FileStorage &fs ) const
|
||||
{
|
||||
String stageTypeStr = stageType == BOOST ? CC_BOOST : String();
|
||||
string stageTypeStr = stageType == BOOST ? CC_BOOST : string();
|
||||
CV_Assert( !stageTypeStr.empty() );
|
||||
fs << CC_STAGE_TYPE << stageTypeStr;
|
||||
String featureTypeStr = featureType == CvFeatureParams::HAAR ? CC_HAAR :
|
||||
string featureTypeStr = featureType == CvFeatureParams::HAAR ? CC_HAAR :
|
||||
featureType == CvFeatureParams::LBP ? CC_LBP :
|
||||
featureType == CvFeatureParams::HOG ? CC_HOG :
|
||||
0;
|
||||
@@ -41,7 +42,7 @@ bool CvCascadeParams::read( const FileNode &node )
|
||||
{
|
||||
if ( node.empty() )
|
||||
return false;
|
||||
String stageTypeStr, featureTypeStr;
|
||||
string stageTypeStr, featureTypeStr;
|
||||
FileNode rnode = node[CC_STAGE_TYPE];
|
||||
if ( !rnode.isString() )
|
||||
return false;
|
||||
@@ -96,7 +97,7 @@ void CvCascadeParams::printAttrs() const
|
||||
cout << "sampleHeight: " << winSize.height << endl;
|
||||
}
|
||||
|
||||
bool CvCascadeParams::scanAttr( const String prmName, const String val )
|
||||
bool CvCascadeParams::scanAttr( const string prmName, const string val )
|
||||
{
|
||||
bool res = true;
|
||||
if( !prmName.compare( "-stageType" ) )
|
||||
@@ -126,9 +127,9 @@ bool CvCascadeParams::scanAttr( const String prmName, const String val )
|
||||
|
||||
//---------------------------- CascadeClassifier --------------------------------------
|
||||
|
||||
bool CvCascadeClassifier::train( const String _cascadeDirName,
|
||||
const String _posFilename,
|
||||
const String _negFilename,
|
||||
bool CvCascadeClassifier::train( const string _cascadeDirName,
|
||||
const string _posFilename,
|
||||
const string _negFilename,
|
||||
int _numPos, int _numNeg,
|
||||
int _precalcValBufSize, int _precalcIdxBufSize,
|
||||
int _numStages,
|
||||
@@ -137,6 +138,9 @@ bool CvCascadeClassifier::train( const String _cascadeDirName,
|
||||
const CvCascadeBoostParams& _stageParams,
|
||||
bool baseFormatSave )
|
||||
{
|
||||
// Start recording clock ticks for training time output
|
||||
const clock_t begin_time = clock();
|
||||
|
||||
if( _cascadeDirName.empty() || _posFilename.empty() || _negFilename.empty() )
|
||||
CV_Error( CV_StsBadArg, "_cascadeDirName or _bgfileName or _vecFileName is NULL" );
|
||||
|
||||
@@ -247,6 +251,14 @@ bool CvCascadeClassifier::train( const String _cascadeDirName,
|
||||
fs << FileStorage::getDefaultObjectName(stageFilename) << "{";
|
||||
tempStage->write( fs, Mat() );
|
||||
fs << "}";
|
||||
|
||||
// Output training time up till now
|
||||
float seconds = float( clock () - begin_time ) / CLOCKS_PER_SEC;
|
||||
int days = int(seconds) / 60 / 60 / 24;
|
||||
int hours = (int(seconds) / 60 / 60) % 24;
|
||||
int minutes = (int(seconds) / 60) % 60;
|
||||
int seconds_left = int(seconds) % 60;
|
||||
cout << "Training until now has taken " << days << " days " << hours << " hours " << minutes << " minutes " << seconds_left <<" seconds." << endl;
|
||||
}
|
||||
|
||||
if(stageClassifiers.size() == 0)
|
||||
@@ -310,6 +322,7 @@ int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositiv
|
||||
if( predict( i ) == 1.0F )
|
||||
{
|
||||
getcount++;
|
||||
printf("%s current samples: %d\r", isPositive ? "POS":"NEG", getcount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -399,7 +412,7 @@ bool CvCascadeClassifier::readStages( const FileNode &node)
|
||||
#define ICV_HAAR_PARENT_NAME "parent"
|
||||
#define ICV_HAAR_NEXT_NAME "next"
|
||||
|
||||
void CvCascadeClassifier::save( const String filename, bool baseFormat )
|
||||
void CvCascadeClassifier::save( const string filename, bool baseFormat )
|
||||
{
|
||||
FileStorage fs( filename, FileStorage::WRITE );
|
||||
|
||||
@@ -491,7 +504,7 @@ void CvCascadeClassifier::save( const String filename, bool baseFormat )
|
||||
fs << "}";
|
||||
}
|
||||
|
||||
bool CvCascadeClassifier::load( const String cascadeDirName )
|
||||
bool CvCascadeClassifier::load( const string cascadeDirName )
|
||||
{
|
||||
FileStorage fs( cascadeDirName + CC_PARAMS_FILENAME, FileStorage::READ );
|
||||
if ( !fs.isOpened() )
|
||||
|
||||
@@ -72,24 +72,24 @@ public:
|
||||
|
||||
CvCascadeParams();
|
||||
CvCascadeParams( int _stageType, int _featureType );
|
||||
void write( FileStorage &fs ) const;
|
||||
bool read( const FileNode &node );
|
||||
void write( cv::FileStorage &fs ) const;
|
||||
bool read( const cv::FileNode &node );
|
||||
|
||||
void printDefaults() const;
|
||||
void printAttrs() const;
|
||||
bool scanAttr( const String prmName, const String val );
|
||||
bool scanAttr( const std::string prmName, const std::string val );
|
||||
|
||||
int stageType;
|
||||
int featureType;
|
||||
Size winSize;
|
||||
cv::Size winSize;
|
||||
};
|
||||
|
||||
class CvCascadeClassifier
|
||||
{
|
||||
public:
|
||||
bool train( const String _cascadeDirName,
|
||||
const String _posFilename,
|
||||
const String _negFilename,
|
||||
bool train( const std::string _cascadeDirName,
|
||||
const std::string _posFilename,
|
||||
const std::string _negFilename,
|
||||
int _numPos, int _numNeg,
|
||||
int _precalcValBufSize, int _precalcIdxBufSize,
|
||||
int _numStages,
|
||||
@@ -99,25 +99,25 @@ public:
|
||||
bool baseFormatSave = false );
|
||||
private:
|
||||
int predict( int sampleIdx );
|
||||
void save( const String cascadeDirName, bool baseFormat = false );
|
||||
bool load( const String cascadeDirName );
|
||||
void save( const std::string cascadeDirName, bool baseFormat = false );
|
||||
bool load( const std::string cascadeDirName );
|
||||
bool updateTrainingSet( double& acceptanceRatio );
|
||||
int fillPassedSamples( int first, int count, bool isPositive, int64& consumed );
|
||||
|
||||
void writeParams( FileStorage &fs ) const;
|
||||
void writeStages( FileStorage &fs, const Mat& featureMap ) const;
|
||||
void writeFeatures( FileStorage &fs, const Mat& featureMap ) const;
|
||||
bool readParams( const FileNode &node );
|
||||
bool readStages( const FileNode &node );
|
||||
void writeParams( cv::FileStorage &fs ) const;
|
||||
void writeStages( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
|
||||
void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
|
||||
bool readParams( const cv::FileNode &node );
|
||||
bool readStages( const cv::FileNode &node );
|
||||
|
||||
void getUsedFeaturesIdxMap( Mat& featureMap );
|
||||
void getUsedFeaturesIdxMap( cv::Mat& featureMap );
|
||||
|
||||
CvCascadeParams cascadeParams;
|
||||
Ptr<CvFeatureParams> featureParams;
|
||||
Ptr<CvCascadeBoostParams> stageParams;
|
||||
cv::Ptr<CvFeatureParams> featureParams;
|
||||
cv::Ptr<CvCascadeBoostParams> stageParams;
|
||||
|
||||
Ptr<CvFeatureEvaluator> featureEvaluator;
|
||||
vector< Ptr<CvCascadeBoost> > stageClassifiers;
|
||||
cv::Ptr<CvFeatureEvaluator> featureEvaluator;
|
||||
std::vector< cv::Ptr<CvCascadeBoost> > stageClassifiers;
|
||||
CvCascadeImageReader imgReader;
|
||||
int numStages, curNumSamples;
|
||||
int numPos, numNeg;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "cascadeclassifier.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
float calcNormFactor( const Mat& sum, const Mat& sqSum )
|
||||
{
|
||||
@@ -24,7 +25,7 @@ CvParams::CvParams() : name( "params" ) {}
|
||||
void CvParams::printDefaults() const
|
||||
{ cout << "--" << name << "--" << endl; }
|
||||
void CvParams::printAttrs() const {}
|
||||
bool CvParams::scanAttr( const String, const String ) { return false; }
|
||||
bool CvParams::scanAttr( const string, const string ) { return false; }
|
||||
|
||||
|
||||
//---------------------------- FeatureParams --------------------------------------
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "cascadeclassifier.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
CvHaarFeatureParams::CvHaarFeatureParams() : mode(BASIC)
|
||||
{
|
||||
@@ -25,9 +26,9 @@ void CvHaarFeatureParams::init( const CvFeatureParams& fp )
|
||||
void CvHaarFeatureParams::write( FileStorage &fs ) const
|
||||
{
|
||||
CvFeatureParams::write( fs );
|
||||
String modeStr = mode == BASIC ? CC_MODE_BASIC :
|
||||
string modeStr = mode == BASIC ? CC_MODE_BASIC :
|
||||
mode == CORE ? CC_MODE_CORE :
|
||||
mode == ALL ? CC_MODE_ALL : String();
|
||||
mode == ALL ? CC_MODE_ALL : string();
|
||||
CV_Assert( !modeStr.empty() );
|
||||
fs << CC_MODE << modeStr;
|
||||
}
|
||||
@@ -40,7 +41,7 @@ bool CvHaarFeatureParams::read( const FileNode &node )
|
||||
FileNode rnode = node[CC_MODE];
|
||||
if( !rnode.isString() )
|
||||
return false;
|
||||
String modeStr;
|
||||
string modeStr;
|
||||
rnode >> modeStr;
|
||||
mode = !modeStr.compare( CC_MODE_BASIC ) ? BASIC :
|
||||
!modeStr.compare( CC_MODE_CORE ) ? CORE :
|
||||
@@ -58,13 +59,13 @@ void CvHaarFeatureParams::printDefaults() const
|
||||
void CvHaarFeatureParams::printAttrs() const
|
||||
{
|
||||
CvFeatureParams::printAttrs();
|
||||
String mode_str = mode == BASIC ? CC_MODE_BASIC :
|
||||
string mode_str = mode == BASIC ? CC_MODE_BASIC :
|
||||
mode == CORE ? CC_MODE_CORE :
|
||||
mode == ALL ? CC_MODE_ALL : 0;
|
||||
cout << "mode: " << mode_str << endl;
|
||||
}
|
||||
|
||||
bool CvHaarFeatureParams::scanAttr( const String prmName, const String val)
|
||||
bool CvHaarFeatureParams::scanAttr( const string prmName, const string val)
|
||||
{
|
||||
if ( !CvFeatureParams::scanAttr( prmName, val ) )
|
||||
{
|
||||
|
||||
@@ -18,12 +18,12 @@ public:
|
||||
CvHaarFeatureParams( int _mode );
|
||||
|
||||
virtual void init( const CvFeatureParams& fp );
|
||||
virtual void write( FileStorage &fs ) const;
|
||||
virtual bool read( const FileNode &node );
|
||||
virtual void write( cv::FileStorage &fs ) const;
|
||||
virtual bool read( const cv::FileNode &node );
|
||||
|
||||
virtual void printDefaults() const;
|
||||
virtual void printAttrs() const;
|
||||
virtual bool scanAttr( const String prm, const String val);
|
||||
virtual bool scanAttr( const std::string prm, const std::string val);
|
||||
|
||||
int mode;
|
||||
};
|
||||
@@ -32,11 +32,11 @@ class CvHaarEvaluator : public CvFeatureEvaluator
|
||||
{
|
||||
public:
|
||||
virtual void init(const CvFeatureParams *_featureParams,
|
||||
int _maxSampleCount, Size _winSize );
|
||||
virtual void setImage(const Mat& img, uchar clsLabel, int idx);
|
||||
int _maxSampleCount, cv::Size _winSize );
|
||||
virtual void setImage(const cv::Mat& img, uchar clsLabel, int idx);
|
||||
virtual float operator()(int featureIdx, int sampleIdx) const;
|
||||
virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const;
|
||||
void writeFeature( FileStorage &fs, int fi ) const; // for old file fornat
|
||||
virtual void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
|
||||
void writeFeature( cv::FileStorage &fs, int fi ) const; // for old file fornat
|
||||
protected:
|
||||
virtual void generateFeatures();
|
||||
|
||||
@@ -48,13 +48,13 @@ protected:
|
||||
int x0, int y0, int w0, int h0, float wt0,
|
||||
int x1, int y1, int w1, int h1, float wt1,
|
||||
int x2 = 0, int y2 = 0, int w2 = 0, int h2 = 0, float wt2 = 0.0F );
|
||||
float calc( const Mat &sum, const Mat &tilted, size_t y) const;
|
||||
void write( FileStorage &fs ) const;
|
||||
float calc( const cv::Mat &sum, const cv::Mat &tilted, size_t y) const;
|
||||
void write( cv::FileStorage &fs ) const;
|
||||
|
||||
bool tilted;
|
||||
struct
|
||||
{
|
||||
Rect r;
|
||||
cv::Rect r;
|
||||
float weight;
|
||||
} rect[CV_HAAR_FEATURE_MAX];
|
||||
|
||||
@@ -64,10 +64,10 @@ protected:
|
||||
} fastRect[CV_HAAR_FEATURE_MAX];
|
||||
};
|
||||
|
||||
vector<Feature> features;
|
||||
Mat sum; /* sum images (each row represents image) */
|
||||
Mat tilted; /* tilted sum images (each row represents image) */
|
||||
Mat normfactor; /* normalization factor */
|
||||
std::vector<Feature> features;
|
||||
cv::Mat sum; /* sum images (each row represents image) */
|
||||
cv::Mat tilted; /* tilted sum images (each row represents image) */
|
||||
cv::Mat normfactor; /* normalization factor */
|
||||
};
|
||||
|
||||
inline float CvHaarEvaluator::operator()(int featureIdx, int sampleIdx) const
|
||||
@@ -76,7 +76,7 @@ inline float CvHaarEvaluator::operator()(int featureIdx, int sampleIdx) const
|
||||
return !nf ? 0.0f : (features[featureIdx].calc( sum, tilted, sampleIdx)/nf);
|
||||
}
|
||||
|
||||
inline float CvHaarEvaluator::Feature::calc( const Mat &_sum, const Mat &_tilted, size_t y) const
|
||||
inline float CvHaarEvaluator::Feature::calc( const cv::Mat &_sum, const cv::Mat &_tilted, size_t y) const
|
||||
{
|
||||
const int* img = tilted ? _tilted.ptr<int>((int)y) : _sum.ptr<int>((int)y);
|
||||
float ret = rect[0].weight * (img[fastRect[0].p0] - img[fastRect[0].p1] - img[fastRect[0].p2] + img[fastRect[0].p3] ) +
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
bool CvCascadeImageReader::create( const String _posFilename, const String _negFilename, Size _winSize )
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
bool CvCascadeImageReader::create( const string _posFilename, const string _negFilename, Size _winSize )
|
||||
{
|
||||
return posReader.create(_posFilename) && negReader.create(_negFilename, _winSize);
|
||||
}
|
||||
@@ -22,21 +25,21 @@ CvCascadeImageReader::NegReader::NegReader()
|
||||
stepFactor = 0.5F;
|
||||
}
|
||||
|
||||
bool CvCascadeImageReader::NegReader::create( const String _filename, Size _winSize )
|
||||
bool CvCascadeImageReader::NegReader::create( const string _filename, Size _winSize )
|
||||
{
|
||||
String dirname, str;
|
||||
string dirname, str;
|
||||
std::ifstream file(_filename.c_str());
|
||||
if ( !file.is_open() )
|
||||
return false;
|
||||
|
||||
size_t pos = _filename.rfind('\\');
|
||||
char dlmrt = '\\';
|
||||
if (pos == String::npos)
|
||||
if (pos == string::npos)
|
||||
{
|
||||
pos = _filename.rfind('/');
|
||||
dlmrt = '/';
|
||||
}
|
||||
dirname = pos == String::npos ? "" : _filename.substr(0, pos) + dlmrt;
|
||||
dirname = pos == string::npos ? "" : _filename.substr(0, pos) + dlmrt;
|
||||
while( !file.eof() )
|
||||
{
|
||||
std::getline(file, str);
|
||||
@@ -64,10 +67,10 @@ bool CvCascadeImageReader::NegReader::nextImg()
|
||||
round = round % (winSize.width * winSize.height);
|
||||
last %= count;
|
||||
|
||||
_offset.x = min( (int)round % winSize.width, src.cols - winSize.width );
|
||||
_offset.y = min( (int)round / winSize.width, src.rows - winSize.height );
|
||||
_offset.x = std::min( (int)round % winSize.width, src.cols - winSize.width );
|
||||
_offset.y = std::min( (int)round / winSize.width, src.rows - winSize.height );
|
||||
if( !src.empty() && src.type() == CV_8UC1
|
||||
&& offset.x >= 0 && offset.y >= 0 )
|
||||
&& _offset.x >= 0 && _offset.y >= 0 )
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -126,7 +129,7 @@ CvCascadeImageReader::PosReader::PosReader()
|
||||
vec = 0;
|
||||
}
|
||||
|
||||
bool CvCascadeImageReader::PosReader::create( const String _filename )
|
||||
bool CvCascadeImageReader::PosReader::create( const string _filename )
|
||||
{
|
||||
if ( file )
|
||||
fclose( file );
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
|
||||
#include "highgui.h"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
|
||||
class CvCascadeImageReader
|
||||
{
|
||||
public:
|
||||
bool create( const String _posFilename, const String _negFilename, Size _winSize );
|
||||
bool create( const std::string _posFilename, const std::string _negFilename, cv::Size _winSize );
|
||||
void restart() { posReader.restart(); }
|
||||
bool getNeg(Mat &_img) { return negReader.get( _img ); }
|
||||
bool getPos(Mat &_img) { return posReader.get( _img ); }
|
||||
bool getNeg(cv::Mat &_img) { return negReader.get( _img ); }
|
||||
bool getPos(cv::Mat &_img) { return posReader.get( _img ); }
|
||||
|
||||
private:
|
||||
class PosReader
|
||||
@@ -19,8 +19,8 @@ private:
|
||||
public:
|
||||
PosReader();
|
||||
virtual ~PosReader();
|
||||
bool create( const String _filename );
|
||||
bool get( Mat &_img );
|
||||
bool create( const std::string _filename );
|
||||
bool get( cv::Mat &_img );
|
||||
void restart();
|
||||
|
||||
short* vec;
|
||||
@@ -35,18 +35,18 @@ private:
|
||||
{
|
||||
public:
|
||||
NegReader();
|
||||
bool create( const String _filename, Size _winSize );
|
||||
bool get( Mat& _img );
|
||||
bool create( const std::string _filename, cv::Size _winSize );
|
||||
bool get( cv::Mat& _img );
|
||||
bool nextImg();
|
||||
|
||||
Mat src, img;
|
||||
vector<String> imgFilenames;
|
||||
Point offset, point;
|
||||
cv::Mat src, img;
|
||||
std::vector<std::string> imgFilenames;
|
||||
cv::Point offset, point;
|
||||
float scale;
|
||||
float scaleFactor;
|
||||
float stepFactor;
|
||||
size_t last, round;
|
||||
Size winSize;
|
||||
cv::Size winSize;
|
||||
} negReader;
|
||||
};
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "lbpfeatures.h"
|
||||
#include "cascadeclassifier.h"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
CvLBPFeatureParams::CvLBPFeatureParams()
|
||||
{
|
||||
maxCatCount = 256;
|
||||
|
||||
@@ -15,11 +15,11 @@ class CvLBPEvaluator : public CvFeatureEvaluator
|
||||
public:
|
||||
virtual ~CvLBPEvaluator() {}
|
||||
virtual void init(const CvFeatureParams *_featureParams,
|
||||
int _maxSampleCount, Size _winSize );
|
||||
virtual void setImage(const Mat& img, uchar clsLabel, int idx);
|
||||
int _maxSampleCount, cv::Size _winSize );
|
||||
virtual void setImage(const cv::Mat& img, uchar clsLabel, int idx);
|
||||
virtual float operator()(int featureIdx, int sampleIdx) const
|
||||
{ return (float)features[featureIdx].calc( sum, sampleIdx); }
|
||||
virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const;
|
||||
virtual void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
|
||||
protected:
|
||||
virtual void generateFeatures();
|
||||
|
||||
@@ -28,18 +28,18 @@ protected:
|
||||
public:
|
||||
Feature();
|
||||
Feature( int offset, int x, int y, int _block_w, int _block_h );
|
||||
uchar calc( const Mat& _sum, size_t y ) const;
|
||||
void write( FileStorage &fs ) const;
|
||||
uchar calc( const cv::Mat& _sum, size_t y ) const;
|
||||
void write( cv::FileStorage &fs ) const;
|
||||
|
||||
Rect rect;
|
||||
cv::Rect rect;
|
||||
int p[16];
|
||||
};
|
||||
vector<Feature> features;
|
||||
std::vector<Feature> features;
|
||||
|
||||
Mat sum;
|
||||
cv::Mat sum;
|
||||
};
|
||||
|
||||
inline uchar CvLBPEvaluator::Feature::calc(const Mat &_sum, size_t y) const
|
||||
inline uchar CvLBPEvaluator::Feature::calc(const cv::Mat &_sum, size_t y) const
|
||||
{
|
||||
const int* psum = _sum.ptr<int>((int)y);
|
||||
int cval = psum[p[5]] - psum[p[6]] - psum[p[9]] + psum[p[10]];
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
#include "cascadeclassifier.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
CvCascadeClassifier classifier;
|
||||
String cascadeDirName, vecName, bgName;
|
||||
string cascadeDirName, vecName, bgName;
|
||||
int numPos = 2000;
|
||||
int numNeg = 1000;
|
||||
int numStages = 20;
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
(p3) = (rect).x + (rect).width - (rect).height \
|
||||
+ (step) * ((rect).y + (rect).width + (rect).height);
|
||||
|
||||
float calcNormFactor( const Mat& sum, const Mat& sqSum );
|
||||
float calcNormFactor( const cv::Mat& sum, const cv::Mat& sqSum );
|
||||
|
||||
template<class Feature>
|
||||
void _writeFeatures( const vector<Feature> features, FileStorage &fs, const Mat& featureMap )
|
||||
void _writeFeatures( const std::vector<Feature> features, cv::FileStorage &fs, const cv::Mat& featureMap )
|
||||
{
|
||||
fs << FEATURES << "[";
|
||||
const Mat_<int>& featureMap_ = (const Mat_<int>&)featureMap;
|
||||
const cv::Mat_<int>& featureMap_ = (const cv::Mat_<int>&)featureMap;
|
||||
for ( int fi = 0; fi < featureMap.cols; fi++ )
|
||||
if ( featureMap_(0, fi) >= 0 )
|
||||
{
|
||||
@@ -53,13 +53,13 @@ public:
|
||||
CvParams();
|
||||
virtual ~CvParams() {}
|
||||
// from|to file
|
||||
virtual void write( FileStorage &fs ) const = 0;
|
||||
virtual bool read( const FileNode &node ) = 0;
|
||||
virtual void write( cv::FileStorage &fs ) const = 0;
|
||||
virtual bool read( const cv::FileNode &node ) = 0;
|
||||
// from|to screen
|
||||
virtual void printDefaults() const;
|
||||
virtual void printAttrs() const;
|
||||
virtual bool scanAttr( const String prmName, const String val );
|
||||
String name;
|
||||
virtual bool scanAttr( const std::string prmName, const std::string val );
|
||||
std::string name;
|
||||
};
|
||||
|
||||
class CvFeatureParams : public CvParams
|
||||
@@ -68,9 +68,9 @@ public:
|
||||
enum { HAAR = 0, LBP = 1, HOG = 2 };
|
||||
CvFeatureParams();
|
||||
virtual void init( const CvFeatureParams& fp );
|
||||
virtual void write( FileStorage &fs ) const;
|
||||
virtual bool read( const FileNode &node );
|
||||
static Ptr<CvFeatureParams> create( int featureType );
|
||||
virtual void write( cv::FileStorage &fs ) const;
|
||||
virtual bool read( const cv::FileNode &node );
|
||||
static cv::Ptr<CvFeatureParams> create( int featureType );
|
||||
int maxCatCount; // 0 in case of numerical features
|
||||
int featSize; // 1 in case of simple features (HAAR, LBP) and N_BINS(9)*N_CELLS(4) in case of Dalal's HOG features
|
||||
};
|
||||
@@ -80,25 +80,25 @@ class CvFeatureEvaluator
|
||||
public:
|
||||
virtual ~CvFeatureEvaluator() {}
|
||||
virtual void init(const CvFeatureParams *_featureParams,
|
||||
int _maxSampleCount, Size _winSize );
|
||||
virtual void setImage(const Mat& img, uchar clsLabel, int idx);
|
||||
virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const = 0;
|
||||
int _maxSampleCount, cv::Size _winSize );
|
||||
virtual void setImage(const cv::Mat& img, uchar clsLabel, int idx);
|
||||
virtual void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const = 0;
|
||||
virtual float operator()(int featureIdx, int sampleIdx) const = 0;
|
||||
static Ptr<CvFeatureEvaluator> create(int type);
|
||||
static cv::Ptr<CvFeatureEvaluator> create(int type);
|
||||
|
||||
int getNumFeatures() const { return numFeatures; }
|
||||
int getMaxCatCount() const { return featureParams->maxCatCount; }
|
||||
int getFeatureSize() const { return featureParams->featSize; }
|
||||
const Mat& getCls() const { return cls; }
|
||||
const cv::Mat& getCls() const { return cls; }
|
||||
float getCls(int si) const { return cls.at<float>(si, 0); }
|
||||
protected:
|
||||
virtual void generateFeatures() = 0;
|
||||
|
||||
int npos, nneg;
|
||||
int numFeatures;
|
||||
Size winSize;
|
||||
cv::Size winSize;
|
||||
CvFeatureParams *featureParams;
|
||||
Mat cls;
|
||||
cv::Mat cls;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -759,11 +759,15 @@ endif()
|
||||
set(CUDA_VERSION_STRING "${CUDA_VERSION}")
|
||||
|
||||
# Support for arm cross compilation with CUDA 5.5
|
||||
if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
|
||||
set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf" CACHE PATH "Toolkit target location.")
|
||||
else()
|
||||
set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}" CACHE PATH "Toolkit target location.")
|
||||
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}")
|
||||
if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
|
||||
if(ANDROID AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-androideabi")
|
||||
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-androideabi")
|
||||
elseif(EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
|
||||
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
|
||||
endif()
|
||||
endif()
|
||||
set(CUDA_TOOLKIT_TARGET_DIR "${__cuda_toolkit_target_dir_initial}" CACHE PATH "Toolkit target location.")
|
||||
mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR)
|
||||
|
||||
# Target CPU architecture
|
||||
|
||||
@@ -9,7 +9,7 @@ set(HAVE_WINRT FALSE)
|
||||
# search Windows Platform SDK
|
||||
message(STATUS "Checking for Windows Platform SDK")
|
||||
GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
|
||||
if (WINDOWS_SDK_PATH STREQUAL "")
|
||||
if(WINDOWS_SDK_PATH STREQUAL "")
|
||||
set(HAVE_MSPDK FALSE)
|
||||
message(STATUS "Windows Platform SDK 8.0 was not found")
|
||||
else()
|
||||
@@ -19,7 +19,7 @@ endif()
|
||||
#search for Visual Studio 11.0 install directory
|
||||
message(STATUS "Checking for Visual Studio 2012")
|
||||
GET_FILENAME_COMPONENT(VISUAL_STUDIO_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH CACHE)
|
||||
if (VISUAL_STUDIO_PATH STREQUAL "")
|
||||
if(VISUAL_STUDIO_PATH STREQUAL "")
|
||||
set(HAVE_MSVC2012 FALSE)
|
||||
message(STATUS "Visual Studio 2012 was not found")
|
||||
else()
|
||||
@@ -30,11 +30,15 @@ try_compile(HAVE_WINRT_SDK
|
||||
"${OpenCV_BINARY_DIR}"
|
||||
"${OpenCV_SOURCE_DIR}/cmake/checks/winrttest.cpp")
|
||||
|
||||
if (ENABLE_WINRT_MODE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
|
||||
if(ENABLE_WINRT_MODE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
|
||||
set(HAVE_WINRT TRUE)
|
||||
set(HAVE_WINRT_CX TRUE)
|
||||
elseif(ENABLE_WINRT_MODE_NATIVE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
|
||||
set(HAVE_WINRT TRUE)
|
||||
set(HAVE_WINRT_CX FALSE)
|
||||
endif()
|
||||
|
||||
if (HAVE_WINRT)
|
||||
if(HAVE_WINRT)
|
||||
add_definitions(/DWINVER=0x0602 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=0x0602)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /appcontainer")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /appcontainer")
|
||||
|
||||
@@ -130,6 +130,12 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(ENABLE_SSE2)
|
||||
add_extra_compiler_option(-msse2)
|
||||
endif()
|
||||
if (ENABLE_NEON)
|
||||
add_extra_compiler_option("-mfpu=neon")
|
||||
endif()
|
||||
if (ENABLE_VFPV3 AND NOT ENABLE_NEON)
|
||||
add_extra_compiler_option("-mfpu=vfpv3")
|
||||
endif()
|
||||
|
||||
# SSE3 and further should be disabled under MingW because it generates compiler errors
|
||||
if(NOT MINGW)
|
||||
@@ -183,9 +189,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} -DNDEBUG")
|
||||
set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -O0 -DDEBUG -D_DEBUG")
|
||||
if(BUILD_WITH_DEBUG_INFO)
|
||||
set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -ggdb3")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
|
||||
@@ -77,6 +77,8 @@ if(MSVC)
|
||||
set(OpenCV_RUNTIME vc10)
|
||||
elseif(MSVC_VERSION EQUAL 1700)
|
||||
set(OpenCV_RUNTIME vc11)
|
||||
elseif(MSVC_VERSION EQUAL 1800)
|
||||
set(OpenCV_RUNTIME vc12)
|
||||
endif()
|
||||
elseif(MINGW)
|
||||
set(OpenCV_RUNTIME mingw)
|
||||
|
||||
@@ -90,12 +90,17 @@ if(CUDA_FOUND)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED __cuda_arch_bin)
|
||||
if(${CUDA_VERSION} VERSION_LESS "5.0")
|
||||
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
|
||||
if(ANDROID)
|
||||
set(__cuda_arch_bin "3.2")
|
||||
set(__cuda_arch_ptx "")
|
||||
else()
|
||||
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
|
||||
if(${CUDA_VERSION} VERSION_LESS "5.0")
|
||||
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
|
||||
else()
|
||||
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
|
||||
endif()
|
||||
set(__cuda_arch_ptx "3.0")
|
||||
endif()
|
||||
set(__cuda_arch_ptx "3.0")
|
||||
endif()
|
||||
|
||||
set(CUDA_ARCH_BIN ${__cuda_arch_bin} CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
|
||||
@@ -147,6 +152,11 @@ if(CUDA_FOUND)
|
||||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ${NVCC_FLAGS_EXTRA})
|
||||
set(OpenCV_CUDA_CC "${NVCC_FLAGS_EXTRA}")
|
||||
|
||||
if(ANDROID)
|
||||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xptxas;-dlcm=ca")
|
||||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-target-os-variant=Android")
|
||||
endif()
|
||||
|
||||
message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}")
|
||||
|
||||
OCV_OPTION(CUDA_FAST_MATH "Enable --use_fast_math for CUDA compiler " OFF)
|
||||
@@ -169,6 +179,14 @@ if(CUDA_FOUND)
|
||||
|
||||
# we remove -Wsign-promo as it generates warnings under linux
|
||||
string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
|
||||
|
||||
# we remove -Wno-delete-non-virtual-dtor because it's used for C++ compiler
|
||||
# but NVCC uses C compiler by default
|
||||
string(REPLACE "-Wno-delete-non-virtual-dtor" "" ${var} "${${var}}")
|
||||
|
||||
# we remove -frtti because it's used for C++ compiler
|
||||
# but NVCC uses C compiler by default
|
||||
string(REPLACE "-frtti" "" ${var} "${${var}}")
|
||||
endforeach()
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
|
||||
@@ -136,6 +136,8 @@ if(MSVC)
|
||||
set(OpenCV_RUNTIME vc10)
|
||||
elseif(MSVC_VERSION EQUAL 1700)
|
||||
set(OpenCV_RUNTIME vc11)
|
||||
elseif(MSVC_VERSION EQUAL 1800)
|
||||
set(OpenCV_RUNTIME vc12)
|
||||
endif()
|
||||
elseif(MINGW)
|
||||
set(OpenCV_RUNTIME mingw)
|
||||
|
||||
20
cmake/OpenCVFindIntelPerCSDK.cmake
Normal file
20
cmake/OpenCVFindIntelPerCSDK.cmake
Normal file
@@ -0,0 +1,20 @@
|
||||
# Main variables:
|
||||
# INTELPERC_LIBRARIES and INTELPERC_INCLUDE to link Intel Perceptial Computing SDK modules
|
||||
# HAVE_INTELPERC for conditional compilation OpenCV with/without Intel Perceptial Computing SDK
|
||||
|
||||
if(X86_64)
|
||||
find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
|
||||
find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/x64" DOC "Path to Intel Perceptual Computing SDK interface libraries")
|
||||
else()
|
||||
find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
|
||||
find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/Win32" DOC "Path to Intel Perceptual Computing SDK interface libraries")
|
||||
endif()
|
||||
|
||||
if(INTELPERC_INCLUDE_DIR AND INTELPERC_LIBRARIES)
|
||||
set(HAVE_INTELPERC TRUE)
|
||||
else()
|
||||
set(HAVE_INTELPERC FALSE)
|
||||
message(WARNING "Intel Perceptual Computing SDK library directory (set by INTELPERC_LIB_DIR variable) is not found or does not have Intel Perceptual Computing SDK libraries.")
|
||||
endif() #if(INTELPERC_INCLUDE_DIR AND INTELPERC_LIBRARIES)
|
||||
|
||||
mark_as_advanced(FORCE INTELPERC_LIBRARIES INTELPERC_INCLUDE_DIR)
|
||||
@@ -250,3 +250,8 @@ if (NOT IOS)
|
||||
set(HAVE_QTKIT YES)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# --- Intel Perceptual Computing SDK ---
|
||||
if(WITH_INTELPERC)
|
||||
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIntelPerCSDK.cmake")
|
||||
endif(WITH_INTELPERC)
|
||||
|
||||
@@ -23,7 +23,7 @@ if(WIN32)
|
||||
if(EXISTS ${XIMEA_PATH})
|
||||
set(XIMEA_FOUND 1)
|
||||
# set LIB folders
|
||||
if(CMAKE_CL_64)
|
||||
if(X86_64)
|
||||
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}/x64")
|
||||
else()
|
||||
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}/x86")
|
||||
|
||||
@@ -44,6 +44,7 @@ if(ANDROID)
|
||||
|
||||
# build the list of opencv libs and dependencies for all modules
|
||||
set(OPENCV_MODULES_CONFIGMAKE "")
|
||||
set(OPENCV_HAVE_GPU_MODULE_CONFIGMAKE "off")
|
||||
set(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "")
|
||||
set(OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE "")
|
||||
foreach(m ${OPENCV_MODULES_PUBLIC})
|
||||
@@ -53,6 +54,11 @@ if(ANDROID)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# remove CUDA runtime and NPP from regular deps
|
||||
# it can be added separately if needed.
|
||||
ocv_list_filterout(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "libcu")
|
||||
ocv_list_filterout(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "libnpp")
|
||||
|
||||
# split 3rdparty libs and modules
|
||||
foreach(mod ${OPENCV_MODULES_CONFIGMAKE})
|
||||
if(NOT mod MATCHES "^opencv_.+$")
|
||||
@@ -63,6 +69,14 @@ if(ANDROID)
|
||||
list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE})
|
||||
endif()
|
||||
|
||||
# GPU module enabled separately
|
||||
list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE "opencv_gpu")
|
||||
list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE "opencv_dynamicuda")
|
||||
|
||||
if(HAVE_opencv_gpu)
|
||||
set(OPENCV_HAVE_GPU_MODULE_CONFIGMAKE "on")
|
||||
endif()
|
||||
|
||||
# convert CMake lists to makefile literals
|
||||
foreach(lst OPENCV_MODULES_CONFIGMAKE OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE OPENCV_EXTRA_COMPONENTS_CONFIGMAKE)
|
||||
ocv_list_unique(${lst})
|
||||
|
||||
@@ -134,11 +134,11 @@ if(WIN32)
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" IMMEDIATE @ONLY)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/lib")
|
||||
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/lib" FILE OpenCVModules${modules_file_suffix}.cmake)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib")
|
||||
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" FILE OpenCVModules${modules_file_suffix}.cmake)
|
||||
else()
|
||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/staticlib")
|
||||
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/staticlib" FILE OpenCVModules${modules_file_suffix}.cmake)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib")
|
||||
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" FILE OpenCVModules${modules_file_suffix}.cmake)
|
||||
endif()
|
||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}")
|
||||
install(FILES "${OpenCV_SOURCE_DIR}/cmake/OpenCVConfig.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# platform-specific config file
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.cmake" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h")
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h")
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# opencv_modules.hpp based on actual modules list
|
||||
|
||||
@@ -76,7 +76,9 @@ if(INSTALL_TO_MANGLED_PATHS)
|
||||
else()
|
||||
set(OPENCV_PC_FILE_NAME opencv.pc)
|
||||
endif()
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/opencv-XXX.pc.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME}" @ONLY IMMEDIATE)
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/opencv-XXX.pc.in"
|
||||
"${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME}"
|
||||
@ONLY IMMEDIATE)
|
||||
|
||||
if(UNIX AND NOT ANDROID)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME} DESTINATION ${OPENCV_LIB_INSTALL_PATH}/pkgconfig)
|
||||
|
||||
@@ -488,7 +488,7 @@ macro(ocv_glob_module_sources)
|
||||
file(GLOB lib_cuda_srcs "src/cuda/*.cu")
|
||||
set(cuda_objs "")
|
||||
set(lib_cuda_hdrs "")
|
||||
if(HAVE_CUDA AND lib_cuda_srcs)
|
||||
if(HAVE_CUDA)
|
||||
ocv_include_directories(${CUDA_INCLUDE_DIRS})
|
||||
file(GLOB lib_cuda_hdrs "src/cuda/*.hpp")
|
||||
|
||||
@@ -537,9 +537,6 @@ macro(ocv_create_module)
|
||||
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS})
|
||||
target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${OPENCV_MODULE_${the_module}_DEPS})
|
||||
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
|
||||
if (HAVE_CUDA)
|
||||
target_link_libraries(${the_module} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_dependencies(opencv_modules ${the_module})
|
||||
|
||||
@@ -13,6 +13,19 @@ OPENCV_BASEDIR:=@OPENCV_BASE_INCLUDE_DIR_CONFIGCMAKE@
|
||||
OPENCV_LOCAL_C_INCLUDES:=@OPENCV_INCLUDE_DIRS_CONFIGCMAKE@
|
||||
OPENCV_MODULES:=@OPENCV_MODULES_CONFIGMAKE@
|
||||
|
||||
OPENCV_HAVE_GPU_MODULE=@OPENCV_HAVE_GPU_MODULE_CONFIGMAKE@
|
||||
OPENCV_USE_GPU_MODULE:=
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||
ifeq ($(OPENCV_HAVE_GPU_MODULE),on)
|
||||
ifneq ($(CUDA_TOOLKIT_DIR),)
|
||||
OPENCV_USE_GPU_MODULE:=on
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
CUDA_RUNTIME_LIBS:=cufft npps nppi nppc cudart
|
||||
|
||||
ifeq ($(OPENCV_LIB_TYPE),)
|
||||
OPENCV_LIB_TYPE:=@OPENCV_LIBTYPE_CONFIGMAKE@
|
||||
endif
|
||||
@@ -102,12 +115,22 @@ ifeq ($(OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED),)
|
||||
|
||||
ifneq ($(OPENCV_BASEDIR),)
|
||||
OPENCV_LOCAL_C_INCLUDES += $(foreach mod, $(OPENCV_MODULES), $(OPENCV_BASEDIR)/modules/$(mod)/include)
|
||||
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
||||
OPENCV_LOCAL_C_INCLUDES += $(OPENCV_BASEDIR)/modules/gpu/include
|
||||
endif
|
||||
endif
|
||||
|
||||
#turn off module installation to prevent their redefinition
|
||||
OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED:=on
|
||||
endif
|
||||
|
||||
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE:=opencv_gpu
|
||||
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/libopencv_gpu.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
endif
|
||||
|
||||
ifeq ($(OPENCV_LOCAL_CFLAGS),)
|
||||
OPENCV_LOCAL_CFLAGS := -fPIC -DANDROID -fsigned-char
|
||||
endif
|
||||
@@ -116,6 +139,10 @@ include $(CLEAR_VARS)
|
||||
LOCAL_C_INCLUDES += $(OPENCV_LOCAL_C_INCLUDES)
|
||||
LOCAL_CFLAGS += $(OPENCV_LOCAL_CFLAGS)
|
||||
|
||||
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
||||
LOCAL_C_INCLUDES += $(CUDA_TOOLKIT_DIR)/include
|
||||
endif
|
||||
|
||||
ifeq ($(OPENCV_INSTALL_MODULES),on)
|
||||
LOCAL_$(OPENCV_LIB_TYPE)_LIBRARIES += $(foreach mod, $(OPENCV_LIBS), opencv_$(mod))
|
||||
else
|
||||
@@ -128,5 +155,10 @@ endif
|
||||
|
||||
LOCAL_LDLIBS += $(foreach lib,$(OPENCV_EXTRA_COMPONENTS), -l$(lib))
|
||||
|
||||
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
||||
LOCAL_STATIC_LIBRARIES+=libopencv_gpu
|
||||
LOCAL_LDLIBS += -L$(CUDA_TOOLKIT_DIR)/lib $(foreach lib, $(CUDA_RUNTIME_LIBS), -l$(lib))
|
||||
endif
|
||||
|
||||
#restore the LOCAL_PATH
|
||||
LOCAL_PATH:=$(USER_LOCAL_PATH)
|
||||
|
||||
@@ -41,7 +41,9 @@ if(ANDROID)
|
||||
string(REPLACE - _ modules_file_suffix "_${ANDROID_NDK_ABI_NAME}")
|
||||
endif()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${modules_file_suffix}.cmake)
|
||||
if(NOT TARGET opencv_core)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${modules_file_suffix}.cmake)
|
||||
endif()
|
||||
|
||||
# TODO All things below should be reviewed. What is about of moving this code into related modules (special vars/hooks/files)
|
||||
|
||||
@@ -179,6 +181,10 @@ foreach(__cvcomponent ${OpenCV_FIND_COMPONENTS})
|
||||
set(${__cvcomponent}_FOUND "${__cvcomponent}_FOUND-NOTFOUND")
|
||||
else()
|
||||
list(APPEND OpenCV_FIND_COMPONENTS_ ${__cvcomponent})
|
||||
# Not using list(APPEND) here, because OpenCV_LIBS may not exist yet.
|
||||
# Also not clearing OpenCV_LIBS anywhere, so that multiple calls
|
||||
# to find_package(OpenCV) with different component lists add up.
|
||||
set(OpenCV_LIBS ${OpenCV_LIBS} "${__cvcomponent}")
|
||||
#indicate that module is found
|
||||
string(TOUPPER "${__cvcomponent}" __cvcomponent)
|
||||
set(${__cvcomponent}_FOUND 1)
|
||||
@@ -195,8 +201,6 @@ else()
|
||||
set(OpenCV_LIB_SUFFIX "")
|
||||
endif()
|
||||
|
||||
SET(OpenCV_LIBS "${OpenCV_LIB_COMPONENTS}")
|
||||
|
||||
foreach(__opttype OPT DBG)
|
||||
SET(OpenCV_LIBS_${__opttype} "${OpenCV_LIBS}")
|
||||
SET(OpenCV_EXTRA_LIBS_${__opttype} "")
|
||||
|
||||
@@ -85,6 +85,9 @@
|
||||
/* Apple ImageIO Framework */
|
||||
#cmakedefine HAVE_IMAGEIO
|
||||
|
||||
/* Intel Perceptual Computing SDK library */
|
||||
#cmakedefine HAVE_INTELPERC
|
||||
|
||||
/* Intel Integrated Performance Primitives */
|
||||
#cmakedefine HAVE_IPP
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
# CMake file for OpenCV docs
|
||||
#
|
||||
|
||||
file(GLOB FILES_TEX *.tex *.sty *.bib)
|
||||
file(GLOB FILES_TEX_PICS pics/*.png pics/*.jpg)
|
||||
|
||||
if(BUILD_DOCS AND HAVE_SPHINX)
|
||||
|
||||
project(opencv_docs)
|
||||
@@ -23,59 +20,84 @@ if(BUILD_DOCS AND HAVE_SPHINX)
|
||||
set(OPTIONAL_DOC_LIST "")
|
||||
|
||||
|
||||
set(OPENCV2_BASE_MODULES core imgproc highgui video calib3d features2d objdetect ml flann gpu photo stitching nonfree contrib legacy)
|
||||
|
||||
# build lists of modules to be documented
|
||||
set(OPENCV2_MODULES "")
|
||||
set(OPENCV_MODULES "")
|
||||
set(BASE_MODULES "")
|
||||
set(EXTRA_MODULES "")
|
||||
|
||||
foreach(mod ${OPENCV_MODULES_BUILD} ${OPENCV_MODULES_DISABLED_USER} ${OPENCV_MODULES_DISABLED_AUTO} ${OPENCV_MODULES_DISABLED_FORCE})
|
||||
string(REGEX REPLACE "^opencv_" "" mod "${mod}")
|
||||
if("${OPENCV_MODULE_opencv_${mod}_LOCATION}" STREQUAL "${OpenCV_SOURCE_DIR}/modules/${mod}")
|
||||
list(APPEND OPENCV2_MODULES ${mod})
|
||||
list(APPEND BASE_MODULES ${mod})
|
||||
else()
|
||||
list(APPEND OPENCV_MODULES ${mod})
|
||||
list(APPEND EXTRA_MODULES ${mod})
|
||||
endif()
|
||||
endforeach()
|
||||
list(REMOVE_ITEM OPENCV2_MODULES ${OPENCV2_BASE_MODULES})
|
||||
ocv_list_sort(OPENCV2_MODULES)
|
||||
ocv_list_sort(OPENCV_MODULES)
|
||||
|
||||
set(FIXED_ORDER_MODULES core imgproc highgui video calib3d features2d objdetect ml flann gpu photo stitching nonfree contrib legacy)
|
||||
|
||||
list(REMOVE_ITEM BASE_MODULES ${FIXED_ORDER_MODULES})
|
||||
|
||||
ocv_list_sort(BASE_MODULES)
|
||||
ocv_list_sort(EXTRA_MODULES)
|
||||
|
||||
set(BASE_MODULES ${FIXED_ORDER_MODULES} ${BASE_MODULES})
|
||||
|
||||
# build lists of documentation files and generate table of contents for reference manual
|
||||
set(OPENCV_FILES_REF "")
|
||||
set(OPENCV_FILES_REF_PICT "")
|
||||
|
||||
set(DOC_FAKE_ROOT "${CMAKE_CURRENT_BINARY_DIR}/fake-root")
|
||||
set(DOC_FAKE_ROOT_FILES "")
|
||||
|
||||
function(ocv_doc_add_file_to_fake_root source destination)
|
||||
add_custom_command(
|
||||
OUTPUT "${DOC_FAKE_ROOT}/${destination}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy "${source}" "${DOC_FAKE_ROOT}/${destination}"
|
||||
DEPENDS "${source}"
|
||||
COMMENT "Copying ${destination} to fake root..."
|
||||
VERBATIM
|
||||
)
|
||||
list(APPEND DOC_FAKE_ROOT_FILES "${DOC_FAKE_ROOT}/${destination}")
|
||||
set(DOC_FAKE_ROOT_FILES "${DOC_FAKE_ROOT_FILES}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(ocv_doc_add_to_fake_root source)
|
||||
if(ARGC GREATER 1)
|
||||
set(destination "${ARGV1}")
|
||||
else()
|
||||
file(RELATIVE_PATH destination "${OpenCV_SOURCE_DIR}" "${source}")
|
||||
endif()
|
||||
|
||||
if(IS_DIRECTORY "${source}")
|
||||
file(GLOB_RECURSE files RELATIVE "${source}" "${source}/*")
|
||||
|
||||
foreach(file ${files})
|
||||
ocv_doc_add_file_to_fake_root("${source}/${file}" "${destination}/${file}")
|
||||
endforeach()
|
||||
else()
|
||||
ocv_doc_add_file_to_fake_root("${source}" "${destination}")
|
||||
endif()
|
||||
|
||||
set(DOC_FAKE_ROOT_FILES "${DOC_FAKE_ROOT_FILES}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
set(OPENCV_REFMAN_TOC "")
|
||||
|
||||
foreach(mod ${OPENCV2_BASE_MODULES} ${OPENCV2_MODULES} ${OPENCV_MODULES})
|
||||
file(GLOB_RECURSE _OPENCV_FILES_REF "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/*.rst")
|
||||
file(GLOB_RECURSE _OPENCV_FILES_REF_PICT "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/*.png" "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/*.jpg")
|
||||
list(APPEND OPENCV_FILES_REF ${_OPENCV_FILES_REF})
|
||||
list(APPEND OPENCV_FILES_REF_PICT ${_OPENCV_FILES_REF_PICT})
|
||||
|
||||
set(toc_file "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/${mod}.rst")
|
||||
if(EXISTS "${toc_file}")
|
||||
file(RELATIVE_PATH toc_file "${OpenCV_SOURCE_DIR}/modules" "${toc_file}")
|
||||
set(OPENCV_REFMAN_TOC "${OPENCV_REFMAN_TOC} ${toc_file}\n")
|
||||
foreach(mod ${BASE_MODULES} ${EXTRA_MODULES})
|
||||
if(EXISTS "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/${mod}.rst")
|
||||
ocv_doc_add_to_fake_root("${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc" modules/${mod}/doc)
|
||||
set(OPENCV_REFMAN_TOC "${OPENCV_REFMAN_TOC} ${mod}/doc/${mod}.rst\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(GLOB_RECURSE _OPENCV_FILES_REF "${OpenCV_SOURCE_DIR}/platforms/android/service/doc/*.rst")
|
||||
file(GLOB_RECURSE _OPENCV_FILES_REF_PICT "${OpenCV_SOURCE_DIR}/platforms/android/service/doc/*.png" "${OpenCV_SOURCE_DIR}/platforms/android/service/doc/*.jpg")
|
||||
list(APPEND OPENCV_FILES_REF ${_OPENCV_FILES_REF})
|
||||
list(APPEND OPENCV_FILES_REF_PICT ${_OPENCV_FILES_REF_PICT})
|
||||
configure_file("${OpenCV_SOURCE_DIR}/modules/refman.rst.in" "${DOC_FAKE_ROOT}/modules/refman.rst" @ONLY)
|
||||
|
||||
configure_file("${OpenCV_SOURCE_DIR}/modules/refman.rst.in" "${OpenCV_SOURCE_DIR}/modules/refman.rst" IMMEDIATE @ONLY)
|
||||
|
||||
file(GLOB_RECURSE OPENCV_FILES_UG user_guide/*.rst)
|
||||
file(GLOB_RECURSE OPENCV_FILES_TUT tutorials/*.rst)
|
||||
file(GLOB_RECURSE OPENCV_FILES_TUT_PICT tutorials/*.png tutorials/*.jpg)
|
||||
|
||||
set(OPENCV_DOC_DEPS conf.py ${OPENCV_FILES_REF} ${OPENCV_FILES_REF_PICT}
|
||||
${OPENCV_FILES_UG} ${OPENCV_FILES_TUT} ${OPENCV_FILES_TUT_PICT})
|
||||
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/index.rst")
|
||||
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/doc")
|
||||
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/platforms/android")
|
||||
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/samples")
|
||||
|
||||
if(PDFLATEX_COMPILER)
|
||||
add_custom_target(docs
|
||||
COMMAND ${SPHINX_BUILD} -b latex -c ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. .
|
||||
COMMAND ${SPHINX_BUILD} -b latex -c "${CMAKE_CURRENT_SOURCE_DIR}" "${DOC_FAKE_ROOT}" .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/pics ${CMAKE_CURRENT_BINARY_DIR}/doc/opencv1/pics
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/patch_refman_latex.py" opencv2refman.tex
|
||||
@@ -95,7 +117,7 @@ if(BUILD_DOCS AND HAVE_SPHINX)
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Generating opencv_cheatsheet.pdf"
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode "${CMAKE_CURRENT_SOURCE_DIR}/opencv_cheatsheet.tex"
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode "${CMAKE_CURRENT_SOURCE_DIR}/opencv_cheatsheet.tex"
|
||||
DEPENDS ${OPENCV_DOC_DEPS}
|
||||
DEPENDS ${DOC_FAKE_ROOT_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating the PDF Manuals"
|
||||
)
|
||||
@@ -109,9 +131,9 @@ if(BUILD_DOCS AND HAVE_SPHINX)
|
||||
endif()
|
||||
|
||||
add_custom_target(html_docs
|
||||
COMMAND ${SPHINX_BUILD} -b html -c ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. ./_html
|
||||
COMMAND "${SPHINX_BUILD}" -b html -c "${CMAKE_CURRENT_SOURCE_DIR}" "${DOC_FAKE_ROOT}" ./_html
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS ${OPENCV_DOC_DEPS}
|
||||
DEPENDS ${DOC_FAKE_ROOT_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating Online Documentation"
|
||||
)
|
||||
|
||||
@@ -437,7 +437,7 @@ Example. Decimate image by factor of $\sqrt{2}$:\\
|
||||
\texttt{\href{http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html\#watershed}{watershed()}},
|
||||
\texttt{\href{http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html\#grabcut}{grabCut()}}
|
||||
& marker-based image segmentation algorithms.
|
||||
See the samples \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/watershed.cpp}{watershed.cpp}} and \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/grabcut.cpp}{grabcut.cpp}}.
|
||||
See the samples \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/watershed.cpp}{watershed.cpp}} and \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/grabcut.cpp}{grabcut.cpp}}.
|
||||
|
||||
\end{tabular}
|
||||
|
||||
@@ -465,7 +465,7 @@ Example. Compute Hue-Saturation histogram of an image:\\
|
||||
\end{tabbing}
|
||||
|
||||
\subsection{Contours}
|
||||
See \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/contours2.cpp}{contours2.cpp}} and \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/squares.cpp}{squares.cpp}}
|
||||
See \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/contours2.cpp}{contours2.cpp}} and \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/squares.cpp}{squares.cpp}}
|
||||
samples on what are the contours and how to use them.
|
||||
|
||||
\section{Data I/O}
|
||||
@@ -559,7 +559,7 @@ samples on what are the contours and how to use them.
|
||||
|
||||
\end{tabular}
|
||||
|
||||
See \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/camshiftdemo.cpp}{camshiftdemo.cpp}} and other \href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/}{OpenCV samples} on how to use the GUI functions.
|
||||
See \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/camshiftdemo.cpp}{camshiftdemo.cpp}} and other \href{https://github.com/Itseez/opencv/tree/master/samples/}{OpenCV samples} on how to use the GUI functions.
|
||||
|
||||
\section{Camera Calibration, Pose Estimation and Depth Estimation}
|
||||
|
||||
@@ -586,10 +586,10 @@ See \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/ma
|
||||
|
||||
\end{tabular}
|
||||
|
||||
To calibrate a camera, you can use \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/calibration.cpp}{calibration.cpp}} or
|
||||
\texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/stereo\_calib.cpp}{stereo\_calib.cpp}} samples.
|
||||
To calibrate a camera, you can use \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/calibration.cpp}{calibration.cpp}} or
|
||||
\texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/stereo\_calib.cpp}{stereo\_calib.cpp}} samples.
|
||||
To get the disparity maps and the point clouds, use
|
||||
\texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/stereo\_match.cpp}{stereo\_match.cpp}} sample.
|
||||
\texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/stereo\_match.cpp}{stereo\_match.cpp}} sample.
|
||||
|
||||
\section{Object Detection}
|
||||
|
||||
@@ -597,9 +597,9 @@ To get the disparity maps and the point clouds, use
|
||||
@{}p{\linewidth-\the\MyLen}@{}}
|
||||
\texttt{\href{http://docs.opencv.org/modules/imgproc/doc/object_detection.html\#matchtemplate}{matchTemplate}} & Compute proximity map for given template.\\
|
||||
|
||||
\texttt{\href{http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html\#cascadeclassifier}{CascadeClassifier}} & Viola's Cascade of Boosted classifiers using Haar or LBP features. Suits for detecting faces, facial features and some other objects without diverse textures. See \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/c/facedetect.cpp}{facedetect.cpp}}\\
|
||||
\texttt{\href{http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html\#cascadeclassifier}{CascadeClassifier}} & Viola's Cascade of Boosted classifiers using Haar or LBP features. Suits for detecting faces, facial features and some other objects without diverse textures. See \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/c/facedetect.cpp}{facedetect.cpp}}\\
|
||||
|
||||
\texttt{{HOGDescriptor}} & N. Dalal's object detector using Histogram-of-Oriented-Gradients (HOG) features. Suits for detecting people, cars and other objects with well-defined silhouettes. See \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/peopledetect.cpp}{peopledetect.cpp}}\\
|
||||
\texttt{{HOGDescriptor}} & N. Dalal's object detector using Histogram-of-Oriented-Gradients (HOG) features. Suits for detecting people, cars and other objects with well-defined silhouettes. See \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/peopledetect.cpp}{peopledetect.cpp}}\\
|
||||
|
||||
\end{tabular}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ Scalar
|
||||
|
||||
Code
|
||||
=====
|
||||
* This code is in your OpenCV sample folder. Otherwise you can grab it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp>`_
|
||||
* This code is in your OpenCV sample folder. Otherwise you can grab it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp>`_
|
||||
|
||||
Explanation
|
||||
=============
|
||||
|
||||
@@ -11,4 +11,5 @@
|
||||
.. |Author_EricCh| unicode:: Eric U+0020 Christiansen
|
||||
.. |Author_AndreyP| unicode:: Andrey U+0020 Pavlenko
|
||||
.. |Author_AlexS| unicode:: Alexander U+0020 Smorkalov
|
||||
.. |Author_BarisD| unicode:: Bar U+0131 U+015F U+0020 Evrim U+0020 Demir U+00F6 z
|
||||
.. |Author_MimmoC| unicode:: Mimmo U+0020 Cosenza
|
||||
.. |Author_BarisD| unicode:: Bar U+0131 U+015F U+0020 Evrim U+0020 Demir U+00F6 z
|
||||
|
||||
@@ -23,7 +23,7 @@ Theory
|
||||
Code
|
||||
====
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/features2D/SURF_descriptor.cpp>`_
|
||||
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/features2D/SURF_descriptor.cpp>`_
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
|
||||
@@ -19,97 +19,10 @@ Theory
|
||||
Code
|
||||
====
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp>`_
|
||||
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp>`_
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/nonfree/nonfree.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
void readme();
|
||||
|
||||
/** @function main */
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
if( argc != 3 )
|
||||
{ readme(); return -1; }
|
||||
|
||||
Mat img_1 = imread( argv[1], CV_LOAD_IMAGE_GRAYSCALE );
|
||||
Mat img_2 = imread( argv[2], CV_LOAD_IMAGE_GRAYSCALE );
|
||||
|
||||
if( !img_1.data || !img_2.data )
|
||||
{ std::cout<< " --(!) Error reading images " << std::endl; return -1; }
|
||||
|
||||
//-- Step 1: Detect the keypoints using SURF Detector
|
||||
int minHessian = 400;
|
||||
|
||||
SurfFeatureDetector detector( minHessian );
|
||||
|
||||
std::vector<KeyPoint> keypoints_1, keypoints_2;
|
||||
|
||||
detector.detect( img_1, keypoints_1 );
|
||||
detector.detect( img_2, keypoints_2 );
|
||||
|
||||
//-- Step 2: Calculate descriptors (feature vectors)
|
||||
SurfDescriptorExtractor extractor;
|
||||
|
||||
Mat descriptors_1, descriptors_2;
|
||||
|
||||
extractor.compute( img_1, keypoints_1, descriptors_1 );
|
||||
extractor.compute( img_2, keypoints_2, descriptors_2 );
|
||||
|
||||
//-- Step 3: Matching descriptor vectors using FLANN matcher
|
||||
FlannBasedMatcher matcher;
|
||||
std::vector< DMatch > matches;
|
||||
matcher.match( descriptors_1, descriptors_2, matches );
|
||||
|
||||
double max_dist = 0; double min_dist = 100;
|
||||
|
||||
//-- Quick calculation of max and min distances between keypoints
|
||||
for( int i = 0; i < descriptors_1.rows; i++ )
|
||||
{ double dist = matches[i].distance;
|
||||
if( dist < min_dist ) min_dist = dist;
|
||||
if( dist > max_dist ) max_dist = dist;
|
||||
}
|
||||
|
||||
printf("-- Max dist : %f \n", max_dist );
|
||||
printf("-- Min dist : %f \n", min_dist );
|
||||
|
||||
//-- Draw only "good" matches (i.e. whose distance is less than 2*min_dist )
|
||||
//-- PS.- radiusMatch can also be used here.
|
||||
std::vector< DMatch > good_matches;
|
||||
|
||||
for( int i = 0; i < descriptors_1.rows; i++ )
|
||||
{ if( matches[i].distance <= 2*min_dist )
|
||||
{ good_matches.push_back( matches[i]); }
|
||||
}
|
||||
|
||||
//-- Draw only "good" matches
|
||||
Mat img_matches;
|
||||
drawMatches( img_1, keypoints_1, img_2, keypoints_2,
|
||||
good_matches, img_matches, Scalar::all(-1), Scalar::all(-1),
|
||||
vector<char>(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS );
|
||||
|
||||
//-- Show detected matches
|
||||
imshow( "Good Matches", img_matches );
|
||||
|
||||
for( int i = 0; i < good_matches.size(); i++ )
|
||||
{ printf( "-- Good Match [%d] Keypoint 1: %d -- Keypoint 2: %d \n", i, good_matches[i].queryIdx, good_matches[i].trainIdx ); }
|
||||
|
||||
waitKey(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @function readme */
|
||||
void readme()
|
||||
{ std::cout << " Usage: ./SURF_FlannMatcher <img1> <img2>" << std::endl; }
|
||||
.. literalinclude:: ../../../../samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp
|
||||
:language: cpp
|
||||
|
||||
Explanation
|
||||
============
|
||||
|
||||
@@ -19,7 +19,7 @@ Theory
|
||||
Code
|
||||
====
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp>`_
|
||||
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp>`_
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Theory
|
||||
Code
|
||||
====
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp>`_
|
||||
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp>`_
|
||||
|
||||
.. literalinclude:: ../../../../../samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp
|
||||
:language: cpp
|
||||
|
||||
@@ -18,7 +18,7 @@ Theory
|
||||
Code
|
||||
====
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp>`_
|
||||
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp>`_
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ How does it work?
|
||||
Code
|
||||
====
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp>`_
|
||||
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp>`_
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ Erosion
|
||||
Code
|
||||
======
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp>`_
|
||||
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp>`_
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ Code
|
||||
* Applies 4 different kinds of filters (explained in Theory) and show the filtered images sequentially
|
||||
|
||||
* **Downloadable code**:
|
||||
Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp>`_
|
||||
Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp>`_
|
||||
|
||||
* **Code at glance:**
|
||||
|
||||
|
||||
@@ -99,9 +99,9 @@ Code
|
||||
|
||||
* **Downloadable code**:
|
||||
|
||||
a. Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp>`_ for the basic version (explained in this tutorial).
|
||||
b. For stuff slightly fancier (using H-S histograms and floodFill to define a mask for the skin area) you can check the `improved demo <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo2.cpp>`_
|
||||
c. ...or you can always check out the classical `camshiftdemo <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/camshiftdemo.cpp>`_ in samples.
|
||||
a. Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp>`_ for the basic version (explained in this tutorial).
|
||||
b. For stuff slightly fancier (using H-S histograms and floodFill to define a mask for the skin area) you can check the `improved demo <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo2.cpp>`_
|
||||
c. ...or you can always check out the classical `camshiftdemo <https://github.com/Itseez/opencv/tree/master/samples/cpp/camshiftdemo.cpp>`_ in samples.
|
||||
|
||||
* **Code at glance:**
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ Code
|
||||
* Plot the three histograms in a window
|
||||
|
||||
* **Downloadable code**:
|
||||
Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp>`_
|
||||
Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp>`_
|
||||
|
||||
* **Code at glance:**
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ Code
|
||||
* Display the numerical matching parameters obtained.
|
||||
|
||||
* **Downloadable code**:
|
||||
Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp>`_
|
||||
Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp>`_
|
||||
|
||||
* **Code at glance:**
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ Code
|
||||
* Display the source and equalized images in a window.
|
||||
|
||||
* **Downloadable code**:
|
||||
Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp>`_
|
||||
Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp>`_
|
||||
|
||||
* **Code at glance:**
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ Code
|
||||
* Draw a rectangle around the area corresponding to the highest match
|
||||
|
||||
* **Downloadable code**:
|
||||
Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp>`_
|
||||
Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp>`_
|
||||
|
||||
* **Code at glance:**
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ Code
|
||||
* Applies the *Canny Detector* and generates a **mask** (bright lines representing the edges on a black background).
|
||||
* Applies the mask obtained on the original image and display it in a window.
|
||||
|
||||
#. The tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp>`_
|
||||
#. The tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp>`_
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ Code
|
||||
The user chooses either option by pressing 'c' (constant) or 'r' (replicate)
|
||||
* The program finishes when the user presses 'ESC'
|
||||
|
||||
#. The tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp>`_
|
||||
#. The tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp>`_
|
||||
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user