1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-24 21:03:03 +04:00

Compare commits

...

1966 Commits

Author SHA1 Message Date
Roman Donchenko fb9a143429 Set status to alpha 2014-08-14 19:17:29 +04:00
Alexander Alekhin 52ac61d87c Merge pull request #3088 from vbystricky:ocl_enableNormEtc 2014-08-14 14:34:40 +00:00
vbystricky 942ff5be57 Disable OpenCL version of minMaxIdx with mask on AMD devices 2014-08-14 17:39:41 +04:00
Vadim Pisarevsky 95a4943762 Merge pull request #3103 from vpisarev:core_imgproc_optim_rearrangements 2014-08-14 13:39:01 +00:00
Vadim Pisarevsky ed8a7fa541 Merge pull request #3101 from akarsakov:ipp_thresh_fix 2014-08-14 11:42:14 +00:00
Vadim Pisarevsky 0e46b4cd03 Merge pull request #3102 from akarsakov:ocl_denoising_fix 2014-08-14 10:59:32 +00:00
Vadim Pisarevsky 75487d43f5 fixed trailing whitespaces 2014-08-14 14:53:02 +04:00
Vadim Pisarevsky 9a5aa4b23c trying to solve compile problems; temporarily disabled some tests for just added optimization algo's 2014-08-14 14:37:30 +04:00
Alexander Alekhin cf4a536440 Merge pull request #3098 from jet47:fix-cuda-compilation 2014-08-14 10:05:49 +00:00
Vadim Pisarevsky 00b2124876 fixing more compile problems with Java bindings etc 2014-08-14 13:48:52 +04:00
Vadim Pisarevsky 4530c7ad08 trying to fix builds 2014-08-14 13:18:04 +04:00
Vadim Pisarevsky f7243be79c Merge pull request #3090 from akarsakov:ocl_reduce_fix 2014-08-14 08:52:18 +00:00
Vadim Pisarevsky 5240a03217 Merge pull request #3100 from vpisarev:disabled_neon_split_merge_on_ios 2014-08-14 08:51:44 +00:00
Vadim Pisarevsky 257463719b removed optim module; moved its functionality to core and photo modules; moved drawing functions from core to imgproc. Removed FilterEngine etc. from public API 2014-08-14 12:50:07 +04:00
vbystricky aab6f6c56f Set sync=true in ocl_minMaxIdx kernel call. For tests 2014-08-14 12:14:56 +04:00
Alexander Karsakov 75ede6e17c Minimal image size is set to 5*5 for OCL path of fastNlMeansDenoising and fastNlMeansDenoisingColored since it breaks tests with test_loop_times=30 and in general doesn't make sense for computation on GPU. 2014-08-14 12:14:33 +04:00
Alexander Karsakov 8760a344ec Fixed incorrect pointer conversion for in-place threshold 2014-08-14 11:02:55 +04:00
Vadim Pisarevsky 6f86c9f118 another mac-related fix, let's squeeze it in this PR too 2014-08-14 10:45:47 +04:00
Vadim Pisarevsky 5d8098a2c3 avoid compiler warnings 2014-08-14 10:06:10 +04:00
VBystricky c5632d412e Change epsilon for NORM_INF_2args accuracy tests 2014-08-13 23:50:32 +04:00
Vadim Pisarevsky a602185fb6 Merge pull request #3097 from mshabunin:gdal-support 2014-08-13 19:26:10 +00:00
Vadim Pisarevsky 5f590ebed0 Merge pull request #3094 from Adil-Ibragimov:minor_fixes_in_Mat-data 2014-08-13 18:28:51 +00:00
Vadim Pisarevsky 71ff228ad3 Merge pull request #3089 from Adil-Ibragimov:fix_cuda_constness 2014-08-13 18:09:42 +00:00
Vadim Pisarevsky a37876ab95 fixed build of iOS framework another time; clang does not like the new NEON-optimized split/merge 2014-08-13 19:59:26 +04:00
Vladislav Vinogradov 9786e0a760 fix cudabgsegm module compilation 2014-08-13 19:20:23 +04:00
vbystricky 1fe403f461 Enable OpenCL version of norm and convertScaleAbs or 32F data
Fix error in minmaxloc.cl
Change test for convertScaleAbs
Fix minMaxIdx for _src2 align
Change epsilon on the tests
2014-08-13 18:33:01 +04:00
mshabunin 3ed89a8879 Merge with master and fix conflicts 2014-08-13 18:24:11 +04:00
Vladislav Vinogradov 8392296eda remove -fvisibility-inlines-hidden from CUDA compiler flags
it generates warning
2014-08-13 18:08:48 +04:00
Vladislav Vinogradov f5d9359da8 use directory-based include_directories command if we build with CUDA 2014-08-13 18:08:08 +04:00
Vladislav Vinogradov 0825120f6a move CUDA compilation step from ocv_glob_module_sources to ocv_add_library 2014-08-13 18:07:31 +04:00
Vadim Pisarevsky 12c69ad490 Merge pull request #3095 from vpisarev:restore_ocl_div_mul_and_repeat 2014-08-13 13:56:19 +00:00
Adil Ibragimov 9ac06a9333 fix for gcc 2014-08-13 16:34:18 +04:00
Vadim Pisarevsky d97f9fc477 now the tests pass with loop_times==30 2014-08-13 16:32:01 +04:00
Adil Ibragimov 8a4a1bb018 Several type of formal refactoring:
1. someMatrix.data -> someMatrix.prt()
2. someMatrix.data + someMatrix.step * lineIndex -> someMatrix.ptr( lineIndex )
3. (SomeType*) someMatrix.data -> someMatrix.ptr<SomeType>()
4. someMatrix.data -> !someMatrix.empty() ( or !someMatrix.data -> someMatrix.empty() ) in logical expressions
2014-08-13 15:21:35 +04:00
Vadim Pisarevsky 30111a786a Merge pull request #3085 from nickdademo:pvapi_fix_decimation_enum 2014-08-13 10:51:46 +00:00
Vadim Pisarevsky 3cd7941098 Merge pull request #3083 from akarsakov:ocl_transpose_check_locmem 2014-08-13 10:50:51 +00:00
Vadim Pisarevsky 01bd4961e3 Merge pull request #3081 from akarsakov:small_fixes 2014-08-13 10:50:33 +00:00
Alexander Karsakov c3100eeb19 Fixed buffer initialization in reduce kernel. Enabled OCL version of reduce for SUM, MAX, MIN modes. 2014-08-13 12:03:06 +04:00
Adil Ibragimov dfd0b297ce datastart must be non-const in CUDA. 2014-08-13 11:11:33 +04:00
Alexander Alekhin 28f3a44e33 Merge pull request #3080 from ElenaGvozdeva:ocl_stich 2014-08-12 16:52:41 +00:00
Alexander Karsakov 713ddb89bd Set minimum matrix size for AmdBlas::gemm to 20 since it works incorrect for small sizes 2014-08-12 18:02:29 +04:00
Vadim Pisarevsky c97c0be4f2 Merge pull request #3082 from ElenaGvozdeva:ocl_morphSmall 2014-08-12 13:56:59 +00:00
Vadim Pisarevsky 5505aa28ce Merge pull request #3078 from vpisarev:refactor_features2d_take3 2014-08-12 13:56:17 +00:00
Nick D'Ademo 91676de638 Change decimation enum values so they can be used in resolution calculations.
BUGFIX: Fixed bugged when setting PVAPI property CV_CAP_PROP_FRAME_HEIGHT.
2014-08-12 15:18:11 +02:00
Alexander Karsakov b4d3b34acf Disabled ippiFilterBoxBorder_* in case maskSize equal roiSize for any dimension 2014-08-12 16:38:11 +04:00
Elena Gvozdeva 1c7ee88b84 fixed test for ocl PlaneWarperTest 2014-08-12 16:37:34 +04:00
Alexander Karsakov 3deea1c3ce Added check required local memory size for non-inplace transpose kernel 2014-08-12 16:26:08 +04:00
Vadim Pisarevsky 5119564579 Merge pull request #3033 from nathanjackson:clahe_datatypes 2014-08-12 10:45:29 +00:00
Vadim Pisarevsky 1629d50999 removed some more trailing whitespaces 2014-08-12 14:33:18 +04:00
Alexander Karsakov 5898dcae4a Added ROUNDING_EPS for identical rounding after dividing on different platforms 2014-08-12 14:28:48 +04:00
Alexander Alekhin da806cc3e7 Merge pull request #3073 from vbystricky:ocl_fixMinMaxLoc 2014-08-12 10:21:41 +00:00
Elena Gvozdeva 8124d10526 fixed Erode and Dilate in case of kernel = Mat() 2014-08-12 12:19:13 +04:00
vbystricky 6fb282aa39 Remove mul24, for CV8UC3 3840x2160 it generates implementation specific result 2014-08-12 11:25:23 +04:00
Alexander Karsakov 10b3d00fd1 Increased epsilon for passing test with IPPICV 2014-08-12 10:42:42 +04:00
Vadim Pisarevsky bca4eb5e00 fixed more doc builder warnings 2014-08-12 10:40:23 +04:00
Alexander Karsakov f3dfdfef8a Fixed warning with "uninitialized local variable" 2014-08-12 10:35:15 +04:00
Nathan Jackson 563200fbf6 CPU (non-OpenCL) CLAHE now supports CV_16UC1. 2014-08-11 18:25:08 -04:00
Vadim Pisarevsky d119afafdb removed the stuff that's now in xfeatures2d; temporarily added dummy definition of SIFT to make doc builder pass (will remove it later) 2014-08-12 00:30:06 +04:00
Vadim Pisarevsky fe7b48aa8f removed the stuff that's now in xfeatures2d; temporarily added dummy definition of SIFT to make doc builder pass (will remove it later) 2014-08-12 00:29:56 +04:00
Vadim Pisarevsky 27d2d3cbac fixed doc builder complains and the test failures 2014-08-12 00:03:40 +04:00
Vadim Pisarevsky 31df47b6ea moved nonfree and a part of features2d to opencv_contrib/xfeatures2d 2014-08-11 23:26:39 +04:00
Vadim Pisarevsky f937f4d951 Merge pull request #3077 from kenlck:master 2014-08-11 16:41:30 +00:00
Vadim Pisarevsky 6df1198e8b Merge pull request #3071 from mshabunin:stitch-fix 2014-08-11 16:08:40 +00:00
Alexander Alekhin 8fd61c9aa6 Merge pull request #3075 from akarsakov:ipp_imgproc_fix 2014-08-11 15:02:53 +00:00
Alexander Alekhin 73115233bb Merge pull request #3074 from ElenaGvozdeva:ocl_lut 2014-08-11 15:01:25 +00:00
Vadim Pisarevsky 8202ab37d8 Merge pull request #3072 from nickdademo:pvapi_decimation_binning 2014-08-11 14:04:38 +00:00
Alexander Alekhin b7d1a70919 Merge pull request #3063 from akarsakov:ocl_warps_check 2014-08-11 13:20:11 +00:00
Low Chin Kian 911e1bd1e4 Allow full range IPv4 support, up to 255.255.255.255
Signed-off-by: Low Chin Kian <kenlck1990@gmail.com>
2014-08-11 21:08:37 +08:00
Elena Gvozdeva b73b28ab9c fix for ocl_lut 2014-08-11 16:21:55 +04:00
vbystricky dfe5fff2f5 Restore OpenCL branch for minmaxLoc on float data 2014-08-11 15:57:29 +04:00
Alexander Karsakov 498da24b8b Disabled some IPP calls of cvtColor since it breaks OCL accuracy tests
with test_loop_times=30
2014-08-11 15:52:53 +04:00
Alexander Karsakov 835b5e2179 Disabled ippiConvert_32f16s_C1R since it breaks OCL accuracy tests of remap with test_loop_times=30. 2014-08-11 15:50:06 +04:00
Alexander Karsakov 6b0e63b652 Enabled IPPMorphReplicate in case BORDER_CONSTANT only for 3x3 kernels. 2014-08-11 15:37:05 +04:00
Nick D'Ademo 2b94bcffb9 Added get and set for additional PVAPI properties: DecimationHorizontal, DecimationVertical, BinningX, BinningY 2014-08-11 13:30:36 +02:00
mshabunin c54b8f9b00 Merge remote-tracking branch 'master' into stitch-fix
* 'master' of github.com:itseez/opencv: (82 commits)
  moved part of video to contrib/{outflow, bgsegm}; moved matlab to contrib
  added some basic functionality needed by the new face module (moved from the old "contrib")
  moved to the new opencv_contrib/face module
  fixed various warnings and obvious errors reported by clang compiler and the coverity tool.
  Fixed review comment from Vadim Pisarevsky
  modified farneback sample to use T-API
  ECC patch by the author (G. Evangelidis); fixed some OCL Farneback optical flow test failures on Mac
  small fix for GaussianBlur ocl test
  fix binary package build
  small fix for ocl_resize
  fix IOS framework
  fixed test ocl_MatchTemplate for sparse matrix
  Fixed typos
  fixing error, wrong template method param.
  fixing Mac build
  some formal changes (generally adding constness)
  Fixed choice of kercn and rowsPerWI for non-Intel device.
  fixed nDiffs for CalcBackProject
  fixed tests for ocl_filter2d, ocl_matchTemplate, ocl_histogram.cpp
  Fixed issue: Mat::copyTo(UMat) if device copy is obsolete. Added test.
  ...

Conflicts:
	modules/core/include/opencv2/core/mat.inl.hpp
2014-08-11 14:50:08 +04:00
Vadim Pisarevsky 07744af790 Merge pull request #3066 from vpisarev:minor_fixes 2014-08-11 10:27:30 +00:00
Vadim Pisarevsky 0f66e2757b Merge pull request #3069 from vpisarev:refactor_video 2014-08-11 08:47:59 +00:00
Vadim Pisarevsky 8368d54d36 Merge pull request #3061 from ElenaGvozdeva:ocl_resize 2014-08-11 06:41:48 +00:00
Vadim Pisarevsky 9ef373f6a5 Merge pull request #3038 from yury-gorbachev:core_arithm_neon 2014-08-10 20:20:04 +00:00
Vadim Pisarevsky d0137b6d2d moved part of video to contrib/{outflow, bgsegm}; moved matlab to contrib 2014-08-10 23:24:16 +04:00
Vadim Pisarevsky 4de4ff5682 Merge pull request #3067 from vpisarev:minor_fixes2 2014-08-10 10:52:57 +00:00
Vadim Pisarevsky 92f326a1b1 Merge pull request #3068 from vpisarev:added_face_module 2014-08-10 10:50:56 +00:00
Vadim Pisarevsky e2f24f43c9 added some basic functionality needed by the new face module (moved from the old "contrib") 2014-08-10 01:54:16 +04:00
Vadim Pisarevsky e49536e88b moved to the new opencv_contrib/face module 2014-08-10 01:52:54 +04:00
Vadim Pisarevsky 05e7c29de5 fixed various warnings and obvious errors reported by clang compiler and the coverity tool. 2014-08-10 00:10:05 +04:00
Yury Gorbachev 9a233999a9 Fixed review comment from Vadim Pisarevsky 2014-08-09 13:37:53 +04:00
Vadim Pisarevsky 09907eeb62 Merge pull request #2639 from kazuki-ma:cv_mat_foreach 2014-08-09 08:25:05 +00:00
Vadim Pisarevsky 68305703bd modified farneback sample to use T-API 2014-08-08 22:45:07 +04:00
Vadim Pisarevsky 0224a20ff6 ECC patch by the author (G. Evangelidis); fixed some OCL Farneback optical flow test failures on Mac 2014-08-08 22:33:40 +04:00
Vadim Pisarevsky 99eed2d885 Merge pull request #3057 from Adil-Ibragimov:adding-constness 2014-08-08 17:27:47 +00:00
Vadim Pisarevsky 72cac5e19f Merge pull request #3065 from alalek:fix_binary_package_build 2014-08-08 17:19:04 +00:00
Vadim Pisarevsky 62f90219fc Merge pull request #3064 from ElenaGvozdeva:ocl_GaussianBlur 2014-08-08 17:16:38 +00:00
Vadim Pisarevsky 74457cd3b5 Merge pull request #3055 from akarsakov:copyto_UMat_fix 2014-08-08 14:20:02 +00:00
Vadim Pisarevsky ce0297ed61 Merge pull request #3050 from ElenaGvozdeva:ocl_fixed_impg 2014-08-08 14:06:49 +00:00
Vadim Pisarevsky 88672f414b Merge pull request #3056 from akarsakov:ocl_setIdentity_fix 2014-08-08 14:03:46 +00:00
Vadim Pisarevsky 951014803b Merge pull request #3060 from akarsakov:ocl_dft_fix 2014-08-08 14:03:27 +00:00
Vadim Pisarevsky 1da3f9d85f Merge pull request #3062 from alalek:fix_ios_framework 2014-08-08 14:01:04 +00:00
Elena Gvozdeva 7cba3ac4f8 small fix for GaussianBlur ocl test 2014-08-08 17:47:57 +04:00
Alexander Alekhin b3a54d588b fix binary package build 2014-08-08 17:24:59 +04:00
Alexander Karsakov 7849c35de1 Changed check condition in tests for warpAffine and warpPerspective 2014-08-08 17:14:38 +04:00
Maksim Shabunin f908c2b0e3 Revert "Avoid obtaining several identical dimensions between two LSH sub-vectors by choosing orthogonal sub-vectors."
This reverts commit e85bacff7b.
2014-08-08 16:59:24 +04:00
Maksim Shabunin 032c363ea0 Revert "Fix a heap issue with static on Windows"
This reverts commit 8e93c19de3.
2014-08-08 16:59:13 +04:00
Maksim Shabunin 0be18aca81 Revert "Allows to choose orthogonal sub-vectors for LSH without using a static table among LshTable instances"
This reverts commit e63d7de87c.
2014-08-08 16:58:35 +04:00
Maksim Shabunin 4c54b287e4 Revert "Fix local variable shadowing"
This reverts commit 2f8b5731da.
2014-08-08 16:55:10 +04:00
Elena Gvozdeva b7899c3d5c small fix for ocl_resize 2014-08-08 16:12:10 +04:00
Alexander Alekhin 03435c0d74 fix IOS framework 2014-08-08 15:57:54 +04:00
Elena Gvozdeva b5f251c815 fixed test ocl_MatchTemplate for sparse matrix 2014-08-08 13:37:18 +04:00
Alexander Karsakov 6ad4521b78 Fixed typos 2014-08-08 13:11:35 +04:00
Alexander Alekhin d0f789dc90 Merge pull request #3044 from akarsakov:fix_ocl_tests 2014-08-07 20:14:17 +00:00
Adil Ibragimov 8dab2ffce7 fixing error, wrong template method param. 2014-08-07 17:43:32 +04:00
Adil Ibragimov 6b05ca589d fixing Mac build 2014-08-07 17:06:22 +04:00
Adil Ibragimov 98d5731ad8 some formal changes (generally adding constness) 2014-08-07 15:49:14 +04:00
Alexander Karsakov c5ad6de596 Fixed choice of kercn and rowsPerWI for non-Intel device. 2014-08-07 15:37:26 +04:00
Elena Gvozdeva 7dd7dd97cd fixed nDiffs for CalcBackProject 2014-08-07 15:36:00 +04:00
Elena Gvozdeva c9b5d8cf4c fixed tests for ocl_filter2d, ocl_matchTemplate, ocl_histogram.cpp 2014-08-07 15:36:00 +04:00
Alexander Karsakov 00221e96fd Fixed issue: Mat::copyTo(UMat) if device copy is obsolete. Added test. 2014-08-07 13:16:02 +04:00
Alexander Karsakov 44fbfb2cf6 Fixed extrapolation in pyrDown 2014-08-07 10:39:25 +04:00
Alexander Karsakov 2a0b39d30a Fixed calculate_histogram kernel 2014-08-07 10:39:24 +04:00
Alexander Karsakov eb9fdb0164 Fixed rounding in remap INTER_LINEAR mode 2014-08-07 10:39:24 +04:00
Alexander Karsakov fec21239c8 Revert optimization for warpAffine INTER_NEAREST mode 2014-08-07 10:39:18 +04:00
Vadim Pisarevsky d30729a816 Merge pull request #3047 from prattmic:python2and3 2014-08-07 06:38:37 +00:00
Vadim Pisarevsky 44f24efad4 Merge pull request #3054 from zillatrooper:master 2014-08-07 06:34:31 +00:00
arc 3d0a270a66 Merge branch 'master' into python2and3 2014-08-07 01:04:26 -04:00
Michael Pratt e9ccadebed Support Python 2 and 3 in test script
Add Python 3 support to the Python test.py script.

The print function is used in place of the print statement.

The urlopen function has been moved to urllib.request in Python 3, so
attempt to import it from either location.

TestCase.assert_() has been deprecated in place of
TestCase.assertTrue().

The tests all pass in both Python 2 and 3.
2014-08-07 00:51:48 -04:00
Michael Pratt 7d41ce23a7 Build Python 3 bindings in subdirectory
Build the Python 3 cv2 module in lib/python3/, to avoid potential naming
conflicts with the Python 2 bindings.

The Python 2 bindings are placed directly in lib/, where they are
required for the Buildbot to successfully execute the Python tests.
2014-08-07 00:21:42 -04:00
Michael Pratt d921cde4d2 Add opencv_matlab to Python ignored modules
Requested by @vpisarev in #3047.
2014-08-07 00:16:49 -04:00
Vadim Pisarevsky 0428ce4703 Merge pull request #3037 from PhilLab:pnpPatch 2014-08-06 20:21:05 +00:00
Björn Wöldecke f3aa4bdf59 fix misinterpretation of empty window name
The documentation states, that a NULL or an empty window name can be used
to refer to the control panel. But the string parameters of the C++ frontend
methods cannot be NULL and converting an empty string to a const char* by
c_str() doesn't produce a NULL pointer, but an empty string. Unfortunately,
the const char* pointer is just passed on to the standard C functions in
the QT backend, which doesn't check for the empty string case.

There are two places where the empty string check could have been introduced:
inside the frontend or inside the backend. As long as the documentation only
mentions this as a special case for the QT backend, the best place seems to
be there.
2014-08-06 19:02:48 +02:00
Vadim Pisarevsky ca183707f2 Merge pull request #3039 from alalek:ocv_world 2014-08-06 14:52:52 +00:00
Vadim Pisarevsky bab5700a09 Merge pull request #3013 from ElenaGvozdeva:ocl_matchTemplate 2014-08-06 11:26:07 +00:00
Vadim Pisarevsky d611684d9e Merge pull request #3041 from adrians:optimize_split 2014-08-06 09:22:38 +00:00
Michael Pratt 9d9411555f Place Python library out in dedicated folder
Place the built Python module library in a dedicated folder inside of
lib/.  This ensures that even if the Python 2 and Python 3 module names
conflict, they will not overwrite one another.
2014-08-06 02:31:30 -04:00
Michael Pratt 976c727eec Fix a few more PYTHON_NUMPY_INCLUDE_PATH
The previous commit fixing references to PYTHON_NUMPY_INCLUDE_PATH
missed a few unset()s.
2014-08-06 02:30:35 -04:00
Michael Pratt 218b12c557 Merge branch 'master' into python2and3 2014-08-06 01:45:07 -04:00
Alexander Alekhin fc0f254f00 make distrib with world (shared libs) 2014-08-05 20:37:18 +04:00
Alexander Alekhin 55188fe991 world fix 2014-08-05 20:12:35 +04:00
Alexander Alekhin d2f1c00719 Merge pull request #3045 from vbystricky:ocl_MeanStdDevFix 2014-08-05 14:52:22 +00:00
Alexander Alekhin 06547120aa Merge pull request #3043 from vbystricky:ocl_ConvertToAccurTestFix 2014-08-05 14:17:06 +00:00
Alexander Alekhin 74d2a6eed1 Merge pull request #3035 from ElenaGvozdeva:ocl_test_fix 2014-08-05 14:16:16 +00:00
vbystricky 774d277c1f Fix error in OpenCl version of meanstddev for continues src and not continues mask 2014-08-05 17:30:06 +04:00
vbystricky 2637b18b67 Fix epsilon for OpenCL function ConverTo, for convertation from float to integer types 2014-08-05 16:34:23 +04:00
Elena Gvozdeva 7999fbf765 fixed ocl_integral 2014-08-05 12:01:28 +04:00
Elena Gvozdeva f32b52ea8d fixed test for CvtColor RGB -> Luv 2014-08-05 11:54:26 +04:00
Elena Gvozdeva 8c2c3b54d9 fixed ocl tests for BlendLinear, BoxFilter, Integral 2014-08-05 11:41:08 +04:00
Adrian Stratulat b2acd1f75a Vectorize split & merge for NEON 2014-08-05 06:51:36 +00:00
Vadim Pisarevsky a05ce00a65 Merge pull request #2879 from alalek:ocl_runtime_flags 2014-08-04 16:43:01 +00:00
Vadim Pisarevsky a58767eff8 Merge pull request #3036 from vbystricky:ocl_NormAccurTestFix 2014-08-04 14:54:12 +00:00
Vadim Pisarevsky 432b7cb235 Merge pull request #3032 from vpisarev:refactor_ml2 2014-08-04 14:51:38 +00:00
Yury Gorbachev 61423a2d47 ARM NEON accelerated implementation of cv::addWeighted, cv::inRange and cv::compare functions.
NOT verified on target platform, compilation passes with and without NEON.
2014-08-04 16:44:51 +04:00
unknown 3fe4980ce1 Double precision for solvePnPRansac() 2014-08-04 14:20:32 +02:00
vbystricky 2d587ad691 Prevent generating test case with mask filled 0 only 2014-08-04 15:12:36 +04:00
Vadim Pisarevsky cb9b88e65b fixed more compile warnings on Windows 2014-08-04 14:22:31 +04:00
Vadim Pisarevsky dbedc63c55 Merge pull request #3034 from jet47:fix-compilation 2014-08-04 09:38:34 +00:00
Vladislav Vinogradov a3da3a01e1 fix test_opencv_imgproc compilation 2014-08-04 12:13:33 +04:00
Vladislav Vinogradov cdb7b83741 fix python module compilation with enabled CUDA support:
filterout all CUDA related headers from python module include headers
2014-08-04 12:12:51 +04:00
Alexander Alekhin add9ce46c3 Merge pull request #3030 from vbystricky:ocl_DotReduceAccurTestFix 2014-08-04 08:09:38 +00:00
Vadim Pisarevsky 222f8a3d5e hopefully fixed test failure on Linux 2014-08-04 01:16:45 +04:00
Vadim Pisarevsky 24b01a8e4f continuing to debug boost and fix MSVC compile errors 2014-08-03 21:21:11 +04:00
Vadim Pisarevsky 98a1181240 fixed the condition 2014-08-03 13:15:43 +04:00
Vadim Pisarevsky 79b593d8d8 more fixes and more debugging code 2014-08-03 13:08:03 +04:00
Vadim Pisarevsky eeb786fcfd fixed compile warnings from MSVC; fixed warnings in Python bindings; added some debugging code 2014-08-03 12:46:28 +04:00
Vadim Pisarevsky 9cb79b9abb temporarily disabled java bindings for ml; hopefully fixed warnings etc. 2014-08-03 04:28:31 +04:00
Vadim Pisarevsky 8e9d1d9fe6 temporarily disabled java bindings for ml; hopefully fixed warnings etc. 2014-08-03 04:28:20 +04:00
Vadim Pisarevsky 2520e335d1 removed many extra whitespaces; fixed 1 warning 2014-08-03 03:08:25 +04:00
Vadim Pisarevsky 28ca6ac05e fixed building html docs 2014-08-03 02:34:47 +04:00
Vadim Pisarevsky d3cdfefa03 Merge pull request #3027 from vbystricky:cvtColorLuv2RGB 2014-08-02 21:52:24 +00:00
Vadim Pisarevsky c6593d02a6 updated docs 2014-08-03 01:41:30 +04:00
Vadim Pisarevsky c20ff6ce19 made everything compile and even run somehow 2014-08-03 01:41:09 +04:00
VBystricky 2026094691 Increase epsilon for OpenCL version UMatDot and ReduceAvg accurency tests 2014-08-02 13:21:34 +04:00
Alexander Alekhin c595457ea0 Merge pull request #3011 from vbystricky:oclopt_morthosmall 2014-08-01 17:21:59 +00:00
Alexander Alekhin 11dd36f3aa Merge pull request #3028 from vbystricky:ocl_MergeAccurTestFix 2014-08-01 17:15:53 +00:00
Alexander Alekhin b33a093844 Merge pull request #3029 from vbystricky:ocl_UMatOpAccurTestFix 2014-08-01 17:15:38 +00:00
Roman Donchenko 74e58ddbb1 Disable the broken fisheye undistortImage test 2014-08-01 19:50:17 +04:00
VBystricky 0f9b79ef64 Change min-max to clamp 2014-08-01 19:45:11 +04:00
vbystricky aad4104297 Fix accurency test for OpenCL matrix operations 2014-08-01 18:30:20 +04:00
vbystricky 184c5917bf Fix accurency test of OpenCL merge function. 2014-08-01 17:53:24 +04:00
Vadim Pisarevsky 936536a284 Merge pull request #2671 from syilma:HomographyDecomp 2014-08-01 13:08:20 +00:00
Vadim Pisarevsky d01ca30f55 Merge pull request #3018 from fradelg:master 2014-08-01 13:06:36 +00:00
vbystricky b724208510 Fix Luv2RGB function 2014-08-01 16:39:12 +04:00
Roman Donchenko 983e75e5de Merge remote-tracking branch 'origin/master' into merge-2.4 2014-08-01 15:01:41 +04:00
Vadim Pisarevsky 345b69d5f7 Merge pull request #3024 from jet47:fix-cudabgsegm-compilation 2014-08-01 09:42:40 +00:00
Vadim Pisarevsky 05164bf713 Merge pull request #2608 from Siddharthk:master 2014-08-01 09:13:32 +00:00
Alexander Alekhin b3e31fb8d6 Merge pull request #3023 from vbystricky:ocl_minMaxLoc 2014-08-01 08:57:37 +00:00
Fco. Javier Delgado del Hoyo 625fd61313 Removed OpticalFlowBM test from cudaoptflow module 2014-08-01 09:28:19 +02:00
Vadim Pisarevsky 18de8dee62 Merge pull request #3009 from vpisarev:ios_experiments 2014-07-31 18:20:07 +00:00
Alexander Alekhin f8aecb2a32 Merge pull request #3002 from vbystricky:oclopt_pyrdown 2014-07-31 15:43:18 +00:00
vbystricky b48e487d53 Enable ocl version of minmaxloc with mask 2014-07-31 19:12:10 +04:00
vbystricky 11a0e3ff78 Fix error in OCL minmaxloc 2014-07-31 19:04:38 +04:00
Alexander Alekhin 17a6b8cdc0 Merge pull request #3021 from ElenaGvozdeva:ocl_flip 2014-07-31 13:56:44 +00:00
Vladislav Vinogradov 7030a1f9a2 fix cudabgsegm module compilation 2014-07-31 17:55:59 +04:00
Elena Gvozdeva 9db8592aa8 fixed ocl_flip for cn==3 2014-07-31 16:57:47 +04:00
Vadim Pisarevsky 2f2a9ad536 Merge pull request #3020 from vpisarev:ocl_disable_more_funcs 2014-07-31 12:54:13 +00:00
Vadim Pisarevsky b0cd822924 trying to make the tests pass 2014-07-31 14:24:21 +04:00
Vadim Pisarevsky 10b60f8d16 continuing refactoring ml samples; added "max vote" response to ANN_MLP. Probably, should make it in less hacky way 2014-07-31 14:12:10 +04:00
Michael Pratt 52df3b232d Reference PYTHON_NUMPY_INCLUDE_DIRS not PYTHON_NUMPY_INCLUDE_PATH
PYTHON_NUMPY_INCLUDE_PATH was a typo, it should have been
PYTHON_NUMPY_INCLUDE_DIRS.
2014-07-31 03:27:06 -04:00
Fco. Javier Delgado del Hoyo fd10557e78 Removed cvCalcOpticalFlowBM from cudaoptflow test 2014-07-31 09:21:44 +02:00
Fco. Javier Delgado del Hoyo 8def44047a Removed cvCalcOpticalFlowBM from performance test 2014-07-31 09:08:29 +02:00
Michael Pratt c9876c3cd8 Merge branch 'master' into python2and3 2014-07-31 01:13:16 -04:00
Samson Yilma 4fe04775d1 Merge remote-tracking branch 'upstream/master' into HomographyDecomp 2014-07-30 20:36:41 -04:00
Samson Yilma 3b608fa489 added comment. 2014-07-30 19:32:37 -04:00
Samson Yilma 3c5eb7de84 updated documentation for decomposeHomography 2014-07-30 18:53:33 -04:00
Vadim Pisarevsky 223cdcd0ee fixed compilation of some samples; fixed ANN_MLP::predict 2014-07-30 22:53:46 +04:00
Vadim Pisarevsky 1a1097ab23 Merge pull request #2983 from wnoise:shrink-global-cuda-usage 2014-07-30 15:55:02 +00:00
Vadim Pisarevsky ef8647fe30 put IPP ReduceSum_32f back 2014-07-30 19:12:11 +04:00
Vadim Pisarevsky 2ab7fb6051 Merge pull request #3017 from f-morozov:akaze 2014-07-30 15:03:47 +00:00
Vadim Pisarevsky 5267ed46c7 1. disabled OpenCL acceleration for cv::multiply() (CV_32F), cv::divide (CV_32F), cv::convertScaleAbs (CV_32F) and cv::reduce (SUM, CV_32F), cv::reduce (MIN & MAX), cv::flip (3-channel case).
2. changed the number of test loops from 1 to 30 (except for cv::pow() test, which fails for yet unknown reason)
3. disabled IPP acceleration for 3-channel norms.
4. modified relativeNorm test function to handle very small values
2014-07-30 18:19:47 +04:00
f-morozov 7f82960897 AKAZE fixes, tests and tutorial 2014-07-30 18:02:08 +04:00
Vadim Pisarevsky a782ee93de Merge pull request #2992 from snikulov:upmerge_jpeg_tweak 2014-07-30 12:48:41 +00:00
Vadim Pisarevsky e368f17caf fixed python bindings generation 2014-07-30 16:11:08 +04:00
Elena Gvozdeva 90ac88cb8e use std::min,max 2014-07-30 14:28:02 +04:00
vbystricky bd8894002e Fix some problems 2014-07-30 11:56:28 +04:00
Fco. Javier Delgado del Hoyo d3d0434f07 Removed opencv_legacy dependency from cudaoptflow 2014-07-30 09:00:23 +02:00
vbystricky 878dec65c8 Optimize OpenCL version of morfology and box filters for small filter kernels 2014-07-30 10:32:52 +04:00
Sergei Nikulov eaec132091 #2992: update after review 2014-07-30 00:03:41 +04:00
Vadim Pisarevsky ba3783d205 initial commit; ml has been refactored; it compiles and the tests run well; some other modules, apps and samples do not compile; to be fixed 2014-07-29 23:54:23 +04:00
Vadim Pisarevsky dce1824a91 Merge pull request #2940 from davembradley:master 2014-07-29 17:22:30 +00:00
Vadim Pisarevsky cf2a307832 Merge pull request #2991 from kovand11:calibrateDebevecFix 2014-07-29 16:58:32 +00:00
Andrey Pavlenko 4c8a9c5d70 Merge pull request #3012 from vpisarev:clean_objdetect 2014-07-29 15:29:35 +00:00
Vadim Pisarevsky 101769d26c eliminated some unnecessary instructions 2014-07-29 18:10:18 +04:00
Vadim Pisarevsky a1791c6be3 Merge pull request #3016 from fradelg:master 2014-07-29 13:50:35 +00:00
Fco. Javier Delgado del Hoyo b8bc99676d Another typo in comment inside OpenNI2 cmake file 2014-07-29 11:13:00 +02:00
Fco. Javier Delgado del Hoyo 6e4562bb56 Fixed typo in OpenNI2 cmake file 2014-07-29 11:10:58 +02:00
Elena Gvozdeva dbb5993d13 added dft for all platforms 2014-07-29 12:21:52 +04:00
Elena Gvozdeva dc3c691c8c new block size for dft 2014-07-29 12:06:20 +04:00
Elena Gvozdeva e7216a5987 Used float instead of int for CV_8U in sumTemplate 2014-07-29 11:34:39 +04:00
Vadim Pisarevsky 277802483f Merge pull request #2987 from anishp:master 2014-07-28 21:15:39 +00:00
Vadim Pisarevsky e9bed17d98 Merge pull request #3008 from jet47:fix-cudacodec-dependecies 2014-07-28 21:13:59 +00:00
siddharth 4cdc155eac test 2014-07-29 00:15:11 +05:30
siddharth 0972a2d758 Fixed mixed cloning bug 2014-07-29 00:15:11 +05:30
siddharth 88d05a89d4 removed build error
Whitespaces removed
2014-07-29 00:15:11 +05:30
siddharth 14d0b763ec changed demo tutorial path 2014-07-29 00:15:11 +05:30
siddharth 1a14d8506d recursive filter output corrected 2014-07-29 00:15:11 +05:30
siddharth 14631be59f Updated Documentation 2014-07-29 00:15:11 +05:30
Vadim Pisarevsky 41df63aacd Merge pull request #3010 from vpisarev:ocl_disable_some_norms2 2014-07-28 17:24:42 +00:00
Vadim Pisarevsky a587759d76 Merge pull request #2989 from smvv:gstreamer_capture_init 2014-07-28 16:00:33 +00:00
Vadim Pisarevsky 962b519708 Merge pull request #2996 from akarsakov:ocl_dft_new_concept 2014-07-28 15:59:59 +00:00
Vadim Pisarevsky 0c749fd7e5 Merge pull request #2998 from ernest-galbrun:cuda_concurrency 2014-07-28 15:59:43 +00:00
Vadim Pisarevsky af83884dc7 disabled ocl_minmaxloc on 32-bit data completely 2014-07-28 19:35:06 +04:00
Vadim Pisarevsky 1925fab427 disabled some more stuff 2014-07-28 19:32:06 +04:00
Vadim Pisarevsky 11e9e375a3 fixed compile warning with GCC 2014-07-28 19:23:46 +04:00
Vadim Pisarevsky 2fd01dcced fixed doc builder warnings 2014-07-28 17:18:28 +04:00
Vadim Pisarevsky 97f6dd1820 trying to make OpenCL builder green 2014-07-28 17:16:02 +04:00
Vadim Pisarevsky 1ad9827fc4 removed ERFilter (to be moved to opencv_contrib/modules/text) and lineMOD (to be moved to opencv_contrib/modules/rgbd) 2014-07-28 16:48:53 +04:00
Vadim Pisarevsky 00263dd664 Merge pull request #2179 from adishavit:feature-SupportClipboardCopyOnWindows 2014-07-28 11:52:27 +00:00
Vadim Pisarevsky f42bb0bd65 disable OpenCL difference norms with mask, since some of the tests fail 2014-07-28 15:45:54 +04:00
Vadim Pisarevsky 4255746c00 fixed compile warnings and removed extra whitespaces 2014-07-28 15:20:25 +04:00
Vadim Pisarevsky 1310dc4ca2 Merge pull request #2994 from znah:py_hpp_glob 2014-07-28 11:15:21 +00:00
Vadim Pisarevsky 50a1def80b Merge pull request #3006 from smvv:fix_findContours_for_python2 2014-07-28 11:13:45 +00:00
Vadim Pisarevsky cb492cc24d Merge pull request #3007 from kobigurk:master 2014-07-28 11:12:14 +00:00
Vadim Pisarevsky ef0f010437 Merge pull request #3003 from ElenaGvozdeva:ocl_sum 2014-07-28 11:08:08 +00:00
Vadim Pisarevsky 4dfb613c3e optimized Bayer=>RGB/RGBA/Gray conversion using Neon intrinsics. Fixed recently introduced build error in iOS framework. 2014-07-28 14:54:41 +04:00
Alexander Karsakov fecfaf4092 Using std::map in PlanCache 2014-07-28 14:19:47 +04:00
Elena Gvozdeva 27d97aa231 fixed 2014-07-28 12:21:00 +04:00
Vladislav Vinogradov ba706177cb fix cudacodec module dependecies 2014-07-28 12:13:52 +04:00
Alexander Mordvintsev 586ace1873 double to float cast warning fix 2014-07-27 18:25:42 +04:00
Kobi Gurkan 6cac76bfe4 fixes tab indentation - replacing with 4 spaces 2014-07-27 17:14:54 +03:00
Kobi Gurkan fc8f0e341b adding support for 16-bit 4 channel tiffs
- when IMREAD_UNCHANGED is set in flags, the tiff is read with 4 channels
- adding test for read/write
2014-07-27 17:09:05 +03:00
Alexander Mordvintsev 5f47f70183 module blacklist 2014-07-27 18:03:27 +04:00
Alexander Mordvintsev a2ae1db31c 'adas' extra module doesn't produce .lib on windows (causes link error) 2014-07-27 17:41:12 +04:00
Alexander Mordvintsev 9ab3b89c53 pass header list to gen2.py by a text file (avoid command line length limit on windows) 2014-07-27 17:17:36 +04:00
Alexander Mordvintsev 42ecfc5538 fixed parsing enums with tailing comma
gen2.py reports headers it processes
cmake file restructured
2014-07-27 17:17:35 +04:00
Alexander Mordvintsev 964657a155 glob for python module dependences 2014-07-27 17:17:35 +04:00
Alexander Mordvintsev 1d1bfd3d7d automatic search for headers for python wrapper generation 2014-07-27 17:17:35 +04:00
Sander Mathijs van Veen d25770ee76 Fix Python 2 bindings for findContours
The sanity check prevents Python 2 from calling findContours, because the
Python 2 bindings pass an empty matrix for `_contours`. If `_contours` is not
empty, the channel and depth check should determine whether the matrix is of
the correct type and size.

Note: the Python 2 bindings passes a matrix of type `STD_VECTOR_MAT` to
parameters of the type `OutputArrayOfArrays`.
2014-07-26 16:40:09 +02:00
Vadim Pisarevsky 7da0e37ba8 Merge pull request #2999 from jpuigcerver:traincascade_choose_threads 2014-07-25 13:24:47 +00:00
Vadim Pisarevsky ee90b88dd7 Merge pull request #2720 from pglotov:master 2014-07-25 12:54:22 +00:00
Vadim Pisarevsky 8e80f9b7a8 Merge pull request #1292 from adrians:neon-pull 2014-07-25 12:29:49 +00:00
Vadim Pisarevsky 603030b005 Merge pull request #2993 from vbystricky:oclopt_warp_affine 2014-07-25 11:26:24 +00:00
Elena Gvozdeva fe29af2e58 Fixed bug in reduce.cl 2014-07-25 14:51:30 +04:00
vbystricky e49d148d47 Optimize ocl function pyrDown 2014-07-25 13:39:19 +04:00
Alexander Karsakov 37d01e2d27 Added license header, using cv::Ptr, small fixes. 2014-07-25 13:27:00 +04:00
Adrian Stratulat a98ce86ca3 Add NEON intrinsics to core/src/arithm.cpp 2014-07-24 19:45:32 +00:00
Andrey Pavlenko 1f0ca00d75 Merge pull request #3000 from akarsakov:ocl_dft_new_tests 2014-07-24 13:30:16 +00:00
Alexander Karsakov e51c0810b6 Added accuracy and performance tests for DFT all modes. 2014-07-24 15:17:31 +04:00
Alexander Karsakov 66ac46214d Final refactoring, fixes 2014-07-24 13:23:02 +04:00
Joan Puigcerver 16a82b1747 Added an option to traincascade program to select the maximum number of threads to use during training 2014-07-23 22:47:51 +02:00
Sander Mathijs van Veen facb2f9a81 Reset class members to NULL after gst_*_unref() 2014-07-23 19:15:16 +02:00
Sander Mathijs van Veen f8442da945 Initialize all pointers of CvCapture_GStreamer correctly 2014-07-23 14:41:17 +02:00
Ernest Galbrun 551ab83cf2 trailing whitespace 2014-07-23 14:34:22 +02:00
Ernest Galbrun d7038423dd Merge branch 'master' of https://github.com/Itseez/opencv 2014-07-23 14:21:45 +02:00
Ernest Galbrun 6a769c92b3 modified default stream initialization to allow concurrent calls modified cuda surf.cuda.cpp to allow concurrent call 2014-07-23 14:21:21 +02:00
Vadim Pisarevsky da1ac35930 Merge pull request #2990 from vbystricky:highgui_split2 2014-07-23 11:27:25 +00:00
Vadim Pisarevsky 7bd7c85b1d Merge pull request #2919 from larshg:Openni2Support 2014-07-23 11:23:48 +00:00
Alexander Alekhin 58cf2a8f19 Merge pull request #2995 from ElenaGvozdeva:ipp_DFT 2014-07-23 10:50:43 +00:00
Elena Gvozdeva 4fdd6de8e8 Fixed ippiDFT call 2014-07-23 13:39:31 +04:00
Alexander Karsakov 1d2cf0e20e Added nonzero_rows support 2014-07-22 18:31:08 +04:00
Alexander Karsakov 52f76a3283 Added rest Elena's changes 2014-07-22 18:31:08 +04:00
Alexander Karsakov 7791264525 Added multi-block scheme 2014-07-22 18:31:03 +04:00
Alexander Karsakov 2b9e556055 Added Elena's changes with implemented DFT_INVERSE C2C mode. 2014-07-22 18:27:31 +04:00
Alexander Karsakov b17bf031f6 Added DFT_SCALE for forward transforms 2014-07-22 18:27:31 +04:00
Alexander Karsakov 6c8b6bd0c7 Added packing to CCS format 2014-07-22 18:27:25 +04:00
Alexander Karsakov ed07241f89 Completed all forward transforms. 2014-07-22 18:27:17 +04:00
Alexander Karsakov e5a3ab3cb9 Added fftplan cache 2014-07-22 18:27:08 +04:00
Alexander Karsakov 0318d27720 Enabled precalculated wave 2014-07-22 18:26:58 +04:00
Alexander Karsakov 5dd9263848 Multi-radix with kernel generation 2014-07-22 18:25:59 +04:00
Alexander Alekhin 63a8cb594a Merge pull request #2961 from ilya-lavrenov:tapi_corners 2014-07-22 09:38:11 +00:00
vbystricky 716218cac4 Optimize ocl version of warp_affine 2014-07-22 13:22:40 +04:00
András Kovács d1c7983fe5 calibrateDebevec index fix (issue 3664) 2014-07-21 17:27:03 +02:00
Sergey Nikulov 9d107fb2d5 fixed test compilation 2014-07-21 19:26:26 +04:00
Sergey Nikulov bd144cfa64 upmerged pull req #2974 to master - added more jpeg options to imgcodecs 2014-07-21 18:56:35 +04:00
vbystricky fd51c133df Add depends from highgui to imgcodecs and videoio. And include header from imgcodecs and videoio to imgcodecs 2014-07-21 15:10:41 +04:00
Alexander Alekhin 9e3124a1c9 Merge pull request #2960 from ilya-lavrenov:tapi_perf_fix 2014-07-21 09:10:24 +00:00
Alexander Alekhin 315c80f793 Merge pull request #2986 from vbystricky:videoio_fix 2014-07-21 08:21:18 +00:00
Anish Pednekar d2493393db added macro guard to enable overriding ENABLE_LOG 2014-07-20 21:06:37 +05:30
VBystricky cc703b01df Fix build errors with cap_v4l on Linux 2014-07-20 18:27:14 +04:00
Lars Glud 1242a66119 Openni2 support 2014-07-20 15:04:11 +02:00
Lars Glud 4dcd37f699 Merge remote-tracking branch 'origin/master' into Openni2Support
Conflicts:
	modules/highgui/CMakeLists.txt
	modules/highgui/include/opencv2/highgui.hpp
	modules/highgui/include/opencv2/highgui/highgui_c.h
2014-07-20 14:28:10 +02:00
Vadim Pisarevsky 9a58b1a3a0 Merge pull request #2925 from BloodAxe:osx-framework-script 2014-07-19 18:04:15 +00:00
Vadim Pisarevsky a7006ac21c Merge pull request #2979 from PhilLab:patch-2 2014-07-18 09:58:07 +00:00
Vadim Pisarevsky 17d69be902 Merge pull request #2933 from ilya-lavrenov:sse_moments 2014-07-18 09:25:22 +00:00
PhilLab e82241cba5 Function for drawing arrows
Porting the [PR 2970](https://github.com/Itseez/opencv/pull/2970) To the new InputOutputArray type
2014-07-18 10:04:44 +02:00
Aaron Denney 4644689d5a And remove final vestiges. 2014-07-17 09:43:21 -07:00
Aaron Denney 85601e03dd remove constant memory use in compute_data_cost 2014-07-17 09:43:21 -07:00
Aaron Denney 52516085d9 remove constant memory from init_data_cost 2014-07-17 09:43:21 -07:00
Aaron Denney 1ff270e41c init_message no longer uses constant memory. 2014-07-17 09:43:21 -07:00
Aaron Denney 9b8002cd43 remove use of constant memory in calc_all_iterations/compute_message/message_per_pixel 2014-07-17 09:43:21 -07:00
Aaron Denney b792419cde Remove compute_disp()'s use of constant memory. 2014-07-17 09:43:21 -07:00
Aaron Denney 6d86d63ac5 Last of csbp load_constants() gone. 2014-07-17 09:43:21 -07:00
Aaron Denney 9bc71f4cb6 Deconstify minimum disparity. 2014-07-17 09:43:21 -07:00
Aaron Denney eed5cbc5db More constant removal. 2014-07-17 09:43:21 -07:00
Aaron Denney 3ab117df04 Change struct with single static function to function. 2014-07-17 09:43:20 -07:00
Aaron Denney 021b0cb4d5 Pass max_disc_term as kernel parameter. 2014-07-17 09:43:20 -07:00
Aaron Denney 0e2ea45c93 ndisp no longer constant 2014-07-17 09:43:20 -07:00
Aaron Denney 2832cfdfe5 No longer use constant memory for image step. 2014-07-17 09:43:20 -07:00
Aaron Denney d8d946a458 Constify cuda csbp 2014-07-17 09:43:20 -07:00
Aaron Denney 2982e77495 Pass in images and scratch space so that multiple copies can run concurrently. 2014-07-17 09:43:20 -07:00
Aaron Denney fe29ed461c Move shared interface to header file rather than repeating. 2014-07-17 09:43:20 -07:00
Aaron Denney e532bd50d5 Move shared interface to header file rather than repeating. 2014-07-17 09:43:20 -07:00
Aaron Denney 1533d0448f cdata_weight always positive; fewer multiplications. 2014-07-17 09:43:20 -07:00
Aaron Denney d848704b35 cuda::DisparityBilateralFilter no longer uses constant memory for parameters
Now multiple filters can be used in the same context without stepping on each other.
2014-07-17 09:43:20 -07:00
Vadim Pisarevsky 8f8450793a Merge pull request #2964 from vbystricky:highgui_split 2014-07-16 19:29:36 +00:00
Lars Glud 8b32235854 Openni2 support 2014-07-16 12:37:53 +02:00
Petr Glotov 7a77cf584a added timelapse 2014-07-15 09:32:47 -07:00
Vadim Pisarevsky dbefbbc522 Merge pull request #2910 from ilya-lavrenov:sse2_canny 2014-07-15 09:46:28 +00:00
Vadim Pisarevsky 40370345c5 Merge pull request #2765 from pradeep-pyro:kullback_leibler 2014-07-15 08:57:31 +00:00
Vadim Pisarevsky b1793e2fb9 Merge pull request #2939 from adishavit:sample-fix_stitching_pipeline 2014-07-15 08:09:04 +00:00
pradeep 7171431e7c Changed cv::log to std::log 2014-07-15 12:32:53 +08:00
VBystricky ca307669d4 Refresh code. Fix merge conflict 2014-07-14 23:30:50 +04:00
Vadim Pisarevsky b63a7e66db Merge pull request #2953 from gongzg:master 2014-07-14 19:21:15 +00:00
vbystricky d58f736935 Split highgui module to videoio and highgui 2014-07-14 23:16:47 +04:00
Vadim Pisarevsky f773cd9a3e Merge pull request #2947 from vbystricky:capDShow 2014-07-14 18:53:25 +00:00
Alexander Alekhin 381986d044 Merge pull request #2882 from akarsakov:ocl_pyrDown_opt 2014-07-14 18:48:28 +00:00
Roman Donchenko 3490a5aded Merge pull request #2962 from alalek:fix_v4l_build 2014-07-14 08:20:54 +00:00
Alexander Alekhin e169083fed Merge pull request #2918 from vbystricky:oclopt_reduce2 2014-07-12 05:00:57 +00:00
Alexander Alekhin df74a266cf Merge pull request #2963 from ilya-lavrenov:tapi_bufferpool 2014-07-11 14:55:13 +00:00
Alexander Alekhin 0876ec7a67 Merge pull request #2935 from vbystricky:oclopt_meanStdDev 2014-07-11 14:53:46 +00:00
Marvin Smith 67e23ed972 Fixing double to uchar conversion warning. 2014-07-11 07:33:42 -07:00
Alexander Alekhin cbf63b0709 Merge pull request #2851 from ilya-lavrenov:tapi_set_identity 2014-07-11 10:00:16 +00:00
Alexander Alekhin 910d8f8e0b Merge pull request #2888 from ilya-lavrenov:tapi_remap 2014-07-11 09:59:27 +00:00
Ilya Lavrenov f2a2467de3 enabled BufferPool 2014-07-11 12:21:10 +04:00
Alexander Alekhin 6dd3244019 fix build 2014-07-10 18:08:38 +04:00
Ilya Lavrenov fee3d6931b corners 2014-07-10 17:17:24 +04:00
Ilya Lavrenov c949845a6b fixed perf test 2014-07-10 16:03:31 +04:00
Alexander Alekhin a0816c6d15 Merge pull request #2927 from ilya-lavrenov:tapi_lut 2014-07-10 09:38:37 +00:00
Vadim Pisarevsky 347eaa8685 Merge pull request #2943 from vbystricky:highgui_imgcodecs 2014-07-10 05:28:44 +00:00
Zhigang Gong 2e49ca4903 Avoid unmap an umat(ocl) which hasn't been mapped at all.
According to opencl 1.2 spec 5.4.2:
  enqueues a command to unmap a previously mapped region of a memory object.
  ...
  CL_INVALID_VALUE if mapped_ptr is not a valid pointer returned by
  clEnqueueMapBuffer, or clEnqueueMapImage for memobj.

So if the u->data is not from a clEnqueueMapBuffer call, we should not
call clEnqueueUnmapMemObject() unmap it. With this patch, the cases
./opencv_test_video --gtest_filter=OCL_Video/FarnebackOpticalFlow.Mat/*
could work well with beignet 0.9.1, Otherwise, it will get a
CL_INVALID_VALUE at the clEnqueueUnmapMemObject().

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-07-09 16:21:20 +08:00
pradeep 0d49f97128 Fixed truncation warning 2014-07-09 15:29:47 +08:00
pradeep f8b23cff18 Fixed test errors, added support for C data types. 2014-07-09 13:39:40 +08:00
Alexander Alekhin 0f1a0a9818 Merge pull request #2951 from ilya-lavrenov:tapi_ipp_filter2d 2014-07-08 15:21:35 +00:00
Ilya Lavrenov e8f5c2fcf6 OpenCL before IPP 2014-07-08 18:51:27 +04:00
Roman Donchenko a3bde36c84 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/calib3d/include/opencv2/calib3d/calib3d.hpp
	modules/contrib/doc/facerec/facerec_api.rst
	modules/contrib/include/opencv2/contrib/contrib.hpp
	modules/contrib/src/facerec.cpp
	modules/core/include/opencv2/core/mat.hpp
	modules/features2d/include/opencv2/features2d/features2d.hpp
	modules/highgui/src/loadsave.cpp
	modules/imgproc/src/pyramids.cpp
	modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime.hpp
	modules/python/src2/gen.py
	modules/python/test/test.py
	modules/superres/test/test_superres.cpp
	samples/cpp/facerec_demo.cpp
2014-07-08 14:33:56 +04:00
vbystricky 7fe7facfee Remove unused variable 2014-07-08 13:29:28 +04:00
vbystricky eb8366bb0a DShow camera as IVideoCapture object 2014-07-08 12:28:34 +04:00
Alexander Alekhin e79ceb4b45 Merge pull request #2936 from ilya-lavrenov:tapi_minmaxloc_opt 2014-07-08 07:30:49 +00:00
Vadim Pisarevsky d05d235c01 Merge pull request #2669 from Adil-Ibragimov:flann_distance_fix 2014-07-07 13:35:09 +00:00
vbystricky 4286f60387 Extract imgcodecs module from highgui 2014-07-07 16:28:08 +04:00
Vadim Pisarevsky e1553d5da3 Merge pull request #2929 from ilya-lavrenov:sse_pow 2014-07-07 11:22:26 +00:00
Vadim Pisarevsky b2ab1b758a Merge pull request #2937 from ilya-lavrenov:sse_patch_nans 2014-07-07 11:20:30 +00:00
Vadim Pisarevsky 41dcd0ac03 Merge pull request #2941 from ilya-lavrenov:sse_inrange 2014-07-07 11:19:54 +00:00
Alexander Alekhin 7d9f79b130 Merge pull request #2944 from bkueng:fix_compiler_error 2014-07-07 11:18:31 +00:00
Beat Küng 90dce84314 imgproc: fix compiler error for gcc 4.8
this bug was introduced in a73809e6.
2014-07-05 09:27:11 +02:00
Ilya Lavrenov e2b86974ae SSE2 optimization of cv::patchNaNs 2014-07-04 10:27:44 +04:00
Ilya Lavrenov e04c39b089 SSE2 optimization of cv::inRange 2014-07-04 10:11:18 +04:00
Adi Shavit b449bd5150 Clarified code. 2014-07-03 22:45:11 +03:00
Adi Shavit e25dca21d1 Fixed indentation. 2014-07-03 22:29:45 +03:00
Adi Shavit d44e3c369d Added documentation. 2014-07-03 22:29:44 +03:00
Adi Shavit 68827072c9 [HighGUI] On Windows: Support Ctrl+C to copy image to clipboard. 2014-07-03 22:29:43 +03:00
David Bradley b71744082b cudabgsegm module was not compiling. Changing all references of opencv2/legacy.hpp to opencv2/cudalegacy.hpp seemed to work.
I'm new at this so it would be good to have someone familiar with the build system confirm the change.
2014-07-03 15:15:23 -04:00
Adi Shavit 7674f3ddbf Added call to clone() to avoid unexpected change to external data.
- Fix both stitching_detailed.cpp sample and cv::Stitcher.
2014-07-03 22:14:58 +03:00
Alexander Alekhin 964b260937 Merge pull request #2932 from ilya-lavrenov:tapi_other_vendors 2014-07-03 13:02:41 +00:00
Ilya Lavrenov 55d84cf815 optimization of cv::minMaxLoc - used min/max 2014-07-03 16:56:22 +04:00
vbystricky 690c932d7f Change groups count for Intel 2014-07-03 15:50:56 +04:00
Ilya Lavrenov 2fe07abf83 use vectors for devices of all vendors 2014-07-03 15:32:34 +04:00
Ilya Lavrenov 8fdbdb131d SSE4.1 optimiation of cv::Moments CV_16U 2014-07-03 15:04:06 +04:00
Alexander Alekhin d183554600 Merge pull request #2931 from alalek:mac_fix_master 2014-07-03 09:26:52 +00:00
Alexander Alekhin e6c305cb75 Merge pull request #2897 from vbystricky:oclopt_sepFilter2D 2014-07-03 09:26:05 +00:00
Alexander Alekhin c5d3c08256 ocl: add try-catch for OpenCL device getter 2014-07-03 12:18:19 +04:00
Ilya Lavrenov 93f8581b69 fixed warnings 2014-07-03 11:10:28 +04:00
Ilya Lavrenov e5b63d43f2 sse2 optimization of inv_sqrt_64f 2014-07-03 01:33:49 +04:00
Alexander Alekhin effff27c4e Merge pull request #2928 from ilya-lavrenov:tapi_warp_fix 2014-07-02 19:06:46 +00:00
Ilya Lavrenov 46e2216165 fixed cv::warpPerspective 2014-07-02 19:32:10 +04:00
Ilya Lavrenov 10c772fa7f minor optimization of cv::LUT 2014-07-02 18:50:21 +04:00
Vadim Pisarevsky 133d861d65 Merge pull request #2915 from SpecLad:core-useless-casts 2014-07-02 14:25:52 +00:00
Vadim Pisarevsky 8539d424b2 Merge pull request #2071 from pemmanuelviel:LshOrthogonalSubvectors 2014-07-02 14:24:09 +00:00
Vadim Pisarevsky c3329ff79d Merge pull request #2856 from sanchom:master 2014-07-02 14:22:56 +00:00
Alexander Alekhin dcf96b2da7 Merge pull request #2922 from ilya-lavrenov:mac_fix 2014-07-02 12:18:11 +00:00
Vadim Pisarevsky 0e534b5a25 Merge pull request #2923 from alalek:ocl_default_device_ignore_cpu 2014-07-02 09:56:59 +00:00
Vadim Pisarevsky d6233b13ba Merge pull request #2913 from ilya-lavrenov:sse2_precornerdetect 2014-07-02 09:55:51 +00:00
Alexander Alekhin d65abcaedb Merge pull request #2830 from mlyashko:moments 2014-07-02 09:14:48 +00:00
Alexander Alekhin b1ac35e14a ocl: fix mac and superres test 2014-07-02 11:54:20 +04:00
Ilya Lavrenov 43e4946cca fix for fisheye 2014-07-02 11:53:53 +04:00
vbystricky a3b9884674 Change global buffer to local 2014-07-02 11:36:25 +04:00
Marvin Smith 561703ca27 Fixed the compiler warnings for the demo program. 2014-07-01 17:04:28 -07:00
Marvin Smith 14548227ca Adding support for GDAL raster images. 2014-07-01 16:29:11 -07:00
Ilya Lavrenov d40cb39616 SSE2 optimization of magnitude calculation 2014-07-02 00:05:55 +04:00
Ievgen Khvedchenia 92ead5fab3 Fix cmake to build OpenCV framework on OSX 2014-07-01 22:31:57 +03:00
Vadim Pisarevsky 1b18ebf28a Merge pull request #2905 from Jazmann:2.4 2014-07-01 18:41:15 +00:00
Vadim Pisarevsky 15197eb09b Merge pull request #2911 from ilya-lavrenov:sse2_convert_scale_abs 2014-07-01 17:31:37 +00:00
Vadim Pisarevsky fe4bdcd71b Merge pull request #2895 from fradelg:master 2014-07-01 17:16:22 +00:00
Vadim Pisarevsky f6cf68094f Merge pull request #2917 from mmaraya:bug_3872 2014-07-01 16:40:08 +00:00
Alexander Alekhin 6bb8c46d9a Merge pull request #2906 from ilya-lavrenov:tapi_transpose 2014-07-01 13:21:35 +00:00
Vadim Pisarevsky d826bcdbbb Merge pull request #2914 from alalek:fix2.4 2014-07-01 11:02:04 +00:00
Ilya Lavrenov 070be56e14 fixed warnings 2014-07-01 14:32:16 +04:00
Alexander Alekhin 157257b072 ocl: don't use OpenCL CPU device in default setup 2014-07-01 14:25:31 +04:00
Mike Maraya 95550c2582 test.py: Check if camera_calibration.tar.gz file exists before downloading it, opencv bug #3782 2014-06-30 22:17:52 -04:00
Ilya Lavrenov 972119bff3 sse2 optimization of cv::convertScaleAbs 2014-07-01 02:21:00 +04:00
Ilya Lavrenov 54e4ef657c optimized cv::transpose inplace 2014-07-01 00:36:13 +04:00
Ilya Lavrenov 9c8b9fc733 cv::transpose 2014-06-30 19:07:45 +04:00
Alexander Alekhin cbd0511a56 Merge pull request #2907 from ilya-lavrenov:tapi_perf_transpose 2014-06-30 14:59:36 +00:00
Ilya Lavrenov 978f7eb44a added perf test for transpose inplace 2014-06-30 18:33:26 +04:00
Roman Donchenko ebb0255e19 Remove a couple of useless casts in core headers
This helps users who compile their code with -Wuseless-cast.
2014-06-30 16:12:04 +04:00
Alexander Alekhin 5c8cd76893 fix bug with invalid signature size (should not be less than signatureLength()) 2014-06-30 16:03:20 +04:00
Alexander Alekhin 3a8af7d691 fix python tests 2014-06-30 16:03:07 +04:00
Alexander Alekhin acbabedac9 Merge pull request #2869 from ilya-lavrenov:tapi_warps 2014-06-30 11:59:13 +00:00
Alexander Alekhin e0584bb818 Merge pull request #2876 from vbystricky:oclopt_integralsum 2014-06-30 10:06:54 +00:00
Alexander Alekhin 1493160f26 Merge pull request #2899 from ilya-lavrenov:tapi_ex 2014-06-30 10:05:24 +00:00
Alexander Alekhin b304868d91 Merge pull request #2886 from ilya-lavrenov:tapi_inrange 2014-06-30 10:04:04 +00:00
Alexander Alekhin 667a9328fb Merge pull request #2829 from ilya-lavrenov:tapi_cvtcolor 2014-06-30 10:02:41 +00:00
Michael Pratt cac1218eef Build both Python 2 and Python 3 bindings
If both Python 2 and Python 3 are found, then build bindings for both of
them during the build process.  Currently, one version of Python is
detected automatically, and building for the other requires changes the
CMake config.

The largest chunk of this change generalizes OpenCVDetectPython.cmake to
find both a Python 2 and Python 3 version of Python.  Secondly, the
opencv_python module is split into two modules, opencv_python2 and
opencv_python3.  Both are built from the same source. but for different
versions of Python.
2014-06-29 20:08:13 -04:00
Ilya Lavrenov 654bdde8ed SSE2 optimization of cv::preCornerDetect 2014-06-30 01:51:53 +04:00
Alexander Karsakov d5c99a07b6 Use fma only for Intel devices 2014-06-27 12:59:44 +04:00
Ilya Lavrenov 36db85a94d optimized some operations 2014-06-27 12:52:29 +04:00
Alexander Alekhin 2d81595ed4 Merge pull request #2852 from ilya-lavrenov:tapi_abs 2014-06-27 08:21:06 +00:00
Roman Donchenko e8850bf84a Merge pull request #2626 from KayKwon:matlab_formatter 2014-06-26 17:40:26 +04:00
Roman Donchenko 1576e24c93 Merge pull request #2672 from a-wi:findContours 2014-06-26 17:35:08 +04:00
Roman Donchenko e89e3066e8 Merge pull request #2774 from 23pointsNorth:lsd-nfa-fix 2014-06-26 17:29:27 +04:00
Roman Donchenko 1138fbb940 Merge pull request #2766 from akarsakov:pyr_border_constant 2014-06-26 17:28:44 +04:00
Roman Donchenko e9bb750d4e Merge pull request #2858 from 23pointsNorth:patch-3 2014-06-26 17:24:25 +04:00
Roman Donchenko b0a70787e1 Merge pull request #2824 from abidrahmank:pylsd 2014-06-26 17:22:54 +04:00
vbystricky 1a73aa1f6a Change local size 2014-06-26 15:43:40 +04:00
Ilya Lavrenov 16ab6ec534 ported changes from PR #2867 2014-06-26 13:52:44 +04:00
Ilya Lavrenov a3592cd068 added ocl_** function 2014-06-26 13:18:03 +04:00
Ilya Lavrenov ad9272e836 reverted to original plain C++ code 2014-06-26 13:13:01 +04:00
mlyashko 6f2fea7ea5 added perftest for moments 2014-06-26 13:05:43 +04:00
vbystricky 730ead44fe Optimize OpenCL version of sepFilter2D 2014-06-26 12:46:03 +04:00
Andrey Pavlenko d4f938ed56 Merge pull request #2894 from vpisarev:cleanup_project_tree1 2014-06-25 17:12:20 +00:00
Vadim Pisarevsky c4fdf71bb3 fixed some more compile warnings on Windows 2014-06-25 20:22:56 +04:00
Roman Donchenko 436342d5f4 Merge pull request #2880 from GravityJack:SparseMatIterator-build-fix 2014-06-25 16:32:18 +04:00
Roman Donchenko b21b8ff9d7 Merge pull request #2891 from nisargthakkar:dims_zero_on_release 2014-06-25 16:27:33 +04:00
Vadim Pisarevsky 8f2aaff6d7 fixed compile warnings on Windows 2014-06-25 16:17:52 +04:00
Fco. Javier Delgado del Hoyo 47e345bcb6 Change comment according to fix 2014-06-25 11:49:26 +02:00
Fco. Javier Delgado del Hoyo a73809e6fc Fix GCC 4.9 compiler warning 2014-06-25 11:46:05 +02:00
Vadim Pisarevsky 66f2e527b6 removed extra whitespaces 2014-06-24 23:05:24 +04:00
Vadim Pisarevsky 07c0d50edf put the detection-based tracker back (to objdetect module), so that the Android face detection sample builds fine. The patch by Konstantin Matskevich that adds C++11 threads support has been merged in too. Also, fixed compile error in the doc builder. 2014-06-24 21:16:09 +04:00
Alexander Alekhin ea2228774d Merge pull request #2881 from mlyashko:moments_opt 2014-06-24 16:19:52 +00:00
Alexander Alekhin ea1b14ee95 Merge pull request #2786 from ElenaGvozdeva:ocl_matchTemplate 2014-06-24 16:12:42 +00:00
Vadim Pisarevsky 3858f2291d removed contrib, legacy and softcsscade modules; removed latentsvm and datamatrix detector from objdetect. removed haartraining and sft apps.
some of the stuff will be moved to opencv_contrib module.
in order to make this PR pass buildbot, please, comment off opencv_legacy, opencv_contrib and opencv_softcascade test runs.
2014-06-24 19:18:51 +04:00
vbystricky 09bcc061dd Change kernel for optimization. Remove restriction to align data
Fix kernel compilation errors on AMD system

Fix licanse information in cl file

Support CV_64F destination type

Change build options of the kernel

Optimize sum of square

Remove separate kernel for integral square

Increase epsilon for perfomance tests

Increase epsilon for perfomance tests

Test double support on AMD devices

Fix some issues

Try to fix problems with AMD device

Try to solve problem with AMD device

Fix error of destination size in kernel

Fix warnings
2014-06-24 18:32:52 +04:00
Vadim Pisarevsky fb8fa3fdac Merge pull request #2889 from Ilya-Krylov:fisheye 2014-06-24 12:06:19 +00:00
Vadim Pisarevsky b6769c9db1 Merge pull request #2892 from PhilLab:patch-1 2014-06-24 11:52:37 +00:00
Jasper f45da9866a Fix for VTK6.2 issue. 2014-06-24 11:52:56 +01:00
PhilLab 3ece65ad62 Updates python feature matching tutorial
The given ORB parameter was misspelled
2014-06-24 11:35:22 +02:00
Nisarg Thakkar 98421e5970 Fix for Bug#3757: All dimension values are 0 after release is called 2014-06-23 20:15:23 +05:30
Alexander Alekhin 6d4c4dcd94 Merge pull request #2887 from ilya-lavrenov:ipp_morph_fix 2014-06-23 14:27:10 +00:00
Alexander Alekhin 4f1d06d14a Merge pull request #2874 from vbystricky:ocl_LUTAMDfix 2014-06-23 14:23:26 +00:00
Ilya Krylov 84bb77e914 Fixed android and windows x64 build issues 2014-06-23 17:06:40 +04:00
Ilya Lavrenov 87f4b47a4f optimized INTER_LINEAR mode 2014-06-23 16:25:05 +04:00
Ilya Lavrenov e89cee35e5 optimized cv::inRange 2014-06-23 13:12:08 +04:00
Ilya Lavrenov 0528d2e2b3 added 32s to 32u conversion 2014-06-23 13:09:54 +04:00
Elena Gvozdeva c23da52564 Fixed core for CCORR and SQDIFF. Used float instead of int for CV_8U. Fixed conditions for call dft. 2014-06-23 11:37:47 +04:00
mlyashko 44ffa42064 replaced factors computation by precomputed values, added kernel for
binary mode
2014-06-23 11:04:39 +04:00
Ilya Lavrenov 007593cab7 cvtColor - optimized index calculations; usage of build-in functions 2014-06-23 02:10:42 +04:00
Ilya Lavrenov 863784efc6 added extra condition 2014-06-22 19:18:14 +04:00
Alexander Alekhin 6952b90ed0 Merge pull request #2790 from akarsakov:ocl_pyrUp_unroll 2014-06-20 13:49:14 +00:00
Alexander Karsakov eeddda4701 Optimization of cv::pyrDown for 8UC1. 2014-06-20 16:46:51 +04:00
Alexander Alekhin 01a98fae93 Merge pull request #2878 from vbystricky:ocl_integral_sqsum_perf_test 2014-06-20 08:49:36 +00:00
Alexander Alekhin 6e0d77469a Merge pull request #2864 from ilya-lavrenov:tapi_boxfilter 2014-06-20 08:47:51 +00:00
Alexander Alekhin 07446ec954 Merge pull request #2847 from ilya-lavrenov:tapi_pow 2014-06-20 08:47:18 +00:00
Alexander Alekhin 7688a18264 Merge pull request #2840 from ilya-lavrenov:tapi_calchist 2014-06-20 08:46:32 +00:00
Marc Rollins 05e0b3b7e6 Fixing build error when using post-increment operator. 2014-06-19 14:14:10 -07:00
vbystricky 655465d9f8 Increase epsilon for pass sanity check 2014-06-19 18:52:25 +04:00
vbystricky eb54c83985 Fix error 2014-06-19 18:09:23 +04:00
Alexander Alekhin d9daa0cbaa ocl: added runtime flags for debugging 2014-06-19 17:52:46 +04:00
vbystricky 6d6ad1b1d9 Change threshold 2014-06-19 17:45:04 +04:00
vbystricky b32fbe72f6 Add peromance tests for OCL integral sum of square 2014-06-19 17:07:09 +04:00
Roman Donchenko 6a94862fef Merge pull request #2870 from 23pointsNorth:patch-5 2014-06-19 16:52:00 +04:00
Roman Donchenko cb69a5c29a Merge pull request #2868 from neo008:2.4 2014-06-19 16:51:37 +04:00
Andrey Pavlenko 75742fcd01 Merge pull request #2843 from berak:f_export_bow_24 2014-06-19 09:08:32 +00:00
Roman Donchenko acebfcd24f Merge pull request #2832 from BRAINSia:20140605_Upstream 2014-06-19 11:57:52 +04:00
Alexander Alekhin c99ce0f427 Merge pull request #2846 from alalek:2.4_fix_python_warnings 2014-06-18 13:19:11 +00:00
Andrey Pavlenko 65953fe39a Merge pull request #2863 from apavlenko:disable_cuda_stubs_defaults 2014-06-18 16:13:13 +04:00
vbystricky ea6da6ee95 Change uchar2 to short 2014-06-18 15:44:56 +04:00
vbystricky 9391ccfe35 Move some variables into #ifdef 2014-06-18 15:03:09 +04:00
Hans Johnson 4c7ed03b5f COMP: Fix problem with narrowing in c++11
modules/core/src/arithm.cpp:345:51:
error: constant expression evaluates to 4294967295 which cannot be narrowed to type 'int' [-Wc++11-narrowing]
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
                                                  ^~~~~~~~~~

Converted to unsigned int.  This variable is only used to initialize a bit pattern anywhy for a 128bit type.
2014-06-17 15:49:06 -05:00
Ilya Lavrenov c41a134394 increased number of rows per work-item 2014-06-17 19:24:25 +04:00
Alexander Alekhin ce5bae1c67 Merge pull request #2871 from vbystricky:oclopt_integral 2014-06-17 18:23:31 +04:00
Alexander Karsakov 06fb5da7c8 Removed storing of zeros in local memory 2014-06-17 17:24:11 +04:00
Elena Gvozdeva dcaa8735ba used vector data types for CCORR cn==1 2014-06-17 17:09:39 +04:00
Elena Gvozdeva 13db948023 added dft for CCORR 2014-06-17 17:09:38 +04:00
Elena Gvozdeva 82da445a15 changed CCOEFF cn==1 2014-06-17 17:09:38 +04:00
Elena Gvozdeva a7036d9668 changed support for 3-channels, changed CCOEFF 2014-06-17 17:06:51 +04:00
Alexander Alekhin 1db9cc3f0d Merge pull request #2854 from ilya-lavrenov:tapi_filter2d 2014-06-17 16:59:00 +04:00
Alexander Alekhin 04628d770c Merge pull request #2849 from ElenaGvozdeva:ocl_matchTemplate_3cn 2014-06-17 14:37:52 +04:00
Ilya Lavrenov 93712e913a optimization of cv::warpAffine INTER_CUBIC 2014-06-17 00:47:19 +04:00
vbystricky 606df0469a Fix pointer conversion 2014-06-16 18:14:05 +04:00
vbystricky 9bf296eeb0 Small refactoring 2014-06-16 17:17:16 +04:00
Ilya Lavrenov c424d36041 optimized cv::boxFilter 2014-06-16 17:00:10 +04:00
Daniel Angelov 660d7cd3ae Updated findHomography docs branch 2.4
Updated the documents to give warning to the users of `findHomography` that the function may return an empty matrix in some cases. 
The user must take care of checking that.
2014-06-16 13:05:17 +01:00
Ilya Lavrenov 7391df386f fixed usage of reshape 2014-06-16 15:19:13 +04:00
vbystricky 6550c4f682 Join kernel code for int and float destination types 2014-06-16 15:08:15 +04:00
Neo Alienson b6e25a9fc7 Fix typos 2014-06-16 18:48:10 +08:00
Ilya Lavrenov 6dd658a0af optimized cv::setIdentity 2014-06-16 13:41:43 +04:00
Alexander Alekhin f269a89792 Merge pull request #2865 from ilya-lavrenov:morph 2014-06-16 13:35:57 +04:00
Alexander Alekhin 758a1eb63d Merge pull request #2855 from ilya-lavrenov:tapi_warpp_fix 2014-06-16 13:22:03 +04:00
vbystricky 504bc7634a Remove pre_invalid parameter 2014-06-16 13:07:39 +04:00
Ilya Lavrenov d5244eb645 invoking OCL before IPP 2014-06-16 12:33:13 +04:00
Andrey Pavlenko 724f5e7f19 Don't build CUDA modules stubs by default (use -DBUILD_CUDA_STUBS=ON if need them) 2014-06-16 11:18:52 +04:00
Daniel Angelov 54292a8376 Removed "CV_" prefix from constants in docs
The `calib3d.hpp` has a definition of the constant that does not contain the prefix "CV_".
The affected methods were `findHomography` and `findEssentialMat`.
Now the documentation updates the definition of the constants to conform to the header.
2014-06-14 18:41:04 +01:00
Sancho McCann e1e243588e Bugfix: Memory leak in deletion of er_stack nodes of ERFilter. 2014-06-12 11:02:06 -07:00
Vadim Pisarevsky 45f21e4f12 Merge pull request #2783 from daferna2:master 2014-06-12 21:41:28 +04:00
Vadim Pisarevsky 2c134318f7 Merge pull request #2784 from saree90:bugfix_Simplex 2014-06-12 21:41:10 +04:00
Vadim Pisarevsky 41ceadf9ed Merge pull request #2799 from 23pointsNorth:patch-1 2014-06-12 21:40:53 +04:00
Vadim Pisarevsky afe6b66d33 Merge pull request #2828 from otsedom:updating_and_adding_haarcascades_mcs 2014-06-12 21:39:50 +04:00
Vadim Pisarevsky 052c8516a8 Merge pull request #2845 from shaibagon:patch-1 2014-06-12 21:38:56 +04:00
Vadim Pisarevsky ad7440c014 Merge pull request #2850 from Sekunde:master 2014-06-12 21:38:41 +04:00
Vadim Pisarevsky 2b2ce3f6e9 Merge pull request #2726 from Ilya-Krylov:2.4 2014-06-12 21:37:47 +04:00
Vadim Pisarevsky 3391caf434 Merge pull request #2779 from pemmanuelviel:kmeansppSquareDist 2014-06-12 21:35:28 +04:00
Ilya Lavrenov 7ccbe10970 fixed cv::warpPerspective 2014-06-12 15:17:24 +04:00
Ilya Lavrenov 316c044e06 used abs in reduction operations 2014-06-11 18:54:43 +04:00
Ilya Lavrenov f1e24381d1 used abs 2014-06-11 18:33:46 +04:00
Ilya Lavrenov b2c2aabd04 used built-in functions 2014-06-11 18:32:42 +04:00
Alexander Alekhin 14671e0cd6 Merge pull request #2823 from ilya-lavrenov:tapi_warpaffine 2014-06-11 14:41:29 +04:00
berak 3500c940d4 add Bag of Words to python wrapper 2014-06-11 11:50:22 +02:00
侯骥 055adc2302 Update MatchTemplate_Demo.cpp 2014-06-11 10:29:30 +02:00
Elena Gvozdeva feeb386bf3 Added support for 3-channels 2014-06-11 11:49:22 +04:00
Daniel Fernandes b3655233f1 Changing #include to generic video.hpp
Per https://github.com/Itseez/opencv/pull/2783#discussion_r13573590
2014-06-11 02:00:21 -05:00
Alexander Alekhin 88ceee05c6 Merge pull request #2837 from ilya-lavrenov:tapi_norm_relative 2014-06-10 22:21:09 +04:00
Ilya Lavrenov 33239fca70 cv::equalizeHist 2014-06-10 19:32:46 +04:00
Alexander Alekhin 96ce9810a9 Merge pull request #2844 from ilya-lavrenov:tapi_perf_pow 2014-06-10 19:32:03 +04:00
Ilya Lavrenov c9528b3952 optimized histogram merging 2014-06-10 19:32:01 +04:00
Ilya Lavrenov eeaa4b3665 eliminated convertTo 2014-06-10 19:32:01 +04:00
Ilya Lavrenov c072c28e28 optimized cv::calcHist 2014-06-10 19:32:00 +04:00
Alexander Alekhin 071daa1d8f Merge pull request #2839 from ilya-lavrenov:tapi_fix 2014-06-10 19:30:26 +04:00
Alexander Alekhin bf39f694ea Merge pull request #2835 from ilya-lavrenov:defects 2014-06-10 19:29:47 +04:00
Ilya Lavrenov 03f665e870 some optimizaions of cv::pow 2014-06-10 18:37:35 +04:00
Shai 91201b225a Update global_motion.cpp
An extremely rare case where, for numeric reasons bestM finds more inliers than ninliersMax. 
This RARE case causes memory corruption and a nasty seg fault.
2014-06-10 17:31:18 +03:00
Alexander Alekhin 4d0848b3e8 fix -Wmaybe-uninitialized warning (initialize pointers to NULL) 2014-06-10 18:12:38 +04:00
Ilya Lavrenov 9edd24fe51 changed power in cv::pow test to test actual kernel 2014-06-10 17:41:43 +04:00
Ilya Lavrenov 556206de2d fixed defects found by coverity scan 2014-06-10 13:14:51 +04:00
Roman Donchenko 1f4ddbe5b6 Merge pull request #2705 from KonstantinMatskevich:face_recognition_labels_info 2014-06-10 12:24:56 +04:00
Roman Donchenko e0f40a7f4a Merge pull request #2841 from SpecLad:merge-2.4 2014-06-10 11:50:12 +04:00
Alexander Alekhin 8681b52dba Merge pull request #2838 from ilya-lavrenov:tapi_warnings 2014-06-09 20:25:28 +04:00
Ilya Lavrenov 634da9f3bf added norm_inf support to minmaxloc kernel 2014-06-09 20:05:26 +04:00
Roman Donchenko 659d21332e Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/contrib/src/spinimages.cpp
2014-06-09 18:03:03 +04:00
Ilya Lavrenov 0b2cafb08b bixed cv::boxFilter 2014-06-09 17:09:44 +04:00
Ilya Lavrenov cf72d2695c fixed possible runtime error 2014-06-09 16:48:59 +04:00
Roman Donchenko 278616bada Merge pull request #2813 from 23pointsNorth:patch-2 2014-06-09 15:58:24 +04:00
Ilya Lavrenov ff6f5d4d24 fixed warnings 2014-06-09 15:54:10 +04:00
Roman Donchenko ed1c56e063 Merge pull request #2817 from bf:patch-1 2014-06-09 15:06:07 +04:00
Roman Donchenko 4ef311949b Merge pull request #2834 from atinfinity:pullreq/140606-TickMeter-2.4 2014-06-09 14:29:44 +04:00
Roman Donchenko 150dd39b08 Merge pull request #2822 from timedia:akaze-java 2014-06-09 14:27:51 +04:00
Roman Donchenko 3a35ca5190 Merge pull request #2831 from alalek:android_examples 2014-06-09 14:26:31 +04:00
Roman Donchenko 64344f4545 Merge pull request #2818 from StevenPuttemans:fix_linux_tutorial 2014-06-09 13:37:39 +04:00
Andrey Pavlenko 02b32d86d3 moving FaceRecognizer2 from public header to .cpp 2014-06-09 13:26:45 +04:00
Ilya Lavrenov 7f2662b310 fixes 2014-06-09 00:50:14 +04:00
Ilya Lavrenov 5403bdd228 optimized cv::norm with NORM_RELATIVE 2014-06-07 21:26:40 +04:00
Ilya Lavrenov 2040995801 optimized cv::norm with 2 args 2014-06-07 20:45:28 +04:00
berak fc610979bb export BOW to script wrappers 2014-06-07 16:34:53 +02:00
atinfinity f08d88fa78 fixed calculation method of "cv::TickMeter" 2014-06-07 07:29:22 +09:00
Ilya Lavrenov 1a7a262f74 optimized cv::norm with NORM_INF 2014-06-06 19:34:26 +04:00
Alexander Alekhin e430ab1a58 Merge pull request #2785 from akarsakov:ocl_pyrDown_borders 2014-06-06 18:53:14 +04:00
Alexander Alekhin ea417ac04a Merge pull request #2755 from vbystricky:oclopt_LUT 2014-06-06 18:52:40 +04:00
Ilya Lavrenov fd5a8b3e97 minmaxloc 2014-06-06 18:39:08 +04:00
Alexander Alekhin f30301d171 Merge pull request #2801 from ilya-lavrenov:tapi_reduction 2014-06-06 18:38:22 +04:00
Alexander Alekhin 15b6fd2ec4 android: allow to build & run examples without Android OpenCV Manager 2014-06-06 18:01:04 +04:00
Konstantin Matskevich 59c8edfd98 facerec2 2014-06-06 15:57:11 +04:00
VBystricky 5d924b7a75 If lut table has one channel and src aligned to 4, work with src as with one channel matrix 2014-06-05 19:31:31 +04:00
VBystricky 0c0ebca855 Read 4 pixel for aligned data with 1 channel 2014-06-04 23:50:23 +04:00
VBystricky 8a5f2781fc Fix kernel by comments 2014-06-04 20:13:42 +04:00
Alexander Alekhin 3f485d58bb Merge pull request #2808 from ilya-lavrenov:tapi_normalize_mask 2014-06-04 18:10:13 +04:00
Alexander Alekhin a42259421c Merge pull request #2794 from mletavin:pullreq/140516-median 2014-06-04 16:36:37 +04:00
Modesto Castrillón b327312bd3 Updated and added haarcascade_mcs*.xml files 2014-06-04 12:24:33 +01:00
Alexander Alekhin 47f1026ce0 Merge pull request #2820 from ilya-lavrenov:tapi_flip 2014-06-04 15:22:07 +04:00
Ilya Lavrenov 405f12fe80 optimized cv::flip (CV_8UC1) 2014-06-04 14:21:42 +04:00
Alexander Alekhin 6d3413bc6a Merge pull request #2810 from ilya-lavrenov:tapi_copytomask 2014-06-04 12:23:36 +04:00
Alexander Alekhin c2ca059baf Merge pull request #2798 from ilya-lavrenov:tapi_copymakeborder 2014-06-04 12:22:52 +04:00
Alexander Alekhin ab9dff12d5 Merge pull request #2812 from arkunze:pullreq/140520-filter2D 2014-06-04 12:20:54 +04:00
Alexander Alekhin ee8adc10a1 Merge pull request #2821 from ilya-lavrenov:tapi_reduce 2014-06-04 12:18:30 +04:00
Alexander Alekhin a49ea6d066 Merge pull request #2826 from ilya-lavrenov:tapi_perf_warp 2014-06-04 12:11:54 +04:00
Roman Donchenko 85edb9e9b1 Merge pull request #1552 from Exocoder:gtk3 2014-06-04 12:07:17 +04:00
Tony f0887a99e2 On branch gtk3
Changes to be committed:
	modified:   CMakeLists.txt
Corrected merge error from last resync
2014-06-03 21:29:54 +01:00
Tony bd12d64641 Merge branch 'gtk3' of https://github.com/Exocoder/opencv into gtk3
resyncing gtk3 with remote.
2014-06-03 20:55:49 +01:00
Ilya Lavrenov 108527c951 added missed INTER_CUBIC 2014-06-03 21:46:30 +04:00
Alexander Alekhin 607cd37b48 Merge pull request #2750 from ilya-lavrenov:tapi_convertto 2014-06-03 16:36:48 +04:00
Ilya Lavrenov 2cc4cf3644 optimized cv::warpAffine 2014-06-03 13:45:22 +04:00
Muto Masayuki 518d0df201 Add AKAZE support for the Java wrapper 2014-06-03 18:41:58 +09:00
Alexander Alekhin 93af92c878 Merge pull request #2795 from ilya-lavrenov:tapi_setto 2014-06-03 13:21:05 +04:00
Alexander Alekhin 5e8a3cde94 Merge pull request #2757 from ElenaGvozdeva:ocl_flip 2014-06-03 13:19:42 +04:00
Ilya Lavrenov 26b73a7bbd merged 2 kernels 2014-06-03 13:14:51 +04:00
abidrahmank 530fc99947 Issue #3709 - PyBindings for LSD
Corrected crashing in Python bindings while using LSD_REFINE_NONE flags
Corrected not drawing lines in drawSegments and compareSegments in Python bindings
2014-06-03 14:25:33 +05:30
Alexander Alekhin 72385979c4 Merge pull request #2761 from ilya-lavrenov:tapi_warpers 2014-06-02 20:37:17 +04:00
Roman Donchenko c836613bad Merge pull request #2819 from SpecLad:merge-2.4 2014-06-02 17:12:07 +04:00
mletavin e224e72bbc Added condition to use optimized kernels for images of size that multiple of 4 only 2014-06-02 15:58:59 +04:00
Ilya Lavrenov ab428c9dbd optimized cv::copyMakeBorder 2014-06-02 15:46:44 +04:00
Ilya Lavrenov 67bb1c6a70 optimized UMat::setTo 2014-06-02 15:39:36 +04:00
Ilya Lavrenov 17956a5ae5 optimized cv::normalize in case of mask 2014-06-02 15:33:19 +04:00
Alexander Alekhin fc2f79701d Merge pull request #2778 from vbystricky:oclopt_reduce 2014-06-02 13:57:57 +04:00
Alexander Alekhin a049c16ca7 Merge pull request #2751 from akarsakov:ocl_thresh_opt 2014-06-02 13:54:31 +04:00
Roman Donchenko 33087f9eaa Merge remote-tracking branch 'origin/2.4' into merge-2.4 2014-06-02 13:43:28 +04:00
StevenPuttemans 7c44a07810 fix typo in linux tutorial 2014-06-02 09:35:19 +02:00
Benjamin Flesch 62533d0d26 perspectiveTransform simplify assert() for better debuggin
When using perspectiveTransform in rather complicated settings, it would be easier for developers to have two separate assertions for each part of the boolean expression in order to pinpoint problems more efficiently. In my case I am struggling in Python2.7 with finding out whether scn+1 == m.cols or the depth == CV_32F || depth == CV_64F is making a problem, which is kind of hard.
2014-06-02 00:27:32 +02:00
Alexander Alekhin abe37659cc Merge pull request #2811 from arkunze:pullreq/140516-erode 2014-06-01 02:30:39 +04:00
Alexander Alekhin 78badcd651 Merge pull request #2781 from ilya-lavrenov:tapi_meanstddev 2014-05-31 22:50:44 +04:00
Alexander Alekhin 89e4118b30 Merge pull request #2809 from ilya-lavrenov:tapi_copy_perf 2014-05-31 22:49:34 +04:00
Alexander Alekhin 17d6083e01 Merge pull request #2787 from ilya-lavrenov:tapi_repeat 2014-05-31 22:46:21 +04:00
Daniel Angelov ce1b6e2137 Fixed inconsistency with flag names
Fixed inconsistency with flag names for solvePnP. 
The default value for the function lacks the CV_ prefix. The code checks against "ITERATIVE". The suggested values for the parameters *include* the prefix.
Even though the enum CV_ITERATIVE (+ CV_P3P, CV_EPNP) = ITERATIVE (& P3P, EPNP), lets show to the users only one of them.
Now the user sees only {ITERATIVE, P3P, EPNP}.
2014-05-30 23:59:32 +01:00
Alexander Alekhin d4a1936c2d Merge pull request #2807 from alalek:disable_tests_KAZE 2014-05-30 19:11:08 +04:00
Ilya Lavrenov 80470f9cf6 added performance test 2014-05-30 18:34:04 +04:00
Ilya Lavrenov 7f818e9bc3 optimized UMat::copyTo with mask 2014-05-30 18:27:55 +04:00
Alexander Alekhin 6126788535 Merge pull request #2800 from krodyush:pullreq/140516-opticalflow-imgext-fix 2014-05-30 16:35:23 +04:00
krodyush 2e2ca58b70 fix according review 2014-05-30 15:44:51 +04:00
Alexander Alekhin d210132b99 Merge pull request #2638 from mlyashko:floodfill_perftest 2014-05-30 00:42:42 +04:00
Alexander Alekhin 316e6a8f2b Merge pull request #2804 from ilya-lavrenov:tapi_perf 2014-05-30 00:38:11 +04:00
Alexander Alekhin 776728ef2a KAZE: disable tests (too many crashes) 2014-05-29 23:12:48 +04:00
Ilya Lavrenov d156f5af6d added missed tests for cv::norm, cv::normalize 2014-05-29 16:00:38 +04:00
Roman Donchenko 67e9708621 Merge pull request #2773 from abidrahmank:pycascade 2014-05-29 14:51:45 +04:00
Roman Donchenko 9a5e9d3442 Merge pull request #2771 from SpecLad:pvs-checks-opencv 2014-05-29 14:50:42 +04:00
Roman Donchenko a8608bd0ac Merge pull request #2777 from alexstadnik:master 2014-05-29 14:43:30 +04:00
Roman Donchenko f57f39276a Merge pull request #2782 from HapeMask:py3_flann 2014-05-29 14:40:38 +04:00
mlyashko f0e3940558 perftest for floodfill 2014-05-29 13:36:13 +04:00
Ilya Lavrenov c52a77b90f optimized cv::UMat::dot 2014-05-29 13:16:16 +04:00
Ilya Lavrenov 579499d900 optimized cv::sum (CV_8UC1) 2014-05-28 19:46:08 +04:00
Ilya Lavrenov 002a79bfc4 optimized cv::countNonZero 2014-05-28 18:42:42 +04:00
Ilya Lavrenov 7804d57f8b optimized index calculation 2014-05-28 18:01:03 +04:00
Ilya Lavrenov 33173d900a optimized cv::meanStdDev 2014-05-28 17:55:30 +04:00
Elena Gvozdeva 437927b7bb optimized index access 2014-05-28 16:27:08 +04:00
Alexander Alekhin 5a268dd27c Merge pull request #2797 from ElenaGvozdeva:ocl_MT 2014-05-28 13:39:48 +04:00
mletavin 68883775fb Adding explicit variable conversion in ocl_medianFilter() to suppress build errors on Linux & Mac 2014-05-28 13:30:50 +04:00
Alexander Alekhin 0ea572d772 Merge pull request #2796 from berak:b_3674_24 2014-05-28 13:28:30 +04:00
berak 2bacd8b702 2 fixed unassigned reshapes in em (#3674) 2014-05-28 10:37:16 +02:00
krodyush 153ac43d3b opencl opticaflow fix that enables buffer2image extension 2014-05-28 10:34:11 +04:00
Daniel Angelov 3ab3367310 Updating missed defines in documentation
Updating missed defines in documentation. The new defines (in imgproc.hpp) state they have a prefix of COLOR instead of CV.
2014-05-27 18:09:12 +01:00
Alexander Alekhin c9db91ace5 Merge pull request #2788 from alalek:icv_public 2014-05-27 18:52:02 +04:00
mletavin df9c75b270 Moved new kernels under conditional compilation to disable their build for 3-channel images; added condition to use new kernels only for images that are big enough 2014-05-27 16:16:00 +04:00
Elena Gvozdeva 40eea303ec OCL: matchTemplate: changed perf test 2014-05-27 14:31:11 +04:00
Roman Donchenko aa170cfb5b Merge pull request #2793 from alalek:run_android_env 2014-05-27 13:35:11 +04:00
Roman Donchenko 68165b1af0 Merge pull request #2792 from SpecLad:merge-2.4 2014-05-27 12:44:23 +04:00
Alexander Karsakov 8e54845049 Removed useless multiplication by 4 2014-05-27 10:52:20 +04:00
vbystricky b4498d1d48 Fix some errors 2014-05-26 16:55:31 +04:00
vbystricky 63584bffda fix code in the kernel 2014-05-26 16:54:26 +04:00
vbystricky 04433b2d2b Change buffer cols count from 64 to 32 2014-05-26 16:54:25 +04:00
vbystricky 169351b01d Optimize openCL version of reduce function 2014-05-26 16:54:25 +04:00
vbystricky cfabf32492 Fix some errors 2014-05-26 16:53:01 +04:00
vbystricky 48d82fd911 Fix some errors 2014-05-26 16:53:01 +04:00
vbystricky a8bfab3cb7 Optimize OpenCL LUT function 2014-05-26 16:53:00 +04:00
vbystricky 6667cea0f4 Optimize OpenCL LUT function 2014-05-26 16:53:00 +04:00
vbystricky 72727111c7 Use 4 pixels for one unit. Some ocl code refactoring 2014-05-26 16:52:59 +04:00
vbystricky 47b092e527 Optimize OpenCL LUT function 2014-05-26 16:52:59 +04:00
mletavin 4a37ac303a Added new Intel-optimized 3x3 and 5x5 kernels to medianFilter.cl file and corresponding code to host in smooth.cpp
Only Intel platform and 1 channel images are supported.
2014-05-26 15:54:18 +04:00
Alexander Alekhin e6f6905868 run.py: propagate OPENCV* env variables only with --android_propagate_opencv_env flag 2014-05-26 14:32:52 +04:00
Ilya Lavrenov 50fa809a96 fixed cv::mixChannels 2014-05-26 14:20:16 +04:00
Alexander Karsakov 5022a0fae3 Added new border types for pyrDown 2014-05-26 13:57:03 +04:00
Alexander Alekhin 766600529b run.py: added --android_env parameter 2014-05-26 13:27:31 +04:00
Ilya Lavrenov ec3c68c8ea fix 2014-05-26 12:19:07 +03:00
Ilya Lavrenov bd5e4c6c49 other kernels now use row scheme 2014-05-26 12:19:06 +03:00
Ilya Lavrenov 15738bf7ef multiple rows in KF kernel 2014-05-26 12:19:06 +03:00
Ilya Lavrenov 5ee398bfd6 multiple rows per work-item 2014-05-26 12:19:05 +03:00
Roman Donchenko 0a2d22bf31 Merge remote-tracking branch 'origin/2.4' into merge-2.4 2014-05-26 12:32:14 +04:00
Alexander Alekhin ab2749d648 Merge pull request #2709 from alalek:icv_update_binary_pack 2014-05-23 15:09:43 +04:00
Alexander Karsakov 4910242732 Unroll pyrUp kernel 2014-05-23 14:58:34 +04:00
Alexander Alekhin 52ba76143c icv: fix test eps on Mac for failed perf test 2014-05-23 14:54:09 +04:00
Ilya Lavrenov c83455d8a4 optimized cv::repeat 2014-05-23 13:16:27 +03:00
Alexander Alekhin 0f7fbe4458 icv: enable public IPPICV packages 2014-05-23 13:43:31 +04:00
Alexander Alekhin c43e32854a Merge pull request #2713 from alalek:icv_enable_fns 2014-05-23 13:35:45 +04:00
Roman Donchenko 09f9b35bc6 Merge pull request #2742 from StevenPuttemans:feature_3176 2014-05-22 18:03:56 +04:00
Saree90 7f7064e3b9 DownhillSolverImpl::innerDownhillSimplex something looks broken here:
Mat_<double> coord_sum(1,ndim,0.0),buf(1,ndim,0.0),y(1,ndim,0.0);
nfunk = 0;
for(i=0;i<ndim+1;++i)
{
y(i) = f->calc(p[i]);
}
y has only ndim elements, while the loop goes over ndim+1
2014-05-22 22:52:37 +10:00
StevenPuttemans fea4396023 Added more info on the data input variable of kmeans 2014-05-22 12:56:44 +02:00
Alexander Alekhin 7249622ce7 Merge pull request #2772 from akarsakov:ocl_pyramids 2014-05-22 13:23:50 +04:00
Alexander Alekhin 694d7726b5 Merge pull request #2762 from ilya-lavrenov:ipp_sort 2014-05-22 12:30:53 +04:00
Daniel Fernandes a0459c2352 Merge branch 'master' of https://github.com/Itseez/opencv 2014-05-21 17:59:10 -05:00
Daniel Fernandes 6598b97b96 Fixed MATLAB bridge
MATLAB bridge.hpp was missing definition for Ptr<DenseOpticalFlow>
2014-05-21 17:57:35 -05:00
Gabe Schwartz c19b6ed20e Fixed pyopencv_to w/FLANN IndexParams in python3.
The keys() and values() functions on dictionaries in Python 3 no longer
return lists.  pyopencv_to() for flann::IndexParams now iterates over
the dictionary in a way that is version-agnostic.
2014-05-21 15:21:41 -04:00
Alexander Alekhin d940093fb5 Merge pull request #2723 from ilya-lavrenov:tapi_intel_vector_width 2014-05-21 19:56:00 +04:00
Alexander Alekhin cf5dd88cf2 Merge pull request #2776 from ilya-lavrenov:tapi_meanstddev 2014-05-21 17:43:29 +04:00
Pierre-Emmanuel Viel ec99f96c62 Add the ensureSimpleDistance() method to ensure the user the returned distance is not ^2 (the default for L2 for instance) 2014-05-21 13:16:12 +02:00
Pierre-Emmanuel Viel 2f8b5731da Fix local variable shadowing 2014-05-21 12:27:38 +02:00
Alexander Karsakov fa1ed5580d Fixed cv::pyrUp performance test 2014-05-21 14:09:21 +04:00
Alexey Stadnik 73bfcf856d Added Haar cascade for russian cars licence plate detection, 16 stages cascade, pretty fast. 2014-05-21 12:51:15 +04:00
Ilya Lavrenov 0e1b37675c added performance test for cv::meanStdDev with mask 2014-05-21 11:50:31 +04:00
Alexander Alekhin 7032a5a46c Merge pull request #2763 from ilya-lavrenov:tapi_perf_norm_relative 2014-05-21 11:44:25 +04:00
Aaron Kunze ab1a37d564 Bug fixes for filter2D and associated tests. 2014-05-20 22:30:09 -07:00
Konstantin Matskevich 8d4a76925c fixed binary compatibility 2014-05-21 09:25:15 +04:00
abidrahmank 31291ced11 Issue #2540 : Python bindings for various "detectMultiScale()" 2014-05-21 08:26:16 +05:30
Pierre-Emmanuel Viel 00367cfb00 Merge remote-tracking branch 'upstream/2.4' into LshOrthogonalSubvectors 2014-05-21 01:31:52 +02:00
Pierre-Emmanuel Viel e63d7de87c Allows to choose orthogonal sub-vectors for LSH without using a static table among LshTable instances 2014-05-20 22:52:11 +02:00
Daniel Angelov 3ca7717e17 Fixed scanning bug identified in comments in pull request #1119.
NFA calculations now generate better line segments.
2014-05-20 21:25:31 +01:00
Alexander Karsakov 511ed4388e Disabled BORDER_CONSTANT for pyramid functions. 2014-05-20 17:28:47 +04:00
Roman Donchenko 7ea1bf3cf0 Fixed several problems found by PVS-Studio.
This fixes all problems from the article "Checking OpenCV with PVS-Studio"
<http://www.viva64.com/en/b/0191/> that are not already fixed and are
not in 3rdparty or the legacy module.

The problems fixed are two instances of useless code and one instance
of unspecified behavior (right-shifting a negative number).
2014-05-20 13:54:00 +04:00
Ilya Krylov 3678020c28 Added license to source files 2014-05-20 12:37:37 +04:00
Roman Donchenko 0ec54982b5 Merge pull request #2767 from SpecLad:merge-2.4 2014-05-20 11:50:49 +04:00
Roman Donchenko 976da2f3d3 Merge pull request #2768 from SpecLad:useless-loop 2014-05-20 11:50:29 +04:00
Roman Donchenko 3d7a457c97 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	doc/tutorials/introduction/linux_install/linux_install.rst
	modules/core/doc/operations_on_arrays.rst
	modules/core/include/opencv2/core/core.hpp
	modules/core/src/system.cpp
	modules/gpu/src/cuda/resize.cu
	modules/imgproc/doc/miscellaneous_transformations.rst
	modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst
	modules/video/src/bgfg_gaussmix2.cpp
2014-05-19 18:39:20 +04:00
Ilya Krylov 0d2fab86b4 Changed documentation for namespace fisheye 2014-05-19 18:16:00 +04:00
Ilya Krylov 651b13f72a Refactored class Fisheye to namespace fisheye 2014-05-19 17:55:32 +04:00
Roman Donchenko bea46c90b5 Remove a useless loop that copies an array to itself 2014-05-19 17:38:30 +04:00
Vadim Pisarevsky 0b4eb6a964 Merge pull request #2509 from euphrat:mog2_bgimg_gray 2014-05-19 17:36:38 +04:00
Vadim Pisarevsky c6113c6cb3 Merge pull request #2630 from isarandi:concat_corr 2014-05-19 17:36:20 +04:00
Vadim Pisarevsky 8bd1efa523 Merge pull request #2673 from BloodAxe:kaze 2014-05-19 17:35:22 +04:00
Vadim Pisarevsky 934cb6c452 Merge pull request #2680 from adrians:remove_cv_err 2014-05-19 17:35:03 +04:00
Vadim Pisarevsky 988b108858 Merge pull request #2701 from thoinvil:BugfixFilterEngineApplyROI 2014-05-19 17:34:45 +04:00
Vadim Pisarevsky 44acfc38a1 Merge pull request #2739 from StevenPuttemans:bug_1523 2014-05-19 17:33:36 +04:00
Vadim Pisarevsky e30939f09b Merge pull request #2738 from kevmitch:2.4 2014-05-19 17:33:22 +04:00
Vadim Pisarevsky 118b27f5b4 Merge pull request #2744 from jet47:kmeans-fix 2014-05-19 17:33:10 +04:00
Vadim Pisarevsky f01bd6f978 Merge pull request #2752 from jet47:pr-2746 2014-05-19 17:30:32 +04:00
Vadim Pisarevsky 165789bfcd Merge pull request #2764 from hbadino:Feature_3692 2014-05-19 17:30:18 +04:00
Roman Donchenko eded87de5b Merge pull request #2754 from thoinvil:patch-1 2014-05-19 15:41:28 +04:00
StevenPuttemans 12207ac763 fix coordinate problem with large images - bug 1523 2014-05-19 13:07:44 +02:00
Roman Donchenko 9eac451a3a Merge pull request #2741 from alalek:icv_android 2014-05-19 15:04:36 +04:00
Roman Donchenko cba5235f08 Merge pull request #2698 from GregoryMorse:patch-2 2014-05-19 14:52:58 +04:00
Roman Donchenko f77aa45cfb Merge pull request #2735 from StevenPuttemans:bug_2000 2014-05-19 14:25:47 +04:00
StevenPuttemans 7fc764f5e5 added documentation for findContours 2014-05-19 11:44:25 +02:00
Roman Donchenko f0b0d4e867 Merge pull request #2685 from znah:ocl_control_py 2014-05-19 13:38:36 +04:00
Roman Donchenko 06b335b2d7 Merge pull request #2733 from StevenPuttemans:bug_2162 2014-05-19 13:04:54 +04:00
Roman Donchenko 62e0759ba2 Merge pull request #2719 from yashdv:patch-1 2014-05-19 13:00:32 +04:00
Konstantin Matskevich a46f119fdf docs fixes 2014-05-19 09:54:15 +04:00
Kazuki Matsuda fa292c3d8d Implimentation "cv::Mat::forEach"
I propose forEach method for cv::Mat and cv::Mat_.
This is solution for the overhead of MatIterator_<_Tp>.

I runs a test that micro opecode runs all over the pixel of cv::Mat_<cv::Point3_<uint8_t>>.
And this implementation 40% faster than the simple pointer, 80% faster than iterator.
With OpenMP, 70% faster than simple pointer, 95% faster than iterator (Core i7 920).

Above all, code is more readable.

My test code is here.
    https://gist.github.com/kazuki-ma/8285876

Thanks.
2014-05-18 11:01:45 +09:00
pradeep c5b4b99350 Implemented Kullback-Leibler divergence 2014-05-17 23:44:31 +08:00
Hernan Badino 9a371de93b Switched insertion of connected components in filterSpecklesImpl 2014-05-16 18:49:45 -04:00
Roman Donchenko c9cb480844 Merge pull request #2753 from shahurik:2.4 2014-05-16 17:40:41 +04:00
Ilya Lavrenov 1e46a99d9f added performance test for cv::norm with NORM_RELATIVE 2014-05-16 14:15:31 +04:00
Ilya Lavrenov eb1dd1900b fixed conditions 2014-05-16 12:18:35 +04:00
Elena Gvozdeva c7dc884855 T-API: optimized ocl_flip 2014-05-16 11:01:10 +04:00
Alexander Karsakov 8ecb8c6a3d Optimized memory access by using stride pattern 2014-05-16 10:22:03 +04:00
Aaron Kunze 033aebe668 A more efficient workaround for erode 2014-05-15 16:31:24 -07:00
Alexander Alekhin ada2879faa Merge pull request #2756 from ElenaGvozdeva:ippi_matchTemplate 2014-05-15 18:50:01 +04:00
Ilya Lavrenov f3440888ef optimized stitching warpers 2014-05-15 16:28:34 +04:00
Elena Gvozdeva ce0b808e3c IPP: fixed ipp_matchTemplate 2014-05-15 13:05:27 +04:00
Vladislav Vinogradov 746185652a add additional tests for different input cases 2014-05-15 12:08:38 +04:00
Vladislav Vinogradov f16503743f use more accurate reshape 2014-05-15 12:08:01 +04:00
thoinvil ea038436e6 Added condition to 1st test in cv::GaussianBlur
Consistent with the test made in cv::boxFilter, it adjusts the kernel size to the source size only if the border is not BORDER_CONSTANT and if BORDER_ISOLATED is set. Otherwise, the source has to be considered possibly in a larger image (i.e. the source being a ROI) in witch the kernel should apply.
2014-05-15 08:40:13 +02:00
Vlad Shakhuro 6a93b43cae Fix svm intro tutorial 2014-05-14 21:24:57 +04:00
Roman Donchenko 0ebde64701 Merge pull request #2743 from StevenPuttemans:bugfix_3549 2014-05-14 19:49:27 +04:00
Ilya Krylov c30fef1f9d Fixed build issues 2014-05-14 18:58:39 +04:00
Alexander Mordvintsev a52979c37f exposed TVL1 optical flow to python 2014-05-14 17:45:21 +04:00
Alexander Mordvintsev 2756ae2051 exposed OpenCL-control functions to python 2014-05-14 17:42:21 +04:00
Roman Donchenko cafcfc4d0f Merge pull request #2749 from jet47:fix-bug-3678 2014-05-14 17:25:19 +04:00
Roman Donchenko 55bff44810 Merge pull request #2747 from jet47:gpu-resize-stream-fix 2014-05-14 16:34:48 +04:00
ZlodeiBaal 00e3c246fe Create haarcascade_russian_plate_number.xml
Detector for russsian vehicle registration plate
2014-05-14 15:18:56 +04:00
Vladislav Vinogradov f1e44fa5ca fix bug #3678 (cuda::integral failures) 2014-05-14 12:48:12 +04:00
Roman Donchenko f13e05cdcb Merge pull request #2740 from ilya-lavrenov:tapi_norm_fix 2014-05-14 12:40:19 +04:00
Roman Donchenko 75a1743f35 Merge pull request #2745 from yashdv:patch-3 2014-05-14 12:38:43 +04:00
Roman Donchenko 83b7fe1b82 Merge pull request #2748 from jet47:fix-bug-3690 2014-05-14 12:35:04 +04:00
Alexander Alekhin 46d672dcc3 Merge pull request #2663 from ilya-lavrenov:ipp_slow 2014-05-14 12:30:05 +04:00
Vladislav Vinogradov 7e2f7f45d7 fix bug #3690
removed invalid condition, it is always false
2014-05-14 10:47:28 +04:00
Vladislav Vinogradov 1f72873c55 fix cv::gpu::resize function
add missing stream parameter to call_resize_linear_glob
2014-05-14 10:31:28 +04:00
Ievgen Khvedchenia 12e1d7fc2b Fix "WARNING: Block quote ends without a blank line" 2014-05-13 21:07:30 +03:00
Roman Donchenko ed5d71b45f Merge pull request #2724 from znah:python_autowrap 2014-05-13 19:50:01 +04:00
Yash Vadalia 7e56cfafbc fixed a syntax error in cap_giganetix.cpp
Ticket 3458 (http://code.opencv.org/issues/3458)
2014-05-13 19:59:37 +05:30
Alexander Alekhin 6f798b1ba7 icv: android x86 build 2014-05-13 18:28:13 +04:00
Yash Vadalia 6ecd553810 Added doc for LinearPolar Transform 2014-05-13 19:36:43 +05:30
Vladislav Vinogradov 55a714c83b fix cv::kmeans function
reshape input matrix, since the function works with data
as with [N x dims] matrix
2014-05-13 18:00:17 +04:00
Alexander Mordvintsev dd67ea0210 find -> rindex 2014-05-13 17:55:57 +04:00
StevenPuttemans 1d557e6702 adding bugfix 3549 2014-05-13 15:34:30 +02:00
Alexander Karsakov 4612b4b827 Added clamp() for THRESH_TRUNC mode 2014-05-13 15:21:47 +04:00
Ilya Lavrenov d16e0b377f disabled IPP functions that slower than OpenCV 2014-05-13 15:06:38 +04:00
Roman Donchenko 10f89b9c8b Merge pull request #2737 from jet47:fix-opencv-cmake-config 2014-05-13 14:39:10 +04:00
Roman Donchenko 4a24ecd176 Merge pull request #2731 from StevenPuttemans:bug_2626 2014-05-13 14:21:36 +04:00
Ilya Lavrenov f64dfeb222 fix for cv::norm (norm_inf) 2014-05-13 14:21:07 +04:00
Roman Donchenko 2cf6cea90f Merge pull request #2730 from StevenPuttemans:bug_2740 2014-05-13 14:19:42 +04:00
Roman Donchenko c607dadc49 Merge pull request #2729 from StevenPuttemans:bug_3252 2014-05-13 14:17:09 +04:00
Roman Donchenko 83e2731c94 Merge pull request #2728 from StevenPuttemans:bug_3434 2014-05-13 14:15:38 +04:00
Ievgen Khvedchenia 87972d0d7c Fix "WARNING: Block quote ends without a blank line" 2014-05-13 13:15:24 +03:00
Kevin Mitchell 63e508abd2 doc: update/clarify behaviour of mask in floodFill
Clarify how the mask parameter is set on output and how this is
affected by the flags parameter.

resolves Feature #2942
2014-05-13 02:26:59 -07:00
StevenPuttemans 006956c324 Fixing as suggested in bug 2626, made naming same for both C, C++ and python API 2014-05-13 11:02:01 +02:00
Roman Donchenko ff2d76ec0d Merge pull request #2699 from GregoryMorse:patch-1 2014-05-13 11:58:25 +04:00
Roman Donchenko bc7b21609a Merge pull request #2692 from 1Hyena:2.4 2014-05-13 11:56:12 +04:00
Roman Donchenko f0547e5e05 Merge pull request #2727 from StevenPuttemans:bug_3484 2014-05-13 11:55:17 +04:00
Roman Donchenko ea5b411c0f Merge pull request #2725 from SpecLad:merge-2.4 2014-05-13 11:53:30 +04:00
Vladislav Vinogradov 67b562d543 fix OpenCVConfig.cmake template - missing parentheses 2014-05-13 11:37:21 +04:00
1Hyena 6c118ebc51 Changed ostringstream to ostream for new print_params and added the old
version of print_params for backwards compatibility.
2014-05-12 23:01:44 +03:00
Roman Donchenko 09674623cf Merge pull request #2714 from asmorkalov:ocv_cmake_config 2014-05-12 18:53:10 +04:00
Roman Donchenko ecfb1ab4f8 Merge pull request #2721 from zarrabeitia:2.4 2014-05-12 18:48:01 +04:00
StevenPuttemans a0a8fb4fd9 fixed bug 2626 2014-05-12 16:43:07 +02:00
StevenPuttemans 6c59e39f7c fix bug 3434 2014-05-12 16:41:22 +02:00
Roman Donchenko 313a0ad255 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/core/include/opencv2/core/internal.hpp
	modules/core/src/arithm.cpp
	modules/imgproc/src/imgwarp.cpp
	modules/objdetect/src/hog.cpp
2014-05-12 17:38:07 +04:00
StevenPuttemans e96de8821c bug 2740 added fix 2014-05-12 15:26:56 +02:00
StevenPuttemans b382984810 fix bug 3252 2014-05-12 15:01:15 +02:00
StevenPuttemans 2b4241c10b fixed bug 3484 2014-05-12 14:40:12 +02:00
Ilya Lavrenov 1e5694e082 heuristic for Intel 2014-05-12 16:08:39 +04:00
Alexander Mordvintsev 120b3a1e77 Work on python wrapped generation automation:
- all parsed headers are included into "cv2.cpp" with "pyopencv_generated_include.h"
 - types starting with "Ptr_" converted to "Ptr<...>" form (avoids many typedefs in "cv2.cpp")
2014-05-12 15:49:54 +04:00
Alexander Smorkalov e8376c789d Fix non-Android cross compilation with OpenCVConfig.cmake 2014-05-12 15:45:02 +04:00
Alexander Alekhin 1f638a3e5b icv: enable functions 2014-05-12 15:38:38 +04:00
Ilya Krylov e4a9c0f184 Fixed review comments 2014-05-12 15:37:47 +04:00
Roman Donchenko 5e47aa6300 Merge pull request #2717 from StevenPuttemans:2.4 2014-05-12 15:14:53 +04:00
Alexander Alekhin e1b5a547cc Merge pull request #2722 from ilya-lavrenov:tapi_luv_eps 2014-05-12 13:03:36 +04:00
Alexander Alekhin 7ac5c367e9 Merge pull request #2715 from akarsakov:fix_corner_min_eigen 2014-05-12 13:03:19 +04:00
Ilya Lavrenov e2558e5ee5 increased eps to pass tests 2014-05-12 11:54:15 +04:00
Konstantin Matskevich d67c9aabff docs 2014-05-12 10:09:39 +04:00
Luis Zarrabeitia bb5a22c504 highgui: fix segfault on CvCapture_GStreamer::retrieveFrame
CvCapture_GStreamer::retrieveFrame assumes that RGB videos are 24BPP.
This is not necesarily the case, unless we explicitly tell GStreamer
that we want 24BPP RGB streams.

Adding bpp=(int)24 to the appsink caps.
2014-05-11 19:00:14 -04:00
Ievgen Khvedchenia 03db61b33b FixFix documentation warnings 2014-05-10 23:06:23 +03:00
Ievgen Khvedchenia 029a8c443a Remove GSURF descriptor from KAZE algorithm 2014-05-10 20:57:37 +03:00
Ievgen Khvedchenia a068ccbf51 Fix "Title underline too short" warning 2014-05-09 22:53:28 +03:00
Ievgen Khvedchenia 616c348536 Fix documentation warnings 2014-05-09 22:31:20 +03:00
Ievgen Khvedchenia 3a8e15fad9 Fix documentation warnings 2014-05-09 22:21:26 +03:00
Ievgen Khvedchenia c4e49463a9 Initial commit of the KAZE & AKAZE docs 2014-05-09 19:35:41 +03:00
Ievgen Khvedchenia b42c268164 Temporary remove of CV_WRAP 2014-05-09 19:34:54 +03:00
Ievgen Khvedchenia 1a5fcd715d Refactor of KAZE and AKAZE:
1) Clean-up from the unused code
2) Remove of SURF extraction method
3) Enabled threading for KAZE extraction
4) Exposed new properties for runtime configuration
2014-05-09 18:46:00 +03:00
StevenPuttemans a9c7db7518 add suggestion of feature 2619 2014-05-09 13:44:12 +02:00
Alexander Alekhin eba1be711c Merge pull request #2710 from ilya-lavrenov:ipp_threshold 2014-05-08 17:33:27 +04:00
Alexander Karsakov 4e7f62fd24 Fixed ipp check for cornerMinEigenVal 2014-05-08 17:32:21 +04:00
Alexander Alekhin c74fed1fcf Merge pull request #2706 from ilya-lavrenov:ipp_2.4_warnings 2014-05-08 17:04:18 +04:00
Alexander Alekhin 7c9caab1fb Merge pull request #2708 from StevenPuttemans:2.4 2014-05-08 17:02:40 +04:00
Alexander Alekhin a82dd8ce48 Merge pull request #2700 from ilya-lavrenov:tapi_cvtColor 2014-05-08 17:01:38 +04:00
Alexander Alekhin eb240cc206 Merge pull request #2697 from PhilLab:master 2014-05-08 16:57:50 +04:00
Konstantin Matskevich aa76ef9a98 fixes 2014-05-08 15:55:55 +04:00
Alexander Alekhin 78f660024b Merge pull request #2712 from jet47:subtract-fix-3rd-attempt 2014-05-08 15:44:52 +04:00
Ilya Lavrenov 11b01cd8b9 added ipp threshold inplace 2014-05-08 13:51:25 +04:00
Ilya Lavrenov 19a2495067 fixed IPP related warnings 2014-05-08 13:31:27 +04:00
Vladislav Vinogradov 77275031ab finally fix cv::subtract 2014-05-08 13:11:42 +04:00
StevenPuttemans 99475e2976 fixed wrong download link in tutorial 2014-05-08 10:45:51 +02:00
Ilya Krylov 349ff631a5 Added sample of work of Fisheye::undistortImage and its description to documentation. Removed readPoints and readExtrinsic (useless) 2014-05-07 20:53:07 +04:00
thoinvil e50ef2dab5 Bugfix #3668 removed the comment 2014-05-07 18:27:08 +02:00
Vladislav Vinogradov 629461c836 fix output matrix allocation in cv::subtract 2014-05-07 19:52:35 +04:00
Alexander Alekhin df9aa8898d icv: fix OpenCV Windows package 2014-05-07 15:20:29 +00:00
Alexander Alekhin 35eb972e9a fix compilation on MSVS 2010 2014-05-07 15:20:29 +00:00
Alexander Alekhin 72e095b8a5 Merge pull request #2665 from ilya-lavrenov:ipp_filter2d 2014-05-07 19:17:57 +04:00
Alexander Alekhin 07d5f56707 Merge pull request #2679 from alalek:ippicv_update 2014-05-07 18:24:41 +04:00
Ilya Lavrenov 3ccaa5294e added OpenCL RGB <-> Luv conversions 2014-05-07 18:09:57 +04:00
Alexander Alekhin 9c780260c2 Merge pull request #2605 from akarsakov:ipp_min_eigen_val 2014-05-07 18:01:44 +04:00
Alexander Alekhin 849228ac6a Merge pull request #2684 from ElenaGvozdeva:ippiDFT 2014-05-07 17:57:17 +04:00
Alexander Alekhin 9e47672b2b Merge pull request #2658 from akarsakov:ipp_hough 2014-05-07 17:07:22 +04:00
Alexander Alekhin e2c7adc7c4 Merge pull request #2703 from jet47:subtract-create-dst-mat 2014-05-07 16:50:50 +04:00
Alexander Alekhin d54aa307fd Merge pull request #2676 from ilya-lavrenov:ipp_gaussianblur 2014-05-07 16:49:59 +04:00
Konstantin Matskevich 36afd4ef55 added additionalInfo in faceRecognition 2014-05-07 16:29:55 +04:00
Ilya Lavrenov abf905154f cv::fitler2D 2014-05-07 15:47:10 +04:00
Ilya Lavrenov 1ad69aba35 changes sigma in perf tests 2014-05-07 14:59:03 +04:00
Alexander Alekhin 0e1bf58195 Merge pull request #2634 from ElenaGvozdeva:ippiDCT 2014-05-07 14:49:13 +04:00
Vladislav Vinogradov 4c66614e07 fix cv::subtract function:
call dst.create(...) before using it
2014-05-07 13:15:19 +04:00
Alexander Alekhin b1a28a52fa Merge pull request #2693 from mvukad:bugfix_ippmorphop 2014-05-07 13:15:09 +04:00
GregoryMorse 38db7a78df WinRT core compatibility fixes
Update system.cpp

Update system.cpp

Update system.cpp

Update matching.cpp

Update matching.cpp
2014-05-07 06:17:37 +08:00
GregoryMorse b1443bc1bc WinRT core compatibility fixes
Update system.cpp

Update system.cpp

Update ocl.cpp

Update matching.cpp

Update ocl.cpp

Update matching.cpp
2014-05-07 06:15:54 +08:00
Thierry Hoinville 5efd2056f0 Bugfix #3668 in FilterEngine::apply(), use the ROI properly 2014-05-06 15:33:07 +02:00
Alexander Karsakov f6a8ac2f6c Changed check condition in tests in case ipp disabled. 2014-05-06 15:24:54 +04:00
Elena Gvozdeva 12279e2631 fixed 2014-05-06 14:49:03 +04:00
Alexander Alekhin 01f31dc007 Merge pull request #2687 from ilya-lavrenov:tapi_norm_inf_234cn 2014-05-06 13:27:03 +04:00
Elena Gvozdeva e362c3fb38 fixed 2014-05-06 13:09:45 +04:00
Alexander Alekhin 03b1d133df Merge pull request #2660 from arkunze:pullreq/140423-filter2D 2014-05-06 12:59:03 +04:00
Ilya Krylov 1f94b7dfc9 minor 2014-05-06 11:17:10 +04:00
Ilya Krylov ef01044b2f Added documentation for Fisheye::stereoCalibrate 2014-05-06 11:09:22 +04:00
Ievgen Khvedchenia 220de14077 Clean-up from the dead code 2014-05-05 21:48:54 +03:00
PhilLab 4ffeb01cfd Update solvepnp.cpp
Clarified assert message for allowed PnP flags
2014-05-05 17:44:59 +02:00
Alexander Alekhin e9be486534 Merge pull request #2694 from rokm:matlab 2014-05-05 19:24:07 +04:00
Alexander Alekhin 787815fd00 Merge pull request #2619 from GregoryMorse:patch-3 2014-05-05 18:00:40 +04:00
Alexander Alekhin 59cf62ad9e Merge pull request #2636 from atrebbi:#3653 2014-05-05 18:00:18 +04:00
Alexander Alekhin 87210690c2 Merge pull request #2678 from intbots:master 2014-05-05 17:55:14 +04:00
Ilya Krylov 50b291995a Added tests for stereoCalibrate 2014-05-05 17:23:03 +04:00
Alexander Alekhin f0d4ccc6cf Merge pull request #2696 from PhilLab:2.4 2014-05-05 17:08:48 +04:00
Alexander Alekhin a5378186e5 Merge pull request #2688 from akarsakov:ipp_disable_resize_8u 2014-05-05 15:21:13 +04:00
Alexander Alekhin d9d9de75db Merge pull request #2686 from vbystricky:ippicv_integral 2014-05-05 15:20:47 +04:00
Alexander Alekhin 347d5b96f3 Merge pull request #2635 from akarsakov:gaussian_float_intel 2014-05-05 15:20:20 +04:00
Alexander Karsakov eda084e123 Used AutoBuffer instead ippsMalloc 2014-05-05 14:40:59 +04:00
Ilya Krylov c2341fd446 Added stereoCalibrate for Fisheye camera model 2014-05-05 14:21:24 +04:00
PhilLab 897d0a9aaf Updated documentation: library names
updated the library names to OpenCV version 2.4.9
2014-05-05 12:16:48 +02:00
Rok Mandeljc c35fd55b0e Matlab bindings: CMakeLists.txt: use "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}" as MEX_LIB_DIR only when compiling with MSVC, otherwise, use only "${LIBRARY_OUTPUT_PATH}" 2014-05-03 17:37:48 +02:00
Rok Mandeljc fa075c50a1 Matlab bindings: fixed the functional template to perform an explicit cast to the type of an input option that is expected. This avoids issues with ternary operator not having the same type in rvalue and lvalue, such as in the case below:
Ptr_FeatureDetector blobDetector = inputs[3].empty() ? makePtr<SimpleBlobDetector>() : inputs[3].toPtrFeatureDetector();

Which after the patch, would be:

Ptr_FeatureDetector blobDetector = inputs[3].empty() ? (Ptr_FeatureDetector) makePtr<SimpleBlobDetector>() : inputs[3].toPtrFeatureDetector();
2014-05-03 17:37:48 +02:00
Rok Mandeljc 2d47dd7038 Matlab bindings: added missing compound type declarations from photo module 2014-05-03 17:37:47 +02:00
Ievgen Khvedchenia e7e00201f1 Enabled parallel processing of the nld_step_scalar function 2014-05-02 14:07:30 +03:00
Ievgen Khvedchenia 9fc90f4069 Merged nldiffusion functions into one module with removal of duplicate functions 2014-05-01 22:24:15 +03:00
Michael Vukadinovic c1aee0c312 Fixed bug in IPPMorphOp function when looping over elements of the morphology kernel. 2014-05-01 11:52:49 -07:00
1Hyena dfdb09386f Autotuned_index now prints all info into logger instead of couting it. 2014-05-01 20:55:49 +03:00
Ievgen Khvedchenia 2df7242646 Prepare to merge KAZE and AKAZE nldiffusion_functions source files (work in progress). 2014-05-01 18:27:24 +03:00
Ievgen Khvedchenia 30f73623ce Replace runtime checks with assertions 2014-05-01 18:24:13 +03:00
Ievgen Khvedchenia 3e51da38fb Removed Feature_Suppression_Distance function that is not used anywhere. 2014-05-01 10:58:34 +03:00
Alexander Alekhin 71f871fafd replaced sanity check condition for stitching perf test 2014-04-30 18:02:06 +04:00
Alexander Karsakov 4ebe76098e Disabled IPP resize for CV_8U 2014-04-30 17:28:35 +04:00
Ilya Lavrenov c80faff42f added cn>1 support to cv::norm (NORM_INF) 2014-04-30 14:59:37 +04:00
vbystricky c9103730b6 Disable ipp integral in IPPICV version 2014-04-30 12:55:34 +04:00
Ievgen Khvedchenia ab1ef08f0e Rename file config.h to KAZEConfig.h 2014-04-29 22:17:18 +03:00
Ievgen Khvedchenia 4509fe55c2 Clean-up of getters/setters that are not needed by OpenCV 2014-04-29 21:39:27 +03:00
Ievgen Khvedchenia 2daa14e3c7 Clean-up from dead code. 2014-04-29 21:07:53 +03:00
Alexander Alekhin e8d3ebecc7 fix IPPDerivSobel condition 2014-04-29 15:36:45 +04:00
Alexander Alekhin b62e59aac0 icv: enable functions 2014-04-29 15:36:43 +04:00
Alexander Alekhin 5658ba0002 icv: update package 2014-04-29 15:35:27 +04:00
Alexander Alekhin dacf63a888 Merge pull request #2682 from ElenaGvozdeva:ippiDFT 2014-04-29 15:34:01 +04:00
Alexander Alekhin 0f22df2b0d Merge pull request #2667 from akarsakov:ipp_otsu 2014-04-29 15:15:33 +04:00
Alexander Alekhin 06746ba645 Merge pull request #2677 from ilya-lavrenov:ipp_compilation 2014-04-29 12:26:49 +04:00
Elena Gvozdeva 043b917c7d IPP: cv::dft fixed 2014-04-29 12:23:23 +04:00
Ilya Krylov e6aa8ce932 Corrected notes 2014-04-29 10:24:39 +04:00
Adrian Stratulat cbf3c1fbf1 remove unused macros 2014-04-28 19:40:11 +00:00
Ievgen Khvedchenia a134e068ef Fix wrong checking of returned descriptor type 2014-04-28 22:25:27 +03:00
Ievgen Khvedchenia c1bf453266 Wrapped nldiffusion functions with details::kaze or details::amaze namespace to avoid collision of function names 2014-04-28 20:41:44 +03:00
Ievgen Khvedchenia c68cbfced3 Fix size_t to int conversion 2014-04-28 19:32:29 +03:00
Ievgen Khvedchenia 0e3bbd7026 Fix "conditional expression constant" warning 2014-04-28 19:32:04 +03:00
Ievgen Khvedchenia a941d25f6d Fix size_t to int conversion 2014-04-28 16:46:09 +03:00
Ievgen Khvedchenia 5662294319 Rename KAZE to KAZEFeatures to fix MSVS x64 compiler error (Duplicate file name confused it) 2014-04-28 16:34:35 +03:00
Ievgen Khvedchenia 599bcfb591 Fix size_t to int conversion 2014-04-28 16:24:35 +03:00
Ievgen Khvedchenia cc0a94c536 Fix "conditional expression constant" warning 2014-04-28 16:23:58 +03:00
Elena Gvozdeva 507ea95265 fixed 2014-04-28 16:46:11 +04:00
Ievgen Khvedchenia 2162aab0e9 Remove AKAZEFeatures desctructor 2014-04-28 15:17:09 +03:00
Ievgen Khvedchenia f9d3c49023 Bugfix: wrong variable name 2014-04-28 15:14:03 +03:00
Ievgen Khvedchenia f9422f60a6 Fix Fix casting from/to int/float that caused lot of compiler warnings. 2014-04-28 15:13:42 +03:00
Elena Gvozdeva 16629bff4c Added parallel version for DCT_ROWS 2014-04-28 16:05:19 +04:00
Elena Gvozdeva 6880dbfd95 IPP: cv::dct 2014-04-28 16:05:19 +04:00
Ievgen Khvedchenia 3c596184e4 Added copyright headers for KAZE and AKAZE wrappers 2014-04-28 15:01:42 +03:00
Ievgen Khvedchenia f97e38d8a6 Fix casting from/to int/float that caused lot of compiler warnings. 2014-04-28 15:00:14 +03:00
Ilya Krylov f0f741b796 Added documentation 2014-04-28 15:27:30 +04:00
Abhijit Kundu 26c8b3a38e Added suuport for finding Intel TBB for Visual Studio 2013 2014-04-28 07:23:49 -04:00
Alexander Alekhin 649935596e Merge pull request #2653 from alalek:ipp_lut 2014-04-28 15:15:11 +04:00
Alexander Alekhin 0e5b0677c9 Merge pull request #2654 from ElenaGvozdeva:ipp_DFT 2014-04-28 15:14:40 +04:00
Alexander Alekhin 5d50917961 Merge pull request #2674 from akarsakov:ocl_hog_fix_epsilon 2014-04-28 15:06:05 +04:00
Ilya Lavrenov 59876cfb34 fixed compilation 2014-04-28 14:04:41 +04:00
Roman Donchenko c6e91e4736 Merge pull request #2675 from SpecLad:merge-2.4 2014-04-28 13:51:44 +04:00
Roman Donchenko 86ec0fc813 Merge pull request #2668 from vbystricky:perf_TransformECC 2014-04-28 13:50:50 +04:00
Ilya Lavrenov 55bbca2d09 added more types to cv::GaussianBlur 2014-04-28 13:50:28 +04:00
Roman Donchenko 47d903d968 Merge remote-tracking branch 'origin/2.4' into merge-2.4 2014-04-28 12:08:21 +04:00
Ilya Krylov 05ee15f108 Added FisheyeTest 2014-04-28 12:01:27 +04:00
Ievgen Khvedchenia 61f79c2632 Fix line ending at EOF 2014-04-28 10:53:09 +03:00
Ievgen Khvedchenia 3cfc22ae4e Fix initialisation order of parallel loop classes for AKAZE descriptor extraction 2014-04-28 10:52:05 +03:00
Ievgen Khvedchenia f3f0e06c4d Fix parenthesis in assert statements 2014-04-28 10:51:09 +03:00
Ievgen Khvedchenia 0e243541f9 Fix shadowed variable warnings 2014-04-28 10:50:46 +03:00
Alexander Karsakov b046210296 Changed epsilon for hog test, because hog detector is sensible to resize accuracy. 2014-04-28 11:37:46 +04:00
Roman Donchenko 5042ab1f32 Merge pull request #2659 from adrians:docs_pull_1 2014-04-28 11:36:12 +04:00
Ievgen Khvedchenia ba5bec1de2 Fix mutable compilation error 2014-04-27 23:07:48 +03:00
Ievgen Khvedchenia eada0f4b48 Fix shadowed i variable warning 2014-04-27 23:04:31 +03:00
Ievgen Khvedchenia 503bd38963 Enable multithreaded extraction of features using cv::parallel_for_ 2014-04-27 22:28:18 +03:00
Artur Wieczorek 59250e8288 cv::findContours: Check if type of output data structure is right to store contours (vector<vector<Point>>). 2014-04-27 19:22:29 +02:00
Samson Yilma de55126b69 Fixed warnings and parameter name mismatches, added #include needed in some platforms. 2014-04-27 13:02:36 -04:00
Samson Yilma e6420bde73 Added function decomposeHomographyMat. New files added are homography_decomp.cpp and test_homography_decomp.cpp.
Modified files calib3d.hpp and camera_calibration_and_3d_reconstruction.rst.
2014-04-26 20:13:27 -04:00
Ievgen Khvedchenia d37220e8ff Clean-up of the iostream manipulator in AKAZEConfig. 2014-04-26 23:34:38 +03:00
Ievgen Khvedchenia d8c9bb777e Fix return value of descriptorType() 2014-04-26 23:34:07 +03:00
Istvan Sarandi 4bf1df7da3 Suppress warning in constructor. 2014-04-26 00:42:26 +02:00
Alexander Karsakov 7bd9b2ac26 Added setIppErrorStatus() 2014-04-25 20:24:37 +04:00
Ilya Krylov 35e1b322cb Added test for jacobians 2014-04-25 18:36:48 +04:00
Adil Ibragimov 3bd364fce3 fixing accum_dist and operator() mismatching for HellingerDistance and KL_Divergence 2014-04-25 17:37:31 +04:00
vbystricky a13e6ab79f Fix problem with sanity check of transform ecc with ipp resize 2014-04-25 17:33:38 +04:00
Alexander Karsakov 232c37e827 Added ippiComputeThreshold_Otsu to cv::threshold 2014-04-25 17:31:45 +04:00
Ilya Krylov 9c7e0bfd33 Added fisheye camera model 2014-04-25 14:49:36 +04:00
Alexander Alekhin 7ee1d5f69b ipp: added LUT optimization 2014-04-25 12:09:06 +04:00
Elena Gvozdeva 10d1b3a534 Added parallel version for DFT_ROWS 2014-04-25 11:39:19 +04:00
Ievgen Khvedchenia 86888bdf77 Replace swap with clear (more efficient) 2014-04-24 22:01:45 +01:00
Ievgen Khvedchenia 3e24822fff Bugfix: clear input vector of key points for detection stage 2014-04-24 22:01:29 +01:00
Ievgen Khvedchenia 33b9e4b4a3 Added missing operator() 2014-04-24 22:00:51 +01:00
Ievgen Khvedchenia 36db97068c Added missing operator() 2014-04-24 22:00:37 +01:00
Alexander Alekhin 32b25de583 Merge pull request #2656 from ilya-lavrenov:ipp_copymakeborder 2014-04-24 20:30:34 +04:00
Alexander Alekhin 6b2c621d20 Merge pull request #2662 from vbystricky:ipp_MatchTempl 2014-04-24 20:25:42 +04:00
Alexander Karsakov dc91be86b2 Disabled ippiHoughLine_Region for cv::HoughLines 2014-04-24 18:00:03 +04:00
Alexander Karsakov 5580d08c6e Added setIppErrorStatus() 2014-04-24 16:48:46 +04:00
Ilya Lavrenov 46e8d9d02d cv::copyMakeBorder 2014-04-24 14:27:51 +04:00
Alexander Karsakov 1909978f7d Added ippiHoughProbLine to cv::HoughLinesP 2014-04-24 12:28:23 +04:00
vbystricky 82a198a8f2 Fix epsilon calculation for sanity check in x32 build 2014-04-24 10:48:32 +04:00
Istvan Sarandi 22d3faaeb9 Corrected expected result of matrix concatenation. 2014-04-24 03:17:40 +02:00
Istvan Sarandi c20cab9ec1 Added test for concatenation with empty matrices. 2014-04-24 03:09:07 +02:00
Istvan Sarandi 2421ac3958 Added test for concatenation with empty matrices. 2014-04-24 02:43:28 +02:00
Ievgen Khvedchenia 6d500cc6f7 Merge KAZE and AKAZE features with most recent version 2014-04-23 23:02:02 +01:00
Ievgen Khvedchenia d27ed856f2 Replace config with AKAZEConfig.h 2014-04-23 22:44:03 +01:00
Adrian Stratulat 4fb5680d91 Documentation - minor fix-ups 2014-04-23 17:30:27 +00:00
Aaron Kunze 1f8b41f390 Optimizes filter2D for Intel GPUs 2014-04-23 10:20:09 -07:00
Alexander Alekhin dcc4d3640b Merge pull request #2651 from ilya-lavrenov:ipp_minmaxidx_3cn 2014-04-23 20:06:55 +04:00
Andrey Pavlenko 8114e071c2 Merge pull request #2655 from akarsakov:ipp_fix_pyramid 2014-04-23 16:27:33 +04:00
Elena Gvozdeva 2d71c094b3 IPP: CV::dft 2014-04-23 15:52:05 +04:00
Andrey Pavlenko d93161812b Merge pull request #2620 from ilya-lavrenov:ipp_integration 2014-04-23 15:12:45 +04:00
Alexander Karsakov f3d1001c5d Changed tests for support intersection between expected and actual lists of lines. 2014-04-23 13:18:47 +04:00
Alexander Karsakov 751264f88a Added ippiHoughLine_Region to cv::HoughLines 2014-04-23 11:59:36 +04:00
Alexander Alekhin 9badfa1f83 Merge pull request #2646 from ilya-lavrenov:ipp_remap 2014-04-23 11:51:01 +04:00
Alexander Alekhin ba0ab8edb0 Merge pull request #2647 from vbystricky:ipp_norm 2014-04-23 11:50:13 +04:00
Alexander Alekhin c2319285a9 Merge pull request #2649 from ilya-lavrenov:gabor_eps 2014-04-23 11:49:43 +04:00
Alexander Karsakov 92f855f0c3 Added checking destination size for pyrUp, pyrDown. 2014-04-23 11:47:15 +04:00
Alexander Karsakov 01123aaa36 Changed integer operations to float for Intel devices 2014-04-23 11:00:32 +04:00
Ilya Lavrenov 493679dc56 cv::minMaxIdx for cn > 1 2014-04-22 23:47:04 +04:00
Alexander Alekhin e42057c487 Merge pull request #2648 from ilya-lavrenov:ipp_dist 2014-04-22 19:00:02 +04:00
Andrey Pavlenko cd01d705c9 Merge pull request #2627 from akarsakov:ipp_pyramids 2014-04-22 17:19:27 +04:00
Ilya Lavrenov 5c0a4878d7 changes eps 2014-04-22 15:49:17 +04:00
vbystricky dfe6adebb9 Fix error in arguments of ipp function 2014-04-22 15:07:03 +04:00
Alexander Alekhin 580559e1e6 Merge pull request #2618 from vbystricky:ipp_Scharr 2014-04-22 15:02:13 +04:00
Ilya Lavrenov 640c9667c7 fix for IPP ICV 2014-04-22 14:55:28 +04:00
Ilya Lavrenov 51e2a8ec96 fixes 2014-04-22 14:51:39 +04:00
vbystricky e68a55cca2 Fix error in ipp function call 2014-04-22 14:35:27 +04:00
Ilya Lavrenov 46e40343f2 cv::remap 2014-04-22 14:33:55 +04:00
Alexander Alekhin caf3ed284d Merge pull request #2645 from vbystricky:ipp_Convert 2014-04-22 13:45:31 +04:00
vbystricky 9cdb330452 Change test conditions 2014-04-22 13:27:20 +04:00
Roman Donchenko cccdcac0c8 Merge pull request #2640 from a-wi:2.4 2014-04-22 12:01:47 +04:00
Roman Donchenko 4211d8fbd9 Merge pull request #2641 from SpecLad:merge-2.4 2014-04-22 12:01:03 +04:00
Andrey Pavlenko 6b986489ec Merge pull request #2643 from vbystricky:ipp_GaussianBorder 2014-04-22 11:55:06 +04:00
Andrey Pavlenko 34afc72c23 Merge pull request #2642 from vbystricky:ipp_resize 2014-04-22 11:53:26 +04:00
Andrey Pavlenko 6823b36974 Merge pull request #2624 from ElenaGvozdeva:ipp_DistanceTransform 2014-04-22 11:48:25 +04:00
vbystricky f5c729396d Fix call of ippiConvert. 2014-04-22 10:50:35 +04:00
Andrey Pavlenko 7c3d5b056a Merge pull request #2612 from grkutty:pullreq/140319-bilateral-b 2014-04-22 09:32:39 +04:00
Artur Wieczorek f27a886314 Fix for issue #3645 (http://code.opencv.org/issues/3645).
Implement missing features in CvCaptureCAM_VFW class.

Implemented missing CvCaptureCAM_VFW::setProperty() member function (handling CV_CAP_PROP_FRAME_WIDTH, CV_CAP_PROP_FRAME_HEIGHT, CV_CAP_PROP_FPS properties).
Extended CvCaptureCAM_VFW::setProperty()/getProperty() functions to handle also CV_CAP_PROP_FPS property.
Minor refactoring of CvCaptureCAM_VFW class.
2014-04-21 17:10:58 +02:00
vbystricky bb12293251 Convert opencv border type to ipp border. Check supported border before call ipp function 2014-04-21 18:32:53 +04:00
vbystricky 42079b899c Fix error in call of ippResize 2014-04-21 17:26:03 +04:00
Elena Gvozdeva 3d7872b904 fixed 2014-04-21 16:59:55 +04:00
Roman Donchenko 4db12032dc Merge remote-tracking branch 'origin/2.4' into merge-2.4
No conflicts! Amazing!
2014-04-21 16:47:35 +04:00
Elena Gvozdeva b4830d896c added ippiTrueDistanceTransform_8u32f_C1R 2014-04-21 15:17:56 +04:00
Elena Gvozdeva 0265247504 Added ippiDistanceTransform for cv::distanceTransform, maskSize=3,5 2014-04-21 15:17:55 +04:00
vbystricky d9ef5bb5a7 Fix compile warnings 2014-04-21 15:02:38 +04:00
vbystricky f52126725f Disable scharr in icv only configuration 2014-04-21 14:43:56 +04:00
vbystricky d97f7da7a9 Fix setIppErrorStatus placement 2014-04-21 14:19:25 +04:00
Ilya Lavrenov fe644ede19 cv::multiply 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 9cc80a68db fixed warnings 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 76c415ff49 cv::filterSpeckles 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 04abffeb16 cv::cornerHarris 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 8603c58f37 Mat::setTo(with mask) 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 0b678c2451 Mat::setTo(Scalar::all(0)) 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 3bd8211a72 Mat::copyTo 2014-04-21 13:14:55 +04:00
Ilya Lavrenov f7ec4a5c47 Mat::copyTo with mask 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 8d24a83c9c cv::flip inplace 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 5ca3d855a2 cv::transpose inplace 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 8da0e2b707 cv::accumulate 2014-04-21 13:14:55 +04:00
Ilya Lavrenov d453a598f8 cv::min/cv::max CV_64F 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 3e173b701e cv::Laplacian 2014-04-21 13:14:54 +04:00
Alessandro Trebbi 3d25d70627 fix for compiling 2.4 opencv with xcode 5.1 2014-04-18 13:42:47 +02:00
vbystricky 650762419c Add setIppErrorStatus() 2014-04-18 15:13:34 +04:00
vbystricky d17f40dc1f Fix error in code 2014-04-18 15:04:46 +04:00
vbystricky 32394df42d Add constant border fix call ipp function 2014-04-18 15:04:46 +04:00
vbystricky 79384beb60 Fix warning 2014-04-18 15:04:45 +04:00
vbystricky 160c964e4b Fix error 2014-04-18 15:04:45 +04:00
vbystricky baa6ab1967 Change Scharr filter to new ipp functions 2014-04-18 15:04:45 +04:00
Andrey Pavlenko 82c67abbfa Merge pull request #2622 from ilya-lavrenov:ipp_sort 2014-04-18 14:47:06 +04:00
Andrey Pavlenko 39b852f51d Merge pull request #2625 from ilya-lavrenov:ipp_reduce 2014-04-18 14:46:37 +04:00
Ilya Lavrenov 9a109440df cv::reduce sum/avg 2014-04-18 14:44:12 +04:00
Ilya Lavrenov aa5767421a cv::reduce (min/max to single column) 2014-04-18 14:39:33 +04:00
Ilya Lavrenov 1f6b719776 added ippisFlip to cv::sort 2014-04-18 14:37:46 +04:00
Ilya Lavrenov 26e8c6216f cv:;sortIdx 2014-04-18 14:31:27 +04:00
Ilya Lavrenov d5513f522b cv::sort 2014-04-18 14:31:27 +04:00
Andrey Pavlenko cb8743f9aa Merge pull request #2628 from ilya-lavrenov:ipp_error_handling 2014-04-18 13:37:35 +04:00
Alexander Karsakov 4f4a95299a Added setIppErrorStatus 2014-04-18 09:04:25 +04:00
Alexander Karsakov 6202f54a18 Fixed sanity check for integer type 2014-04-17 19:02:56 +04:00
Ilya Lavrenov 05a47d9014 cmd option 2014-04-17 18:06:14 +04:00
Ilya Lavrenov 87eb1b8fcc fixes in imgproc 2014-04-17 14:51:59 +04:00
Roman Donchenko da58425fbc Merge pull request #2629 from maksqwe:unused_fix 2014-04-17 13:02:36 +04:00
Ilya Lavrenov 6f9ca3d77c fixed some errors 2014-04-17 11:08:02 +04:00
Ilya Lavrenov ce0941160e added status check 2014-04-17 11:08:02 +04:00
Ilya Lavrenov 2cd7a913ed verbose errors 2014-04-17 11:07:01 +04:00
Ilya Lavrenov f3c56f8310 first attemp 2014-04-17 11:07:01 +04:00
Istvan Sarandi e18224110c Removed emptiness check from cv::hconcat and cv::vconcat. Sometimes you want to concatenate with an empty matrix. 2014-04-17 02:41:52 +02:00
Maks Naumov 3e5a69d8ba remove unused variables in OCL_PERF_TEST_P() 2014-04-17 00:19:04 +03:00
Maks Naumov dba0f9fc8f remove unused variable in erGrouping() 2014-04-17 00:16:07 +03:00
Maks Naumov 9e10c09f2d remove unused variable in LineSegmentDetectorImpl::compareSegments() 2014-04-17 00:14:13 +03:00
Alexander Karsakov a7d12aabab Added epsilon for tests with float data type 2014-04-16 18:07:24 +04:00
Alexander Karsakov 793e980876 Added IPP Pyramid API functions to cv::buildPyramid 2014-04-16 17:10:20 +04:00
Andrey Pavlenko e11d998cfb Merge pull request #2623 from alalek:icv_fix_color 2014-04-16 15:56:09 +04:00
Alexander Karsakov ef2f5999ed Added perf test for cv::buildPyramid 2014-04-16 13:01:49 +04:00
Alexander Karsakov 8230f1fd68 Added ippiPyrUp_Gauss5x5 to cv::pyrUp 2014-04-16 11:59:32 +04:00
Alexander Karsakov f218dffce6 Added ippiPyrDown_Gauss5x5 to cv::pyrDown 2014-04-16 11:39:10 +04:00
Alexander Karsakov 10cb660240 Fixed condition 2014-04-16 10:28:24 +04:00
KayKwon e13e3be16e Merge branch 'master' into matlab_formatter 2014-04-16 11:13:02 +09:00
KayKwon 84257b57d0 Fix for (Bug #2789)
Add MatlabFormatter for matlab style output.
See http://code.opencv.org/issues/2789
2014-04-16 10:56:27 +09:00
unknown c2f540d090 White space fixes 2014-04-15 09:32:34 -07:00
Andrey Pavlenko 80ef1f6753 Merge pull request #2621 from arkunze:pullreq/140319-resize-b 2014-04-15 19:56:56 +04:00
Andrey Pavlenko a26bed16e6 Merge pull request #2617 from ElenaGvozdeva:ipp_matchTemplate 2014-04-15 19:56:38 +04:00
Andrey Pavlenko dab8e920b0 Merge pull request #2565 from apavlenko:tapi_stitching 2014-04-15 19:56:11 +04:00
Andrey Pavlenko 7ba4212529 Merge pull request #2544 from alalek:perf_report_regressions 2014-04-15 16:17:39 +04:00
Alexander Alekhin 3bb6db522d ICV: mark missed functions 2014-04-15 15:55:44 +04:00
GregoryMorse aa3c36f545 Update cap_msmf.cpp
Add support for WinRT in the MF capture framework by removing the disallowed calls to enumerate devices and create a sample grabber sink and adding framework for the MediaCapture interface and a custom sink which interfaces with the sample grabber callback interface. The change requires discussion for making it completely functional as redundancy is required given that if the source is a video file, the old code pathways must be used. Otherwise all IMFMediaSession, IMFMediaSource, and IMFActivate code must use a MediaCapture code path and all sink code must use the CMediaSink custom sink.

Support for the custom sink is extended to non-WinRT not for compatibility as Windows Vista client is a minimum regardless, but because it offers more flexibility, could be faster and is able to be used as an optionally different code path during sink creation based on a future configuration parameter.

My discussion and proposal to finish this change:
 Devices are so easily enumerated through WinRT Windows.Devices namespace that wrapping the calls in a library is quite a chore for little benefit though to get the various modes and formats could still be a worthwhile project. For now conditional compilation to remove videodevices and any offending non-video file related activity in videodevice. In my opinion, this is a different , far less fundamental and important change which can possibly be done as a future project and also much more easily implemented in C++/CX.

ImageGrabber has the IMFSampleGrabberSinkCallback replaced with a base class (SharedSampleGrabber) which also be is base class for ImageGrabberRT. This change is necessary as the custom sink does not require a thread to pump events which is done through MediaCapture already. IMFSampleGrabberSinkCallback is the common element between both models and that piece can be shared. Initializing the new ImageGrabberRT is as simple as passing an already initialized MediaCapture object and any video format/encoding parameters.

The concurrency event is necessary to wait for completion and is the way the underlying, IAsyncAction wrappers in the task library work as well. Native WIN32 event objects would be an option if HAVE_CONCURRENCY is not defined. I could even imagine doing it with sleep/thread yield and InterlockedCompareExchange yet I am not enthusiastic about that approach either. Since there is a specific compiler HAVE_ for concurrency, I do not like pulling it in though I think for WinRT it is safe to say we will always have it available though should probably conditionally compile with the Interlocked option as WIN32 events would require HAVE_WIN32.

It looks like C++/CX cannot be used for the IMediaExtension sink (which should not be a problem) as using COM objects requires WRL and though deriving from IMediaExtension can be done, there is little purpose without COM. Objects from C++/CX can be swapped to interact with objects from native C++ as Inspectable* can reinterpret_cast to the ref object IInspectable^ and vice-versa. A solution to the COM class with C++/CX would be great so we could have dual support. Also without #define for every WRL object in use, the code will get quite muddy given that the */^ would need to be ifdef'd everywhere.

Update cap_msmf.cpp

Fixed bugs and completed the change.  I believe the new classes need to be moved to a header file as the file has become to large and more classes need to be added for handling all the asynchronous problems (one wrapping IAsyncAction in a task and another for making a task out of IAsyncAction).  Unfortunately, blocking on the UI thread is not an option in WinRT so a synchronous architecture is considered "illegal" by Microsoft's standards even if implementable (C++/CX ppltasks library throws errors if you try it).  Worse, either by design or a bug in the MF MediaCapture class with Custom Sinks causes a crash if stop/start previewing without reinitializing (spPreferredPreviewMediaType is fatally nulled).  After decompiling Windows.Media.dll, I worked around this in my own projects by using an activate-able custom sink ID which strangely assigns 1 to this pointer allowing it to be reinitialized in what can only be described as a hack by Microsoft.  This would add additional overhead to the project to implement especially for static libraries as it requires IDL/DLL exporting followed by manifest declaration.  Better to document that it is not supported.

Furthermore, an additional class for IMFAttributes should be implemented to make clean architecture for passing around attributes as opposed to directly calling non-COM interface calls on the objects and making use of SetProperties which would also be a set up for an object that uses the RuntimeClass activation ID.

The remaining changes are not difficult and will be complete soon along with debug tracing messages.

Update and rename cap_msmf.h to cap_msmf.hpp

Update cap_msmf.cpp

Successful test - samples are grabbed

Update ppltasks_winrt.h

Library updated and cleaned up with comments, marshaling, exceptions and linker settings
Fixed trailing whitespace

Support VS 2013 and consistency cleanup and C++/CX object creation fixed
2014-04-15 18:32:23 +08:00
Vadim Pisarevsky 6a5a0fe803 Merge pull request #2016 from pemmanuelviel:kmeansppSquareDist 2014-04-15 13:31:48 +04:00
Vadim Pisarevsky 7942494fb6 Merge pull request #2233 from palindromoroz:BGSubtract_KNN_new_code 2014-04-15 13:22:43 +04:00
Vadim Pisarevsky 20aaa8fe77 Merge pull request #2560 from akarsakov:gaussianblur_integer 2014-04-15 13:21:25 +04:00
Vadim Pisarevsky 92db6786a9 Merge pull request #2578 from akrynski:patch-1 2014-04-15 13:21:08 +04:00
Vadim Pisarevsky 4eede18027 Merge pull request #2606 from alalek:icv_downloader 2014-04-15 13:20:04 +04:00
Vadim Pisarevsky 9cdd15e141 Merge pull request #2615 from krodyush:pullreq/140319-PyrLKOpticalFlow-fix 2014-04-15 13:19:45 +04:00
Roman Donchenko 534f9623f2 Merge pull request #2616 from SpecLad:merge-2.4 2014-04-15 12:06:13 +04:00
Elena Gvozdeva 3553e9379b fixed 2014-04-15 11:41:33 +04:00
unknown 36d33dd6c2 Review comments 2014-04-14 16:10:11 -07:00
Aaron Kunze ebbac3c66d Optimizes OpenCL resize and optical flow to use image extension. 2014-04-14 16:09:17 -07:00
Andrey Pavlenko 8176e893c0 Merge pull request #2609 from alalek:tests_fixes 2014-04-14 18:54:01 +04:00
Andrey Pavlenko 5ff59af09d Merge pull request #2610 from ilya-lavrenov:ipp_cvtcolor 2014-04-14 18:52:07 +04:00
Andrey Pavlenko f4c5679db8 Merge pull request #2614 from ilya-lavrenov:ipp_laplacian 2014-04-14 18:51:31 +04:00
Alexander Karsakov 53bc93730c Added suppressing deprecation for ippiMulC_32f_C1IR 2014-04-14 16:38:59 +04:00
Roman Donchenko 799d2dabd6 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/core/test/test_arithm.cpp
	modules/cuda/src/cascadeclassifier.cpp
	modules/imgproc/doc/geometric_transformations.rst
	modules/objdetect/src/hog.cpp
	modules/ocl/perf/perf_imgproc.cpp
	modules/ocl/src/gftt.cpp
	modules/ocl/src/moments.cpp
2014-04-14 16:08:02 +04:00
Ilya Lavrenov 884b706b3a fixed warning 2014-04-14 14:40:40 +04:00
Ilya Lavrenov ad7f2311c0 cv::Laplacian 2014-04-14 14:34:28 +04:00
Ilya Lavrenov 2a051a124f cvtColor 2014-04-14 14:29:36 +04:00
Andrey Pavlenko 5522c14efc Merge pull request #2607 from ilya-lavrenov:warn_sup 2014-04-14 14:15:12 +04:00
krodyush 57992e0169 replace IPatchLocal[][] into *IPatchLocal to fix compilation error on some devices. 2014-04-14 13:23:12 +04:00
Tony fd5e180657 Rebase branch gtk3 2014-04-13 15:52:22 +01:00
Tony 265148b974 Correction to enable compilation on platform with only GTK2 libs
modified:   CMakeLists.txt
	modified:   cmake/OpenCVFindLibsGUI.cmake
2014-04-13 11:11:05 +01:00
Tony cb4fffc72a Fix logic error in OpenCVFindLibsGUI.cmake
When with_gtk is selected but GTK3 is not present the current logic
fails to check for GTK2. This edit corrects this.
2014-04-13 11:08:32 +01:00
Tony c0dbc083ea Correct error with GTK3 not found selection
When GTK3 is not found, HAVE_GTK was being set to TRUE. This edit
ensures that HAVE_GTK is only set if GTK3 or GTK2 (meeting minimum
version requirements) is present.
Selection logic for printing 'GTK: No' when the libraries are not found
has also been removed so the message is printed when GTK is not found or
selected in common with other libraries.

Changes committed:
	modified:   CMakeLists.txt
	modified:   cmake/OpenCVFindLibsGUI.cmake
2014-04-13 11:08:31 +01:00
Tony 65f63421fa Change quotes around GTK headers for angle brackets
The linux buildbots have started to fail compilation due to not
finding the gtk headers. The quotes have been changed to angle brackets
to indicate to the compiler that these are system includes.
2014-04-13 11:07:38 +01:00
Tony a28ad40c2a Fix bug in GTK+3 logic introduced by previous merge
During merging of conflicting versions of this file, I erroneously
deleted several lines in the GUI reporting section. This is repaired
in this commit.
2014-04-13 11:07:38 +01:00
Tony f318b5bc9d Improve GTK+ library selection logic.
The new logic will select GTK+3 by default if WITH_GTK is selected. If
the GTK+3 libraries are not found, then GTK+2 libraries will be selected
if found.
This can be overridden by using WITH_GTK_2_X to force selection of GTK+2
(if found).
2014-04-13 11:04:56 +01:00
Tony 1638341270 Use GTK_VERSION_MAJOR to switch between GTK+ version two and three
specific code. As a result of this, HAVE_GTK3 no longer needs to be
exposed.

The use of HAVE_GTK, and HAVE_ GTK3 have been changed to mirror the
method used by HAVE_QT and HAVE_QT5.
 On branch gtk3
 Changes to be committed:
        modified:   CMakeLists.txt
        modified:   cmake/OpenCVFindLibsGUI.cmake
        modified:   cmake/templates/cvconfig.h.in
        modified:   modules/highgui/src/window.cpp
        modified:   modules/highgui/src/window_gtk.cpp
2014-04-13 11:04:56 +01:00
Tony befdef9685 Merge remote-tracking branch 'upstream/master'
Rebase to lates upstream
2014-04-13 10:39:32 +01:00
Tony 512cb4fced Correction to enable compilation on platform with only GTK2 libs
modified:   CMakeLists.txt
	modified:   cmake/OpenCVFindLibsGUI.cmake
2014-04-12 22:43:42 +01:00
unknown d2b4ee1e9b More intendation fixes 2014-04-11 21:44:12 -07:00
unknown 06df383675 Indent fixes 2014-04-11 19:14:01 -07:00
Alexander Alekhin 3a1a3da782 fix tests 2014-04-11 16:11:05 +04:00
Andrey Pavlenko f104d5be8c Merge pull request #2600 from ilya-lavrenov:ipp_calc_hist 2014-04-11 15:18:04 +04:00
Andrey Pavlenko fd90efc9dd Merge pull request #2593 from arkunze:pullreq/140319-color 2014-04-11 15:16:33 +04:00
Alexander Alekhin 047d285b7d ICV: added package downloader 2014-04-11 14:19:18 +04:00
Roman Donchenko df8e28283f Merge pull request #2571 from MartinChodakowski:fix-old-python-doc-typos 2014-04-11 14:15:26 +04:00
Roman Donchenko 4c2db3d6e7 Merge pull request #2579 from maksqwe:test_operations_fix 2014-04-11 14:14:33 +04:00
Roman Donchenko 8ab224746b Merge pull request #2603 from maksqwe:unused_fix_2.4 2014-04-11 14:14:04 +04:00
Ilya Lavrenov 19d470749b added macro for denoting region for suppression of "Wdeprecated-declarations" 2014-04-11 13:45:20 +04:00
Andrey Pavlenko 925178749a removing SuppressWarning and CV_OPENCL_RUN 2014-04-11 13:09:19 +04:00
Alexander Alekhin 3578f0afe9 ocl: workaround for synchronization issue in ::map() 2014-04-11 13:09:18 +04:00
Alexander Alekhin 588658d1a3 tapi: stitching: fix documentation 2014-04-11 13:09:17 +04:00
Alexander Alekhin 026b13b3db TAPI: stitching: blender: fix OpenCL path & adjust test condition 2014-04-11 13:09:16 +04:00
Alexander Alekhin e6cc1be7e8 stitching: allow to use dynamic DescriptorMatcher 2014-04-11 13:01:13 +04:00
Alexander Alekhin 06738468af TAPI: stiching: add custom OpenCL kernels for MultiBandBlender 2014-04-11 13:01:12 +04:00
Alexander Alekhin c22d92c1cb stitching: extend logging 2014-04-11 13:01:11 +04:00
Alexander Alekhin a7f69a37e3 stitching: use BORDER_CONSTANT in warp 2014-04-11 13:01:10 +04:00
Alexander Alekhin c4a31a1ab1 TAPI: stitching: optimize compare operation 2014-04-11 13:01:10 +04:00
Alexander Alekhin 7a5c1babde TAPI: stitching: optimize exposure 2014-04-11 13:01:09 +04:00
Alexander Alekhin 2737e3c99b TAPI: stitching: workaround for problem getUMat() call 2014-04-11 13:01:08 +04:00
Alexander Alekhin c1ea6f3c42 TAPI: stitching: improve warpers 2014-04-11 13:01:07 +04:00
Alexander Alekhin 89e3e448f5 features2d: workaround for 'utrainDescCollection' issue (PR #2142) 2014-04-11 13:01:07 +04:00
Alexander Alekhin 1d9808e5d5 TAPI: stitching, replaced Mat->UMat/_Array 2014-04-11 13:01:06 +04:00
Alexander Alekhin 8b6c5ade0e TAPI: added perf test for stitching 2014-04-11 13:01:05 +04:00
Andrey Pavlenko 6bfbcf02cb Merge pull request #2587 from ElenaGvozdeva:ipp_matchTemplate 2014-04-11 12:47:25 +04:00
Andrey Pavlenko f7f4593936 Merge pull request #2581 from vbystricky:ipp_moments 2014-04-11 12:45:13 +04:00
Andrey Pavlenko 7ae547a208 Merge pull request #2597 from ilya-lavrenov:ipp_countnonzero 2014-04-11 12:43:24 +04:00
Andrey Pavlenko b56dce3965 Merge pull request #2604 from alalek:binary_package_fix 2014-04-11 12:34:23 +04:00
Tony 8fd11f477b Fix logic error in OpenCVFindLibsGUI.cmake
When with_gtk is selected but GTK3 is not present the current logic
fails to check for GTK2. This edit corrects this.
2014-04-10 23:28:23 +01:00
unknown e032b5f5d5 Resolving conflicts after rebasing from public 2014-04-10 12:28:37 -07:00
Aaron Kunze b59c517f98 Optimizations to OpenCL bilateral filter. 2014-04-10 12:15:13 -07:00
Tony 47d4f8cd61 Merge remote-tracking branch 'upstream/master' into gtk3
Conflicts:
	CMakeLists.txt
2014-04-10 20:10:28 +01:00
Ilya Lavrenov b970ec7dae parallel version 2014-04-10 19:39:00 +04:00
Elena Gvozdeva 43c29a6751 fixed 2014-04-10 17:26:38 +04:00
Alexander Karsakov 7369cfd9ec Added perf test for cornerMinEigenVal 2014-04-10 16:09:48 +04:00
Vadim Pisarevsky f417c79d16 Merge pull request #1932 from seth-planet:master 2014-04-10 13:36:14 +04:00
Vadim Pisarevsky 604a64b206 Merge pull request #2390 from nicolasmartin3d:master_bug3546 2014-04-10 13:33:43 +04:00
Vadim Pisarevsky a0bf7f82ba Merge pull request #2067 from pemmanuelviel:groupWiseCenterChooser 2014-04-10 13:33:29 +04:00
Vadim Pisarevsky dae04aacc3 Merge pull request #2575 from rold2007:Bugfix_1437 2014-04-10 13:31:33 +04:00
Vadim Pisarevsky b66adc81a4 Merge pull request #2599 from maksqwe:test_calibration_2.4 2014-04-10 13:30:37 +04:00
Vadim Pisarevsky b5755b1228 Merge pull request #2588 from vpisarev:fix_samples_n_unused 2014-04-10 13:30:20 +04:00
Vadim Pisarevsky 211d44cfc5 Merge pull request #2591 from Nerei:viz_cloud_shading_support 2014-04-10 13:29:58 +04:00
Ilya Lavrenov b2379b51b5 cv::countNonZero 2014-04-10 13:21:52 +04:00
Tony 34984328fd Merge remote-tracking branch 'upstream/master'
Conflicts:
	CMakeLists.txt
2014-04-10 08:07:02 +01:00
Alexander Karsakov d9556a998f Added ippiMinEigenVal_ to cv::cornerMinEigenVal 2014-04-10 11:00:08 +04:00
Tony 2f9dad5ce8 Correct error with GTK3 not found selection
When GTK3 is not found, HAVE_GTK was being set to TRUE. This edit
ensures that HAVE_GTK is only set if GTK3 or GTK2 (meeting minimum
version requirements) is present.
Selection logic for printing 'GTK: No' when the libraries are not found
has also been removed so the message is printed when GTK is not found or
selected in common with other libraries.

Changes committed:
	modified:   CMakeLists.txt
	modified:   cmake/OpenCVFindLibsGUI.cmake
2014-04-09 22:07:59 +01:00
Maks Naumov eb89f5207c remove unused variables in CV_KDTreeTest_CPP::findNeighbors() 2014-04-09 23:07:48 +03:00
Maks Naumov 29d1bce85f remove unused variable in TEST_P() 2014-04-09 23:06:06 +03:00
Maks Naumov 79eb3c5cde remove unused variable in OCL_PERF_TEST_P() 2014-04-09 23:04:29 +03:00
Maks Naumov befbe89bdf remove unused variable in ocl_moments() 2014-04-09 23:01:49 +03:00
Maks Naumov eb45cf0c93 remove unused variable in findCorners_caller() 2014-04-09 22:59:52 +03:00
Maks Naumov 9b52b61451 remove unused variable in HOGDescriptor::groupRectangles() 2014-04-09 22:56:19 +03:00
Maks Naumov a01659825c remove unused variable in loadFromXML() 2014-04-09 22:53:36 +03:00
Maks Naumov c098c18942 Merge pull request #1 from Itseez/2.4
2.4
2014-04-09 22:48:19 +03:00
Ilya Lavrenov 18ef25ec30 cv::calcHist 2014-04-09 21:46:09 +04:00
Aaron Kunze 785acc1834 Fixes global size issue, adds #pragma unroll to loops 2014-04-09 08:42:55 -07:00
Alexander Alekhin 03773cb117 remove ippasync samples from build without IPP-A 2014-04-09 18:58:53 +04:00
Andrey Pavlenko 7b366df822 Merge pull request #2589 from alalek:icv_update 2014-04-09 18:23:35 +04:00
Andrey Pavlenko cd02a7002b Merge pull request #2596 from ilya-lavrenov:tapi_setto 2014-04-09 18:23:15 +04:00
Alexander Alekhin ab691a4a24 ipp: some functions are not available in the ICV package #2 2014-04-09 18:20:49 +04:00
Alexander Alekhin 0d477ffea1 ipp: some functions are not available in the ICV package 2014-04-09 18:20:49 +04:00
Alexander Alekhin 1461ab41bc ipp: added support for updated ICV package 2014-04-09 18:20:49 +04:00
Maks Naumov b033a63e63 fix typo in test_cameracalibration 2014-04-09 14:41:16 +03:00
vbystricky b6d58d1d3b Fix ipp ifdef 2014-04-09 14:53:59 +04:00
vbystricky d9013a85f1 Fix IPP version ifdef 2014-04-09 14:49:37 +04:00
vbystricky 8899ec1586 Add IPP version of Moments calculattion of image 2014-04-09 14:49:36 +04:00
Andrey Pavlenko ced81b9121 Merge pull request #2594 from arkunze:pullreq/140319-dll-shutdown-fix-b 2014-04-09 14:25:12 +04:00
Andrey Pavlenko e9bc737485 Merge pull request #2584 from akarsakov:ipp_threshold 2014-04-09 14:17:48 +04:00
Andrey Pavlenko e6d6a3a85b Merge pull request #2586 from ilya-lavrenov:ipp_disable 2014-04-09 14:16:25 +04:00
Ilya Lavrenov bcd7151867 added UMat::setTo accuracy test 2014-04-09 14:15:22 +04:00
Andrey Pavlenko e013f04669 Merge pull request #2583 from ilya-lavrenov:ippicv 2014-04-09 14:14:14 +04:00
Andrey Pavlenko 96484e1ad7 Merge pull request #2592 from ilya-lavrenov:tests 2014-04-09 14:06:14 +04:00
Ilya Lavrenov 4a63b3dd90 cv2cvtest part2 2014-04-09 13:08:51 +04:00
Alexander Karsakov a66db67b83 Attempt to improve performance 2014-04-09 11:54:09 +04:00
Alexander Karsakov 35494f81ef Added ippiThreshold to cv::threshold 2014-04-09 11:41:35 +04:00
Elena Gvozdeva 6119ae0ea9 fixed 2014-04-09 11:09:51 +04:00
David Rolland cb8ddb1179 Corrected bug #1437. Corrected the cast of two short values from an lParam. lParam contains two signed-short, the position can be negative when another mouse event happens with a mouse_move (mouse_click, etc.)
The Microsoft documentation specifies NOT to use LOWORD and HIWORD macros to extract the x/y positions as it won't work correctly with multiple monitors. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms645607(v=vs.85).aspx.
2014-04-09 18:24:21 +12:00
Aaron Kunze 629ddf0bf8 Resolves bug #3450 (Improperly cleaning up resources in DllMain) 2014-04-08 16:21:33 -07:00
Aaron Kunze bea2515f0e Optimizations for OpenCL color conversion. 2014-04-08 15:58:04 -07:00
Tony 8592022bd8 Change quotes around GTK headers for angle brackets
The linux buildbots have started to fail compilation due to not
finding the gtk headers. The quotes have been changed to angle brackets
to indicate to the compiler that these are system includes.
2014-04-08 23:13:27 +01:00
Tony 838bb4bdeb Fix bug in GTK+3 logic introduced by previous merge
During merging of conflicting versions of this file, I erroneously
deleted several lines in the GUI reporting section. This is repaired
in this commit.
2014-04-08 21:21:40 +01:00
Ilya Lavrenov 444ab0ef0d fixed (IppiSize&)sz 2014-04-09 00:19:56 +04:00
Ilya Lavrenov c735594178 cv::scaleAdd 2014-04-09 00:12:48 +04:00
Ilya Lavrenov fd3a6f0db7 cv::blur 2014-04-09 00:11:28 +04:00
Ilya Lavrenov a624ec167d cv::Mat::convertTo 2014-04-09 00:11:28 +04:00
Ilya Lavrenov b72b256fda cv::pow (added ippiSqr_32f_C1R for power=2) 2014-04-09 00:11:28 +04:00
Ilya Lavrenov b56b9c43dc cv::updateMotionHistory 2014-04-09 00:11:28 +04:00
Ilya Lavrenov 77723db034 cv::flip 2014-04-09 00:11:28 +04:00
Ilya Lavrenov f2a35d6388 cv::boxFilter 2014-04-09 00:11:28 +04:00
Ilya Lavrenov c6f208e1c8 cv::medianBlur 2014-04-09 00:11:27 +04:00
Ilya Lavrenov ed1ca00bf6 cv::magnitude 2014-04-09 00:11:27 +04:00
Ilya Lavrenov bf860dbb31 cv::pow 2014-04-09 00:11:27 +04:00
Ilya Lavrenov 49d1691a3e cv::sqrt 2014-04-09 00:11:27 +04:00
Ilya Lavrenov c224cfa628 cv::accumulateSquare && cv::acumulateProduct 2014-04-09 00:11:27 +04:00
Ilya Lavrenov 2c0c887f70 cv::accumulateWeighted 2014-04-09 00:11:27 +04:00
Ilya Lavrenov 5ddff235bb cv::polarToCart 2014-04-09 00:11:27 +04:00
Ilya Lavrenov 46cb4e0cbc cv::transpose 2014-04-09 00:11:26 +04:00
Ilya Lavrenov f1b38c4198 cv::warpPerspective and cv::warpAffine 2014-04-09 00:11:26 +04:00
Ilya Lavrenov e090aa07db disabled some IPP funcs 2014-04-08 22:30:18 +04:00
Tony d60be58a92 Merge remote-tracking branch 'upstream/master' into gtk3
Conflicts:
	CMakeLists.txt
2014-04-08 19:25:51 +01:00
Tony 3cd50739ef Merge remote-tracking branch 'upstream/master' 2014-04-08 19:14:05 +01:00
Anatoly Baksheev 3f95818252 Added cloud shading support - additional normals array is used 2014-04-08 20:31:28 +04:00
Andrey Pavlenko 5600bc54f4 Merge pull request #2585 from ilya-lavrenov:norm 2014-04-08 18:01:24 +04:00
Andrey Pavlenko ac92d4c701 Merge pull request #2566 from krodyush:pullreq/140319-PyrLKOpticalFlow 2014-04-08 17:58:16 +04:00
Vadim Pisarevsky 1b339eb0d4 fixed slow down in getRectSubPix (original patch by Markus JR Mueller); removed some unused variables and functions 2014-04-08 17:54:08 +04:00
Firat Kalaycilar 990295644e made a performance improvement.
changed the way the mean value for each pixel is assigned in the output image.
2014-04-08 16:10:32 +03:00
Elena Gvozdeva 42d45e0b02 Added ippiSqrDistanceNorm and ippiCrossCorrNorm to cv::matchTemplate 2014-04-08 16:51:15 +04:00
Firat Kalaycilar 9eb0e7d99b Merge branch '2.4' of git://github.com/Itseez/opencv into mog2_bgimg_gray 2014-04-08 14:58:32 +03:00
Ilya Lavrenov aa5326c231 cv::norm -> cvtest::norm in tests
Conflicts:

	modules/core/src/stat.cpp
2014-04-08 14:49:20 +04:00
Andrey Pavlenko a6ef45aa13 Merge pull request #2582 from vbystricky:ipp_fix 2014-04-08 14:30:48 +04:00
vbystricky 9828cd6086 Remove defined(HAVE_IPP) 2014-04-08 13:05:23 +04:00
vbystricky f23134ce01 Add IPP_VERSION_X100 define 2014-04-08 12:43:57 +04:00
Andrey Pavlenko 9ec823d800 Merge pull request #2538 from ElenaGvozdeva:ipp_async_convert 2014-04-08 11:05:30 +04:00
Martin Chodakowski 267241b889 Fix typos in old python wrapper documentation(Bug #3628)
Fixed spelling of CV_INTER_LINEAR flag in geometric_transformations.rst
2014-04-08 00:55:08 -04:00
Elena Gvozdeva f9c5289483 fixed 2014-04-07 18:53:07 +04:00
Roman Donchenko 6f055d7a76 Merge pull request #2580 from SpecLad:merge-2.4 2014-04-07 18:29:51 +04:00
krodyush 616ec74beb fix previous merge error 2014-04-07 17:32:39 +04:00
vbystricky 7badc85b60 Fix for pullrequest comment 2014-04-07 17:06:02 +04:00
vbystricky 2d54581971 Fix ifdef for IPP version greater 8.1 2014-04-07 16:45:35 +04:00
Andrey Pavlenko f690440533 Merge pull request #2568 from vbystricky:ippicv 2014-04-07 15:52:32 +04:00
Roman Donchenko 4f2b126b7b Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/core/include/opencv2/core/version.hpp
	modules/core/src/out.cpp
	modules/cudaimgproc/test/test_hough.cpp
	modules/gpu/doc/introduction.rst
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/src/generalized_hough.cpp
	modules/nonfree/perf/perf_main.cpp
2014-04-07 14:59:34 +04:00
vbystricky 268c0caa7a Fix problems in CMakeLists.txt 2014-04-07 14:53:30 +04:00
vbystricky e8f79d6e1f Fix rebase errors 2014-04-07 14:44:01 +04:00
vbystricky dbdc476b79 Check results of ipp function 2014-04-07 14:31:34 +04:00
vbystricky 38913bf5f6 Change all 'ippStsNoErr==' to '0<=', and all 'ippStsNoErr!=' to '0>' 2014-04-07 14:31:34 +04:00
vbystricky 67484e027b Fix function names (log, exp) 2014-04-07 14:31:33 +04:00
vbystricky 566f783968 Fix errors 2014-04-07 14:31:33 +04:00
vbystricky 23e1b50837 Check 8.1 ipp version for color convertion functions, which not exists in versions before this. 2014-04-07 14:31:33 +04:00
vbystricky 06acb8b0ee Check 8.1 ipp version for gaussian functions, which not exists in versions before this. 2014-04-07 14:31:32 +04:00
vbystricky be29d628d3 Check 8.1 ipp version for morphology functions, which not exists in versions before this. 2014-04-07 14:31:32 +04:00
vbystricky 4512d06484 Fix const src matrix in IPPresizeInvoker 2014-04-07 14:31:31 +04:00
vbystricky 824ed8a3ae Fix errors 2014-04-07 14:31:31 +04:00
vbystricky 1b3651d8ee Undo changes ipp to ippicv prefix of function names 2014-04-07 14:30:03 +04:00
vbystricky eb8c531791 Add preprocessor check for IPP version greater 8.1 on some code 2014-04-07 14:26:51 +04:00
vbystricky 188c506237 Uncomment ippiNormDiff_Inf_16s_C3R, ippiNormDiff_Inf_16s_C4R 2014-04-07 14:26:51 +04:00
vbystricky ec6f977783 Uncomment ippicviNorm_Inf_16s_C3R, ippicviNorm_Inf_16s_C4R functions 2014-04-07 14:26:50 +04:00
vbystricky a9a0ea3706 Fix error not initialized IppStatus before ipp functions call 2014-04-07 14:26:50 +04:00
vbystricky c321330777 Comment ipp version of CV_BGR2GRAY color convertion, by problems in BRIEF accuracy test and Path_Idx_Cn_NPoints_WSize perfomance test 2014-04-07 14:26:50 +04:00
vbystricky ad23ef2a42 Remove unused #include "ippverdion.h" 2014-04-07 14:26:49 +04:00
vbystricky 9d138b2bbe Enable ipp MeanStdDev calculation for 32F_C1 images. Decrease accuracy sanity check of the perfomance test 2014-04-07 14:26:49 +04:00
vbystricky c29583eacc Change Canny input image description, we can use multichannel image now 2014-04-07 14:26:48 +04:00
vbystricky ee2df645f4 Canny uncommented, prefix of ipp function changed. Ipp version of Canny called only for images with one channels 2014-04-07 14:26:48 +04:00
vbystricky 9b6feee1a5 Change sanity check for perfomance test of dft 2014-04-07 14:26:47 +04:00
vbystricky a6b53489e6 Change sanity check for perfomance test of bilateral filter 2014-04-07 14:26:47 +04:00
vbystricky aece433b15 Check ippStsNoErr as result of ipp function instead >=0 2014-04-07 14:26:47 +04:00
vbystricky c65e5a1e7b Fix error BGRA2RGBA color convertion by ipp. Uncomment ipp color converstion, which pass tests 2014-04-07 14:26:46 +04:00
vbystricky b3db990daa Remove unused code 2014-04-07 14:26:46 +04:00
vbystricky 07e84c635a Remove unused code 2014-04-07 14:26:45 +04:00
vbystricky 06434bedfd Change deprecated function ippicviMulC_32f_C1IR to ippicviMulC_32f_C1R. Check results of ipp function, if error was return run opencv branch of code 2014-04-07 14:26:45 +04:00
vbystricky 3b03044047 Fix warning 2014-04-07 14:26:44 +04:00
vbystricky 58de8bc917 Change deprecated functions to valid 2014-04-07 14:24:06 +04:00
vbystricky 01a66a2938 Prepare codes for ippicv library 2014-04-07 14:24:05 +04:00
Andrey Pavlenko c2f859569c Merge pull request #2563 from alalek:ipp_builds 2014-04-07 13:03:11 +04:00
Maks Naumov 8271bd5f14 fix condition in CV_OperationsTest::operations1() 2014-04-07 11:24:27 +03:00
Roman Donchenko 1cee868e88 Merge pull request #2572 from jet47:gpu-generalized-hough 2014-04-07 11:57:52 +04:00
Andrey Pavlenko def4f5e2a3 Merge pull request #2499 from mlyashko:back_proj_fix1 2014-04-07 10:57:21 +04:00
Vladislav Vinogradov d822d6f101 disable GeneralizedHough tests on gcc 4.7 2014-04-07 09:49:17 +04:00
akrynski 1dba47b77b Update crop_face.py
I propose some changes, to automate file cropping
2014-04-06 18:48:38 +02:00
Tony 572e4f5255 Merge remote-tracking branch 'upstream/master' 2014-04-06 11:49:23 +01:00
Ievgen Khvedchenia 5848e75168 Clean-up from unused utils.h/utils/cpp 2014-04-05 15:25:59 +03:00
Ievgen Khvedchenia 17f305140b Added unit-tests for KAZE and AKAZE features 2014-04-05 10:25:59 +03:00
Ievgen Khvedchenia 137ff7eccb Added KAZE and AKAZE wrappers 2014-04-05 10:25:46 +03:00
Ievgen Khvedchenia 703e012a5b Prepare KAZE and AKAZE sources for integration 2014-04-05 10:24:27 +03:00
Ievgen Khvedchenia 7a59435490 KAZE and AKAZE integration initial commit 2014-04-04 14:25:38 +03:00
Andrey Pavlenko d1710a8547 Merge pull request #2562 from akarsakov:gftt_fix 2014-04-04 13:34:31 +04:00
krodyush 4ca695cab0 Merge remote-tracking branch 'github/master' into pullreq/140319-PyrLKOpticalFlow
Conflicts:
	modules/video/src/opencl/pyrlk.cl
2014-04-04 11:26:08 +04:00
Vladislav Vinogradov f8d922ad3e disable gpu::GeneralizedHough compilation on gcc 4.7 2014-04-04 10:31:33 +04:00
Andrey Pavlenko 5a3200d513 Merge pull request #2567 from apavlenko:fix_compare_scalar 2014-04-03 22:08:18 +04:00
Andrey Pavlenko 9a3895d842 Merge pull request #2556 from DeanF:master 2014-04-03 17:07:06 +04:00
Alexander Karsakov c747426fc1 Enabled integer arithmetic for filterSepSinglePass 2014-04-03 16:53:57 +04:00
Andrey Pavlenko 271f60ba7a fixing OCL run condition (build program failure for comparison 64F Mat with Scalar) 2014-04-03 16:21:04 +04:00
Alexander Alekhin bfc546d23c enable IPP ICV support 2014-04-03 15:05:38 +04:00
Elena Gvozdeva 037ac27ec8 Added SharedMatrix 2014-04-03 14:53:27 +04:00
Alexander Karsakov fc10ffefb8 Enabled integer arithmetic for row_filter_C1_D0 2014-04-03 13:31:06 +04:00
Alexander Karsakov 2cf3a6e26c Fixed error in case corners not found 2014-04-03 10:30:55 +04:00
Alexander Karsakov a3825acee4 Small refactoring 2014-04-02 16:38:32 +04:00
Andrey Pavlenko 2aab7b2926 Merge pull request #2557 from ilya-lavrenov:tapi_fnlm_fix 2014-04-02 13:01:08 +04:00
Roman Donchenko c165f07319 Merge pull request #2550 from SpecLad:merge-2.4 2014-04-02 12:00:01 +04:00
Tony 7daec9e9a8 Improve GTK+ library selection logic.
The new logic will select GTK+3 by default if WITH_GTK is selected. If
the GTK+3 libraries are not found, then GTK+2 libraries will be selected
if found.
This can be overridden by using WITH_GTK_2_X to force selection of GTK+2
(if found).
2014-04-01 23:01:18 +01:00
Ilya Lavrenov 2cd51c04e4 fixed condition in cv::FNLM 2014-04-01 23:18:07 +04:00
DeanF 48df67a9c5 Fixed trailing whitespace 2014-04-01 22:04:58 +03:00
DeanF bdc91c66c9 Fixed problem with compilation without HAVE_OPENCL
When compiling without OpenCL, some classes from its namespace are still used in code.
2014-04-01 21:20:13 +03:00
Elena Gvozdeva fa2d79a15b Added IPP Async converters, doc and sample 2014-04-01 16:47:29 +04:00
Andrey Pavlenko 6ef94b52ad Merge pull request #2536 from ilya-lavrenov:tapi_resize_linear 2014-04-01 12:54:07 +04:00
Roman Donchenko a8cb5c3983 Merge pull request #2554 from asmorkalov:ocv_249_version 2014-04-01 12:16:25 +04:00
Alexander Smorkalov e23f7303a6 OpenCV version++. OpenCV Manager version++. 2014-03-31 15:00:25 -07:00
Tony 7f671406db Use GTK_VERSION_MAJOR to switch between GTK+ version two and three
specific code. As a result of this, HAVE_GTK3 no longer needs to be
exposed.

The use of HAVE_GTK, and HAVE_ GTK3 have been changed to mirror the
method used by HAVE_QT and HAVE_QT5.
 On branch gtk3
 Changes to be committed:
        modified:   CMakeLists.txt
        modified:   cmake/OpenCVFindLibsGUI.cmake
        modified:   cmake/templates/cvconfig.h.in
        modified:   modules/highgui/src/window.cpp
        modified:   modules/highgui/src/window_gtk.cpp
2014-03-31 22:05:09 +01:00
Andrey Pavlenko 0d5ffec521 Merge pull request #2553 from ilya-lavrenov:typo 2014-03-31 23:21:07 +04:00
Andrey Pavlenko aa3c4ae5d2 Merge pull request #2552 from ilya-lavrenov:tapi_compare 2014-03-31 21:22:00 +04:00
Andrey Pavlenko 97eac3f394 Merge pull request #2551 from ilya-lavrenov:ocl_nonfree 2014-03-31 21:21:27 +04:00
Ilya Lavrenov 31f864a22b integer cv::resize (INTER_LINEAR && CV_8UC(cn)) 2014-03-31 20:25:53 +04:00
Andrey Pavlenko bb3c0c066c Merge pull request #2548 from jet47:gpu_mog2_test 2014-03-31 20:19:21 +04:00
Ilya Lavrenov 9b9769169f doc typos 2014-03-31 19:57:05 +04:00
Andrey Pavlenko d170faeb5c Merge pull request #2549 from ilya-lavrenov:tapi_laplacian 2014-03-31 19:36:44 +04:00
Andrey Pavlenko 6c2d77079f Merge pull request #2487 from ilya-lavrenov:tapi_perf_orb 2014-03-31 18:17:50 +04:00
Ilya Lavrenov 322b15a459 compare with scalar (cn > 1) 2014-03-31 17:50:16 +04:00
Ilya Lavrenov 7df92bbb77 fixed C4505 2014-03-31 17:30:15 +04:00
Alexander Karsakov 10a52220f0 Added integer arithmetic to sepFilter2D 2014-03-31 16:45:15 +04:00
Alexander Alekhin eeed9ce247 perf report: summary.py: added custom --regressions map 2014-03-31 16:04:18 +04:00
Andrey Pavlenko 1f4586f3dd Merge pull request #2541 from JinoBetti:2.4 2014-03-31 15:48:45 +04:00
Ilya Lavrenov c53398a438 performance tests for FAST 2014-03-31 15:03:00 +04:00
mlyashko 5acd178790 copyright fix 2014-03-31 14:57:03 +04:00
Roman Donchenko f77c68e0fa Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/imgproc/src/opencl/integral_sqrsum.cl
	modules/nonfree/doc/feature_detection.rst
	modules/nonfree/include/opencv2/nonfree/ocl.hpp
	modules/nonfree/src/surf_ocl.cpp
	modules/nonfree/test/test_features2d.cpp
	modules/ocl/doc/image_processing.rst
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_imgproc.cpp
	modules/ocl/perf/perf_match_template.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/match_template.cpp
	modules/ocl/src/opencl/haarobjectdetect.cl
	modules/ocl/src/opencl/haarobjectdetect_scaled2.cl
	modules/ocl/test/test_imgproc.cpp
2014-03-31 14:42:00 +04:00
Ilya Lavrenov e1efed1914 added support of ksize >= 5 to cv::Laplacian 2014-03-31 13:17:58 +04:00
mlyashko 4c5de04efb bug fix 2014-03-31 10:58:15 +04:00
Vladislav Vinogradov 6d368dc1e7 increase epsilon for MOG2::getBackgroundImage test:
it uses float arithmetics
2014-03-30 18:02:03 -07:00
Andrey Pavlenko 51530d4d8e Merge pull request #2543 from apavlenko:24_haar_revert 2014-03-28 23:17:08 +04:00
Alexander Karsakov d17142b83d Prototype OCL version of gaussian blur with integer arithmetic 2014-03-28 21:46:03 +04:00
Roman Donchenko 8541b7bf92 Merge pull request #2534 from asmorkalov:opencv_config_cut_cuda_abs_path 2014-03-28 19:37:04 +04:00
Alexander Smorkalov b852108262 OpenCVConfig.cmake fix after cutting absolute CUDA libraries path. 2014-03-28 18:57:21 +04:00
unknown 75534a4828 Python typdef fixed. Reverted the example to MOG2. Not time to make the command line switch for now. 2014-03-28 14:23:10 +01:00
Andrey Pavlenko 3747d2643f Revert pull request #1929 from @alalek "ocl: added workaround into Haar kernels"
This reverts commit 3dcddad88a.

Conflicts:
	modules/ocl/src/opencl/haarobjectdetect.cl
2014-03-28 16:08:11 +04:00
Andrey Pavlenko 7d82171af4 - fix test 2014-03-28 16:06:39 +04:00
Andrey Pavlenko e6e817e613 Revert "Merge pull request #1779 from perping:integral_2.4"
This reverts commit 54ea5bbac7, reversing
changes made to 28e0d3d771.
2014-03-28 16:05:04 +04:00
Roman Donchenko 0469c18726 Merge pull request #2542 from asmorkalov:android_javacam_cvtcolor_fix 2014-03-28 12:45:39 +04:00
Roman Donchenko d6b54ff9d1 Merge pull request #2476 from minkless:3.0-bugfix-core-filestorage 2014-03-28 12:17:16 +04:00
Roman Donchenko e055b68ceb Merge pull request #2403 from hbristow:issue-3451 2014-03-28 12:13:14 +04:00
Roman Donchenko 0b4534d4c9 Merge pull request #2379 from ngryman:optimize_jpeg 2014-03-28 12:08:55 +04:00
Roman Donchenko 0c1ab50643 Merge pull request #2533 from kenaniah:master 2014-03-28 12:08:23 +04:00
Roman Donchenko f5fecc7e9a Merge pull request #2539 from mjul:fixtypos 2014-03-28 11:58:23 +04:00
Roman Donchenko 4382970739 Merge pull request #2540 from mjul:fixtypos_2.4 2014-03-28 11:58:11 +04:00
Koji Miyazato 1ab8060b62 corrected some style errors found by review. 2014-03-28 10:45:33 +09:00
Alexander Smorkalov d17740ec87 Bug #3553 JavaCameraView frame format and cvtColor format inconsistency fixed. 2014-03-28 04:56:31 +04:00
Tony 41b8ab086b Merge remote-tracking branch 'upstream/master' 2014-03-27 19:32:05 +00:00
Nicolas Gryman da34f1d58c added jpeg with optimized coding support. 2014-03-27 13:34:33 -04:00
JinoBetti 91511c1521 Update out.cpp
Fixed a bug with the cv::format(cv::Mat, ...) method for matrices with only one row

see http://answers.opencv.org/question/21201/cvformat-does-not-format-the-way-it-should/?answer=23945#post-id-23945 for details
2014-03-27 16:28:40 +01:00
Roman Donchenko 2e3e106676 Merge pull request #2537 from ilya-lavrenov:doc_fix 2014-03-27 17:43:02 +04:00
mlyashko 4b71921526 both tests by picture and rand mat 2014-03-27 17:08:05 +04:00
Martin Jul a1798cb28e Fixed typo in BFMatcher in docs. 2014-03-27 13:52:49 +01:00
Ilya Lavrenov 80df44bd75 doc fix 2014-03-27 16:30:29 +04:00
Martin Jul bb05af8ece Merge branch '2.4' into fixtypos 2014-03-27 13:20:48 +01:00
Andrey Pavlenko e34a7caabc Merge pull request #2535 from akarsakov:stereobm_fix 2014-03-27 15:22:45 +04:00
Alexander Karsakov 4ceaf44fa0 Fixed incorrect calculation of best_disp 2014-03-27 11:21:32 +04:00
Andrey Pavlenko 6f5800e7df Merge pull request #2286 from alalek:umat_unmap_issue 2014-03-27 11:05:21 +04:00
Kenaniah Cerny 5005f5e88e Fixed type gPython -> Python 2014-03-26 23:15:42 -07:00
Kenaniah Cerny c764e0f114 Added link to main GitHub repo 2014-03-26 23:12:43 -07:00
Kenaniah Cerny 9f1b20a794 Grammar 2014-03-26 23:11:03 -07:00
Hilton Bristow 61c22d5899 removed experimental slots 2014-03-27 14:58:53 +10:00
Hilton Bristow fc696a9ff3 Improved standalone importing behaviour and creation of nested directories 2014-03-27 14:52:23 +10:00
Hilton Bristow 6f190bb907 Generalized todict implementation 2014-03-27 14:51:17 +10:00
Hilton Bristow 068b1bc3d0 More generic todict 2014-03-27 11:34:20 +10:00
Martin Jul 73042b32e1 Fixed typos in "matching" 2014-03-26 23:29:48 +01:00
Alexander Alekhin 3488fdcb43 disable failed tests 2014-03-26 19:29:59 +04:00
Alexander Alekhin 569e1346f2 UMat: issue in OpenCLAllocator::unmap() 2014-03-26 19:29:41 +04:00
Andrey Pavlenko 04c857a4e8 Merge pull request #2505 from alalek:umat_unmap_synchronization_test 2014-03-26 19:08:15 +04:00
Andrey Pavlenko a2f8a93bf5 Merge pull request #2529 from ilya-lavrenov:tapi_filter2D 2014-03-26 19:04:57 +04:00
Andrey Pavlenko 6c12f20395 Merge pull request #2528 from mlyashko:back_proj_fix 2014-03-26 19:04:39 +04:00
Andrey Pavlenko a1d151924d Merge pull request #2527 from apavlenko:ocl_surf_24 2014-03-26 19:03:44 +04:00
Andrey Pavlenko fa5705613d splitting plain and OCL tests for SURF. 2014-03-26 17:18:05 +04:00
Ilya Lavrenov f7d6d3cff5 improved cv::filter2D 2014-03-26 14:19:59 +04:00
Roman Donchenko 491b84d463 Merge pull request #2478 from clemenscorny:master 2014-03-26 12:19:54 +04:00
Roman Donchenko a7f9677378 Merge pull request #2404 from yashdv:old_basic_structures_doc_fix 2014-03-26 12:18:39 +04:00
Roman Donchenko d67b450741 Merge pull request #2378 from ngryman:progressive_jpeg 2014-03-26 12:12:02 +04:00
Alexander Karsakov 8c39b4e8b6 Fixed stereoBM for Intel CPU. 2014-03-26 11:53:36 +04:00
Tony 46ba9d30b9 Merge remote-tracking branch 'upstream/master' 2014-03-25 20:44:06 +00:00
Nicolas Gryman b211e1d989 added jpeg progressive support. 2014-03-25 15:27:24 -04:00
mlyashko 70fdfa0bdb changed type of sanity check 2014-03-25 16:43:20 +04:00
Andrey Pavlenko d63a8ba018 Merge pull request #2523 from ilya-lavrenov:tapi_filters 2014-03-25 16:23:02 +04:00
Alexander Alekhin 6bd7a444bc UMat map-unmap synchronization test 2014-03-25 16:19:52 +04:00
Clemens Korner f1c8b4b965 FEATURES2D: add DenseFeatureDetector Python wrapper 2014-03-25 12:07:01 +01:00
mlyashko 953aafbd3d Merge branch 'master' of https://github.com/Itseez/opencv into back_proj_fix 2014-03-25 14:52:39 +04:00
mlyashko f38fe76025 added perf test for CalcBackProj 2014-03-25 14:50:37 +04:00
Roman Donchenko da7a605224 Merge pull request #2123 from white-pony:vkysenko/fix-mertens 2014-03-25 14:37:56 +04:00
Andrey Pavlenko c1acbb02bc disabling calls to SURF_OCL causing tests failures 2014-03-25 14:09:49 +04:00
Andrey Pavlenko 63a746c6ea fixing conditional compilation 2014-03-25 13:16:42 +04:00
Andrey Pavlenko 7e03a8b279 fixing check_docs2.py issue 2014-03-25 13:15:56 +04:00
Andrey Pavlenko c6199fc3c1 Merge pull request #2526 from KonstantinMatskevich:ocl_morph_fix 2014-03-25 12:59:10 +04:00
Roman Donchenko 5effebb5f5 Merge pull request #2498 from dreamworld:fix_tutorial_mat_the_basic_image_container 2014-03-25 12:14:44 +04:00
Roman Donchenko 85cf2d9671 Merge pull request #2524 from SpecLad:merge-2.4 2014-03-25 12:13:04 +04:00
Konstantin Matskevich 67926fa028 ocl morphology fix 2014-03-25 10:39:50 +04:00
Aaron Kunze ede6d4482b Optimizations to OpenCL bilateral filter. 2014-03-24 13:35:56 -07:00
Andrey Pavlenko 9e1124d24a Merge pull request #2525 from ilya-lavrenov:tapi_sep 2014-03-24 22:43:34 +04:00
Andrey Pavlenko ba2eee9cbd Merge pull request #2522 from ilya-lavrenov:tapi_canny 2014-03-24 19:31:26 +04:00
Roman Donchenko cc05493730 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	cmake/OpenCVDetectAndroidSDK.cmake
	cmake/OpenCVGenAndroidMK.cmake
	cmake/OpenCVModule.cmake
	cmake/templates/OpenCV.mk.in
	cmake/templates/OpenCVConfig.cmake.in
	doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.rst
	modules/cudabgsegm/src/cuda/mog.cu
	modules/imgproc/perf/opencl/perf_filters.cpp
	modules/imgproc/src/opencl/filterSep_singlePass.cl
	modules/nonfree/CMakeLists.txt
	modules/nonfree/perf/perf_precomp.hpp
	modules/ocl/perf/perf_haar.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/src/opencl/bgfg_mog.cl
	modules/superres/CMakeLists.txt
	modules/superres/src/btv_l1_cuda.cpp
	modules/superres/src/cuda/btv_l1_gpu.cu
	modules/superres/src/frame_source.cpp
	modules/superres/src/input_array_utility.cpp
	modules/superres/src/optical_flow.cpp
	modules/superres/src/precomp.hpp
	samples/gpu/CMakeLists.txt
	samples/gpu/brox_optical_flow.cpp
	samples/gpu/super_resolution.cpp
2014-03-24 19:02:16 +04:00
Roman Donchenko 8af175b81b Merge pull request #2521 from atrebbi:#3620 2014-03-24 18:54:00 +04:00
Roman Donchenko 4d3f9228aa Merge pull request #2516 from Daniil-Osokin:fix_docs 2014-03-24 18:52:49 +04:00
Andrey Pavlenko 9c5745383f Merge pull request #2512 from KonstantinMatskevich:ocl_gpu_type_parser 2014-03-24 18:46:01 +04:00
Daniil Osokin ac19420907 Removed obsolete list from docs 2014-03-24 14:50:20 +01:00
Ilya Lavrenov 061a25447e eliminated restriction delta == 0 from cv::sepFilter2D 2014-03-24 17:39:07 +04:00
Konstantin Matskevich c2355d3a12 case-insensitivity 2014-03-24 15:20:00 +04:00
Ilya Lavrenov e2c6ab0166 refactored filter2D; eliminated restrictions sdepth == ddepth, delta == 0 2014-03-24 14:42:51 +04:00
Ilya Lavrenov b6833fdde7 added 3-channels support to cv::medianBlur 2014-03-24 14:32:31 +04:00
Ilya Lavrenov a51ab99a79 added 3-channels support to cv::filter2D, cv::Laplacian 2014-03-24 14:32:31 +04:00
Ilya Lavrenov e19c42dded added 3-channels support to cv::boxFilter, cv::blur, cv::sqrBoxFilter 2014-03-24 14:31:42 +04:00
Ilya Lavrenov 8f5fd44fb2 added 3 channels support to cv::bilateralFilter
Conflicts:
	modules/imgproc/test/ocl/test_filters.cpp
2014-03-24 14:31:41 +04:00
Roman Donchenko f8a100f3e0 Merge pull request #2520 from vlkolesnikov:misprint_fix 2014-03-24 14:05:18 +04:00
Ilya Lavrenov 6ba60a1e22 added 3-channels support to cv::Canny 2014-03-24 13:02:54 +04:00
Daniil Osokin 04b1822cff Fixed "Mat mask operations" tutorial. Thanks @RJ2 for pointing this. 2014-03-24 12:53:30 +04:00
Roman Donchenko bcb0ee3e4b Merge pull request #2514 from asmorkalov:android_two_libs_cuda 2014-03-24 12:26:57 +04:00
Roman Donchenko 9aa6528fd7 Merge pull request #2504 from asmorkalov:android_camera_locks_24 2014-03-24 12:06:51 +04:00
Roman Donchenko 7efb09fb8f Merge pull request #2513 from asmorkalov:ocv_cuda_link_revert 2014-03-24 12:03:27 +04:00
Roman Donchenko 623b1db8d1 Merge pull request #2515 from apavlenko:perf_default_strategy 2014-03-24 12:02:30 +04:00
Vladimir Kolesnikov 60803afe8f Misprint fixed in table formatter 2014-03-24 11:04:49 +04:00
Andrey Pavlenko d8c018289a Merge pull request #2491 from ilya-lavrenov:tapi_sep_filter 2014-03-24 10:37:15 +04:00
Andrey Pavlenko 157f35ef29 Merge pull request #2503 from mlyashko:optflow_dualtvl1 2014-03-24 10:35:51 +04:00
Andrey Pavlenko ae89787984 Merge pull request #2511 from apavlenko:2.4_fix_perf_nonfree 2014-03-24 10:25:47 +04:00
Andrey Pavlenko cf3a2e30cd Merge pull request #2517 from ilya-lavrenov:fix 2014-03-24 10:25:04 +04:00
Andrey Pavlenko 259b9e093c disabling failing tests 2014-03-24 10:12:02 +04:00
Andrey Pavlenko 5421d741bc making OCL tests conform to the comon style 2014-03-24 10:08:44 +04:00
Alessandro Trebbi c4a63f6a86 - 2014-03-23 22:00:16 +01:00
Ilya Lavrenov 20b6191842 doc fix 2014-03-23 16:20:00 +04:00
Alexander Smorkalov 64d679ecb4 Added guard to prevent from gpu module redefinition in OpenCV.mk 2014-03-22 05:41:29 +04:00
Kang Liu 9dc51a1aa4 Keep definitions of link aliases consistent 2014-03-21 22:28:48 +01:00
Daniil Osokin 2d3aa3861c Fixed Load, Modify, and Save an Image tutorial 2014-03-21 16:58:50 +01:00
Koji Miyazato 0a5d6e10b9 Added test code for I/O of user-defined types. 2014-03-22 00:32:44 +09:00
Andrey Pavlenko 244f126ff6 Merge pull request #2454 from apavlenko:2.4_haar_extend 2014-03-21 18:45:58 +04:00
Andrey Pavlenko f368b27f0a Merge pull request #2489 from vbystricky:iocl_pyrlk 2014-03-21 18:33:32 +04:00
Andrey Pavlenko a3668f1369 changing default perf strategy from BASIC (old) to SIMPLE (new, faster) 2014-03-21 18:29:06 +04:00
Andrey Pavlenko 8ac93f9b6b Merge pull request #2508 from akarsakov:fix_erode_intel 2014-03-21 18:25:12 +04:00
Andrey Pavlenko ef9669ba1a Merge pull request #2506 from apavlenko:lbp_ocl_use_any_device 2014-03-21 18:24:36 +04:00
Alexander Smorkalov 3b65b710b6 Implicit linkage with CUDA runtime reverted. 2014-03-21 17:58:59 +04:00
Alexander Smorkalov 0dba5bdc4a Multiple fixes in camera.
Fixed constant value for focus mode FOCUS_MODE_CONTINUES_PHOTO;
Add setters and getters for exposure lock and white balance lock flags;
Excluded camera restart for all setters except frame size.
2014-03-21 17:26:05 +04:00
Konstantin Matskevich 79fc3a6203 added gpu type selection in OPENCV_OPENCL_DEVICE parser 2014-03-21 17:01:37 +04:00
Roman Donchenko 46d39aff68 Merge pull request #2501 from asmorkalov:android_native_camera_qualcomm 2014-03-21 16:28:48 +04:00
Andrey Pavlenko 7193762d2d Merge pull request #2495 from ilya-lavrenov:tapi_flip 2014-03-21 16:08:46 +04:00
Andrey Pavlenko d18ebfa8e8 Merge pull request #2500 from akarsakov:hog_intel_fix 2014-03-21 16:02:49 +04:00
Ilya Lavrenov 2875ce60ea added 3-channels support to optimized version 2014-03-21 16:02:47 +04:00
Roman Donchenko 6bf4a7ce01 Merge pull request #2510 from asmorkalov:android_cuda_filter_fix 2014-03-21 16:00:29 +04:00
Kang Liu dc21e2cc0e remove highlighting in some function links
1. Remove whole-document highlighting in some function links
2. fix the function alias `readwriteimagevideo`
2014-03-21 11:54:35 +01:00
Andrey Pavlenko fe5eaae102 adding missing include (fixing 'no ocl implementation' error) 2014-03-21 14:30:49 +04:00
Alexander Smorkalov 846266fde4 Native camera fix for some deivices with Qualcomm SoC like Samsung Galaxy S4. 2014-03-21 14:16:03 +04:00
Roman Donchenko 3572ee278e Merge pull request #2396 from m3d:patch-1 2014-03-21 14:00:12 +04:00
Roman Donchenko 49efc250d3 Merge pull request #2400 from RJ2:Bugfix_2 2014-03-21 13:58:06 +04:00
Roman Donchenko 722c0fea41 Merge pull request #2414 from yashdv:meanshift_tutorial_error 2014-03-21 13:55:35 +04:00
Roman Donchenko a66018d14d Merge pull request #2423 from RJ2:bugfix_5 2014-03-21 13:54:52 +04:00
Alexander Smorkalov b0ad84cfa2 Libraries filter update after abs path cut. 2014-03-21 12:48:38 +04:00
Andrey Pavlenko 4e851f5050 Merge pull request #2507 from apavlenko:haar_perf_test_cleanup 2014-03-21 12:20:32 +04:00
Firat Kalaycilar c9f51d5eed modified BackgroundSubtractorMOG2::getBackgroundImage so that it can now work with gray-level images. 2014-03-21 09:44:11 +02:00
Alexander Karsakov 0bd4fd3a87 Workaround for Intel platform: replace min() with ternary operator 2014-03-21 09:33:00 +04:00
Andrey Pavlenko b7198ccf1c dropping legacy modes testing 2014-03-20 22:30:16 +04:00
Andrey Pavlenko 640e180efe switching to CV_HAAR_SCALE_IMAGE mode, enabling test 2014-03-20 22:22:55 +04:00
Andrey Pavlenko d060d30fa0 enabling OCL LBP branch for all devices 2014-03-20 21:57:34 +04:00
Andrey Pavlenko bdfd29a0b8 Merge pull request #2496 from ilya-lavrenov:tapi_imgproc 2014-03-20 19:20:15 +04:00
Roman Donchenko 034ef02409 Merge pull request #2449 from asmorkalov:cuda_abs_path_fix 2014-03-20 17:49:41 +04:00
mlyashko 80a40ae3d7 changed epsilon for test pass on Win32 2014-03-20 16:15:43 +04:00
Andrey Pavlenko 9c7ba6db90 Merge pull request #2490 from ilya-lavrenov:ocl_sep_filters 2014-03-20 13:54:27 +04:00
Andrey Pavlenko 2299e2ed1b Merge pull request #2494 from ilya-lavrenov:tapi_merge 2014-03-20 13:39:39 +04:00
Andrey Pavlenko 87ae0f9990 Merge pull request #2492 from KonstantinMatskevich:ocl_fix_wrongdevice 2014-03-20 13:39:17 +04:00
Ilya Lavrenov 63d8a61b9b enabled 3-channels support for cv::createSuperResolution_BTVL1 2014-03-20 13:31:20 +04:00
Alexander Karsakov b14c314fc3 Fixed incorrect thread synchronizations 2014-03-20 13:03:03 +04:00
Roman Donchenko 68c57a1e82 Merge pull request #2473 from euphrat:mog2_weight_bugfix 2014-03-20 12:40:23 +04:00
Ilya Lavrenov eb8b4c58c7 fixed bug in cv::ocl::predictOptimalVectorWidth 2014-03-20 00:28:21 +04:00
krodyush 65d64af2a8 ocl_calcOpticalFlowPyrLK optimizations
1. decrease branch number in CL code by replacing them into weights
2. decrease local mem pressure in reduce operation by using private variables
3. decrease image sampler pressure by caching data into local memory
4. remove unnecessary sync point on the HOST side.
2014-03-19 19:31:14 +04:00
Ilya Lavrenov 291458a859 generalized OpenCL version of cv::sepFilter2D; removed some restrictions and added 3-channels support 2014-03-19 18:56:16 +04:00
Alexander Smorkalov 284b2fc1e7 Cut path to CUDA libraries to prevent generation of OpenCVModules.cmake with abs path. 2014-03-19 18:47:32 +04:00
Alexander Karsakov 30a8308f8e Enabled Intel-specific optimizations for HOG detector. 2014-03-19 17:30:13 +04:00
Kang Liu 17713f6831 1. fix an error in sample code
2. change an external link to maintain consistency with the previous tutorial
2014-03-19 13:05:38 +01:00
Ilya Lavrenov b449b0bf71 simplified cv::sepFilter2D OpenCL part 2014-03-19 15:59:00 +04:00
Roman Donchenko a1e5bd71f1 Merge pull request #2446 from asmorkalov:ocv_implicit_cuda_control 2014-03-19 14:49:22 +04:00
Ilya Lavrenov b73490f86c eliminated restriction src[i].channels() == 1 in cv::merge 2014-03-19 13:56:31 +04:00
Andrey Pavlenko a2dec6c34e Merge pull request #2493 from ilya-lavrenov:tapi_fnlm 2014-03-19 12:56:11 +04:00
Konstantin Matskevich f9f730c426 update error message 2014-03-19 12:14:48 +04:00
Ilya Lavrenov 04884ebf45 added 3-channels support to cv::setIdentity 2014-03-19 01:53:53 +04:00
Ilya Lavrenov d1cfcfcafd added 3-channels support to morphology operations 2014-03-18 20:15:11 +04:00
Ilya Lavrenov 8d97d0d631 added 3-channels support to cv::flip 2014-03-18 19:31:37 +04:00
Firat Kalaycilar 0a16d93e1d Fixed an issue with weight assignment causing the resulting GMM weights to be unsorted in the CUDA and OCL versions of BackgroundSubtractorMOG2 2014-03-18 17:26:24 +02:00
Koji Miyazato a43ef9a6cd WriteStructContext treats state of fs 2014-03-18 23:29:30 +09:00
Alexander Smorkalov b4e4f13f9e Superres module enabled for Android. GPU samples build fixed for Android. 2014-03-18 17:07:19 +04:00
Roman Donchenko b70332d806 Merge pull request #1986 from GregoryMorse:patch-3 2014-03-18 16:18:33 +04:00
Firat Kalaycilar 4d9698a4cf Merge branch '2.4' of git://github.com/Itseez/opencv into mog2_weight_bugfix 2014-03-18 14:00:30 +02:00
Andrey Pavlenko 6e44f05e6f Merge pull request #2464 from KonstantinMatskevich:ocl_stereobm_experiment 2014-03-18 15:53:09 +04:00
Konstantin Matskevich eebf92ba58 fix for incorrect opencl device selection 2014-03-18 15:47:35 +04:00
Roman Donchenko bff92da970 Merge pull request #2488 from Nerei:minor_doc 2014-03-18 15:41:20 +04:00
Roman Donchenko d76226e21b Merge pull request #2456 from kurodash:pr_use_cvAlloc 2014-03-18 14:39:40 +04:00
Ilya Lavrenov 6fe71bd27c added 4 channels support to fnlm 2014-03-18 14:29:02 +04:00
Roman Donchenko ae2b0b0098 Merge pull request #2486 from SpecLad:merge-2.4 2014-03-18 13:55:57 +04:00
Roman Donchenko bfb1ba371c Merge pull request #2026 from pemmanuelviel:giveFurthestPoint 2014-03-18 13:40:44 +04:00
RJ2 0470bb0e29 I have changed one sentence in tutorial, making it more understandable 2014-03-18 08:59:53 +01:00
RJ2 16869225ff It's will be better 2014-03-18 08:01:18 +01:00
yash b9cdde6991 edited sample code for mean/cam sihft and fixed an error 2014-03-18 08:44:33 +05:30
Ilya Lavrenov 82e6edfba2 optimized sep filter 2014-03-18 00:16:38 +04:00
Ilya Lavrenov 3940b6163b remove intel guard since the code is 2 times faster on AMD too 2014-03-17 19:11:21 +04:00
yash 51cb6998ea made the example consistent with the fuction definition and improved doc
made the example consistent with the fuction definition and improved doc
2014-03-17 18:44:02 +05:30
Anatoly Baksheev 0c02e5de25 minor doc fix 2014-03-17 17:02:49 +04:00
vbystricky 6890aa0033 Fix problems on Intel HD graphics 2014-03-17 16:03:15 +04:00
Roman Donchenko a489d86e5f Merge pull request #2460 from berak:b_3598_24 2014-03-17 15:52:56 +04:00
Roman Donchenko ae036838dd Merge pull request #2458 from asmorkalov:android_cmake_opencv_modules_suffix 2014-03-17 14:43:15 +04:00
Alexander Smorkalov 6b8de222d7 OpenCV_MODULES_SUFFIX variable added to OpenCVConfig.cmake to enable custom module configurations. 2014-03-17 14:32:32 +04:00
Roman Donchenko 40a740ff88 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/imgproc/src/opencl/precornerdetect.cl
	modules/nonfree/perf/perf_main.cpp
	modules/nonfree/perf/perf_surf.ocl.cpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/gftt.cpp
	modules/ocl/src/opencl/arithm_bitwise.cl
	modules/ocl/src/opencl/arithm_bitwise_binary_scalar_mask.cl
	modules/ocl/src/opencl/arithm_minMax.cl
	modules/ocl/src/opencl/arithm_nonzero.cl
	modules/ocl/src/opencl/arithm_sum.cl
	modules/ocl/test/test_arithm.cpp
	modules/viz/src/precomp.hpp
	modules/viz/src/vizcore.cpp
	modules/viz/src/vtk/vtkCloudMatSink.h
	modules/viz/src/vtk/vtkXYZReader.cpp
	modules/viz/src/vtk/vtkXYZReader.h
	modules/viz/test/test_precomp.hpp
2014-03-17 14:14:07 +04:00
Andrey Pavlenko dc28451b8a Merge pull request #2479 from alalek:ocl_compare_scalar 2014-03-17 14:04:22 +04:00
berak 5f94a205d1 fixed h / s ranges in histogram_calculation tutorial
literalinclude

literalinclude, dropped :lines:
2014-03-17 11:01:02 +01:00
Andrey Pavlenko 2a1d5c6d43 Merge pull request #2428 from alalek:ocl_copyMakeBorder_3channels 2014-03-17 13:10:34 +04:00
Alexander Alekhin af062b7c42 ocl: compare: remove useless perf tests 2014-03-17 12:33:12 +04:00
Roman Donchenko 882971151d Merge pull request #2485 from Nerei:viz_correct_viewer_pose 2014-03-17 11:59:14 +04:00
Roman Donchenko 136e5eb804 Merge pull request #2484 from berak:mat_doc_24 2014-03-17 11:57:10 +04:00
Konstantin Matskevich 1a43ed9893 finalizing 2014-03-17 10:42:19 +04:00
Anatoly Baksheev 24d8cbf940 Viz::setViewerPose() - changed up-vector to down (common for Computer Vision & Odometry) 2014-03-16 20:07:05 +04:00
berak 80708008a4 missing () on Mat::type() 2014-03-16 14:04:05 +01:00
Alexander Alekhin 7ce2ca2e0c ocl: workaround for Pow accuracy test failure 2014-03-14 19:51:19 +04:00
Alexander Alekhin 9cafd50160 ocl: fixes 2014-03-14 19:51:19 +04:00
Alexander Alekhin 755ca4b7cf ocl: compare with scalar 2014-03-14 19:51:19 +04:00
Andrey Pavlenko dd6cf15a39 Merge pull request #2481 from akarsakov:fix_hog_intel 2014-03-14 19:17:03 +04:00
Andrey Pavlenko bcb938efbb Merge pull request #2483 from ilya-lavrenov:tapi_3_vs_4 2014-03-14 19:14:35 +04:00
Andrey Pavlenko c72a0a1295 Merge pull request #2482 from ilya-lavrenov:tapi_fix 2014-03-14 19:08:07 +04:00
Andrey Pavlenko 5726e80f77 Merge pull request #2475 from ilya-lavrenov:ocl_2.4_fix 2014-03-14 19:05:55 +04:00
Andrey Pavlenko 6b434befc9 Merge pull request #2480 from vpisarev:ocl_orb 2014-03-14 19:04:19 +04:00
Konstantin Matskevich af1084eb58 speedUp 2014-03-14 18:00:13 +04:00
Konstantin Matskevich 91e4334227 temp 2014-03-14 18:00:12 +04:00
Konstantin Matskevich 18a59b48ba fixes 2014-03-14 18:00:12 +04:00
Konstantin Matskevich ddc235172e new approach 2014-03-14 18:00:11 +04:00
Konstantin Matskevich a5d989f346 new attempt 2014-03-14 18:00:11 +04:00
Konstantin Matskevich 799d7e7a50 bad experiment =( 2014-03-14 18:00:10 +04:00
Konstantin Matskevich 0904f10ab5 optimizations 2014-03-14 18:00:10 +04:00
Konstantin Matskevich bfc843a5f5 added optimization 2014-03-14 18:00:09 +04:00
Konstantin Matskevich b5f717b6b3 stereoBM 2014-03-14 18:00:09 +04:00
Ilya Lavrenov 6f12f1b3b5 added 3 vs 4 channels performance tests 2014-03-14 17:30:14 +04:00
Ilya Lavrenov 6be7869ae8 fix for unsupported doubles 2014-03-14 16:54:52 +04:00
Roman Donchenko 4a4151ec97 Merge pull request #2474 from akarsakov:fix_getpolicy 2014-03-14 15:17:45 +04:00
Alexander Karsakov 4698d62125 Removed workaround for Intel platform. 2014-03-14 14:18:52 +04:00
Alexander Karsakov 8910508b83 Fixed getPolicy() method to make it thread-safe. 2014-03-14 13:50:33 +04:00
kuroda sho f9484bae8a fix: use "cvAlloc" wrapper function for malloc. 2014-03-14 17:09:08 +09:00
Ilya Lavrenov b47bec2ed0 performance tests for ORB 2014-03-13 23:30:02 +04:00
Vadim Pisarevsky 4fafab3786 fixed extra whitespace 2014-03-13 23:18:41 +04:00
Vadim Pisarevsky 42e604abea fixed bug in FAST 2014-03-13 23:17:28 +04:00
Vadim Pisarevsky 3e854fa6e5 finished OpenCL port of ORB 2014-03-13 22:56:53 +04:00
Ilya Lavrenov 61c347fb76 typos 2014-03-13 22:56:46 +04:00
Ilya Lavrenov 357a856cf6 nonfree perf tests 2014-03-13 22:35:08 +04:00
Ilya Lavrenov 6f76e7b42d improved performance of bitwise ops 2014-03-13 19:42:13 +04:00
Andrey Pavlenko 0ce8f1d5dd Merge pull request #2477 from alalek:ocl_cleanup_workarounds 2014-03-13 18:55:28 +04:00
Andrey Pavlenko c5bf1c108c Merge pull request #2470 from ilya-lavrenov:tapi_reduction 2014-03-13 18:42:01 +04:00
Andrey Pavlenko 4233539617 Merge pull request #2469 from alalek:ocl_pyrUp_pyrDown_3channels 2014-03-13 18:37:05 +04:00
Ilya Lavrenov adc15c2bba improved performance of cv::ocl::sum 2014-03-13 17:33:18 +04:00
Andrey Pavlenko a6c40abfb2 Merge pull request #2466 from ilya-lavrenov:tapi_transpose_3cn 2014-03-13 16:56:01 +04:00
Andrey Pavlenko 0764a23eb2 Merge pull request #2459 from ilya-lavrenov:tapi_experiments 2014-03-13 16:49:57 +04:00
Andrey Pavlenko 6b6cfa893d Merge pull request #2382 from ilya-lavrenov:tapi_nlmeans 2014-03-13 16:48:38 +04:00
Alexander Alekhin 48196ad10b ocl: cleanup workarounds 2014-03-13 15:46:38 +04:00
Ilya Lavrenov 3ebfe60008 improved performance of cv::ocl::countNonZero 2014-03-13 15:35:53 +04:00
Ilya Lavrenov 8e79de35a8 changes for GFTT 2014-03-13 14:57:13 +04:00
Koji Miyazato b96762a48f Fix for bug #3599: cv::FileStorage does not work for std::vector of user-defined struct. 2014-03-13 19:41:13 +09:00
Ilya Lavrenov a5afcd9f11 improved performance of cv::ocl::minMax 2014-03-13 14:35:12 +04:00
Roman Donchenko 553673eeed Merge pull request #2468 from mlyashko:back_proj_fix 2014-03-13 13:42:20 +04:00
Roman Donchenko fd8f2c8d23 Merge pull request #2463 from ziyangli:master 2014-03-12 18:51:41 +04:00
Firat Kalaycilar a87607e3ef Fixed an issue with weight assignment causing the resulting GMM weights to be unsorted in BackgroundSubtractorMOG2 2014-03-12 16:14:59 +02:00
Roman Donchenko 290b93422c Merge pull request #2465 from SpecLad:merge-2.4 2014-03-12 17:08:43 +04:00
Roman Donchenko 836635d2d5 Merge pull request #2434 from Nerei:viz_continue 2014-03-12 16:53:42 +04:00
Anatoly Baksheev 4d7a593c25 minor cmake fix fo macos 2014-03-12 16:22:22 +04:00
Ilya Lavrenov 9932cf41a4 3-channel reduction operations 2014-03-12 15:07:39 +04:00
Alexander Alekhin dca401d4cc ocl: pyrUp/pyrDown 3-channel 2014-03-12 14:39:55 +04:00
ziyangli bbe8654c3d cleanup 2014-03-12 18:16:54 +08:00
Ziyang LI 4f5896493e remove a whitepace 2014-03-12 18:14:43 +08:00
Ilya Lavrenov f138b613b7 cv::compare 2014-03-12 13:16:33 +04:00
mlyashko 5252aa8fdd added data type check for back projection fix 2014-03-12 11:30:28 +04:00
Ilya Lavrenov 89b7c0dd93 3 channel support to cv::transpose 2014-03-12 00:17:11 +04:00
Ilya Lavrenov 2755ae5df9 experiments 2014-03-11 23:03:55 +04:00
Roman Donchenko 1bb0c5747c Merge pull request #2462 from ibtaylor:fix_deblurring_calcBlurriness_var_name_typo 2014-03-11 17:41:18 +04:00
Roman Donchenko 95a55453df Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/calib3d/perf/perf_pnp.cpp
	modules/contrib/src/imagelogpolprojection.cpp
	modules/contrib/src/templatebuffer.hpp
	modules/core/perf/opencl/perf_gemm.cpp
	modules/cudafeatures2d/doc/feature_detection_and_description.rst
	modules/cudafeatures2d/perf/perf_features2d.cpp
	modules/cudafeatures2d/src/fast.cpp
	modules/cudafeatures2d/test/test_features2d.cpp
	modules/features2d/doc/feature_detection_and_description.rst
	modules/features2d/include/opencv2/features2d/features2d.hpp
	modules/features2d/perf/opencl/perf_brute_force_matcher.cpp
	modules/gpu/include/opencv2/gpu/gpu.hpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/perf4au/main.cpp
	modules/imgproc/perf/opencl/perf_blend.cpp
	modules/imgproc/perf/opencl/perf_color.cpp
	modules/imgproc/perf/opencl/perf_moments.cpp
	modules/imgproc/perf/opencl/perf_pyramid.cpp
	modules/objdetect/perf/opencl/perf_hogdetect.cpp
	modules/ocl/perf/perf_arithm.cpp
	modules/ocl/perf/perf_bgfg.cpp
	modules/ocl/perf/perf_blend.cpp
	modules/ocl/perf/perf_brute_force_matcher.cpp
	modules/ocl/perf/perf_canny.cpp
	modules/ocl/perf/perf_filters.cpp
	modules/ocl/perf/perf_gftt.cpp
	modules/ocl/perf/perf_haar.cpp
	modules/ocl/perf/perf_imgproc.cpp
	modules/ocl/perf/perf_imgwarp.cpp
	modules/ocl/perf/perf_match_template.cpp
	modules/ocl/perf/perf_matrix_operation.cpp
	modules/ocl/perf/perf_ml.cpp
	modules/ocl/perf/perf_moments.cpp
	modules/ocl/perf/perf_opticalflow.cpp
	modules/ocl/perf/perf_precomp.hpp
	modules/ocl/src/cl_context.cpp
	modules/ocl/src/opencl/haarobjectdetect.cl
	modules/video/src/lkpyramid.cpp
	modules/video/src/precomp.hpp
	samples/gpu/morphology.cpp
2014-03-11 17:20:01 +04:00
Andrey Pavlenko 702a2a6ff6 Merge pull request #2373 from mlyashko:optflow_dualtvl1 2014-03-11 16:00:22 +04:00
Andrey Pavlenko 5261fbe217 Merge pull request #2387 from alalek:ocl_remap_3cn 2014-03-11 15:59:12 +04:00
Andrey Pavlenko 90c5dde887 Merge pull request #2455 from ilya-lavrenov:tapi_fix 2014-03-11 15:58:32 +04:00
Ilya Lavrenov 9b31e6cd44 changes according to reviewer's suggestions 2014-03-11 15:40:31 +04:00
Andrey Pavlenko 0084dee05b Merge pull request #2448 from akarsakov:ocl_cxt_termination 2014-03-11 12:57:29 +04:00
Andrey Pavlenko fd0ab8eba1 Merge pull request #2461 from ilya-lavrenov:tapi_calc_hist 2014-03-11 12:44:33 +04:00
Andrey Pavlenko 1f8df38dba Merge pull request #2457 from ilya-lavrenov:ocl_calc_hist 2014-03-11 12:37:11 +04:00
Ilya Lavrenov 3eff05e3eb added performance tests for cv::ocl::calcHist 2014-03-11 12:34:27 +04:00
Alexander Alekhin e7475bff68 TAPI: remap 3-channel 2014-03-10 20:35:10 +04:00
Alexander Alekhin e4608229f0 ocl: copyMakeBorder 3-channel 2014-03-10 17:22:49 +04:00
Ziyang LI 786e3b9eee Moved x = 0 into the parenthesis
Easier to understand
2014-03-10 17:33:13 +08:00
Ian Taylor 45969bb3ae fix variable name typo in calcBlurriness 2014-03-10 03:02:06 -04:00
Ilya Lavrenov 208831eb5d optimized cv::calcHist 2014-03-08 12:24:31 +04:00
Vadim Pisarevsky efdfca7a11 do not use the large "score" buffer; now without non-max suppression OpenCL FAST is pretty efficient 2014-03-07 18:55:45 +04:00
Roman Donchenko 70e22b682d Merge pull request #2397 from vbystricky:intelperc 2014-03-07 18:19:00 +04:00
Vadim Pisarevsky 06c138bd64 make the correctness test pass 2014-03-07 18:18:10 +04:00
vbystricky 193e97a34a Move declaration of IVideoCapture class into precomp.hpp, make some methods of IVideoCapture pure virtual 2014-03-07 16:25:15 +04:00
kurodash 0eaeff0641 fix: use "cvAlloc" wrapper function for malloc. 2014-03-07 19:02:37 +09:00
Andrey Pavlenko 2879ff2098 Merge pull request #2437 from ilya-lavrenov:tapi_morph 2014-03-07 14:00:09 +04:00
Andrey Pavlenko 5dbe73f94d Merge pull request #2438 from ilya-lavrenov:tapi_flip 2014-03-07 13:54:34 +04:00
Andrey Pavlenko 182d74d33f Merge pull request #2441 from akarsakov:ocl_platform_vendor 2014-03-07 13:54:13 +04:00
Andrey Pavlenko 451be9ed53 Merge pull request #2444 from ilya-lavrenov:tapi_gftt 2014-03-07 13:53:43 +04:00
Andrey Pavlenko 3cb49eac49 Merge pull request #2451 from ilya-lavrenov:tapi_fast_covar_data 2014-03-07 13:52:47 +04:00
Andrey Pavlenko 8f3492851e Merge pull request #2453 from ilya-lavrenov:tapi_sobel 2014-03-07 13:51:37 +04:00
Alexander Karsakov 8660588fe9 Pass vendor macro to opencl kernel 2014-03-07 12:57:29 +04:00
mlyashko eb2e8a11fa changed kernel.set to support unsuccssful set 2014-03-07 11:15:54 +04:00
sprice 75ed2f52f1 Merge branch 'master' of https://github.com/Itseez/opencv
Conflicts:
	modules/features2d/include/opencv2/features2d.hpp
	modules/features2d/src/freak.cpp
	modules/features2d/src/stardetector.cpp
2014-03-06 15:39:06 -08:00
Ilya Lavrenov 0e2cc5ef63 fix bitwise ops and mask support 2014-03-06 23:39:05 +04:00
Andrey Pavlenko d1d451c952 Merge pull request #2431 from ilya-lavrenov:tapi_perf 2014-03-06 22:17:44 +04:00
Andrey Pavlenko 229aa62300 Merge pull request #2445 from ilya-lavrenov:ocl_perf 2014-03-06 22:03:01 +04:00
Andrey Pavlenko 2f0fe5b87b Merge pull request #2450 from ilya-lavrenov:tapi_test 2014-03-06 21:55:50 +04:00
Andrey Pavlenko f21a94880e Merge pull request #2452 from ilya-lavrenov:tapi_disable_surf 2014-03-06 21:51:25 +04:00
Vadim Pisarevsky 8e1918e86e added OpenCL-accelerated(?) FAST; for now the tests fail :( 2014-03-06 18:04:04 +04:00
Ilya Lavrenov dc76e6b4a1 added new dtypes to cv::Sobel 2014-03-06 17:57:13 +04:00
Roman Donchenko f351540eda Merge pull request #2443 from waveform80:issue-3554 2014-03-06 17:53:31 +04:00
Ilya Lavrenov 4a7289b22f improved cv::preCornerDetect 2014-03-06 17:40:02 +04:00
Ilya Lavrenov d9c5fbc9ba disable SURF 2014-03-06 16:49:22 +04:00
Alexander Karsakov 806e9241a6 Clarifying comments 2014-03-06 16:44:46 +04:00
Ilya Lavrenov 1291bd1c4a ported fast calculation of covar data 2014-03-06 15:40:27 +04:00
Ilya Lavrenov f404315368 test for clEnqueueReadBufferRect 2014-03-06 12:11:46 +04:00
mlyashko 66ed6a8a50 macro for normal return from thriveless kernel.set 2014-03-06 11:43:01 +04:00
Alexander Smorkalov b3e18d23a3 Implicit CUDA and OpenCL control for module definition added.
Feature allows to exclude CUDA or OpenCL optimizations at all even CUDA is used
on build. Exclusion of CUDA or OpenCL cut unwanted dependencies.
2014-03-06 10:31:33 +04:00
Ilya Lavrenov f7a474180b tuned some tests 2014-03-06 09:24:02 +04:00
Ilya Lavrenov 86a3ed4162 improved performance of GFTT 2014-03-06 09:19:40 +04:00
Anatoly Baksheev fde0185a77 iteractor work 2014-03-06 03:26:21 +04:00
Vadim Pisarevsky 22f42a639f fixed doc builder warnings; make sure the tests give reasonable results when OpenCL is not available 2014-03-05 18:48:19 +04:00
Alexander Karsakov 4aa891e773 Remove clReleaseDevice call (workaround for pure virtual call on Windows) 2014-03-05 17:57:06 +04:00
Roman Donchenko 42f9ee3f3e Merge pull request #2440 from codyrigney92:Master_LKOptFlow_NEON 2014-03-05 17:28:09 +04:00
Vadim Pisarevsky 60ce2b2e9f modified SURF's performance test to test OpenCL version as well 2014-03-05 17:10:51 +04:00
Vadim Pisarevsky da70b04262 made SURF_OCL default constructor parameters the same as SURF 2014-03-05 17:04:49 +04:00
Vadim Pisarevsky 3c1917771b modified OpenCL SURF API and the tests in 2.4.x to prove that it gives different from CPU results 2014-03-05 16:31:41 +04:00
Alexander Karsakov c1dad2178c Added Device:: isAMD,isIntel,isNvidia methods. 2014-03-05 14:43:11 +04:00
vbystricky d4a1df85be Change text of copyright 2014-03-05 13:06:36 +04:00
vbystricky f9e942f9ef Change text of license and copyright 2014-03-05 11:03:57 +04:00
Dave Hughes b184d7f27b Fix for #3554
v4l2_scan_controls_enumerate_menu is unused and causes ioctl error on
RaspberryPi and possibly other Video4Linux variants. See
http://www.raspberrypi.org/forum/viewtopic.php?f=43&t=65026 for more
detail.
2014-03-05 02:44:40 +00:00
Cody Rigney a80ebfe28d Master Version: Added NEON Optimizations for LK Optical Flow. 2014-03-04 14:47:12 -05:00
Andrey Pavlenko 0a3aca230c Merge pull request #2436 from ilya-lavrenov:tapi_dft_fix 2014-03-04 19:21:15 +04:00
Andrey Pavlenko ba4513503e Merge pull request #2429 from ilya-lavrenov:master_compatible_tests 2014-03-04 19:18:13 +04:00
Andrey Pavlenko c9d8025fab Merge pull request #2391 from ilya-lavrenov:tapi_match_template 2014-03-04 18:50:14 +04:00
Andrey Pavlenko c00f0faf24 Merge pull request #2408 from ilya-lavrenov:tapi_core_opt 2014-03-04 18:37:26 +04:00
Roman Donchenko 5527f2872d Merge pull request #2409 from juanmanpr:master 2014-03-04 15:32:13 +04:00
Roman Donchenko b5248dbf3f Merge pull request #2407 from codyrigney92:LKOptFlow_NEON 2014-03-04 15:30:26 +04:00
Roman Donchenko fa3f29f2b5 Merge pull request #2439 from ilya-lavrenov:typo 2014-03-04 13:51:31 +04:00
Ilya Lavrenov 099ea91823 typos 2014-03-04 12:47:40 +04:00
Roman Donchenko 0692a674d1 Merge pull request #2381 from ElenaGvozdeva:ipp_resize 2014-03-04 11:49:02 +04:00
Roman Donchenko a600267b9f Merge pull request #2432 from ilya-lavrenov:summary_py 2014-03-04 11:46:29 +04:00
mlyashko 5c867463d2 changed localsize to NULL (reviewers comment) 2014-03-04 11:36:47 +04:00
Hilton Bristow 72d5609a36 Merged upstream master 2014-03-04 11:14:03 +10:00
GregoryMorse 90920c2376 Update cap_msmf.cpp
Add support for WinRT in the MF capture framework by removing the disallowed calls to enumerate devices and create a sample grabber sink and adding framework for the MediaCapture interface and a custom sink which interfaces with the sample grabber callback interface. The change requires discussion for making it completely functional as redundancy is required given that if the source is a video file, the old code pathways must be used. Otherwise all IMFMediaSession, IMFMediaSource, and IMFActivate code must use a MediaCapture code path and all sink code must use the CMediaSink custom sink.

Support for the custom sink is extended to non-WinRT not for compatibility as Windows Vista client is a minimum regardless, but because it offers more flexibility, could be faster and is able to be used as an optionally different code path during sink creation based on a future configuration parameter.

My discussion and proposal to finish this change:
 Devices are so easily enumerated through WinRT Windows.Devices namespace that wrapping the calls in a library is quite a chore for little benefit though to get the various modes and formats could still be a worthwhile project. For now conditional compilation to remove videodevices and any offending non-video file related activity in videodevice. In my opinion, this is a different , far less fundamental and important change which can possibly be done as a future project and also much more easily implemented in C++/CX.

ImageGrabber has the IMFSampleGrabberSinkCallback replaced with a base class (SharedSampleGrabber) which also be is base class for ImageGrabberRT. This change is necessary as the custom sink does not require a thread to pump events which is done through MediaCapture already. IMFSampleGrabberSinkCallback is the common element between both models and that piece can be shared. Initializing the new ImageGrabberRT is as simple as passing an already initialized MediaCapture object and any video format/encoding parameters.

The concurrency event is necessary to wait for completion and is the way the underlying, IAsyncAction wrappers in the task library work as well. Native WIN32 event objects would be an option if HAVE_CONCURRENCY is not defined. I could even imagine doing it with sleep/thread yield and InterlockedCompareExchange yet I am not enthusiastic about that approach either. Since there is a specific compiler HAVE_ for concurrency, I do not like pulling it in though I think for WinRT it is safe to say we will always have it available though should probably conditionally compile with the Interlocked option as WIN32 events would require HAVE_WIN32.

It looks like C++/CX cannot be used for the IMediaExtension sink (which should not be a problem) as using COM objects requires WRL and though deriving from IMediaExtension can be done, there is little purpose without COM. Objects from C++/CX can be swapped to interact with objects from native C++ as Inspectable* can reinterpret_cast to the ref object IInspectable^ and vice-versa. A solution to the COM class with C++/CX would be great so we could have dual support. Also without #define for every WRL object in use, the code will get quite muddy given that the */^ would need to be ifdef'd everywhere.

Update cap_msmf.cpp

Fixed bugs and completed the change.  I believe the new classes need to be moved to a header file as the file has become to large and more classes need to be added for handling all the asynchronous problems (one wrapping IAsyncAction in a task and another for making a task out of IAsyncAction).  Unfortunately, blocking on the UI thread is not an option in WinRT so a synchronous architecture is considered "illegal" by Microsoft's standards even if implementable (C++/CX ppltasks library throws errors if you try it).  Worse, either by design or a bug in the MF MediaCapture class with Custom Sinks causes a crash if stop/start previewing without reinitializing (spPreferredPreviewMediaType is fatally nulled).  After decompiling Windows.Media.dll, I worked around this in my own projects by using an activate-able custom sink ID which strangely assigns 1 to this pointer allowing it to be reinitialized in what can only be described as a hack by Microsoft.  This would add additional overhead to the project to implement especially for static libraries as it requires IDL/DLL exporting followed by manifest declaration.  Better to document that it is not supported.

Furthermore, an additional class for IMFAttributes should be implemented to make clean architecture for passing around attributes as opposed to directly calling non-COM interface calls on the objects and making use of SetProperties which would also be a set up for an object that uses the RuntimeClass activation ID.

The remaining changes are not difficult and will be complete soon along with debug tracing messages.

Update cap_msmf.cpp

Create cap_msmf.h

Update cap_msmf.cpp

Update cap_msmf.h

Update cap_msmf.cpp

Update cap_msmf.h

Update and rename cap_msmf.h to cap_msmf.hpp

Update cap_msmf.cpp

Update CMakeLists.txt

Update cap_msmf.hpp

Update cap_msmf.cpp

Update cap_msmf.cpp

Update cap_msmf.cpp

Update cap_msmf.hpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Successful test - samples are grabbed

Update cap_msmf.cpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Update cap_msmf.hpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Update cap_msmf.hpp

Create ppltasks_winrt.h

Update cap_msmf.hpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Update ppltasks_winrt.h

Library updated and cleaned up with comments, marshaling, exceptions and linker settings

Update ppltasks_winrt.h

Fixed trailing whitespace
2014-03-04 01:52:17 +08:00
Ilya Lavrenov 050cca0422 improved performance of cv::flip (flip cols) 2014-03-03 19:04:32 +04:00
Roman Donchenko 7ecbf45751 Merge pull request #2435 from SpecLad:merge-2.4 2014-03-03 15:41:06 +04:00
Ilya Lavrenov 4376de7698 fixed morphology operations 2014-03-03 15:29:48 +04:00
Ilya Lavrenov be5b5a0471 fixed cv::dft 2014-03-03 14:32:38 +04:00
Roman Donchenko db85c35e69 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/contrib/src/basicretinafilter.hpp
	modules/contrib/src/magnoretinafilter.hpp
	modules/contrib/src/parvoretinafilter.hpp
	modules/contrib/src/retinacolor.hpp
	modules/gpu/include/opencv2/gpu/gpu.hpp
	modules/highgui/src/cap_tyzx.cpp
	modules/ocl/perf/perf_filters.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/opencl/haarobjectdetect.cl
	modules/ocl/test/test_filters.cpp
	modules/ocl/test/test_objdetect.cpp
2014-03-03 13:45:22 +04:00
Ilya Lavrenov 29deff8707 ability to merge logs with intersections only 2014-03-03 13:27:07 +04:00
Roman Donchenko af8aa8a2fa Merge pull request #2433 from ilya-lavrenov:typos 2014-03-03 12:20:35 +04:00
Anatoly Baksheev fb7e74c511 iteractor work 2014-03-02 23:15:53 +04:00
Ilya Lavrenov eedf86402d typos 2014-03-02 21:04:17 +04:00
Ilya Lavrenov 68957b2757 added some new performance tests 2014-03-02 10:29:50 +04:00
Ilya Lavrenov 767b28f2e3 tests 2014-03-01 18:47:44 +04:00
Cody Rigney fbc69e444b Added NEON optimizations for LK optical flow (Intrinsics). 2014-02-28 16:48:04 -05:00
Ilya Lavrenov c1c3139368 master-like performance tests 2014-02-28 22:40:24 +04:00
Andrey Pavlenko 409bd162ff Merge pull request #2421 from akarsakov:fix_ocl_haar_intel 2014-02-28 18:22:03 +04:00
Andrey Pavlenko 37580687e6 Merge pull request #2427 from alalek:ocl_build_log 2014-02-28 18:21:38 +04:00
Elena Gvozdeva 68edda3350 fixed 2014-02-28 11:56:23 +04:00
Alexander Alekhin b9d68ef061 core/ocl: OpenCL build log improvements 2014-02-27 13:16:07 +04:00
Andrey Pavlenko 57b6850d74 Merge pull request #2415 from vpisarev:fix_stereobm_sse 2014-02-27 09:37:04 +04:00
Alexander Karsakov e6f6707558 OCL: Fix for Haar classifier (thanks to Konstantin Rodyushkin). 2014-02-26 18:11:11 +04:00
Roman Donchenko 7dc22b4ea6 Merge pull request #2419 from linquize:tgit.icon 2014-02-26 17:34:49 +04:00
Linquize a228633d31 Add tgit.icon project config 2014-02-26 17:46:52 +08:00
Roman Donchenko bd5d8404c9 Merge pull request #2393 from ilya-lavrenov:coverity 2014-02-26 12:16:36 +04:00
mlyashko ba5ebaa758 changed file name to case-sensitve to support linux 2014-02-26 10:55:18 +04:00
juanmanpr 7a68e3d207 CV_Assert for photo module corrected 2014-02-25 19:58:08 +01:00
Roman Donchenko 693129902d Merge pull request #2399 from SpecLad:merge-2.4 2014-02-25 19:42:54 +04:00
Vadim Pisarevsky a3aced20c1 fixed difference between SSE2 and C branches of StereoBM; they should now produce absolutely the same results 2014-02-25 18:13:51 +04:00
Roman Donchenko c9a4a82667 Merge pull request #2358 from rohitgirdhar:rotatedRect 2014-02-25 17:43:48 +04:00
Ilya Lavrenov ce0557ebb8 fixed defects from Xcode 2014-02-25 17:33:12 +04:00
Elena Gvozdeva 45cc8a5300 fixed 2014-02-25 16:43:52 +04:00
Roman Donchenko 1db1a83410 Merge pull request #2410 from asmorkalov:android_tiff_lowmem_fix 2014-02-25 15:04:24 +04:00
Roman Donchenko 48432502b6 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	cmake/OpenCVDetectCUDA.cmake
	doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.rst
	modules/core/CMakeLists.txt
	modules/features2d/perf/opencl/perf_brute_force_matcher.cpp
	modules/highgui/src/grfmt_tiff.cpp
	modules/imgproc/src/clahe.cpp
	modules/imgproc/src/moments.cpp
	modules/nonfree/CMakeLists.txt
	modules/ocl/perf/perf_ml.cpp
	modules/superres/CMakeLists.txt
2014-02-25 15:02:24 +04:00
Roman Donchenko 3693facd9e Merge pull request #2412 from arunjvs:master 2014-02-25 14:21:12 +04:00
Ilya Lavrenov fe38aab84a core tapi optimization 2014-02-25 14:14:42 +04:00
Arun JVS 31fb7c4fec Fixed Bug #3568: Build fails with WITH_OPENGL=ON 2014-02-25 14:34:32 +05:30
Elena Gvozdeva 48e7bc6b30 fixed 2014-02-25 12:59:33 +04:00
Roman Donchenko 7dc549f166 Merge pull request #2411 from asmorkalov:android_mat_leak_fix 2014-02-25 12:37:01 +04:00
Alexander Smorkalov c78142acb0 Bug #3391 org.opencv.android.NativeCameraView crashes after latest OpenCV Manager update fixed.
The crash was cased by massive Mat objects leak in NativeCameraView class.
2014-02-25 11:54:03 +04:00
vbystricky ff8b8ef24c Remove implementation of CvCapture interface for Intel PerC camera. Add IVideoCapture interface and implementation of this one for Intel PerC camera 2014-02-25 10:59:35 +04:00
Alexander Smorkalov dbb7aa7856 Highgui_Tiff.decode_tile16384x16384 disabled for Android.
Last changes in test leads to SIGKILL on Android.
SIGKILL is called by out of memory killer.
2014-02-25 10:36:20 +04:00
Andrey Pavlenko d695d4a0bf Merge pull request #2406 from ilya-lavrenov:abf 2014-02-25 09:12:32 +04:00
juanmanpr 540a60fca7 Replaced calls to cout from photo module, by CV_Assert 2014-02-25 00:29:07 +01:00
Ilya Lavrenov 653b99c9bd new scheme of sqrSum 2014-02-25 00:38:44 +04:00
Ilya Lavrenov e1a598c5b3 disabled ABF tests 2014-02-24 23:26:01 +04:00
Nicolas Martin 67cf0dabea Do not build apple objective-c codes if using gcc 2014-02-24 09:44:49 -05:00
mlyashko e75a257f92 changed epsilon for test passing 2014-02-24 17:47:56 +04:00
Andrey Pavlenko 73dfc4cb8c Merge pull request #2402 from ilya-lavrenov:amd_libs 2014-02-24 16:56:40 +04:00
Andrey Pavlenko 3845b96f6c Merge pull request #2388 from alalek:coverity_bug_fix 2014-02-24 16:54:44 +04:00
Andrey Pavlenko 52a339cba5 Merge pull request #2401 from akarsakov:fix_elem_size 2014-02-24 16:22:28 +04:00
Andrey Pavlenko 0f43345f9e Merge pull request #2394 from ilya-lavrenov:tapi_memop_fix 2014-02-24 16:21:41 +04:00
Ilya Lavrenov 16bfdbd22a dump AMD Blas/Fft 2014-02-24 15:12:42 +04:00
Alexander Karsakov 6d83048ec3 Fixed incorrect calculation of element size in OCL.(Mul/Div).Mat_Scalar_Scale. 2014-02-24 15:10:00 +04:00
Roman Donchenko 681a8c6e18 Merge pull request #2398 from nghiaho12:integral_doc 2014-02-24 14:26:41 +04:00
Nghia Ho ced8e7a813 Typo 2014-02-24 20:06:20 +11:00
Roman Donchenko 2b0c3eb170 Merge pull request #2389 from SpecLad:ios-big-endian 2014-02-24 12:44:36 +04:00
Roman Donchenko 1cf75c0cab Hardcode iOS's endianness, since the TestBigEndian module doesn't work there 2014-02-24 12:13:35 +04:00
Martin Dlouhy 8f6ebc2427 fixed rotated rectangle (center instead of corner) 2014-02-24 07:54:08 +01:00
Ilya Lavrenov 32eb38ec98 fixed defects from coverity.com 2014-02-23 20:21:08 +04:00
Ilya Lavrenov 0406898b9a int2 -> ulong; to work properly with 3 channels 2014-02-23 15:12:38 +04:00
Ilya Lavrenov 0ef16125ae improved cv::matchTemplate OpenCL part 2014-02-22 14:30:19 +04:00
Rohit Girdhar fd4461d543 addressed issues 2014-02-22 09:54:16 +05:30
Roman Donchenko 0a90d6dde6 Merge pull request #2266 from vpisarev:ipp_norm_fix 2014-02-21 19:11:57 +04:00
Vadim Pisarevsky 51dafc780b fixed hint type declaration 2014-02-21 18:07:01 +04:00
Roman Donchenko 51421098dd Merge pull request #2201 from mattip:2.4 2014-02-21 17:57:36 +04:00
Matti Picus dc50dc7254 fix merge 2014-02-21 13:54:58 +02:00
Andrey Pavlenko 3e5890694e Merge pull request #2384 from ilya-lavrenov:perf_match 2014-02-21 15:14:12 +04:00
Alexander Alekhin 9b3c76a3db TAPI: coverity bug fix 2014-02-21 14:04:01 +04:00
Matti Picus f5330a44e8 merge with origin 2014-02-21 11:59:49 +02:00
Ilya Lavrenov c7857e8c13 small fixes 2014-02-21 12:19:08 +04:00
Rohit Girdhar 347a3dc520 added randomized test 2014-02-21 12:47:01 +05:30
Matti Picus 31c8f2ec57 fix code, it turns out only TIFFReadRGBATile needs buffer pointer mangling 2014-02-20 22:12:22 +02:00
Matti Picus 46d128e073 add test (needs updated opencv_extra repo) 2014-02-20 22:10:22 +02:00
Andrey Pavlenko 9c5bd85247 Merge pull request #2375 from akarsakov:fix_getGradient 2014-02-20 21:41:43 +04:00
Andrey Pavlenko b96923d5fa Merge pull request #2377 from alalek:tapi_warpers_perf_test 2014-02-20 21:40:28 +04:00
Andrey Pavlenko f04a158268 Merge pull request #2383 from ilya-lavrenov:perf_match_template 2014-02-20 21:36:30 +04:00
Ilya Lavrenov aa5311ea9f backport of master-based perf tests for matchTemplate to 2.4 2014-02-20 18:58:32 +04:00
Ilya Lavrenov 804b70b72f ported 2.4 perf tests for matchTemplate 2014-02-20 18:11:56 +04:00
Elena Gvozdeva 7b552c0493 fixed 2014-02-20 17:34:51 +04:00
Rohit Girdhar ea7b1bb3d2 added test, doc 2014-02-20 17:51:48 +05:30
Elena Gvozdeva cd68cd43a2 Fixed 2014-02-20 16:13:05 +04:00
mlyashko 10f2a038c2 Optical flow dualt tvl1 ocl-based implementation and tests 2014-02-20 14:23:10 +04:00
Elena Gvozdeva e013d31715 Added IPP function for resize() 2014-02-20 14:01:22 +04:00
Alexander Karsakov 7e4dea968c Fixed typo with indexes in getGradient(x/y) functions. 2014-02-20 13:58:31 +04:00
Roman Donchenko ad66233774 Merge pull request #2376 from GrinIara:master 2014-02-20 13:43:22 +04:00
Roman Donchenko efafd4a9e5 Merge pull request #2380 from jet47:fix-3562 2014-02-20 13:41:45 +04:00
Roman Donchenko 61976b8461 Merge pull request #2325 from alalek:perf_fix 2014-02-20 13:39:54 +04:00
Alexander Alekhin 79eba54a4f some fixes in perf tests 2014-02-20 13:29:11 +04:00
Alexander Alekhin ddd3c062b5 TAPI: fix perf test for warpers 2014-02-20 13:09:06 +04:00
Vladislav Vinogradov 7fd21d217a fix bug #3562:
add missing __syncthreads to edgesHysteresisLocalKernel
2014-02-20 10:24:52 +04:00
GrinIara fa0599448d Fixed compilation error due to missing std::. 2014-02-19 17:06:33 +01:00
Rohit Girdhar b939b4ae3b removed inline, changed interface 2014-02-19 20:58:40 +05:30
Ilya Lavrenov 8bf616e4c7 added color image support via L*a*b* 2014-02-19 18:35:37 +04:00
Ilya Lavrenov 634e8d37cc fixed for 2 channels 2014-02-19 18:18:22 +04:00
Alexander Alekhin bf4f15fb5f TAPI: fix OpenCL warpers and test 2014-02-19 15:30:43 +04:00
Ilya Lavrenov 7faf1f6277 some improvements 2014-02-19 15:01:34 +04:00
Roman Donchenko ccbceb56c4 Merge pull request #2144 from nickdademo:pvapi_framestarttriggermode 2014-02-19 14:48:57 +04:00
Roman Donchenko cfc4621587 Merge pull request #2291 from xgvargas:extra-note-for-waitKey 2014-02-19 14:33:58 +04:00
Roman Donchenko ce42593fe6 Merge pull request #2368 from asmorkalov:ocv_gcc48_warning_fix 2014-02-19 12:03:06 +04:00
Roman Donchenko 7cbc4e88de Merge pull request #2357 from akarsakov:fix_ipp_compilation_linux 2014-02-19 12:02:41 +04:00
Alexander Smorkalov 4c1ed13846 Warning fixes for GCC 4.8. 2014-02-18 23:53:35 +04:00
Ilya Lavrenov 72c327fef8 hope it finally works 2014-02-18 19:23:38 +04:00
Roman Donchenko 8754adc021 Merge pull request #2371 from ilya-lavrenov:typo 2014-02-18 18:00:14 +04:00
Roman Donchenko af9368d35f Merge pull request #2370 from ilya-lavrenov:cuda_nlm_typo 2014-02-18 17:00:54 +04:00
Roman Donchenko c35dab9046 Merge pull request #2359 from SpecLad:moments-no-vectorize 2014-02-18 17:00:32 +04:00
Roman Donchenko 3782c324c4 Merge pull request #2098 from pxli168:patch-1 2014-02-18 15:49:19 +04:00
Roman Donchenko 6f19ef8631 Merge pull request #2361 from alekcac:ios_camera_changes 2014-02-18 15:44:56 +04:00
Ilya Lavrenov 38cbe9873a small fixes 2014-02-18 14:56:13 +04:00
Ilya Lavrenov 9db28f332a more fixes 2014-02-18 14:32:03 +04:00
Ilya Lavrenov 891dbeabba implemented OpenCL version of cv::fastNlMeansDenoising 2014-02-18 14:32:03 +04:00
Ilya Lavrenov d27068f79a some more refactoring 2014-02-18 14:32:03 +04:00
Ilya Lavrenov e16d89e8d6 some refactoring 2014-02-18 14:32:03 +04:00
Roman Donchenko 5cb2d1c20d Merge pull request #2338 from asmorkalov:ocv_gcov 2014-02-18 14:25:16 +04:00
Ilya Lavrenov e460a29cab typo 2014-02-18 14:24:17 +04:00
Ilya Lavrenov da9bdf9c15 fixes typo and unused variables 2014-02-18 14:16:54 +04:00
Alexander Shishkov 77df5948e7 removed trailing spaces 2014-02-18 13:56:26 +04:00
Roman Donchenko e35d98e566 Worked around an apparent GCC bug in moments. 2014-02-18 13:51:27 +04:00
Roman Donchenko b7659c62f3 Merge pull request #2366 from yashdv:mat_copyto_doc_bug 2014-02-18 13:47:46 +04:00
Roman Donchenko edbff68843 Merge pull request #2355 from alekcac:hough_circles_fix 2014-02-18 13:36:33 +04:00
yash 394c74b349 edited the doc for mat::copyto and clarified the part regarding reallocation by .create 2014-02-18 15:04:27 +05:30
Andrey Pavlenko e6420c523d Merge pull request #2235 from alalek:ocl_svm_perf_test 2014-02-18 13:33:16 +04:00
Andrey Pavlenko b3cfe6b446 Merge pull request #2341 from alalek:ocl_fix_error_processing 2014-02-18 13:27:38 +04:00
Andrey Pavlenko ff9a0815b9 Merge pull request #2352 from ilya-lavrenov:flann 2014-02-18 13:24:41 +04:00
Alexander Smorkalov de6d13088f gcov tool support added. 2014-02-18 12:59:41 +04:00
Roman Donchenko 2409812803 Merge pull request #2347 from Chechli:master 2014-02-18 12:57:26 +04:00
Roman Donchenko 139a262072 Merge pull request #2367 from jet47:fix-3544 2014-02-18 12:15:49 +04:00
Roman Donchenko bcf4307345 Merge pull request #2356 from SpecLad:merge-2.4 2014-02-18 12:14:57 +04:00
Roman Donchenko 689589ebaa Merge pull request #2365 from yashdv:image_tutorial_doc_bug 2014-02-18 11:58:11 +04:00
Roman Donchenko 95d7ecb33f Merge pull request #2364 from ilya-lavrenov:unused_field 2014-02-18 11:57:36 +04:00
Roman Donchenko 13182da945 Merge pull request #2363 from alekcac:introduction_tut_fix 2014-02-18 11:56:57 +04:00
Roman Donchenko a0a4f6c23d Merge pull request #2362 from alekcac:docs_style_change 2014-02-18 11:56:36 +04:00
Roman Donchenko 224124b69e Merge pull request #2360 from Evgenij-Gr:XLSreport 2014-02-18 11:56:21 +04:00
Chechli 768da4d95a Update hough_circles.cpp 2014-02-18 08:50:33 +01:00
Vladislav Vinogradov afd99c9c81 fix bug #3544:
add "opencv2/core/utility.hpp" header to precomp.hpp
2014-02-18 10:45:47 +04:00
yash 38ef8894b7 Made a sentence in the doc for Mat::copyTo more clearer 2014-02-18 10:51:05 +05:30
yash 017a282c7a Minor error in the documentation Load and Save Image 2014-02-18 10:34:58 +05:30
Gustavo Vargas 0d199b4048 Update py_image_display.rst 2014-02-17 23:22:18 -03:00
pxli168 44ecb727c5 Change again.
Opps.
2014-02-18 10:13:30 +08:00
Ilya Lavrenov 6ad7b64912 some more changes 2014-02-17 21:57:33 +04:00
Ilya Lavrenov 01527c44fd removed unused field 2014-02-17 21:50:00 +04:00
Alexander Shishkov a8eab26bae fixed incorrect code in introduction tutorial 2014-02-17 18:10:08 +04:00
Alexander Shishkov 63235f51f0 fixed year in copyright 2014-02-17 17:56:12 +04:00
Andrey Pavlenko 9885a671ee Merge pull request #2346 from ilya-lavrenov:umat_tests_cleanup 2014-02-17 17:53:05 +04:00
Andrey Pavlenko 47d9b933f6 Merge pull request #2345 from ilya-lavrenov:tapi_3cn_perf 2014-02-17 17:38:26 +04:00
Alexander Shishkov cc529d971b removed tabs 2014-02-17 17:37:02 +04:00
Andrey Pavlenko aeeb9f9e25 Merge pull request #2334 from alalek:umat_usage_flags_2 2014-02-17 17:34:19 +04:00
Rohit Girdhar a879e1fcd6 fixed warnings 2014-02-17 19:00:36 +05:30
Evgeniy 8236181c62 Added more colorizing options to XLS generating script 2014-02-17 17:01:23 +04:00
Alexander Karsakov 01a980aa9e Fixed compilation with IPP on Linux. Added linking with Intel compiler runtime libraries. 2014-02-17 16:56:02 +04:00
Andrey Pavlenko 01b225acb0 Merge pull request #2340 from ilya-lavrenov:tapi_lab 2014-02-17 16:45:40 +04:00
Rohit Girdhar 613a17355d rotRect using points 2014-02-17 17:39:13 +05:30
Roman Donchenko 029ffb7c2d Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/core/src/gl_core_3_1.cpp
	modules/core/src/opencl/convert.cl
	modules/cudaimgproc/src/cuda/canny.cu
	modules/cudastereo/perf/perf_stereo.cpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/test/test_denoising.cpp
	modules/ocl/src/opencl/imgproc_resize.cl
	samples/cpp/Qt_sample/main.cpp
2014-02-17 15:24:05 +04:00
Roman Donchenko a6d64e254f Merge pull request #2354 from gleb-sternharz:Branch_2.4.8 2014-02-17 15:00:47 +04:00
Roman Donchenko e8d26b02ac Merge pull request #2339 from jet47:gpu-warnings 2014-02-17 13:35:15 +04:00
Roman Donchenko 7358b44222 Merge pull request #2343 from yashdv:template_matching_doc_fix 2014-02-17 13:33:29 +04:00
Marijan Vukcevich 9a98cd6e65 Update cap_ios_abstract_camera.mm
AVCaptureVideoPreviewLayer setOrientation is depricated. This fixes the warning and provides backward compatibility.
2014-02-17 13:23:25 +04:00
Alexander Shishkov f60913ddd3 small changes in hough circles tutorial 2014-02-17 12:55:19 +04:00
Chechli 9211d1ac2d Update hough_circles.cpp 2014-02-17 09:50:32 +01:00
Chechli 640a45d359 Update precomp.hpp 2014-02-17 09:48:51 +01:00
Roman Donchenko a0bb74a086 Merge pull request #2337 from pmoulon:master 2014-02-17 12:24:48 +04:00
Roman Donchenko cfcf07acfa Merge pull request #2328 from rohitgirdhar:bugfix_blobdetector_kpt_radius 2014-02-17 12:23:59 +04:00
Roman Donchenko 947fb74c18 Merge pull request #2330 from rohitgirdhar:linux_tutorial_make_j8 2014-02-17 12:22:11 +04:00
Roman Donchenko b6dafed5ba Merge pull request #2342 from yashdv:android_doc_fix 2014-02-17 12:21:20 +04:00
Roman Donchenko 8cbb284b7b Merge pull request #2348 from ilya-lavrenov:typo 2014-02-17 12:02:59 +04:00
Roman Donchenko f252687eae Merge pull request #2351 from yashdv:BOW_assert_error 2014-02-17 11:58:03 +04:00
Roman Donchenko 9fcb0b2201 Merge pull request #2349 from jet47:fix-bug-3552 2014-02-17 11:52:01 +04:00
Roman Donchenko aad289a3a2 Merge pull request #2344 from kirill-kornyakov:replace-gittip-button 2014-02-17 11:48:03 +04:00
gleb.sternharz f85aa929f1 fix dev by 0 in KL-Divergence 2014-02-17 04:08:30 +01:00
pxli168 70d462b352 Simplify the code
Simplify the code as @SpecLad suggested.
2014-02-17 10:21:18 +08:00
Ilya Lavrenov f74ef644bc changed the signature of add method according to the base class 2014-02-17 02:39:38 +04:00
yash 1a89a03c7c Fixed CV_ASSERT condition in the code for bag of words 2014-02-16 22:33:30 +05:30
Chechli 10465c546a Update hough_circles.cpp 2014-02-16 13:26:00 +01:00
Ilya Lavrenov c8e22c04c8 extended performance test 2014-02-16 13:42:25 +04:00
Vladislav Vinogradov 150e522bee fix bug #3552:
replace std::swap with own code
2014-02-16 12:17:17 +04:00
Ilya Lavrenov 510680a5df typo 2014-02-16 01:42:02 +04:00
Ilya Lavrenov 7629bb78a4 extended performance tests to test 3 channels 2014-02-16 01:31:33 +04:00
Anatoly Baksheev 03bd82796d source compatibility with master 2014-02-15 23:40:09 +04:00
Chechli 72e4f72a75 Update hough_circles.cpp 2014-02-15 17:31:14 +01:00
Ilya Lavrenov 9b627a5e9f disabled 'reshape', 'copyTo' test 2014-02-15 20:17:42 +04:00
Anatoly Baksheev 56754e907d fixed crash for windows if console widow is closed or CTRL_C/CTRL_BRAK keys in console are pressed. 2014-02-15 20:08:04 +04:00
Anatoly Baksheev 1a5dfe421d Added WidgetMerger, Polyline - colors support for each point independently, simple widgets now compute color array instead of setting global color 2014-02-15 17:02:17 +04:00
Ilya Lavrenov 7ce2c3574a restored lost in PR #1735 umat tests 2014-02-15 16:09:55 +04:00
Ilya Lavrenov 4f36bc29d9 cleaned-up UMat tests 2014-02-15 15:51:52 +04:00
Kirill Kornyakov ed1aa73dd3 Replaced Gittip button 2014-02-15 13:10:09 +04:00
yash cce225f6e9 fixed doc/tutorials/imgproc/histograms/template_matching/template_matching.rst 2014-02-15 12:48:42 +05:30
yash e2f5001b11 fixed doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst 2014-02-14 23:04:03 +05:30
Alexander Alekhin 915fb632fd core/ocl: change error processing for missed function 2014-02-14 19:50:58 +04:00
Ilya Lavrenov 8150c1b7e4 added [s|l]rgb <-> lab conversion 2014-02-14 18:45:56 +04:00
Vladislav Vinogradov 8b8c368148 fixed two warnings in gpu sources (-Wshadow, -Wno-sign-promo) 2014-02-14 17:56:03 +04:00
Alexander Alekhin d1606b4aa3 ocl: added SVM perf test 2014-02-14 16:36:46 +04:00
Roman Donchenko 3542da7167 Merge pull request #2336 from SpecLad:useOclChanged 2014-02-14 16:21:01 +04:00
Roman Donchenko e0d991cf46 Merge pull request #2335 from jet47:gpu-alphacomp-test 2014-02-14 16:20:45 +04:00
Andrey Pavlenko 0fc248fb70 Merge pull request #2326 from vpisarev:ocl_ch3 2014-02-14 15:49:36 +04:00
Alexander Alekhin 95e38e457f core/umat: usage flags (with proposals from PR #2195) 2014-02-14 15:40:16 +04:00
Roman Donchenko fa272c43c2 Merge pull request #2323 from stuart8c:issue2601_2.4_fix_16bit_tiff_reading_on_big_endian_host 2014-02-14 15:37:09 +04:00
Pierre Moulon 8829e9f6c8 Fix a typo error 2014-02-14 12:22:53 +01:00
Pierre Moulon f3f8b843b6 Fix a typo error 2014-02-14 12:21:35 +01:00
Roman Donchenko a1de9e9ad5 Merge pull request #2329 from ilya-lavrenov:macosx_ogl 2014-02-14 14:38:37 +04:00
Roman Donchenko 88f993dbda Deleted an assignment to a variable that doesn't exist. 2014-02-14 14:37:56 +04:00
Vladislav Vinogradov 1ce5165cb7 temporary disable performance test for alphaComp function 2014-02-14 14:27:43 +04:00
Andrey Pavlenko 534bec3a90 Merge pull request #2315 from ilya-lavrenov:nlmeans_perf 2014-02-14 13:24:12 +04:00
Andrey Pavlenko d68c688f22 Merge pull request #1735 from KonstantinMatskevich:umat_tests 2014-02-14 12:37:47 +04:00
Roman Donchenko 3def7778dc Merge pull request #2062 from cook:bug3440 2014-02-14 12:09:03 +04:00
Stuart Cunningham 1454843b81 Fix build of libtiff on big endian host due to defined but empty WORDS_BIGENDIAN macro 2014-02-14 16:16:17 +11:00
Ilya Lavrenov b92a46c130 some more fixes 2014-02-13 23:47:18 +04:00
Yantao Xie 6b00c4e337 Use CMAKE_CFG_INTDIR meta-variable to get the library output directory of the opencv_matlab. 2014-02-13 23:53:58 +08:00
Roman Donchenko ecbe843061 Merge pull request #2333 from asmorkalov:java_dead_code_fix 2014-02-13 19:21:56 +04:00
Roman Donchenko b4a535272c Merge pull request #2332 from jet47:gpu-fixes 2014-02-13 19:21:45 +04:00
Alexander Smorkalov dbe7634286 Dead code removed as this cannot be null in Java. 2014-02-13 18:17:47 +04:00
Roman Donchenko b8d8b0568c Merge pull request #2331 from asmorkalov:android_native_activity_finish 2014-02-13 17:57:46 +04:00
Vadim Pisarevsky 630bdbf42f fixed OpenCL kernel flag in resize (thanks to Ilya L) 2014-02-13 17:37:42 +04:00
Vladislav Vinogradov eb247d826f temporary disable perf test for StereoBeliefPropagation 2014-02-13 17:25:59 +04:00
Vladislav Vinogradov 9e69e2a07a increase epsilon for AlphaComp sanity test for integer input 2014-02-13 17:16:43 +04:00
Alexander Smorkalov 7da3e98dfd Application pause/resume fix for Android sample NativeActivity. 2014-02-13 16:47:02 +04:00
Stuart Cunningham 55b9c0374c Fix cmake detection of build platform endianness
Improve comments to indicate actual usage of WORDS_BIGENDIAN where
it is tested with #ifdef rather than #if
2014-02-13 22:59:30 +11:00
Konstantin Matskevich 5f76072c62 update 2014-02-13 13:29:53 +04:00
Roman Donchenko f297ec55ae Merge pull request #2304 from mattvenn:master 2014-02-13 12:30:20 +04:00
Rohit Girdhar 01b624e359 -j8 in linux_installation tutorial 2014-02-13 13:52:00 +05:30
Roman Donchenko 91ab92c349 Merge pull request #2318 from gongzg:2.4 2014-02-13 12:16:19 +04:00
Roman Donchenko 935e36bc72 Merge pull request #2319 from m3d:patch-1 2014-02-13 12:12:00 +04:00
Andrey Pavlenko 0ee5c34f40 Merge pull request #2324 from vpisarev:fix_facedetect 2014-02-13 11:46:24 +04:00
Matt Venn 7acd28fbea added imgpoints back 2014-02-13 07:44:29 +00:00
Konstantin Matskevich a0a3b8b56d Some tests for UMat 2014-02-13 09:59:05 +04:00
Ilya Lavrenov 879c0196d4 enabled OpenGL on MacOSX 2014-02-13 00:17:15 +04:00
Rohit Girdhar a4b5641836 bugfix: blobdetector was putting incorrect diameter value in keypoints 2014-02-12 22:29:04 +05:30
Vadim Pisarevsky 91587059ad tab => spaces 2014-02-12 20:28:55 +04:00
Vadim Pisarevsky 290fbc0121 3-channel support in OpenCL kernels for setTo, resize, warpAffine and warpPerspective 2014-02-12 19:29:18 +04:00
Vadim Pisarevsky a18bc9651d fixed bug reported by Irina K. Also tried to fix LBP detector regression in quality (probably it did not help but still ...) 2014-02-12 17:42:09 +04:00
Stuart Cunningham 5d43d3ca88 Fix Windows build of grfmt_tiff.cpp by using libtiff's integer types. 2014-02-12 23:41:38 +11:00
Roman Donchenko 863e9c699a Merge pull request #2322 from berak:b_cc_read 2014-02-12 16:32:29 +04:00
Roman Donchenko e55679079f Merge pull request #2320 from asmorkalov:ocv_readme_license_install 2014-02-12 16:27:24 +04:00
Roman Donchenko 3994cfbc59 Merge pull request #2321 from asmorkalov:android_run_all_tests 2014-02-12 15:41:29 +04:00
Roman Donchenko fa38ea6d50 Merge pull request #2317 from blueskymonster:master 2014-02-12 15:14:26 +04:00
Martin Dlouhy d9a322f606 undo changes of cv2.cv.* functions/constants 2014-02-12 11:25:03 +01:00
Alexander Smorkalov d02c291160 opencv_run_all_tests.sh implemented for Android SDK. 2014-02-12 14:21:58 +04:00
Stuart Cunningham 8bbce0a2a2 Fix reading of 16-bit TIFF images on big endian host.
Use correct integer types for arguments to TIFFGetField to avoid corruption
of values and failed loads of TIFF file when using cv::imread().

Added test where both big and little endian TIFF files are read using imread().

Fixed build of 3rdparty libtiff on big endian hosts.

Reduced memory required during decode_tile16384x16384 test by not converting
large grayscale test image to color image during read.
2014-02-12 21:21:06 +11:00
Alexander Smorkalov e55f2b2602 LICENSE and README files installation rules added. 2014-02-12 14:06:41 +04:00
Vadim Pisarevsky f7620dc7d1 added 3-channel support to arithmetic operations 2014-02-12 12:18:55 +04:00
Martin Dlouhy bbefc101de removed return images and fixed cv2 names 2014-02-12 07:06:05 +01:00
Elliot Godzich 2806679781 Updated DisplayImage.cpp program to compile
CV_WINDOW_AUTOSIZE -> WINDOW_AUTOSIZE
2014-02-11 21:46:14 -08:00
Zhigang Gong 9aef26e2ad Workaround a LLVM/Clang 3.3 bug.
The LLVM/Clang 3.3 has a bug when compile a cl kernel with
assignment of a scalar to a vector data type. This patch
could work around this bug.

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-02-12 13:14:43 +08:00
Anatoly Baksheev 261546f6f6 casting Vec3b operator for viz::Color 2014-02-11 23:27:19 +04:00
Ilya Lavrenov 4f2cdc9bac added performance tests for NLMeans 2014-02-11 18:21:53 +04:00
Roman Donchenko 511e79aef7 Merge pull request #2311 from SvenWe:master 2014-02-11 17:11:06 +04:00
Roman Donchenko 1cef6f9fb1 Merge pull request #2313 from m3d:patch-1 2014-02-11 17:10:23 +04:00
Roman Donchenko bb4199b177 Merge pull request #2314 from ilya-lavrenov:typo 2014-02-11 17:06:38 +04:00
Roman Donchenko dad536f490 Merge pull request #1851 from dneelyep:patch-1 2014-02-11 16:46:35 +04:00
Ilya Lavrenov 281666887e typo 2014-02-11 14:25:37 +04:00
Roman Donchenko 7a35f4593e Merge pull request #2310 from SpecLad:merge-2.4 2014-02-11 13:44:51 +04:00
Roman Donchenko 72aabb8a84 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	CMakeLists.txt
	cmake/OpenCVGenAndroidMK.cmake
	cmake/templates/OpenCV.mk.in
	doc/tutorials/viz/creating_widgets/creating_widgets.rst
	doc/tutorials/viz/launching_viz/launching_viz.rst
	doc/tutorials/viz/table_of_content_viz/images/image_effects.png
	doc/tutorials/viz/transformations/transformations.rst
	doc/tutorials/viz/widget_pose/widget_pose.rst
	modules/core/include/opencv2/core/affine.hpp
	modules/core/include/opencv2/core/core.hpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/src/cuda/canny.cu
	modules/gpu/src/cuda/generalized_hough.cu
	modules/gpu/src/generalized_hough.cpp
	modules/gpu/src/imgproc.cpp
	modules/gpu/test/test_color.cpp
	modules/gpu/test/test_core.cpp
	modules/gpu/test/test_gpumat.cpp
	modules/gpu/test/test_hough.cpp
	modules/nonfree/CMakeLists.txt
	modules/nonfree/include/opencv2/nonfree/gpu.hpp
	modules/nonfree/perf/perf_gpu.cpp
	modules/nonfree/src/cuda/surf.cu
	modules/nonfree/src/precomp.hpp
	modules/nonfree/src/surf_gpu.cpp
	modules/nonfree/test/test_gpu.cpp
	modules/ocl/perf/perf_haar.cpp
	modules/stitching/CMakeLists.txt
	modules/stitching/include/opencv2/stitching/detail/matchers.hpp
	modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp
	modules/stitching/include/opencv2/stitching/detail/warpers.hpp
	modules/stitching/include/opencv2/stitching/warpers.hpp
	modules/stitching/src/blenders.cpp
	modules/stitching/src/matchers.cpp
	modules/stitching/src/precomp.hpp
	modules/stitching/src/seam_finders.cpp
	modules/stitching/src/stitcher.cpp
	modules/stitching/src/warpers.cpp
	modules/viz/doc/widget.rst
	modules/viz/include/opencv2/viz/types.hpp
	modules/viz/include/opencv2/viz/viz3d.hpp
	modules/viz/include/opencv2/viz/widget_accessor.hpp
	modules/viz/src/precomp.hpp
	modules/viz/src/shapes.cpp
	modules/viz/src/vizcore.cpp
	modules/viz/src/vtk/vtkCloudMatSink.h
	modules/viz/src/vtk/vtkCloudMatSource.h
	modules/viz/test/test_precomp.hpp
	modules/viz/test/tests_simple.cpp
	samples/android/tutorial-4-cuda/CMakeLists.txt
	samples/android/tutorial-4-cuda/jni/Android.mk
	samples/android/tutorial-4-cuda/src/org/opencv/samples/tutorial4/Tutorial4Activity.java
	samples/cpp/stitching_detailed.cpp
	samples/cpp/tutorial_code/viz/creating_widgets.cpp
	samples/cpp/tutorial_code/viz/launching_viz.cpp
	samples/cpp/tutorial_code/viz/transformations.cpp
	samples/cpp/tutorial_code/viz/widget_pose.cpp
2014-02-11 12:05:01 +04:00
Martin Dlouhy 47a41449e3 fixed spelling and removed return images 2014-02-10 20:32:54 +01:00
Sven Wehner f7041bacc0 grabcut.py sample: Allow drawing rect from bottom/right
The grabcut sample script isn't able to create rectangles correctly that are
drawn from e.g. bottom-right to top-left.
This small commit uses four min() calls to determine the correct
top-left point of the rectangle.
It also removes some unnecessary white spaces before colons.
2014-02-10 16:53:17 +01:00
Matt Venn 2d33063a59 removed whitespace at end of line 96 2014-02-10 14:51:29 +00:00
Anatoly Baksheev f1c062c30a cloud collection finalize 2014-02-10 15:45:46 +04:00
Anatoly Baksheev 5dc17f5d58 Fixed all OpenGL issues for Macos (via objective-C++ layer) 2014-02-10 15:45:46 +04:00
Anatoly Baksheev 069dd8a068 default meshlab background 2014-02-10 15:45:45 +04:00
Anatoly Baksheev f8ccc115ef proper render call order (fixes some issues with VTK6.1) 2014-02-10 15:45:45 +04:00
Anatoly Baksheev 17fea0dd0a fixed size_t/int conversion warnings 2014-02-10 15:45:45 +04:00
Anatoly Baksheev 998aefd1d1 cloud collection merges data only on rendering 2014-02-10 15:45:44 +04:00
Anatoly Baksheev 975a6299fa More proper OpneCv+Qt+Vtk issues handling (http://code.opencv.org/issues/3492) 2014-02-10 15:45:44 +04:00
Anatoly Baksheev eb8728d727 Updated cloud io functionality - removed dependency from VTK legacy 2014-02-10 15:45:44 +04:00
Roman Donchenko 63dbe66b41 Merge pull request #2308 from jet47:gpu-tests-timeout 2014-02-10 15:10:31 +04:00
Roman Donchenko 3cc27c769c Merge pull request #2309 from Nerei:fixed_cl_exe_hang_with_eigen 2014-02-10 14:59:05 +04:00
Anatoly Baksheev becbfa6281 Fixed Cl.exe hang for VS2008 x64 with Eigen::exp() function 2014-02-10 13:41:27 +04:00
Vladislav Vinogradov 8b44a42a40 decrease input size for several gpu tests to fix "timed out" error:
* BruteForceNonLocalMeans
* OpticalFlowBM
2014-02-10 11:50:14 +04:00
berak 3959329ef4 proper initialization for ccimpl in bool CascadeClassifier::read(const FileNode 2014-02-08 14:42:09 +01:00
Matt Venn 3170414ca8 fixed whitespace 2014-02-07 22:18:59 +00:00
Matt Venn a0bfdb9bf1 fixed examples for opencv 2.4.8 2014-02-07 20:53:57 +00:00
Roman Donchenko 1d68a89947 Merge pull request #2303 from jet47:gpu-canny-fix 2014-02-07 19:03:14 +04:00
Andrey Pavlenko 86b6c48712 Merge pull request #2295 from alalek:opencl_align_rw_buffers 2014-02-07 17:45:15 +04:00
Roman Donchenko 48f95d92ae Merge pull request #2294 from jet47:fix-gpu-issues 2014-02-07 16:54:49 +04:00
Roman Donchenko 8b16b8b657 Merge pull request #2296 from apavlenko:fix_coverity_scan 2014-02-07 16:54:30 +04:00
Vladislav Vinogradov 5dbdadb769 fixed several bugs in CUDA Canny implementation:
* out of border access in edgesHysteresisLocalKernel
* incorrect usage of atomicAdd
2014-02-07 16:04:29 +04:00
Roman Donchenko 5a8363a44e Merge pull request #2301 from jet47:fix-nonfree-build 2014-02-07 15:34:46 +04:00
Roman Donchenko d534d04f25 Merge pull request #2297 from asmorkalov:ocv_testdata_install_perms_fix 2014-02-07 15:33:59 +04:00
Vladislav Vinogradov bfc27271e2 Revert "disable gpu Canny and HoughCircles perf tests:"
This reverts commit dbce90692a.
2014-02-07 14:55:06 +04:00
Alexander Alekhin ce992c8269 ocl: update gftt 2014-02-07 14:51:59 +04:00
Alexander Alekhin e371901dd9 ocl: workaround for failures with misaligned host buffers 2014-02-07 14:51:58 +04:00
Alexander Smorkalov b86088b89c Implicit testdata directory permissions setup added. 2014-02-07 14:42:35 +04:00
Roman Donchenko c1b6bf21d5 Merge pull request #2300 from asmorkalov:android_no_cuda_not_armeabiv7a 2014-02-07 14:39:09 +04:00
Vladislav Vinogradov 3e1f74f2ca fix nonfree module compilation without CUDA 2014-02-07 13:40:37 +04:00
Alexander Smorkalov b10d4b05ed dynamicuda module disabled in OpenCv.mk for all arches except armeabi-v7a. 2014-02-07 12:46:24 +04:00
Andrey Pavlenko 4b31b9cb8c Merge pull request #2251 from ilya-lavrenov:tapi_sqrboxfilter 2014-02-07 11:33:49 +04:00
Gustavo Vargas 44cc51dfb1 Update py_image_display.rst
OS information removed.
2014-02-06 18:21:19 -02:00
Andrey Pavlenko 710d51bb41 Merge pull request #2287 from ilya-lavrenov:mat_step 2014-02-06 21:38:22 +04:00
Andrey Pavlenko 9ff5a24f92 Merge pull request #2289 from ilya-lavrenov:umat_expr 2014-02-06 21:37:57 +04:00
Andrey Pavlenko 38f46eb3b4 fixing issues from coverity scan 1167937, 1167938, 1167939, 1127248 (http://scan.coverity.com/projects/169?tab=Overview) 2014-02-06 21:33:44 +04:00
Ilya Lavrenov 412468e0ae added cv::sqrBoxFilter to T-API 2014-02-06 19:19:18 +04:00
Vladislav Vinogradov 5d099df578 Revert "disable CUDA generalized Hough Transform"
This reverts commit 33d42b740c.
2014-02-06 18:02:14 +04:00
Vladislav Vinogradov 3e4bb371c8 fix epsilons for several gpu tests 2014-02-06 18:02:14 +04:00
Vladislav Vinogradov b6ba1f226c Revert "disable gpu CvtColor.*2HSV tests:"
This reverts commit 952027a853.
2014-02-06 18:02:14 +04:00
Vladislav Vinogradov da44a2fac1 Revert "disable gpu Subtract_Array test:"
This reverts commit e91bf95d58.
2014-02-06 18:02:14 +04:00
Roman Donchenko 7daf26d398 Merge pull request #2269 from Nerei:qt5_vtk_guards 2014-02-06 16:47:15 +04:00
Roman Donchenko 34b02f6437 Merge pull request #2276 from asmorkalov:android_install_cuda 2014-02-06 16:45:49 +04:00
Ilya Lavrenov af0040eab0 condition for Mat step 2014-02-06 15:44:27 +04:00
Alexander Smorkalov 6ae4a9b09b Multiple improvements in OpenCV examples build.
EMBED_CUDA and FORCE_EMBED_OPENCV flags added to cmake macro add_android_project;
INSTALL_CUDA_LIBRARIES option added to OpenCV.mk
opencv_dynamicuda library installation with enabled OPENCV_INSTALL_MODULES flag fixed;
CUDA initialization apportunity added to OpenCVLoader.initDebug();
Tutorial-4-CUDA sample reimplemented with static OpenCV and CUDA initialization.
2014-02-06 15:32:57 +04:00
Roman Donchenko e91b818e3e Merge pull request #2292 from asmorkalov:ocv_deb_tests_script_path_fix 2014-02-06 14:59:31 +04:00
Andrey Pavlenko b6675ee2a8 Merge pull request #2278 from KonstantinMatskevich:ocl_toinputarray 2014-02-06 12:55:04 +04:00
Andrey Pavlenko a078653ab4 Merge pull request #2285 from KonstantinMatskevich:ocl_test_cascade2.4 2014-02-06 12:52:28 +04:00
Alexander Smorkalov 530702c5f2 Absolute path to tests in opencv_run_app_tests.sh fixed. 2014-02-06 12:35:14 +04:00
Roman Donchenko feed2c074d Merge pull request #2288 from asmorkalov:android_project_properties_generation_fix 2014-02-06 12:20:08 +04:00
Gustavo Vargas 390fa14a2a Update py_image_display.rst 2014-02-05 21:25:16 -02:00
Ilya Lavrenov e190d3fd36 added perf test 2014-02-05 20:24:30 +04:00
Ilya Lavrenov 563dc5aa38 implemented umat expressions 2014-02-05 19:23:42 +04:00
Roman Donchenko 721d0145e0 Merge pull request #2002 from abak:stereo_calibrate 2014-02-05 17:47:27 +04:00
Alexander Smorkalov 65b4d77959 project.properties file generation fixed for per-component installation. 2014-02-05 17:34:19 +04:00
Roman Donchenko 9493a4ec4e Merge tag '3.0-ocl-tp2' (-s ours)
OpenCV 3.0 OpenCL Technical Preview 2
2014-02-05 14:00:20 +04:00
Konstantin Matskevich bdfa9fa14a fixes2 2014-02-05 13:51:14 +04:00
Roman Donchenko 4ab891e9e5 Merge pull request #2277 from asmorkalov:android_test_path_fix 2014-02-05 12:36:37 +04:00
Konstantin Matskevich 435615ba2e update test CascadeClassifier 2014-02-05 12:23:36 +04:00
Konstantin Matskevich 1aa83d324b fixed docs2 2014-02-05 11:32:35 +04:00
Konstantin Matskevich eb4c2cd59f removed CV_IN/OUT 2014-02-05 10:55:26 +04:00
Konstantin Matskevich a0ccb46a7f fixed docs 2014-02-05 10:49:56 +04:00
Konstantin Matskevich b0f617bc01 fixes 2014-02-05 09:59:04 +04:00
Roman Donchenko ccda4bf008 Merge pull request #2274 from jet47:android-mk-fix 2014-02-04 18:59:14 +04:00
Konstantin Matskevich f44334285b features2d 2014-02-04 16:55:07 +04:00
Alexander Smorkalov 0cd0e4749b Tests install path fix for Android SDK. 2014-02-04 16:23:01 +04:00
Konstantin Matskevich c684da3549 drawing 2014-02-04 11:09:29 +04:00
Vladislav Vinogradov 286fe261d0 save previous values of LOCAL_* variables and restore them at the end 2014-02-04 10:29:43 +04:00
Vladislav Vinogradov a098fb1803 fix path to CUDA libraries (use targets/armv7-linux-androideabi/lib) 2014-02-04 10:29:15 +04:00
Vadim Pisarevsky b8c6adc569 Merge pull request #2178 from Nerei:viz_backport 2014-02-03 16:16:51 +04:00
Roman Donchenko cd1ffd169c Merge pull request #2261 from jet47:stitching-cuda-android 2014-02-03 15:35:55 +04:00
Vadim Pisarevsky 11926dafb2 eliminate crash in ipp-accelerated norm and mean functions (thanks to Matt Curfman and Aaron Kunze for the patch) 2014-02-03 15:31:32 +04:00
Andrey Pavlenko a1ad1f0800 Merge pull request #2259 from ilya-lavrenov:ocl_surf 2014-02-03 14:24:36 +04:00
Vladislav Vinogradov 214cbabc40 update stitching sample 2014-02-03 12:55:03 +04:00
Vladislav Vinogradov a138e5a6a5 turn on CUDA part of stitching module on Android for non-dynamic build 2014-02-03 12:35:24 +04:00
Vladislav Vinogradov d8f7377122 turn on CUDA part of nonfree module on Android for non-dynamic build 2014-02-03 11:52:43 +04:00
Ilya Lavrenov ede5b23753 rewrote perf tests for SURF 2014-02-03 02:00:29 +04:00
Anatoly Baksheev 1f5007f106 modified viz module header layout for 2.4 compatibility 2014-02-02 16:23:34 +04:00
Anatoly Baksheev 0a870faf28 added guard against linking qt5 and VTK together 2014-02-02 16:23:33 +04:00
U-WBI\nlv20442 be7eb72051 some fixes 2014-01-30 14:50:35 +01:00
U-WBI\nlv20442 d950adc0d2 function code 2014-01-30 10:51:12 +01:00
unknown 14b1e8c7f1 New KNN code -should compile now 2014-01-30 10:47:12 +01:00
Anatoly Baksheev 3dc2dbc17e VTK off by default 2014-01-26 14:48:29 +04:00
Matti Picus 64fd54ffb4 fix tiled read for reading tiles into partial blocks in image 2014-01-24 13:03:47 +02:00
Anatoly Baksheev 9145985ff4 added guard to prevent linking VTK with Qt5 2014-01-23 16:40:24 +04:00
Anatoly Baksheev 130914d9f4 fixed documentation warnings 2014-01-21 02:15:37 +04:00
Anatoly Baksheev 02ebc4368c Viz initial backport, compilation fixes, moved viz/viz.hpp header according to 2.4 style 2014-01-20 22:51:33 +04:00
Nick D'Ademo 75b80e5d7d Added missing comma in enum. 2014-01-16 20:17:49 +11:00
Nick D'Ademo 25870fa66b Added PVAPI enums to highgui.hpp
Added "PVAPI_" prefix to FrameStartTriggerMode definition
2014-01-14 21:38:57 +11:00
Nick D'Ademo 3cf5c0b991 Added get and set for extra PVAPI property: CV_CAP_PROP_FRAMESTARTTRIGGERMODE 2014-01-13 22:01:09 +11:00
Volodymyr Kysenko 89dd828e3c added test for correct handling of uniforma areas in the MergeMertens 2014-01-09 14:10:00 -08:00
Volodymyr Kysenko aa36898024 added epsilon value to weights in the MergeMertens in order to avoid zero weights for pixels from uniformly filled areas of image 2014-01-07 19:38:57 -08:00
pxli168 203a9acdbc Add support to bool type
Add the bool support to the get function
2013-12-31 12:53:31 +08:00
Hilton Bristow 483061e802 explicit string encoding when writing to file in python3 2013-12-29 17:10:52 +10:00
Hilton Bristow 7cad2c6788 fixed relative imports in Jinja for python3 2013-12-29 17:10:52 +10:00
Hilton Bristow 2f45942adc converted necessary files for python3 compatibility using 2to3 2013-12-29 17:10:44 +10:00
Pierre-Emmanuel Viel 9cb48606ba Merge remote-tracking branch 'upstream/2.4' into LshOrthogonalSubvectors 2013-12-27 00:19:37 +01:00
Pierre-Emmanuel Viel 8e93c19de3 Fix a heap issue with static on Windows 2013-12-26 23:46:52 +01:00
Pierre-Emmanuel Viel e85bacff7b Avoid obtaining several identical dimensions between two LSH sub-vectors by choosing orthogonal sub-vectors. 2013-12-26 19:44:23 +01:00
Pierre-Emmanuel Viel 112d63ae96 Add a new method for initializing KMeans centers that leads to better clusters and thus better retrieval when final centers have to be existing keypoints instead of clusters barycenters. 2013-12-26 16:15:35 +01:00
ytxie 3d3b310ae1 Fix the bug 3440. 2013-12-26 17:54:05 +08:00
Pierre-Emmanuel Viel d3ac1bc314 When a cluster is empty for KMeans, it's better to give it the point from another cluster j that is the furthest one from center j. 2013-12-20 01:00:55 +01:00
Pierre-Emmanuel Viel 0d19685f95 Move templates in dist.h in order to share them between KMeansIndex and HierarchicalClusteringIndex classes. 2013-12-18 20:48:34 +01:00
Pierre-Emmanuel Viel fa749de0dc As some processed distances are already ^2, use template to select whether or not we have to ^2 in KMeanspp 2013-12-18 20:48:25 +01:00
Pierre-Emmanuel Viel 5aeeaa6fce Apply to KMeansIndex KMeanspp the same modification as in HierarchicalClusteringIndex 2013-12-18 20:48:15 +01:00
Pierre-Emmanuel Viel 45e0e5f8e9 Pick centers in KMeans++ with a probability proportional to their distance^2, instead of simple distance, to previous centers 2013-12-18 20:48:02 +01:00
Adrien BAK 6ae16ebec3 update doc accordingly 2013-12-17 16:51:33 +09:00
Adrien BAK c5c3fd4443 modify signature of stereoCalibrate for consistency 2013-12-17 14:53:44 +09:00
sprice 1c15776cf5 Merge branch 'master' of https://github.com/Itseez/opencv
Conflicts:
	modules/imgproc/src/sumpixels.cpp
2013-12-11 14:35:51 -08:00
sprice 73b0827ec1 Don't automatically convert to grayscale (keep previous behavior.) 2013-12-04 18:21:56 -08:00
sprice 2cc11e2c6a Updating STAR detector and FREAK descriptor to work with large and/or 16-bit images 2013-12-04 18:13:34 -08:00
Tony 69dc840583 mprove Gtk2/3 options in cmake
Update to cmake files for to include minimum versions, and tidy up gtk operation.

Files updated:
CMakeLists.txt:
  WITH_GTK now uses Gtk3 by default. If not found then Gtk2 is used.
  WITH_GTK_2_X forces Gtk2.x use

cmake/OpenCVFindLibsGUI.cmake
  Updated selection logic to implement methodology described above.
  Implemented warning if Gtk3 not found (and not overridden)
  Implemented error if Gtk does not meet minimum required version

cmake/OpenCVMinDepVersions.cmake
  Added minimum Gtk version of 2.18.0
2013-11-26 21:35:03 +00:00
Daniel Neel 67a2c4ecd5 Re-phrased some odd wording. 2013-11-21 22:36:31 -05:00
Tony 5368f12b33 Rework gtk3 window resize and draw cleanup
The gtk3 resize functions fail to shrink the window after it has been
resized. This edit changes this and allows the window to be shrunk
back to its original size.

This edit also cleans up the draw/expose functions.
2013-10-15 21:49:20 +01:00
Tony d4df373999 Code cleanup
Remove redundent #if defs from code
2013-10-09 20:50:35 +01:00
Tony c1cd70e25a Disable OpenGL when Gtk3 is selected
The OpenGL library is not supported on Gtk3 which uses the cairo
library for rendering. Cairo, in turn uses hardware acceleration when
supported by the underlying system. Some improvement to performance
may be gained by useing the cairo-gl and cairo-glx libraries included
on modern Gtk3 systems.

See the cairo documentation for further information. The following
link may also be of interest.

http://lists.cairographics.org/archives/cairo/2012-October/023609.html
2013-10-04 23:09:45 +01:00
Tony 81d6842b8e These changes introduce Gtk3 support into the highgui module.
A new option WITH_GTK3 has been added to the cmake configure system to enable compilation under Gtk version 3.The flag HAVE_GTK3 is also introduced to select the new Gtk3 code in the source files. (Gtk2 is disbled when Gtk3 is selected).

window_gtk.cpp has been modified to remove obsolete (and deleted from libgtk 3) and introduce new Gtk3 code in its place when compiled for Gtk3.

To compile for Gtk2, disable WITH_GTK3 in cmake. To build for Gtk3 both WITH_GTK and WITH_GTK3 must be selected.
2013-10-02 21:16:40 +01:00
1585 changed files with 96441 additions and 566963 deletions
+2
View File
@@ -0,0 +1,2 @@
[tgit]
icon = doc/opencv.ico
+2
View File
@@ -0,0 +1,2 @@
downloads/
unpack/
+108
View File
@@ -0,0 +1,108 @@
#
# The script downloads ICV package
#
# On return this will define:
# OPENCV_ICV_PATH - path to unpacked downloaded package
#
function(_icv_downloader)
# Define actual ICV versions
if(APPLE)
set(OPENCV_ICV_PACKAGE_NAME "ippicv_macosx_20140429.tgz")
set(OPENCV_ICV_PACKAGE_HASH "f2195a60829899983acd4a45794e1717")
set(OPENCV_ICV_PLATFORM "macosx")
set(OPENCV_ICV_PACKAGE_SUBDIR "/ippicv_osx")
elseif(UNIX)
if(ANDROID AND (NOT ANDROID_ABI STREQUAL x86))
return()
endif()
set(OPENCV_ICV_PACKAGE_NAME "ippicv_linux_20140513.tgz")
set(OPENCV_ICV_PACKAGE_HASH "d80cb24f3a565113a9d6dc56344142f6")
set(OPENCV_ICV_PLATFORM "linux")
set(OPENCV_ICV_PACKAGE_SUBDIR "/ippicv_lnx")
elseif(WIN32 AND NOT ARM)
set(OPENCV_ICV_PACKAGE_NAME "ippicv_windows_20140429.zip")
set(OPENCV_ICV_PACKAGE_HASH "b5028a92224ec1fbc554010c52eb3ec8")
set(OPENCV_ICV_PLATFORM "windows")
set(OPENCV_ICV_PACKAGE_SUBDIR "/ippicv_win")
else()
return() # Not supported
endif()
set(OPENCV_ICV_UNPACK_PATH "${CMAKE_CURRENT_LIST_DIR}/unpack")
set(OPENCV_ICV_PATH "${OPENCV_ICV_UNPACK_PATH}${OPENCV_ICV_PACKAGE_SUBDIR}")
if(DEFINED OPENCV_ICV_PACKAGE_DOWNLOADED
AND OPENCV_ICV_PACKAGE_DOWNLOADED STREQUAL OPENCV_ICV_PACKAGE_HASH
AND EXISTS ${OPENCV_ICV_PATH})
# Package has been downloaded and checked by the previous build
set(OPENCV_ICV_PATH "${OPENCV_ICV_PATH}" PARENT_SCOPE)
return()
else()
if(EXISTS ${OPENCV_ICV_UNPACK_PATH})
message(STATUS "ICV: Removing previous unpacked package: ${OPENCV_ICV_UNPACK_PATH}")
file(REMOVE_RECURSE ${OPENCV_ICV_UNPACK_PATH})
endif()
endif()
unset(OPENCV_ICV_PACKAGE_DOWNLOADED CACHE)
set(OPENCV_ICV_PACKAGE_ARCHIVE "${CMAKE_CURRENT_LIST_DIR}/downloads/${OPENCV_ICV_PLATFORM}-${OPENCV_ICV_PACKAGE_HASH}/${OPENCV_ICV_PACKAGE_NAME}")
get_filename_component(OPENCV_ICV_PACKAGE_ARCHIVE_DIR "${OPENCV_ICV_PACKAGE_ARCHIVE}" PATH)
if(EXISTS "${OPENCV_ICV_PACKAGE_ARCHIVE}")
file(MD5 "${OPENCV_ICV_PACKAGE_ARCHIVE}" archive_md5)
if(NOT archive_md5 STREQUAL OPENCV_ICV_PACKAGE_HASH)
message(WARNING "ICV: Local copy of ICV package has invalid MD5 hash: ${archive_md5} (expected: ${OPENCV_ICV_PACKAGE_HASH})")
file(REMOVE "${OPENCV_ICV_PACKAGE_ARCHIVE}")
file(REMOVE_RECURSE "${OPENCV_ICV_PACKAGE_ARCHIVE_DIR}")
endif()
endif()
if(NOT EXISTS "${OPENCV_ICV_PACKAGE_ARCHIVE}")
if(NOT DEFINED OPENCV_ICV_URL)
if(DEFINED ENV{OPENCV_ICV_URL})
set(OPENCV_ICV_URL $ENV{OPENCV_ICV_URL})
else()
set(OPENCV_ICV_URL "http://sourceforge.net/projects/opencvlibrary/files/3rdparty/ippicv")
endif()
endif()
file(MAKE_DIRECTORY ${OPENCV_ICV_PACKAGE_ARCHIVE_DIR})
message(STATUS "ICV: Downloading ${OPENCV_ICV_PACKAGE_NAME}...")
file(DOWNLOAD "${OPENCV_ICV_URL}/${OPENCV_ICV_PACKAGE_NAME}" "${OPENCV_ICV_PACKAGE_ARCHIVE}"
TIMEOUT 600 STATUS __status
EXPECTED_MD5 ${OPENCV_ICV_PACKAGE_HASH})
if(NOT __status EQUAL 0)
message(FATAL_ERROR "ICV: Failed to download ICV package: ${OPENCV_ICV_PACKAGE_NAME}. Status=${__status}")
else()
# Don't remove this code, because EXPECTED_MD5 parameter doesn't fail "file(DOWNLOAD)" step
# on wrong hash
file(MD5 "${OPENCV_ICV_PACKAGE_ARCHIVE}" archive_md5)
if(NOT archive_md5 STREQUAL OPENCV_ICV_PACKAGE_HASH)
message(FATAL_ERROR "ICV: Downloaded copy of ICV package has invalid MD5 hash: ${archive_md5} (expected: ${OPENCV_ICV_PACKAGE_HASH})")
endif()
endif()
endif()
ocv_assert(EXISTS "${OPENCV_ICV_PACKAGE_ARCHIVE}")
ocv_assert(NOT EXISTS "${OPENCV_ICV_UNPACK_PATH}")
file(MAKE_DIRECTORY ${OPENCV_ICV_UNPACK_PATH})
ocv_assert(EXISTS "${OPENCV_ICV_UNPACK_PATH}")
message(STATUS "ICV: Unpacking ${OPENCV_ICV_PACKAGE_NAME} to ${OPENCV_ICV_UNPACK_PATH}...")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xz "${OPENCV_ICV_PACKAGE_ARCHIVE}"
WORKING_DIRECTORY "${OPENCV_ICV_UNPACK_PATH}"
RESULT_VARIABLE __result)
if(NOT __result EQUAL 0)
message(FATAL_ERROR "ICV: Failed to unpack ICV package from ${OPENCV_ICV_PACKAGE_ARCHIVE} to ${OPENCV_ICV_UNPACK_PATH} with error ${__result}")
endif()
ocv_assert(EXISTS "${OPENCV_ICV_PATH}")
set(OPENCV_ICV_PACKAGE_DOWNLOADED "${OPENCV_ICV_PACKAGE_HASH}" CACHE INTERNAL "ICV package hash")
message(STATUS "ICV: Package successfully downloaded")
set(OPENCV_ICV_PATH "${OPENCV_ICV_PATH}" PARENT_SCOPE)
endfunction()
_icv_downloader()
+2 -2
View File
@@ -9,7 +9,7 @@
:license: BSD, see LICENSE for more details.
"""
import re
from _compat import text_type, string_types, int_types, \
from ._compat import text_type, string_types, int_types, \
unichr, PY2
@@ -227,7 +227,7 @@ class _MarkupEscapeHelper(object):
try:
from _speedups import escape, escape_silent, soft_unicode
except ImportError:
from _native import escape, escape_silent, soft_unicode
from ._native import escape, escape_silent, soft_unicode
if not PY2:
soft_str = soft_unicode
+1 -1
View File
@@ -8,7 +8,7 @@
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from _compat import text_type
from ._compat import text_type
def escape(s):
+1 -1
View File
@@ -517,4 +517,4 @@ class Joiner(object):
# Imported here because that's where it was in the past
from markupsafe import Markup, escape, soft_unicode
from .markupsafe import Markup, escape, soft_unicode
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -9,7 +9,7 @@ ocv_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
file(GLOB lib_srcs *.c)
file(GLOB lib_hdrs *.h)
if(ANDROID OR IOS)
if(ANDROID OR IOS OR APPLE)
ocv_list_filterout(lib_srcs jmemansi.c)
else()
ocv_list_filterout(lib_srcs jmemnobs.c)
+2 -10
View File
@@ -54,7 +54,7 @@
/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
(Intel) */
#define HOST_BIGENDIAN 0
#define HOST_BIGENDIAN @WORDS_BIGENDIAN@
/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
#define HOST_FILLORDER FILLORDER_LSB2MSB
@@ -156,15 +156,7 @@
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
#cmakedefine WORDS_BIGENDIAN 1
/* Support Deflate compression */
#define ZIP_SUPPORT 1
+5 -5
View File
@@ -1,5 +1,5 @@
This folder contains libraries and headers of a few very popular still image codecs
used by highgui module.
used by imgcodecs module.
The libraries and headers are preferably to build Win32 and Win64 versions of OpenCV.
On UNIX systems all the libraries are automatically detected by configure script.
In order to use these versions of libraries instead of system ones on UNIX systems you
@@ -11,7 +11,7 @@ libjpeg 8d (8.4) - The Independent JPEG Group's JPEG software.
See IGJ home page http://www.ijg.org
for details and links to the source code
HAVE_JPEG preprocessor flag must be set to make highgui use libjpeg.
HAVE_JPEG preprocessor flag must be set to make imgcodecs use libjpeg.
On UNIX systems configure script takes care of it.
------------------------------------------------------------------------------------
libpng 1.5.12 - Portable Network Graphics library.
@@ -19,7 +19,7 @@ libpng 1.5.12 - Portable Network Graphics library.
See libpng home page http://www.libpng.org
for details and links to the source code
HAVE_PNG preprocessor flag must be set to make highgui use libpng.
HAVE_PNG preprocessor flag must be set to make imgcodecs use libpng.
On UNIX systems configure script takes care of it.
------------------------------------------------------------------------------------
libtiff 4.0.2 - Tag Image File Format (TIFF) Software
@@ -28,7 +28,7 @@ libtiff 4.0.2 - Tag Image File Format (TIFF) Software
See libtiff home page http://www.remotesensing.org/libtiff/
for details and links to the source code
HAVE_TIFF preprocessor flag must be set to make highgui use libtiff.
HAVE_TIFF preprocessor flag must be set to make imgcodecs use libtiff.
On UNIX systems configure script takes care of it.
In this build support for ZIP (LZ77 compression) is turned on.
------------------------------------------------------------------------------------
@@ -37,7 +37,7 @@ zlib 1.2.7 - General purpose LZ77 compression library
See zlib home page http://www.zlib.net
for details and links to the source code
No preprocessor definition is needed to make highgui use this library -
No preprocessor definition is needed to make imgcodecs use this library -
it is included automatically if either libpng or libtiff are used.
------------------------------------------------------------------------------------
jasper-1.900.1 - JasPer is a collection of software
+132 -32
View File
@@ -6,6 +6,8 @@
#
# ----------------------------------------------------------------------------
include(cmake/OpenCVMinDepVersions.cmake)
if(CMAKE_GENERATOR MATCHES Xcode AND XCODE_VERSION VERSION_GREATER 4.3)
@@ -127,13 +129,15 @@ OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF )
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_IPP "Include Intel IPP support" OFF IF (MSVC OR X86 OR X86_64) )
OCV_OPTION(WITH_GTK_2_X "Use GTK version 2" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_IPP "Include Intel IPP support" ON IF (NOT IOS) )
OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) )
OCV_OPTION(WITH_JPEG "Include JPEG support" ON)
OCV_OPTION(WITH_WEBP "Include WebP support" ON IF (NOT IOS) )
OCV_OPTION(WITH_OPENEXR "Include ILM support via OpenEXR" ON IF (NOT IOS) )
OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT APPLE) )
OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID) )
OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_OPENNI2 "Include OpenNI2 support" OFF IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_PNG "Include PNG support" ON)
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" ON IF (NOT ANDROID AND NOT IOS) )
@@ -147,8 +151,8 @@ OCV_OPTION(WITH_TIFF "Include TIFF support" ON
OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
OCV_OPTION(WITH_LIBV4L "Use libv4l for Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON IF (WIN32 AND NOT ARM) )
OCV_OPTION(WITH_MSMF "Build HighGUI with Media Foundation support" OFF IF WIN32 )
OCV_OPTION(WITH_DSHOW "Build VideoIO with DirectShow support" ON IF (WIN32 AND NOT ARM) )
OCV_OPTION(WITH_MSMF "Build VideoIO 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_CLP "Include Clp support (EPL)" OFF)
@@ -157,7 +161,8 @@ OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON
OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_DIRECTX "Include DirectX support" ON IF WIN32 )
OCV_OPTION(WITH_INTELPERC "Include Intel Perceptual Computing support" OFF IF WIN32 )
OCV_OPTION(WITH_IPP_A "Include Intel IPP_A support" OFF IF (MSVC OR X86 OR X86_64) )
OCV_OPTION(WITH_GDAL "Include GDAL Support" OFF IF (NOT ANDROID AND NOT IOS) )
# OpenCV build components
# ===================================================
@@ -174,6 +179,7 @@ OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for sta
OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(BUILD_ANDROID_SERVICE "Build OpenCV Manager for Google Play" OFF IF ANDROID AND ANDROID_SOURCE_TREE )
OCV_OPTION(BUILD_ANDROID_PACKAGE "Build platform-specific package for Google Play" OFF IF ANDROID )
OCV_OPTION(BUILD_CUDA_STUBS "Build CUDA modules stubs when no CUDA SDK" OFF IF (NOT IOS) )
# 3rd party libs
OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE )
@@ -198,6 +204,7 @@ OCV_OPTION(INSTALL_TESTS "Install accuracy and performance test binar
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) )
OCV_OPTION(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_COVERAGE "Enable coverage collection with GCov" OFF IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON IF CMAKE_COMPILER_IS_GNUCXX AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX) )
OCV_OPTION(ENABLE_POWERPC "Enable PowerPC for GCC" ON IF (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*) )
OCV_OPTION(ENABLE_FAST_MATH "Enable -ffast-math (not recommended for GCC 4.6.x)" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
@@ -214,6 +221,7 @@ OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too no
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 )
OCV_OPTION(ANDROID_EXAMPLES_WITH_LIBS "Build binaries of Android examples with native libraries" OFF IF ANDROID )
# ----------------------------------------------------------------------------
@@ -253,13 +261,24 @@ if(WIN32)
message(STATUS "Can't detect runtime and/or arch")
set(OpenCV_INSTALL_BINARIES_PREFIX "")
endif()
elseif(ANDROID)
set(OpenCV_INSTALL_BINARIES_PREFIX "sdk/native/")
else()
set(OpenCV_INSTALL_BINARIES_PREFIX "")
endif()
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
if(ANDROID)
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples/${ANDROID_NDK_ABI_NAME}")
else()
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
endif()
if(ANDROID)
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin/${ANDROID_NDK_ABI_NAME}")
else()
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
endif()
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
if(NOT OPENCV_TEST_INSTALL_PATH)
set(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
endif()
@@ -319,6 +338,9 @@ if(DEFINED CMAKE_DEBUG_POSTFIX)
set(OPENCV_DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
endif()
if(INSTALL_CREATE_DISTRIB AND BUILD_SHARED_LIBS AND NOT DEFINED BUILD_opencv_world)
set(BUILD_opencv_world ON CACHE INTERNAL "")
endif()
# ----------------------------------------------------------------------------
# Path for build/platform -specific headers
@@ -404,6 +426,19 @@ endif()
include(cmake/OpenCVPCHSupport.cmake)
include(cmake/OpenCVModule.cmake)
# ----------------------------------------------------------------------------
# Detect endianness of build platform
# ----------------------------------------------------------------------------
if(CMAKE_SYSTEM_NAME STREQUAL iOS)
# test_big_endian needs try_compile, which doesn't work for iOS
# http://public.kitware.com/Bug/view.php?id=12288
set(WORDS_BIGENDIAN 0)
else()
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
endif()
# ----------------------------------------------------------------------------
# Detect 3rd-party libraries
# ----------------------------------------------------------------------------
@@ -413,7 +448,6 @@ include(cmake/OpenCVFindLibsGUI.cmake)
include(cmake/OpenCVFindLibsVideo.cmake)
include(cmake/OpenCVFindLibsPerf.cmake)
# ----------------------------------------------------------------------------
# Detect other 3rd-party libraries/tools
# ----------------------------------------------------------------------------
@@ -524,7 +558,6 @@ endif()
# ----------------------------------------------------------------------------
# Finalization: generate configuration-based files
# ----------------------------------------------------------------------------
ocv_track_build_dependencies()
# Generate platform-dependent and configuration-dependent headers
include(cmake/OpenCVGenHeaders.cmake)
@@ -542,16 +575,46 @@ include(cmake/OpenCVGenConfig.cmake)
include(cmake/OpenCVGenInfoPlist.cmake)
# Generate environment setup file
if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH AND UNIX AND NOT ANDROID)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_testing.sh.in"
"${CMAKE_BINARY_DIR}/unix-install/opencv_testing.sh" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/unix-install/opencv_testing.sh"
DESTINATION /etc/profile.d/ COMPONENT tests)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests.sh.in"
"${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH AND UNIX)
if(ANDROID)
get_filename_component(TEST_PATH ${OPENCV_TEST_INSTALL_PATH} DIRECTORY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_android.sh.in"
"${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
install(PROGRAMS "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT tests)
else()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_testing.sh.in"
"${CMAKE_BINARY_DIR}/unix-install/opencv_testing.sh" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/unix-install/opencv_testing.sh"
DESTINATION /etc/profile.d/ COMPONENT tests)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_unix.sh.in"
"${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
install(PROGRAMS "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
endif()
endif()
if(NOT OPENCV_README_FILE)
if(ANDROID)
set(OPENCV_README_FILE ${CMAKE_CURRENT_SOURCE_DIR}/platforms/android/README.android)
endif()
endif()
if(NOT OPENCV_LICENSE_FILE)
set(OPENCV_LICENSE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
endif()
# for UNIX it does not make sense as LICENSE and readme will be part of the package automatically
if(ANDROID OR NOT UNIX)
install(FILES ${OPENCV_LICENSE_FILE}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT libs)
if(OPENCV_README_FILE)
install(FILES ${OPENCV_README_FILE}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT libs)
endif()
endif()
# ----------------------------------------------------------------------------
@@ -693,8 +756,14 @@ else()
status(" Cocoa:" YES)
endif()
else()
status(" GTK+ 2.x:" HAVE_GTK THEN "YES (ver ${ALIASOF_gtk+-2.0_VERSION})" ELSE NO)
status(" GThread :" HAVE_GTHREAD THEN "YES (ver ${ALIASOF_gthread-2.0_VERSION})" ELSE NO)
if(HAVE_GTK3)
status(" GTK+ 3.x:" HAVE_GTK THEN "YES (ver ${ALIASOF_gtk+-3.0_VERSION})" ELSE NO)
elseif(HAVE_GTK)
status(" GTK+ 2.x:" HAVE_GTK THEN "YES (ver ${ALIASOF_gtk+-2.0_VERSION})" ELSE NO)
else()
status(" GTK+:" NO)
endif()
status(" GThread :" HAVE_GTHREAD THEN "YES (ver ${ALIASOF_gthread-2.0_VERSION})" ELSE NO)
status(" GtkGlExt:" HAVE_GTKGLEXT THEN "YES (ver ${ALIASOF_gtkglext-1.0_VERSION})" ELSE NO)
endif()
endif()
@@ -745,6 +814,12 @@ else()
status(" OpenEXR:" "NO")
endif()
if( WITH_GDAL )
status(" GDAL:" GDAL_FOUND THEN "${GDAL_LIBRARY}")
else()
status(" GDAL:" "NO")
endif()
# ========================== VIDEO IO ==========================
status("")
status(" Video I/O:")
@@ -802,6 +877,11 @@ if(DEFINED WITH_OPENNI)
THEN "YES (${OPENNI_PRIME_SENSOR_MODULE})" ELSE NO)
endif(DEFINED WITH_OPENNI)
if(DEFINED WITH_OPENNI2)
status(" OpenNI2:" HAVE_OPENNI2 THEN "YES (ver ${OPENNI2_VERSION_STRING}, build ${OPENNI2_VERSION_BUILD})"
ELSE NO)
endif(DEFINED WITH_OPENNI2)
if(DEFINED WITH_PVAPI)
status(" PvAPI:" HAVE_PVAPI THEN YES ELSE NO)
endif(DEFINED WITH_PVAPI)
@@ -862,13 +942,17 @@ endif(DEFINED WITH_INTELPERC)
status("")
status(" Other third-party libraries:")
if(WITH_IPP AND IPP_FOUND)
status(" Use IPP:" "${IPP_LATEST_VERSION_STR} [${IPP_LATEST_VERSION_MAJOR}.${IPP_LATEST_VERSION_MINOR}.${IPP_LATEST_VERSION_BUILD}]")
if(WITH_IPP AND HAVE_IPP)
status(" Use IPP:" "${IPP_VERSION_STR} [${IPP_VERSION_MAJOR}.${IPP_VERSION_MINOR}.${IPP_VERSION_BUILD}]")
status(" at:" "${IPP_ROOT_DIR}")
else()
status(" Use IPP:" WITH_IPP AND NOT IPP_FOUND THEN "IPP not found" ELSE NO)
status(" Use IPP:" WITH_IPP AND NOT HAVE_IPP THEN "IPP not found" ELSE NO)
endif()
if(DEFINED WITH_IPP_A)
status(" Use IPP Async:" HAVE_IPP_A THEN "YES" ELSE NO)
endif(DEFINED WITH_IPP_A)
status(" Use Eigen:" HAVE_EIGEN THEN "YES (ver ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})" ELSE NO)
status(" Use TBB:" HAVE_TBB THEN "YES (ver ${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR} interface ${TBB_INTERFACE_VERSION})" ELSE NO)
status(" Use OpenMP:" HAVE_OPENMP THEN YES ELSE NO)
@@ -924,18 +1008,34 @@ endif()
# ========================== python ==========================
status("")
status(" Python:")
status(" Interpreter:" PYTHONINTERP_FOUND THEN "${PYTHON_EXECUTABLE} (ver ${PYTHON_VERSION_STRING})" ELSE NO)
if(BUILD_opencv_python)
if(PYTHONLIBS_VERSION_STRING)
status(" Libraries:" HAVE_opencv_python THEN "${PYTHON_LIBRARIES} (ver ${PYTHONLIBS_VERSION_STRING})" ELSE NO)
status(" Python 2:")
status(" Interpreter:" PYTHON2INTERP_FOUND THEN "${PYTHON2_EXECUTABLE} (ver ${PYTHON2_VERSION_STRING})" ELSE NO)
if(BUILD_opencv_python2)
if(PYTHON2LIBS_VERSION_STRING)
status(" Libraries:" HAVE_opencv_python2 THEN "${PYTHON2_LIBRARIES} (ver ${PYTHON2LIBS_VERSION_STRING})" ELSE NO)
else()
status(" Libraries:" HAVE_opencv_python THEN "${PYTHON_LIBRARIES}" ELSE NO)
status(" Libraries:" HAVE_opencv_python2 THEN "${PYTHON2_LIBRARIES}" ELSE NO)
endif()
status(" numpy:" PYTHON_NUMPY_INCLUDE_DIRS THEN "${PYTHON_NUMPY_INCLUDE_DIRS} (ver ${PYTHON_NUMPY_VERSION})" ELSE "NO (Python wrappers can not be generated)")
status(" packages path:" PYTHON_EXECUTABLE THEN "${PYTHON_PACKAGES_PATH}" ELSE "-")
status(" numpy:" PYTHON2_NUMPY_INCLUDE_DIRS THEN "${PYTHON2_NUMPY_INCLUDE_DIRS} (ver ${PYTHON2_NUMPY_VERSION})" ELSE "NO (Python wrappers can not be generated)")
status(" packages path:" PYTHON2_EXECUTABLE THEN "${PYTHON2_PACKAGES_PATH}" ELSE "-")
endif()
status("")
status(" Python 3:")
status(" Interpreter:" PYTHON3INTERP_FOUND THEN "${PYTHON3_EXECUTABLE} (ver ${PYTHON3_VERSION_STRING})" ELSE NO)
if(BUILD_opencv_python3)
if(PYTHON3LIBS_VERSION_STRING)
status(" Libraries:" HAVE_opencv_python3 THEN "${PYTHON3_LIBRARIES} (ver ${PYTHON3LIBS_VERSION_STRING})" ELSE NO)
else()
status(" Libraries:" HAVE_opencv_python3 THEN "${PYTHON3_LIBRARIES}" ELSE NO)
endif()
status(" numpy:" PYTHON3_NUMPY_INCLUDE_DIRS THEN "${PYTHON3_NUMPY_INCLUDE_DIRS} (ver ${PYTHON3_NUMPY_VERSION})" ELSE "NO (Python3 wrappers can not be generated)")
status(" packages path:" PYTHON3_EXECUTABLE THEN "${PYTHON3_PACKAGES_PATH}" ELSE "-")
endif()
status("")
status(" Python (for build):" PYTHON_DEFAULT_AVAILABLE THEN "${PYTHON_DEFAULT_EXECUTABLE}" ELSE NO)
# ========================== java ==========================
status("")
status(" Java:")
+2 -3
View File
@@ -1,5 +1,7 @@
### OpenCV: Open Source Computer Vision Library
[![Gittip](http://img.shields.io/gittip/OpenCV.png)](https://www.gittip.com/OpenCV/)
#### Resources
* Homepage: <http://opencv.org>
@@ -18,6 +20,3 @@ Summary of guidelines:
* Include tests and documentation;
* Clean up "oops" commits before submitting;
* Follow the coding style guide.
[![Donate OpenCV project](http://opencv.org/wp-content/uploads/2013/07/gittip1.png)](https://www.gittip.com/OpenCV/)
[![Donate OpenCV project](http://opencv.org/wp-content/uploads/2013/07/paypal-donate-button.png)](https://www.paypal.com/cgi-bin/webscr?item_name=Donation+to+OpenCV&cmd=_donations&business=accountant%40opencv.org)
-2
View File
@@ -1,6 +1,4 @@
add_definitions(-D__OPENCV_BUILD=1)
link_libraries(${OPENCV_LINKER_LIBS})
add_subdirectory(haartraining)
add_subdirectory(traincascade)
add_subdirectory(sft)
-89
View File
@@ -1,89 +0,0 @@
SET(OPENCV_HAARTRAINING_DEPS opencv_core opencv_imgproc opencv_photo opencv_ml opencv_highgui opencv_objdetect opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy)
ocv_check_dependencies(${OPENCV_HAARTRAINING_DEPS})
if(NOT OCV_DEPENDENCIES_FOUND)
return()
endif()
project(haartraining)
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_include_modules(${OPENCV_HAARTRAINING_DEPS})
if(WIN32)
link_directories(${CMAKE_CURRENT_BINARY_DIR})
endif()
link_libraries(${OPENCV_HAARTRAINING_DEPS} opencv_haartraining_engine)
# -----------------------------------------------------------
# Library
# -----------------------------------------------------------
set(cvhaartraining_lib_src
_cvcommon.h
cvclassifier.h
_cvhaartraining.h
cvhaartraining.h
cvboost.cpp
cvcommon.cpp
cvhaarclassifier.cpp
cvhaartraining.cpp
cvsamples.cpp
)
add_library(opencv_haartraining_engine STATIC ${cvhaartraining_lib_src})
set_target_properties(opencv_haartraining_engine PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
INSTALL_NAME_DIR lib
)
# -----------------------------------------------------------
# haartraining
# -----------------------------------------------------------
add_executable(opencv_haartraining cvhaartraining.h haartraining.cpp)
set_target_properties(opencv_haartraining PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
OUTPUT_NAME "opencv_haartraining")
# -----------------------------------------------------------
# createsamples
# -----------------------------------------------------------
add_executable(opencv_createsamples cvhaartraining.h createsamples.cpp)
set_target_properties(opencv_createsamples PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
OUTPUT_NAME "opencv_createsamples")
# -----------------------------------------------------------
# performance
# -----------------------------------------------------------
add_executable(opencv_performance performance.cpp)
set_target_properties(opencv_performance PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
OUTPUT_NAME "opencv_performance")
# -----------------------------------------------------------
# Install part
# -----------------------------------------------------------
if(INSTALL_CREATE_DISTRIB)
if(BUILD_SHARED_LIBS)
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
endif()
else()
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
endif()
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(opencv_performance PROPERTIES FOLDER "applications")
set_target_properties(opencv_createsamples PROPERTIES FOLDER "applications")
set_target_properties(opencv_haartraining PROPERTIES FOLDER "applications")
set_target_properties(opencv_haartraining_engine PROPERTIES FOLDER "applications")
endif()
-92
View File
@@ -1,92 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __CVCOMMON_H_
#define __CVCOMMON_H_
#include "opencv2/core.hpp"
#include "cxcore.h"
#include "cv.h"
#include "cxmisc.h"
#define __BEGIN__ __CV_BEGIN__
#define __END__ __CV_END__
#define EXIT __CV_EXIT__
#ifndef PATH_MAX
#define PATH_MAX 512
#endif /* PATH_MAX */
int icvMkDir( const char* filename );
/* returns index at specified position from index matrix of any type.
if matrix is NULL, then specified position is returned */
CV_INLINE
int icvGetIdxAt( CvMat* idx, int pos );
CV_INLINE
int icvGetIdxAt( CvMat* idx, int pos )
{
if( idx == NULL )
{
return pos;
}
else
{
CvScalar sc;
int type;
type = CV_MAT_TYPE( idx->type );
cvRawDataToScalar( idx->data.ptr + pos *
( (idx->rows == 1) ? CV_ELEM_SIZE( type ) : idx->step ), type, &sc );
return (int) sc.val[0];
}
}
/* debug functions */
#define CV_DEBUG_SAVE( ptr ) icvSave( ptr, __FILE__, __LINE__ );
void icvSave( const CvArr* ptr, const char* filename, int line );
#endif /* __CVCOMMON_H_ */
-414
View File
@@ -1,414 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
/*
* _cvhaartraining.h
*
* training of cascade of boosted classifiers based on haar features
*/
#ifndef __CVHAARTRAINING_H_
#define __CVHAARTRAINING_H_
#include "_cvcommon.h"
#include "cvclassifier.h"
#include <cstring>
#include <cstdio>
/* parameters for tree cascade classifier training */
/* max number of clusters */
#define CV_MAX_CLUSTERS 3
/* term criteria for K-Means */
#define CV_TERM_CRITERIA() cvTermCriteria( CV_TERMCRIT_EPS, 1000, 1E-5 )
/* print statistic info */
#define CV_VERBOSE 1
#define CV_STAGE_CART_FILE_NAME "AdaBoostCARTHaarClassifier.txt"
#define CV_HAAR_FEATURE_MAX 3
#define CV_HAAR_FEATURE_DESC_MAX 20
typedef int sum_type;
typedef double sqsum_type;
typedef short idx_type;
#define CV_SUM_MAT_TYPE CV_32SC1
#define CV_SQSUM_MAT_TYPE CV_64FC1
#define CV_IDX_MAT_TYPE CV_16SC1
#define CV_STUMP_TRAIN_PORTION 100
#define CV_THRESHOLD_EPS (0.00001F)
typedef struct CvTHaarFeature
{
char desc[CV_HAAR_FEATURE_DESC_MAX];
int tilted;
struct
{
CvRect r;
float weight;
} rect[CV_HAAR_FEATURE_MAX];
} CvTHaarFeature;
typedef struct CvFastHaarFeature
{
int tilted;
struct
{
int p0, p1, p2, p3;
float weight;
} rect[CV_HAAR_FEATURE_MAX];
} CvFastHaarFeature;
typedef struct CvIntHaarFeatures
{
CvSize winsize;
int count;
CvTHaarFeature* feature;
CvFastHaarFeature* fastfeature;
} CvIntHaarFeatures;
CV_INLINE CvTHaarFeature cvHaarFeature( const char* desc,
int x0, int y0, int w0, int h0, float wt0,
int x1, int y1, int w1, int h1, float wt1,
int x2 CV_DEFAULT( 0 ), int y2 CV_DEFAULT( 0 ),
int w2 CV_DEFAULT( 0 ), int h2 CV_DEFAULT( 0 ),
float wt2 CV_DEFAULT( 0.0F ) );
CV_INLINE CvTHaarFeature cvHaarFeature( const char* desc,
int x0, int y0, int w0, int h0, float wt0,
int x1, int y1, int w1, int h1, float wt1,
int x2, int y2, int w2, int h2, float wt2 )
{
CvTHaarFeature hf;
assert( CV_HAAR_FEATURE_MAX >= 3 );
assert( strlen( desc ) < CV_HAAR_FEATURE_DESC_MAX );
strcpy( &(hf.desc[0]), desc );
hf.tilted = ( hf.desc[0] == 't' );
hf.rect[0].r.x = x0;
hf.rect[0].r.y = y0;
hf.rect[0].r.width = w0;
hf.rect[0].r.height = h0;
hf.rect[0].weight = wt0;
hf.rect[1].r.x = x1;
hf.rect[1].r.y = y1;
hf.rect[1].r.width = w1;
hf.rect[1].r.height = h1;
hf.rect[1].weight = wt1;
hf.rect[2].r.x = x2;
hf.rect[2].r.y = y2;
hf.rect[2].r.width = w2;
hf.rect[2].r.height = h2;
hf.rect[2].weight = wt2;
return hf;
}
/* Prepared for training samples */
typedef struct CvHaarTrainingData
{
CvSize winsize; /* training image size */
int maxnum; /* maximum number of samples */
CvMat sum; /* sum images (each row represents image) */
CvMat tilted; /* tilted sum images (each row represents image) */
CvMat normfactor; /* normalization factor */
CvMat cls; /* classes. 1.0 - object, 0.0 - background */
CvMat weights; /* weights */
CvMat* valcache; /* precalculated feature values (CV_32FC1) */
CvMat* idxcache; /* presorted indices (CV_IDX_MAT_TYPE) */
} CvHaarTrainigData;
/* Passed to callback functions */
typedef struct CvUserdata
{
CvHaarTrainingData* trainingData;
CvIntHaarFeatures* haarFeatures;
} CvUserdata;
CV_INLINE
CvUserdata cvUserdata( CvHaarTrainingData* trainingData,
CvIntHaarFeatures* haarFeatures );
CV_INLINE
CvUserdata cvUserdata( CvHaarTrainingData* trainingData,
CvIntHaarFeatures* haarFeatures )
{
CvUserdata userdata;
userdata.trainingData = trainingData;
userdata.haarFeatures = haarFeatures;
return userdata;
}
#define CV_INT_HAAR_CLASSIFIER_FIELDS() \
float (*eval)( CvIntHaarClassifier*, sum_type*, sum_type*, float ); \
void (*save)( CvIntHaarClassifier*, FILE* file ); \
void (*release)( CvIntHaarClassifier** );
/* internal weak classifier*/
typedef struct CvIntHaarClassifier
{
CV_INT_HAAR_CLASSIFIER_FIELDS()
} CvIntHaarClassifier;
/*
* CART classifier
*/
typedef struct CvCARTHaarClassifier
{
CV_INT_HAAR_CLASSIFIER_FIELDS()
int count;
int* compidx;
CvTHaarFeature* feature;
CvFastHaarFeature* fastfeature;
float* threshold;
int* left;
int* right;
float* val;
} CvCARTHaarClassifier;
/* internal stage classifier */
typedef struct CvStageHaarClassifier
{
CV_INT_HAAR_CLASSIFIER_FIELDS()
int count;
float threshold;
CvIntHaarClassifier** classifier;
} CvStageHaarClassifier;
/* internal cascade classifier */
typedef struct CvCascadeHaarClassifier
{
CV_INT_HAAR_CLASSIFIER_FIELDS()
int count;
CvIntHaarClassifier** classifier;
} CvCascadeHaarClassifier;
/* internal tree cascade classifier node */
typedef struct CvTreeCascadeNode
{
CvStageHaarClassifier* stage;
struct CvTreeCascadeNode* next;
struct CvTreeCascadeNode* child;
struct CvTreeCascadeNode* parent;
struct CvTreeCascadeNode* next_same_level;
struct CvTreeCascadeNode* child_eval;
int idx;
int leaf;
} CvTreeCascadeNode;
/* internal tree cascade classifier */
typedef struct CvTreeCascadeClassifier
{
CV_INT_HAAR_CLASSIFIER_FIELDS()
CvTreeCascadeNode* root; /* root of the tree */
CvTreeCascadeNode* root_eval; /* root node for the filtering */
int next_idx;
} CvTreeCascadeClassifier;
CV_INLINE float cvEvalFastHaarFeature( const CvFastHaarFeature* feature,
const sum_type* sum, const sum_type* tilted )
{
const sum_type* img = feature->tilted ? tilted : sum;
float ret = feature->rect[0].weight*
(img[feature->rect[0].p0] - img[feature->rect[0].p1] -
img[feature->rect[0].p2] + img[feature->rect[0].p3]) +
feature->rect[1].weight*
(img[feature->rect[1].p0] - img[feature->rect[1].p1] -
img[feature->rect[1].p2] + img[feature->rect[1].p3]);
if( feature->rect[2].weight != 0.0f )
ret += feature->rect[2].weight *
( img[feature->rect[2].p0] - img[feature->rect[2].p1] -
img[feature->rect[2].p2] + img[feature->rect[2].p3] );
return ret;
}
typedef struct CvSampleDistortionData
{
IplImage* src;
IplImage* erode;
IplImage* dilate;
IplImage* mask;
IplImage* img;
IplImage* maskimg;
int dx;
int dy;
int bgcolor;
} CvSampleDistortionData;
/*
* icvConvertToFastHaarFeature
*
* Convert to fast representation of haar features
*
* haarFeature - input array
* fastHaarFeature - output array
* size - size of arrays
* step - row step for the integral image
*/
void icvConvertToFastHaarFeature( CvTHaarFeature* haarFeature,
CvFastHaarFeature* fastHaarFeature,
int size, int step );
void icvWriteVecHeader( FILE* file, int count, int width, int height );
void icvWriteVecSample( FILE* file, CvArr* sample );
void icvPlaceDistortedSample( CvArr* background,
int inverse, int maxintensitydev,
double maxxangle, double maxyangle, double maxzangle,
int inscribe, double maxshiftf, double maxscalef,
CvSampleDistortionData* data );
void icvEndSampleDistortion( CvSampleDistortionData* data );
int icvStartSampleDistortion( const char* imgfilename, int bgcolor, int bgthreshold,
CvSampleDistortionData* data );
typedef int (*CvGetHaarTrainingDataCallback)( CvMat* img, void* userdata );
typedef struct CvVecFile
{
FILE* input;
int count;
int vecsize;
int last;
short* vector;
} CvVecFile;
int icvGetHaarTraininDataFromVecCallback( CvMat* img, void* userdata );
/*
* icvGetHaarTrainingDataFromVec
*
* Fill <data> with samples from .vec file, passed <cascade>
int icvGetHaarTrainingDataFromVec( CvHaarTrainingData* data, int first, int count,
CvIntHaarClassifier* cascade,
const char* filename,
int* consumed );
*/
CvIntHaarClassifier* icvCreateCARTHaarClassifier( int count );
void icvReleaseHaarClassifier( CvIntHaarClassifier** classifier );
void icvInitCARTHaarClassifier( CvCARTHaarClassifier* carthaar, CvCARTClassifier* cart,
CvIntHaarFeatures* intHaarFeatures );
float icvEvalCARTHaarClassifier( CvIntHaarClassifier* classifier,
sum_type* sum, sum_type* tilted, float normfactor );
CvIntHaarClassifier* icvCreateStageHaarClassifier( int count, float threshold );
void icvReleaseStageHaarClassifier( CvIntHaarClassifier** classifier );
float icvEvalStageHaarClassifier( CvIntHaarClassifier* classifier,
sum_type* sum, sum_type* tilted, float normfactor );
CvIntHaarClassifier* icvCreateCascadeHaarClassifier( int count );
void icvReleaseCascadeHaarClassifier( CvIntHaarClassifier** classifier );
float icvEvalCascadeHaarClassifier( CvIntHaarClassifier* classifier,
sum_type* sum, sum_type* tilted, float normfactor );
void icvSaveHaarFeature( CvTHaarFeature* feature, FILE* file );
void icvLoadHaarFeature( CvTHaarFeature* feature, FILE* file );
void icvSaveCARTHaarClassifier( CvIntHaarClassifier* classifier, FILE* file );
CvIntHaarClassifier* icvLoadCARTHaarClassifier( FILE* file, int step );
void icvSaveStageHaarClassifier( CvIntHaarClassifier* classifier, FILE* file );
CvIntHaarClassifier* icvLoadCARTStageHaarClassifier( const char* filename, int step );
/* tree cascade classifier */
float icvEvalTreeCascadeClassifier( CvIntHaarClassifier* classifier,
sum_type* sum, sum_type* tilted, float normfactor );
void icvSetLeafNode( CvTreeCascadeClassifier* tree, CvTreeCascadeNode* leaf );
float icvEvalTreeCascadeClassifierFilter( CvIntHaarClassifier* classifier, sum_type* sum,
sum_type* tilted, float normfactor );
CvTreeCascadeNode* icvCreateTreeCascadeNode();
void icvReleaseTreeCascadeNodes( CvTreeCascadeNode** node );
void icvReleaseTreeCascadeClassifier( CvIntHaarClassifier** classifier );
/* Prints out current tree structure to <stdout> */
void icvPrintTreeCascade( CvTreeCascadeNode* root );
/* Loads tree cascade classifier */
CvIntHaarClassifier* icvLoadTreeCascadeClassifier( const char* filename, int step,
int* splits );
/* Finds leaves belonging to maximal level and connects them via leaf->next_same_level */
CvTreeCascadeNode* icvFindDeepestLeaves( CvTreeCascadeClassifier* tree );
#endif /* __CVHAARTRAINING_H_ */
-245
View File
@@ -1,245 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
/*
* createsamples.cpp
*
* Create test/training samples
*/
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
using namespace std;
#include "cvhaartraining.h"
int main( int argc, char* argv[] )
{
int i = 0;
char* nullname = (char*)"(NULL)";
char* vecname = NULL; /* .vec file name */
char* infoname = NULL; /* file name with marked up image descriptions */
char* imagename = NULL; /* single sample image */
char* bgfilename = NULL; /* background */
int num = 1000;
int bgcolor = 0;
int bgthreshold = 80;
int invert = 0;
int maxintensitydev = 40;
double maxxangle = 1.1;
double maxyangle = 1.1;
double maxzangle = 0.5;
int showsamples = 0;
/* the samples are adjusted to this scale in the sample preview window */
double scale = 4.0;
int width = 24;
int height = 24;
srand((unsigned int)time(0));
if( argc == 1 )
{
printf( "Usage: %s\n [-info <collection_file_name>]\n"
" [-img <image_file_name>]\n"
" [-vec <vec_file_name>]\n"
" [-bg <background_file_name>]\n [-num <number_of_samples = %d>]\n"
" [-bgcolor <background_color = %d>]\n"
" [-inv] [-randinv] [-bgthresh <background_color_threshold = %d>]\n"
" [-maxidev <max_intensity_deviation = %d>]\n"
" [-maxxangle <max_x_rotation_angle = %f>]\n"
" [-maxyangle <max_y_rotation_angle = %f>]\n"
" [-maxzangle <max_z_rotation_angle = %f>]\n"
" [-show [<scale = %f>]]\n"
" [-w <sample_width = %d>]\n [-h <sample_height = %d>]\n",
argv[0], num, bgcolor, bgthreshold, maxintensitydev,
maxxangle, maxyangle, maxzangle, scale, width, height );
return 0;
}
for( i = 1; i < argc; ++i )
{
if( !strcmp( argv[i], "-info" ) )
{
infoname = argv[++i];
}
else if( !strcmp( argv[i], "-img" ) )
{
imagename = argv[++i];
}
else if( !strcmp( argv[i], "-vec" ) )
{
vecname = argv[++i];
}
else if( !strcmp( argv[i], "-bg" ) )
{
bgfilename = argv[++i];
}
else if( !strcmp( argv[i], "-num" ) )
{
num = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-bgcolor" ) )
{
bgcolor = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-bgthresh" ) )
{
bgthreshold = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-inv" ) )
{
invert = 1;
}
else if( !strcmp( argv[i], "-randinv" ) )
{
invert = CV_RANDOM_INVERT;
}
else if( !strcmp( argv[i], "-maxidev" ) )
{
maxintensitydev = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-maxxangle" ) )
{
maxxangle = atof( argv[++i] );
}
else if( !strcmp( argv[i], "-maxyangle" ) )
{
maxyangle = atof( argv[++i] );
}
else if( !strcmp( argv[i], "-maxzangle" ) )
{
maxzangle = atof( argv[++i] );
}
else if( !strcmp( argv[i], "-show" ) )
{
showsamples = 1;
if( i+1 < argc && strlen( argv[i+1] ) > 0 && argv[i+1][0] != '-' )
{
double d;
d = strtod( argv[i+1], 0 );
if( d != -HUGE_VAL && d != HUGE_VAL && d > 0 ) scale = d;
++i;
}
}
else if( !strcmp( argv[i], "-w" ) )
{
width = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-h" ) )
{
height = atoi( argv[++i] );
}
}
printf( "Info file name: %s\n", ((infoname == NULL) ? nullname : infoname ) );
printf( "Img file name: %s\n", ((imagename == NULL) ? nullname : imagename ) );
printf( "Vec file name: %s\n", ((vecname == NULL) ? nullname : vecname ) );
printf( "BG file name: %s\n", ((bgfilename == NULL) ? nullname : bgfilename ) );
printf( "Num: %d\n", num );
printf( "BG color: %d\n", bgcolor );
printf( "BG threshold: %d\n", bgthreshold );
printf( "Invert: %s\n", (invert == CV_RANDOM_INVERT) ? "RANDOM"
: ( (invert) ? "TRUE" : "FALSE" ) );
printf( "Max intensity deviation: %d\n", maxintensitydev );
printf( "Max x angle: %g\n", maxxangle );
printf( "Max y angle: %g\n", maxyangle );
printf( "Max z angle: %g\n", maxzangle );
printf( "Show samples: %s\n", (showsamples) ? "TRUE" : "FALSE" );
if( showsamples )
{
printf( "Scale: %g\n", scale );
}
printf( "Width: %d\n", width );
printf( "Height: %d\n", height );
/* determine action */
if( imagename && vecname )
{
printf( "Create training samples from single image applying distortions...\n" );
cvCreateTrainingSamples( vecname, imagename, bgcolor, bgthreshold, bgfilename,
num, invert, maxintensitydev,
maxxangle, maxyangle, maxzangle,
showsamples, width, height );
printf( "Done\n" );
}
else if( imagename && bgfilename && infoname )
{
printf( "Create test samples from single image applying distortions...\n" );
cvCreateTestSamples( infoname, imagename, bgcolor, bgthreshold, bgfilename, num,
invert, maxintensitydev,
maxxangle, maxyangle, maxzangle, showsamples, width, height );
printf( "Done\n" );
}
else if( infoname && vecname )
{
int total;
printf( "Create training samples from images collection...\n" );
total = cvCreateTrainingSamplesFromInfo( infoname, vecname, num, showsamples,
width, height );
printf( "Done. Created %d samples\n", total );
}
else if( vecname )
{
printf( "View samples from vec file (press ESC to exit)...\n" );
cvShowVecSamples( vecname, width, height, scale );
printf( "Done\n" );
}
else
{
printf( "Nothing to do\n" );
}
return 0;
}
File diff suppressed because it is too large Load Diff
-729
View File
@@ -1,729 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
/*
* File cvclassifier.h
*
* Classifier types
*/
#ifndef _CVCLASSIFIER_H_
#define _CVCLASSIFIER_H_
#include <cmath>
#include "cxcore.h"
#define CV_BOOST_API
/* Convert matrix to vector */
#define CV_MAT2VEC( mat, vdata, vstep, num ) \
assert( (mat).rows == 1 || (mat).cols == 1 ); \
(vdata) = ((mat).data.ptr); \
if( (mat).rows == 1 ) \
{ \
(vstep) = CV_ELEM_SIZE( (mat).type ); \
(num) = (mat).cols; \
} \
else \
{ \
(vstep) = (mat).step; \
(num) = (mat).rows; \
}
/* Set up <sample> matrix header to be <num> sample of <trainData> samples matrix */
#define CV_GET_SAMPLE( trainData, tdflags, num, sample ) \
if( CV_IS_ROW_SAMPLE( tdflags ) ) \
{ \
cvInitMatHeader( &(sample), 1, (trainData).cols, \
CV_MAT_TYPE( (trainData).type ), \
((trainData).data.ptr + (num) * (trainData).step), \
(trainData).step ); \
} \
else \
{ \
cvInitMatHeader( &(sample), (trainData).rows, 1, \
CV_MAT_TYPE( (trainData).type ), \
((trainData).data.ptr + (num) * CV_ELEM_SIZE( (trainData).type )), \
(trainData).step ); \
}
#define CV_GET_SAMPLE_STEP( trainData, tdflags, sstep ) \
(sstep) = ( ( CV_IS_ROW_SAMPLE( tdflags ) ) \
? (trainData).step : CV_ELEM_SIZE( (trainData).type ) );
#define CV_LOGRATIO_THRESHOLD 0.00001F
/* log( val / (1 - val ) ) */
CV_INLINE float cvLogRatio( float val );
CV_INLINE float cvLogRatio( float val )
{
float tval;
tval = MAX(CV_LOGRATIO_THRESHOLD, MIN( 1.0F - CV_LOGRATIO_THRESHOLD, (val) ));
return logf( tval / (1.0F - tval) );
}
/* flags values for classifier consturctor flags parameter */
/* each trainData matrix column is a sample */
#define CV_COL_SAMPLE 0
/* each trainData matrix row is a sample */
#define CV_ROW_SAMPLE 1
#ifndef CV_IS_ROW_SAMPLE
# define CV_IS_ROW_SAMPLE( flags ) ( ( flags ) & CV_ROW_SAMPLE )
#endif
/* Classifier supports tune function */
#define CV_TUNABLE (1 << 1)
#define CV_IS_TUNABLE( flags ) ( (flags) & CV_TUNABLE )
/* classifier fields common to all classifiers */
#define CV_CLASSIFIER_FIELDS() \
int flags; \
float(*eval)( struct CvClassifier*, CvMat* ); \
void (*tune)( struct CvClassifier*, CvMat*, int flags, CvMat*, CvMat*, CvMat*, \
CvMat*, CvMat* ); \
int (*save)( struct CvClassifier*, const char* file_name ); \
void (*release)( struct CvClassifier** );
typedef struct CvClassifier
{
CV_CLASSIFIER_FIELDS()
} CvClassifier;
#define CV_CLASSIFIER_TRAIN_PARAM_FIELDS()
typedef struct CvClassifierTrainParams
{
CV_CLASSIFIER_TRAIN_PARAM_FIELDS()
} CvClassifierTrainParams;
/*
Common classifier constructor:
CvClassifier* cvCreateMyClassifier( CvMat* trainData,
int flags,
CvMat* trainClasses,
CvMat* typeMask,
CvMat* missedMeasurementsMask CV_DEFAULT(0),
CvCompIdx* compIdx CV_DEFAULT(0),
CvMat* sampleIdx CV_DEFAULT(0),
CvMat* weights CV_DEFAULT(0),
CvClassifierTrainParams* trainParams CV_DEFAULT(0)
)
*/
typedef CvClassifier* (*CvClassifierConstructor)( CvMat*, int, CvMat*, CvMat*, CvMat*,
CvMat*, CvMat*, CvMat*,
CvClassifierTrainParams* );
typedef enum CvStumpType
{
CV_CLASSIFICATION = 0,
CV_CLASSIFICATION_CLASS = 1,
CV_REGRESSION = 2
} CvStumpType;
typedef enum CvStumpError
{
CV_MISCLASSIFICATION = 0,
CV_GINI = 1,
CV_ENTROPY = 2,
CV_SQUARE = 3
} CvStumpError;
typedef struct CvStumpTrainParams
{
CV_CLASSIFIER_TRAIN_PARAM_FIELDS()
CvStumpType type;
CvStumpError error;
} CvStumpTrainParams;
typedef struct CvMTStumpTrainParams
{
CV_CLASSIFIER_TRAIN_PARAM_FIELDS()
CvStumpType type;
CvStumpError error;
int portion; /* number of components calculated in each thread */
int numcomp; /* total number of components */
/* callback which fills <mat> with components [first, first+num[ */
void (*getTrainData)( CvMat* mat, CvMat* sampleIdx, CvMat* compIdx,
int first, int num, void* userdata );
CvMat* sortedIdx; /* presorted samples indices */
void* userdata; /* passed to callback */
} CvMTStumpTrainParams;
typedef struct CvStumpClassifier
{
CV_CLASSIFIER_FIELDS()
int compidx;
float lerror; /* impurity of the right node */
float rerror; /* impurity of the left node */
float threshold;
float left;
float right;
} CvStumpClassifier;
typedef struct CvCARTTrainParams
{
CV_CLASSIFIER_TRAIN_PARAM_FIELDS()
/* desired number of internal nodes */
int count;
CvClassifierTrainParams* stumpTrainParams;
CvClassifierConstructor stumpConstructor;
/*
* Split sample indices <idx>
* on the "left" indices <left> and "right" indices <right>
* according to samples components <compidx> values and <threshold>.
*
* NOTE: Matrices <left> and <right> must be allocated using cvCreateMat function
* since they are freed using cvReleaseMat function
*
* If it is NULL then the default implementation which evaluates training
* samples from <trainData> passed to classifier constructor is used
*/
void (*splitIdx)( int compidx, float threshold,
CvMat* idx, CvMat** left, CvMat** right,
void* userdata );
void* userdata;
} CvCARTTrainParams;
typedef struct CvCARTClassifier
{
CV_CLASSIFIER_FIELDS()
/* number of internal nodes */
int count;
/* internal nodes (each array of <count> elements) */
int* compidx;
float* threshold;
int* left;
int* right;
/* leaves (array of <count>+1 elements) */
float* val;
} CvCARTClassifier;
CV_BOOST_API
void cvGetSortedIndices( CvMat* val, CvMat* idx, int sortcols CV_DEFAULT( 0 ) );
CV_BOOST_API
void cvReleaseStumpClassifier( CvClassifier** classifier );
CV_BOOST_API
float cvEvalStumpClassifier( CvClassifier* classifier, CvMat* sample );
CV_BOOST_API
CvClassifier* cvCreateStumpClassifier( CvMat* trainData,
int flags,
CvMat* trainClasses,
CvMat* typeMask,
CvMat* missedMeasurementsMask CV_DEFAULT(0),
CvMat* compIdx CV_DEFAULT(0),
CvMat* sampleIdx CV_DEFAULT(0),
CvMat* weights CV_DEFAULT(0),
CvClassifierTrainParams* trainParams CV_DEFAULT(0) );
/*
* cvCreateMTStumpClassifier
*
* Multithreaded stump classifier constructor
* Includes huge train data support through callback function
*/
CV_BOOST_API
CvClassifier* cvCreateMTStumpClassifier( CvMat* trainData,
int flags,
CvMat* trainClasses,
CvMat* typeMask,
CvMat* missedMeasurementsMask,
CvMat* compIdx,
CvMat* sampleIdx,
CvMat* weights,
CvClassifierTrainParams* trainParams );
/*
* cvCreateCARTClassifier
*
* CART classifier constructor
*/
CV_BOOST_API
CvClassifier* cvCreateCARTClassifier( CvMat* trainData,
int flags,
CvMat* trainClasses,
CvMat* typeMask,
CvMat* missedMeasurementsMask,
CvMat* compIdx,
CvMat* sampleIdx,
CvMat* weights,
CvClassifierTrainParams* trainParams );
CV_BOOST_API
void cvReleaseCARTClassifier( CvClassifier** classifier );
CV_BOOST_API
float cvEvalCARTClassifier( CvClassifier* classifier, CvMat* sample );
/****************************************************************************************\
* Boosting *
\****************************************************************************************/
/*
* CvBoostType
*
* The CvBoostType enumeration specifies the boosting type.
*
* Remarks
* Four different boosting variants for 2 class classification problems are supported:
* Discrete AdaBoost, Real AdaBoost, LogitBoost and Gentle AdaBoost.
* The L2 (2 class classification problems) and LK (K class classification problems)
* algorithms are close to LogitBoost but more numerically stable than last one.
* For regression three different loss functions are supported:
* Least square, least absolute deviation and huber loss.
*/
typedef enum CvBoostType
{
CV_DABCLASS = 0, /* 2 class Discrete AdaBoost */
CV_RABCLASS = 1, /* 2 class Real AdaBoost */
CV_LBCLASS = 2, /* 2 class LogitBoost */
CV_GABCLASS = 3, /* 2 class Gentle AdaBoost */
CV_L2CLASS = 4, /* classification (2 class problem) */
CV_LKCLASS = 5, /* classification (K class problem) */
CV_LSREG = 6, /* least squares regression */
CV_LADREG = 7, /* least absolute deviation regression */
CV_MREG = 8 /* M-regression (Huber loss) */
} CvBoostType;
/****************************************************************************************\
* Iterative training functions *
\****************************************************************************************/
/*
* CvBoostTrainer
*
* The CvBoostTrainer structure represents internal boosting trainer.
*/
typedef struct CvBoostTrainer CvBoostTrainer;
/*
* cvBoostStartTraining
*
* The cvBoostStartTraining function starts training process and calculates
* response values and weights for the first weak classifier training.
*
* Parameters
* trainClasses
* Vector of classes of training samples classes. Each element must be 0 or 1 and
* of type CV_32FC1.
* weakTrainVals
* Vector of response values for the first trained weak classifier.
* Must be of type CV_32FC1.
* weights
* Weight vector of training samples for the first trained weak classifier.
* Must be of type CV_32FC1.
* type
* Boosting type. CV_DABCLASS, CV_RABCLASS, CV_LBCLASS, CV_GABCLASS
* types are supported.
*
* Return Values
* The return value is a pointer to internal trainer structure which is used
* to perform next training iterations.
*
* Remarks
* weakTrainVals and weights must be allocated before calling the function
* and of the same size as trainingClasses. Usually weights should be initialized
* with 1.0 value.
* The function calculates response values and weights for the first weak
* classifier training and stores them into weakTrainVals and weights
* respectively.
* Note, the training of the weak classifier using weakTrainVals, weight,
* trainingData is outside of this function.
*/
CV_BOOST_API
CvBoostTrainer* cvBoostStartTraining( CvMat* trainClasses,
CvMat* weakTrainVals,
CvMat* weights,
CvMat* sampleIdx,
CvBoostType type );
/*
* cvBoostNextWeakClassifier
*
* The cvBoostNextWeakClassifier function performs next training
* iteration and caluclates response values and weights for the next weak
* classifier training.
*
* Parameters
* weakEvalVals
* Vector of values obtained by evaluation of each sample with
* the last trained weak classifier (iteration i). Must be of CV_32FC1 type.
* trainClasses
* Vector of classes of training samples. Each element must be 0 or 1,
* and of type CV_32FC1.
* weakTrainVals
* Vector of response values for the next weak classifier training
* (iteration i+1). Must be of type CV_32FC1.
* weights
* Weight vector of training samples for the next weak classifier training
* (iteration i+1). Must be of type CV_32FC1.
* trainer
* A pointer to internal trainer returned by the cvBoostStartTraining
* function call.
*
* Return Values
* The return value is the coefficient for the last trained weak classifier.
*
* Remarks
* weakTrainVals and weights must be exactly the same vectors as used in
* the cvBoostStartTraining function call and should not be modified.
* The function calculates response values and weights for the next weak
* classifier training and stores them into weakTrainVals and weights
* respectively.
* Note, the training of the weak classifier of iteration i+1 using
* weakTrainVals, weight, trainingData is outside of this function.
*/
CV_BOOST_API
float cvBoostNextWeakClassifier( CvMat* weakEvalVals,
CvMat* trainClasses,
CvMat* weakTrainVals,
CvMat* weights,
CvBoostTrainer* trainer );
/*
* cvBoostEndTraining
*
* The cvBoostEndTraining function finishes training process and releases
* internally allocated memory.
*
* Parameters
* trainer
* A pointer to a pointer to internal trainer returned by the cvBoostStartTraining
* function call.
*/
CV_BOOST_API
void cvBoostEndTraining( CvBoostTrainer** trainer );
/****************************************************************************************\
* Boosted tree models *
\****************************************************************************************/
/*
* CvBtClassifier
*
* The CvBtClassifier structure represents boosted tree model.
*
* Members
* flags
* Flags. If CV_IS_TUNABLE( flags ) != 0 then the model supports tuning.
* eval
* Evaluation function. Returns sample predicted class (0, 1, etc.)
* for classification or predicted value for regression.
* tune
* Tune function. If the model supports tuning then tune call performs
* one more boosting iteration if passed to the function flags parameter
* is CV_TUNABLE otherwise releases internally allocated for tuning memory
* and makes the model untunable.
* NOTE: Since tuning uses the pointers to parameters,
* passed to the cvCreateBtClassifier function, they should not be modified
* or released between tune calls.
* save
* This function stores the model into given file.
* release
* This function releases the model.
* type
* Boosted tree model type.
* numclasses
* Number of classes for CV_LKCLASS type or 1 for all other types.
* numiter
* Number of iterations. Number of weak classifiers is equal to number
* of iterations for all types except CV_LKCLASS. For CV_LKCLASS type
* number of weak classifiers is (numiter * numclasses).
* numfeatures
* Number of features in sample.
* trees
* Stores weak classifiers when the model does not support tuning.
* seq
* Stores weak classifiers when the model supports tuning.
* trainer
* Pointer to internal tuning parameters if the model supports tuning.
*/
typedef struct CvBtClassifier
{
CV_CLASSIFIER_FIELDS()
CvBoostType type;
int numclasses;
int numiter;
int numfeatures;
union
{
CvCARTClassifier** trees;
CvSeq* seq;
};
void* trainer;
} CvBtClassifier;
/*
* CvBtClassifierTrainParams
*
* The CvBtClassifierTrainParams structure stores training parameters for
* boosted tree model.
*
* Members
* type
* Boosted tree model type.
* numiter
* Desired number of iterations.
* param
* Parameter Model Type Parameter Meaning
* param[0] Any Shrinkage factor
* param[1] CV_MREG alpha. (1-alpha) determines "break-down" point of
* the training procedure, i.e. the fraction of samples
* that can be arbitrary modified without serious
* degrading the quality of the result.
* CV_DABCLASS, Weight trimming factor.
* CV_RABCLASS,
* CV_LBCLASS,
* CV_GABCLASS,
* CV_L2CLASS,
* CV_LKCLASS
* numsplits
* Desired number of splits in each tree.
*/
typedef struct CvBtClassifierTrainParams
{
CV_CLASSIFIER_TRAIN_PARAM_FIELDS()
CvBoostType type;
int numiter;
float param[2];
int numsplits;
} CvBtClassifierTrainParams;
/*
* cvCreateBtClassifier
*
* The cvCreateBtClassifier function creates boosted tree model.
*
* Parameters
* trainData
* Matrix of feature values. Must have CV_32FC1 type.
* flags
* Determines how samples are stored in trainData.
* One of CV_ROW_SAMPLE or CV_COL_SAMPLE.
* Optionally may be combined with CV_TUNABLE to make tunable model.
* trainClasses
* Vector of responses for regression or classes (0, 1, 2, etc.) for classification.
* typeMask,
* missedMeasurementsMask,
* compIdx
* Not supported. Must be NULL.
* sampleIdx
* Indices of samples used in training. If NULL then all samples are used.
* For CV_DABCLASS, CV_RABCLASS, CV_LBCLASS and CV_GABCLASS must be NULL.
* weights
* Not supported. Must be NULL.
* trainParams
* A pointer to CvBtClassifierTrainParams structure. Training parameters.
* See CvBtClassifierTrainParams description for details.
*
* Return Values
* The return value is a pointer to created boosted tree model of type CvBtClassifier.
*
* Remarks
* The function performs trainParams->numiter training iterations.
* If CV_TUNABLE flag is specified then created model supports tuning.
* In this case additional training iterations may be performed by
* tune function call.
*/
CV_BOOST_API
CvClassifier* cvCreateBtClassifier( CvMat* trainData,
int flags,
CvMat* trainClasses,
CvMat* typeMask,
CvMat* missedMeasurementsMask,
CvMat* compIdx,
CvMat* sampleIdx,
CvMat* weights,
CvClassifierTrainParams* trainParams );
/*
* cvCreateBtClassifierFromFile
*
* The cvCreateBtClassifierFromFile function restores previously saved
* boosted tree model from file.
*
* Parameters
* filename
* The name of the file with boosted tree model.
*
* Remarks
* The restored model does not support tuning.
*/
CV_BOOST_API
CvClassifier* cvCreateBtClassifierFromFile( const char* filename );
/****************************************************************************************\
* Utility functions *
\****************************************************************************************/
/*
* cvTrimWeights
*
* The cvTrimWeights function performs weight trimming.
*
* Parameters
* weights
* Weights vector.
* idx
* Indices vector of weights that should be considered.
* If it is NULL then all weights are used.
* factor
* Weight trimming factor. Must be in [0, 1] range.
*
* Return Values
* The return value is a vector of indices. If all samples should be used then
* it is equal to idx. In other case the cvReleaseMat function should be called
* to release it.
*
* Remarks
*/
CV_BOOST_API
CvMat* cvTrimWeights( CvMat* weights, CvMat* idx, float factor );
/*
* cvReadTrainData
*
* The cvReadTrainData function reads feature values and responses from file.
*
* Parameters
* filename
* The name of the file to be read.
* flags
* One of CV_ROW_SAMPLE or CV_COL_SAMPLE. Determines how feature values
* will be stored.
* trainData
* A pointer to a pointer to created matrix with feature values.
* cvReleaseMat function should be used to destroy created matrix.
* trainClasses
* A pointer to a pointer to created matrix with response values.
* cvReleaseMat function should be used to destroy created matrix.
*
* Remarks
* File format:
* ============================================
* m n
* value_1_1 value_1_2 ... value_1_n response_1
* value_2_1 value_2_2 ... value_2_n response_2
* ...
* value_m_1 value_m_2 ... value_m_n response_m
* ============================================
* m
* Number of samples
* n
* Number of features in each sample
* value_i_j
* Value of j-th feature of i-th sample
* response_i
* Response value of i-th sample
* For classification problems responses represent classes (0, 1, etc.)
* All values and classes are integer or real numbers.
*/
CV_BOOST_API
void cvReadTrainData( const char* filename,
int flags,
CvMat** trainData,
CvMat** trainClasses );
/*
* cvWriteTrainData
*
* The cvWriteTrainData function stores feature values and responses into file.
*
* Parameters
* filename
* The name of the file.
* flags
* One of CV_ROW_SAMPLE or CV_COL_SAMPLE. Determines how feature values
* are stored.
* trainData
* Feature values matrix.
* trainClasses
* Response values vector.
* sampleIdx
* Vector of idicies of the samples that should be stored. If it is NULL
* then all samples will be stored.
*
* Remarks
* See the cvReadTrainData function for file format description.
*/
CV_BOOST_API
void cvWriteTrainData( const char* filename,
int flags,
CvMat* trainData,
CvMat* trainClasses,
CvMat* sampleIdx );
/*
* cvRandShuffle
*
* The cvRandShuffle function perfroms random shuffling of given vector.
*
* Parameters
* vector
* Vector that should be shuffled.
* Must have CV_8UC1, CV_16SC1, CV_32SC1 or CV_32FC1 type.
*/
CV_BOOST_API
void cvRandShuffleVec( CvMat* vector );
#endif /* _CVCLASSIFIER_H_ */
-125
View File
@@ -1,125 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "_cvcommon.h"
#include <cstring>
#include <ctime>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef _WIN32
#include <direct.h>
#endif /* _WIN32 */
int icvMkDir( const char* filename )
{
char path[PATH_MAX];
char* p;
int pos;
#ifdef _WIN32
struct _stat st;
#else /* _WIN32 */
struct stat st;
mode_t mode;
mode = 0755;
#endif /* _WIN32 */
strcpy( path, filename );
p = path;
for( ; ; )
{
pos = (int)strcspn( p, "/\\" );
if( pos == (int) strlen( p ) ) break;
if( pos != 0 )
{
p[pos] = '\0';
#ifdef _WIN32
if( p[pos-1] != ':' )
{
if( _stat( path, &st ) != 0 )
{
if( _mkdir( path ) != 0 ) return 0;
}
}
#else /* _WIN32 */
if( stat( path, &st ) != 0 )
{
if( mkdir( path, mode ) != 0 ) return 0;
}
#endif /* _WIN32 */
}
p[pos] = '/';
p += pos + 1;
}
return 1;
}
#if 0
/* debug functions */
void icvSave( const CvArr* ptr, const char* filename, int line )
{
CvFileStorage* fs;
char buf[PATH_MAX];
const char* name;
name = strrchr( filename, '\\' );
if( !name ) name = strrchr( filename, '/' );
if( !name ) name = filename;
else name++; /* skip '/' or '\\' */
sprintf( buf, "%s-%d-%d", name, line, time( NULL ) );
fs = cvOpenFileStorage( buf, NULL, CV_STORAGE_WRITE_TEXT );
if( !fs ) return;
cvWrite( fs, "debug", ptr );
cvReleaseFileStorage( &fs );
}
#endif // #if 0
/* End of file. */
-835
View File
@@ -1,835 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
/*
* cvhaarclassifier.cpp
*
* haar classifiers (stump, CART, stage, cascade)
*/
#include "_cvhaartraining.h"
CvIntHaarClassifier* icvCreateCARTHaarClassifier( int count )
{
CvCARTHaarClassifier* cart;
size_t datasize;
datasize = sizeof( *cart ) +
( sizeof( int ) +
sizeof( CvTHaarFeature ) + sizeof( CvFastHaarFeature ) +
sizeof( float ) + sizeof( int ) + sizeof( int ) ) * count +
sizeof( float ) * (count + 1);
cart = (CvCARTHaarClassifier*) cvAlloc( datasize );
memset( cart, 0, datasize );
cart->feature = (CvTHaarFeature*) (cart + 1);
cart->fastfeature = (CvFastHaarFeature*) (cart->feature + count);
cart->threshold = (float*) (cart->fastfeature + count);
cart->left = (int*) (cart->threshold + count);
cart->right = (int*) (cart->left + count);
cart->val = (float*) (cart->right + count);
cart->compidx = (int*) (cart->val + count + 1 );
cart->count = count;
cart->eval = icvEvalCARTHaarClassifier;
cart->save = icvSaveCARTHaarClassifier;
cart->release = icvReleaseHaarClassifier;
return (CvIntHaarClassifier*) cart;
}
void icvReleaseHaarClassifier( CvIntHaarClassifier** classifier )
{
cvFree( classifier );
*classifier = NULL;
}
void icvInitCARTHaarClassifier( CvCARTHaarClassifier* carthaar, CvCARTClassifier* cart,
CvIntHaarFeatures* intHaarFeatures )
{
int i;
for( i = 0; i < cart->count; i++ )
{
carthaar->feature[i] = intHaarFeatures->feature[cart->compidx[i]];
carthaar->fastfeature[i] = intHaarFeatures->fastfeature[cart->compidx[i]];
carthaar->threshold[i] = cart->threshold[i];
carthaar->left[i] = cart->left[i];
carthaar->right[i] = cart->right[i];
carthaar->val[i] = cart->val[i];
carthaar->compidx[i] = cart->compidx[i];
}
carthaar->count = cart->count;
carthaar->val[cart->count] = cart->val[cart->count];
}
float icvEvalCARTHaarClassifier( CvIntHaarClassifier* classifier,
sum_type* sum, sum_type* tilted, float normfactor )
{
int idx = 0;
do
{
if( cvEvalFastHaarFeature(
((CvCARTHaarClassifier*) classifier)->fastfeature + idx, sum, tilted )
< (((CvCARTHaarClassifier*) classifier)->threshold[idx] * normfactor) )
{
idx = ((CvCARTHaarClassifier*) classifier)->left[idx];
}
else
{
idx = ((CvCARTHaarClassifier*) classifier)->right[idx];
}
} while( idx > 0 );
return ((CvCARTHaarClassifier*) classifier)->val[-idx];
}
CvIntHaarClassifier* icvCreateStageHaarClassifier( int count, float threshold )
{
CvStageHaarClassifier* stage;
size_t datasize;
datasize = sizeof( *stage ) + sizeof( CvIntHaarClassifier* ) * count;
stage = (CvStageHaarClassifier*) cvAlloc( datasize );
memset( stage, 0, datasize );
stage->count = count;
stage->threshold = threshold;
stage->classifier = (CvIntHaarClassifier**) (stage + 1);
stage->eval = icvEvalStageHaarClassifier;
stage->save = icvSaveStageHaarClassifier;
stage->release = icvReleaseStageHaarClassifier;
return (CvIntHaarClassifier*) stage;
}
void icvReleaseStageHaarClassifier( CvIntHaarClassifier** classifier )
{
int i;
for( i = 0; i < ((CvStageHaarClassifier*) *classifier)->count; i++ )
{
if( ((CvStageHaarClassifier*) *classifier)->classifier[i] != NULL )
{
((CvStageHaarClassifier*) *classifier)->classifier[i]->release(
&(((CvStageHaarClassifier*) *classifier)->classifier[i]) );
}
}
cvFree( classifier );
*classifier = NULL;
}
float icvEvalStageHaarClassifier( CvIntHaarClassifier* classifier,
sum_type* sum, sum_type* tilted, float normfactor )
{
int i;
float stage_sum;
stage_sum = 0.0F;
for( i = 0; i < ((CvStageHaarClassifier*) classifier)->count; i++ )
{
stage_sum +=
((CvStageHaarClassifier*) classifier)->classifier[i]->eval(
((CvStageHaarClassifier*) classifier)->classifier[i],
sum, tilted, normfactor );
}
return stage_sum;
}
CvIntHaarClassifier* icvCreateCascadeHaarClassifier( int count )
{
CvCascadeHaarClassifier* ptr;
size_t datasize;
datasize = sizeof( *ptr ) + sizeof( CvIntHaarClassifier* ) * count;
ptr = (CvCascadeHaarClassifier*) cvAlloc( datasize );
memset( ptr, 0, datasize );
ptr->count = count;
ptr->classifier = (CvIntHaarClassifier**) (ptr + 1);
ptr->eval = icvEvalCascadeHaarClassifier;
ptr->save = NULL;
ptr->release = icvReleaseCascadeHaarClassifier;
return (CvIntHaarClassifier*) ptr;
}
void icvReleaseCascadeHaarClassifier( CvIntHaarClassifier** classifier )
{
int i;
for( i = 0; i < ((CvCascadeHaarClassifier*) *classifier)->count; i++ )
{
if( ((CvCascadeHaarClassifier*) *classifier)->classifier[i] != NULL )
{
((CvCascadeHaarClassifier*) *classifier)->classifier[i]->release(
&(((CvCascadeHaarClassifier*) *classifier)->classifier[i]) );
}
}
cvFree( classifier );
*classifier = NULL;
}
float icvEvalCascadeHaarClassifier( CvIntHaarClassifier* classifier,
sum_type* sum, sum_type* tilted, float normfactor )
{
int i;
for( i = 0; i < ((CvCascadeHaarClassifier*) classifier)->count; i++ )
{
if( ((CvCascadeHaarClassifier*) classifier)->classifier[i]->eval(
((CvCascadeHaarClassifier*) classifier)->classifier[i],
sum, tilted, normfactor )
< ( ((CvStageHaarClassifier*)
((CvCascadeHaarClassifier*) classifier)->classifier[i])->threshold
- CV_THRESHOLD_EPS) )
{
return 0.0;
}
}
return 1.0;
}
void icvSaveHaarFeature( CvTHaarFeature* feature, FILE* file )
{
fprintf( file, "%d\n", ( ( feature->rect[2].weight == 0.0F ) ? 2 : 3) );
fprintf( file, "%d %d %d %d %d %d\n",
feature->rect[0].r.x,
feature->rect[0].r.y,
feature->rect[0].r.width,
feature->rect[0].r.height,
0,
(int) (feature->rect[0].weight) );
fprintf( file, "%d %d %d %d %d %d\n",
feature->rect[1].r.x,
feature->rect[1].r.y,
feature->rect[1].r.width,
feature->rect[1].r.height,
0,
(int) (feature->rect[1].weight) );
if( feature->rect[2].weight != 0.0F )
{
fprintf( file, "%d %d %d %d %d %d\n",
feature->rect[2].r.x,
feature->rect[2].r.y,
feature->rect[2].r.width,
feature->rect[2].r.height,
0,
(int) (feature->rect[2].weight) );
}
fprintf( file, "%s\n", &(feature->desc[0]) );
}
void icvLoadHaarFeature( CvTHaarFeature* feature, FILE* file )
{
int nrect;
int j;
int tmp;
int weight;
nrect = 0;
int values_read = fscanf( file, "%d", &nrect );
CV_Assert(values_read == 1);
assert( nrect <= CV_HAAR_FEATURE_MAX );
for( j = 0; j < nrect; j++ )
{
values_read = fscanf( file, "%d %d %d %d %d %d",
&(feature->rect[j].r.x),
&(feature->rect[j].r.y),
&(feature->rect[j].r.width),
&(feature->rect[j].r.height),
&tmp, &weight );
CV_Assert(values_read == 6);
feature->rect[j].weight = (float) weight;
}
for( j = nrect; j < CV_HAAR_FEATURE_MAX; j++ )
{
feature->rect[j].r.x = 0;
feature->rect[j].r.y = 0;
feature->rect[j].r.width = 0;
feature->rect[j].r.height = 0;
feature->rect[j].weight = 0.0f;
}
values_read = fscanf( file, "%s", &(feature->desc[0]) );
CV_Assert(values_read == 1);
feature->tilted = ( feature->desc[0] == 't' );
}
void icvSaveCARTHaarClassifier( CvIntHaarClassifier* classifier, FILE* file )
{
int i;
int count;
count = ((CvCARTHaarClassifier*) classifier)->count;
fprintf( file, "%d\n", count );
for( i = 0; i < count; i++ )
{
icvSaveHaarFeature( &(((CvCARTHaarClassifier*) classifier)->feature[i]), file );
fprintf( file, "%e %d %d\n",
((CvCARTHaarClassifier*) classifier)->threshold[i],
((CvCARTHaarClassifier*) classifier)->left[i],
((CvCARTHaarClassifier*) classifier)->right[i] );
}
for( i = 0; i <= count; i++ )
{
fprintf( file, "%e ", ((CvCARTHaarClassifier*) classifier)->val[i] );
}
fprintf( file, "\n" );
}
CvIntHaarClassifier* icvLoadCARTHaarClassifier( FILE* file, int step )
{
CvCARTHaarClassifier* ptr;
int i;
int count;
ptr = NULL;
int values_read = fscanf( file, "%d", &count );
CV_Assert(values_read == 1);
if( count > 0 )
{
ptr = (CvCARTHaarClassifier*) icvCreateCARTHaarClassifier( count );
for( i = 0; i < count; i++ )
{
icvLoadHaarFeature( &(ptr->feature[i]), file );
values_read = fscanf( file, "%f %d %d", &(ptr->threshold[i]), &(ptr->left[i]),
&(ptr->right[i]) );
CV_Assert(values_read == 3);
}
for( i = 0; i <= count; i++ )
{
values_read = fscanf( file, "%f", &(ptr->val[i]) );
CV_Assert(values_read == 1);
}
icvConvertToFastHaarFeature( ptr->feature, ptr->fastfeature, ptr->count, step );
}
return (CvIntHaarClassifier*) ptr;
}
void icvSaveStageHaarClassifier( CvIntHaarClassifier* classifier, FILE* file )
{
int count;
int i;
float threshold;
count = ((CvStageHaarClassifier*) classifier)->count;
fprintf( file, "%d\n", count );
for( i = 0; i < count; i++ )
{
((CvStageHaarClassifier*) classifier)->classifier[i]->save(
((CvStageHaarClassifier*) classifier)->classifier[i], file );
}
threshold = ((CvStageHaarClassifier*) classifier)->threshold;
/* to be compatible with the previous implementation */
/* threshold = 2.0F * ((CvStageHaarClassifier*) classifier)->threshold - count; */
fprintf( file, "%e\n", threshold );
}
static CvIntHaarClassifier* icvLoadCARTStageHaarClassifierF( FILE* file, int step )
{
CvStageHaarClassifier* ptr = NULL;
//CV_FUNCNAME( "icvLoadCARTStageHaarClassifierF" );
__BEGIN__;
if( file != NULL )
{
int count;
int i;
float threshold;
count = 0;
int values_read = fscanf( file, "%d", &count );
CV_Assert(values_read == 1);
if( count > 0 )
{
ptr = (CvStageHaarClassifier*) icvCreateStageHaarClassifier( count, 0.0F );
for( i = 0; i < count; i++ )
{
ptr->classifier[i] = icvLoadCARTHaarClassifier( file, step );
}
values_read = fscanf( file, "%f", &threshold );
CV_Assert(values_read == 1);
ptr->threshold = threshold;
/* to be compatible with the previous implementation */
/* ptr->threshold = 0.5F * (threshold + count); */
}
if( feof( file ) )
{
ptr->release( (CvIntHaarClassifier**) &ptr );
ptr = NULL;
}
}
__END__;
return (CvIntHaarClassifier*) ptr;
}
CvIntHaarClassifier* icvLoadCARTStageHaarClassifier( const char* filename, int step )
{
CvIntHaarClassifier* ptr = NULL;
CV_FUNCNAME( "icvLoadCARTStageHaarClassifier" );
__BEGIN__;
FILE* file;
file = fopen( filename, "r" );
if( file )
{
CV_CALL( ptr = icvLoadCARTStageHaarClassifierF( file, step ) );
fclose( file );
}
__END__;
return ptr;
}
/* tree cascade classifier */
/* evaluates a tree cascade classifier */
float icvEvalTreeCascadeClassifier( CvIntHaarClassifier* classifier,
sum_type* sum, sum_type* tilted, float normfactor )
{
CvTreeCascadeNode* ptr;
ptr = ((CvTreeCascadeClassifier*) classifier)->root;
while( ptr )
{
if( ptr->stage->eval( (CvIntHaarClassifier*) ptr->stage,
sum, tilted, normfactor )
>= ptr->stage->threshold - CV_THRESHOLD_EPS )
{
ptr = ptr->child;
}
else
{
while( ptr && ptr->next == NULL ) ptr = ptr->parent;
if( ptr == NULL ) return 0.0F;
ptr = ptr->next;
}
}
return 1.0F;
}
/* sets path int the tree form the root to the leaf node */
void icvSetLeafNode( CvTreeCascadeClassifier* tcc, CvTreeCascadeNode* leaf )
{
CV_FUNCNAME( "icvSetLeafNode" );
__BEGIN__;
CvTreeCascadeNode* ptr;
ptr = NULL;
while( leaf )
{
leaf->child_eval = ptr;
ptr = leaf;
leaf = leaf->parent;
}
leaf = tcc->root;
while( leaf && leaf != ptr ) leaf = leaf->next;
if( leaf != ptr )
CV_ERROR( CV_StsError, "Invalid tcc or leaf node." );
tcc->root_eval = ptr;
__END__;
}
/* evaluates a tree cascade classifier. used in filtering */
float icvEvalTreeCascadeClassifierFilter( CvIntHaarClassifier* classifier, sum_type* sum,
sum_type* tilted, float normfactor )
{
CvTreeCascadeNode* ptr;
//CvTreeCascadeClassifier* tree;
//tree = (CvTreeCascadeClassifier*) classifier;
ptr = ((CvTreeCascadeClassifier*) classifier)->root_eval;
while( ptr )
{
if( ptr->stage->eval( (CvIntHaarClassifier*) ptr->stage,
sum, tilted, normfactor )
< ptr->stage->threshold - CV_THRESHOLD_EPS )
{
return 0.0F;
}
ptr = ptr->child_eval;
}
return 1.0F;
}
/* creates tree cascade node */
CvTreeCascadeNode* icvCreateTreeCascadeNode()
{
CvTreeCascadeNode* ptr = NULL;
CV_FUNCNAME( "icvCreateTreeCascadeNode" );
__BEGIN__;
size_t data_size;
data_size = sizeof( *ptr );
CV_CALL( ptr = (CvTreeCascadeNode*) cvAlloc( data_size ) );
memset( ptr, 0, data_size );
__END__;
return ptr;
}
/* releases all tree cascade nodes accessible via links */
void icvReleaseTreeCascadeNodes( CvTreeCascadeNode** node )
{
//CV_FUNCNAME( "icvReleaseTreeCascadeNodes" );
__BEGIN__;
if( node && *node )
{
CvTreeCascadeNode* ptr;
CvTreeCascadeNode* ptr_;
ptr = *node;
while( ptr )
{
while( ptr->child ) ptr = ptr->child;
if( ptr->stage ) ptr->stage->release( (CvIntHaarClassifier**) &ptr->stage );
ptr_ = ptr;
while( ptr && ptr->next == NULL ) ptr = ptr->parent;
if( ptr ) ptr = ptr->next;
cvFree( &ptr_ );
}
}
__END__;
}
/* releases tree cascade classifier */
void icvReleaseTreeCascadeClassifier( CvIntHaarClassifier** classifier )
{
if( classifier && *classifier )
{
icvReleaseTreeCascadeNodes( &((CvTreeCascadeClassifier*) *classifier)->root );
cvFree( classifier );
*classifier = NULL;
}
}
void icvPrintTreeCascade( CvTreeCascadeNode* root )
{
//CV_FUNCNAME( "icvPrintTreeCascade" );
__BEGIN__;
CvTreeCascadeNode* node;
CvTreeCascadeNode* n;
char buf0[256];
char buf[256];
int level;
int i;
int max_level;
node = root;
level = max_level = 0;
while( node )
{
while( node->child ) { node = node->child; level++; }
if( level > max_level ) { max_level = level; }
while( node && !node->next ) { node = node->parent; level--; }
if( node ) node = node->next;
}
printf( "\nTree Classifier\n" );
printf( "Stage\n" );
for( i = 0; i <= max_level; i++ ) printf( "+---" );
printf( "+\n" );
for( i = 0; i <= max_level; i++ ) printf( "|%3d", i );
printf( "|\n" );
for( i = 0; i <= max_level; i++ ) printf( "+---" );
printf( "+\n\n" );
node = root;
buf[0] = 0;
while( node )
{
sprintf( buf + strlen( buf ), "%3d", node->idx );
while( node->child )
{
node = node->child;
sprintf( buf + strlen( buf ),
((node->idx < 10) ? "---%d" : ((node->idx < 100) ? "--%d" : "-%d")),
node->idx );
}
printf( " %s\n", buf );
while( node && !node->next ) { node = node->parent; }
if( node )
{
node = node->next;
n = node->parent;
buf[0] = 0;
while( n )
{
if( n->next )
sprintf( buf0, " | %s", buf );
else
sprintf( buf0, " %s", buf );
strcpy( buf, buf0 );
n = n->parent;
}
printf( " %s |\n", buf );
}
}
printf( "\n" );
fflush( stdout );
__END__;
}
CvIntHaarClassifier* icvLoadTreeCascadeClassifier( const char* filename, int step,
int* splits )
{
CvTreeCascadeClassifier* ptr = NULL;
CvTreeCascadeNode** nodes = NULL;
CV_FUNCNAME( "icvLoadTreeCascadeClassifier" );
__BEGIN__;
size_t data_size;
CvStageHaarClassifier* stage;
char stage_name[PATH_MAX];
char* suffix;
int i, num;
FILE* f;
int result, parent=0, next=0;
int stub;
if( !splits ) splits = &stub;
*splits = 0;
data_size = sizeof( *ptr );
CV_CALL( ptr = (CvTreeCascadeClassifier*) cvAlloc( data_size ) );
memset( ptr, 0, data_size );
ptr->eval = icvEvalTreeCascadeClassifier;
ptr->release = icvReleaseTreeCascadeClassifier;
sprintf( stage_name, "%s/", filename );
suffix = stage_name + strlen( stage_name );
for( i = 0; ; i++ )
{
sprintf( suffix, "%d/%s", i, CV_STAGE_CART_FILE_NAME );
f = fopen( stage_name, "r" );
if( !f ) break;
fclose( f );
}
num = i;
if( num < 1 ) EXIT;
data_size = sizeof( *nodes ) * num;
CV_CALL( nodes = (CvTreeCascadeNode**) cvAlloc( data_size ) );
for( i = 0; i < num; i++ )
{
sprintf( suffix, "%d/%s", i, CV_STAGE_CART_FILE_NAME );
f = fopen( stage_name, "r" );
CV_CALL( stage = (CvStageHaarClassifier*)
icvLoadCARTStageHaarClassifierF( f, step ) );
result = ( f && stage ) ? fscanf( f, "%d%d", &parent, &next ) : 0;
if( f ) fclose( f );
if( result != 2 )
{
num = i;
break;
}
printf( "Stage %d loaded\n", i );
if( parent >= i || (next != -1 && next != i + 1) )
CV_ERROR( CV_StsError, "Invalid tree links" );
CV_CALL( nodes[i] = icvCreateTreeCascadeNode() );
nodes[i]->stage = stage;
nodes[i]->idx = i;
nodes[i]->parent = (parent != -1 ) ? nodes[parent] : NULL;
nodes[i]->next = ( next != -1 ) ? nodes[i] : NULL;
nodes[i]->child = NULL;
}
for( i = 0; i < num; i++ )
{
if( nodes[i]->next )
{
(*splits)++;
nodes[i]->next = nodes[i+1];
}
if( nodes[i]->parent && nodes[i]->parent->child == NULL )
{
nodes[i]->parent->child = nodes[i];
}
}
ptr->root = nodes[0];
ptr->next_idx = num;
__END__;
cvFree( &nodes );
return (CvIntHaarClassifier*) ptr;
}
CvTreeCascadeNode* icvFindDeepestLeaves( CvTreeCascadeClassifier* tcc )
{
CvTreeCascadeNode* leaves;
//CV_FUNCNAME( "icvFindDeepestLeaves" );
__BEGIN__;
int level, cur_level;
CvTreeCascadeNode* ptr;
CvTreeCascadeNode* last;
leaves = last = NULL;
ptr = tcc->root;
level = -1;
cur_level = 0;
/* find leaves with maximal level */
while( ptr )
{
if( ptr->child ) { ptr = ptr->child; cur_level++; }
else
{
if( cur_level == level )
{
last->next_same_level = ptr;
ptr->next_same_level = NULL;
last = ptr;
}
if( cur_level > level )
{
level = cur_level;
leaves = last = ptr;
ptr->next_same_level = NULL;
}
while( ptr && ptr->next == NULL ) { ptr = ptr->parent; cur_level--; }
if( ptr ) ptr = ptr->next;
}
}
__END__;
return leaves;
}
/* End of file. */
File diff suppressed because it is too large Load Diff
-192
View File
@@ -1,192 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
/*
* cvhaartraining.h
*
* haar training functions
*/
#ifndef _CVHAARTRAINING_H_
#define _CVHAARTRAINING_H_
/*
* cvCreateTrainingSamples
*
* Create training samples applying random distortions to sample image and
* store them in .vec file
*
* filename - .vec file name
* imgfilename - sample image file name
* bgcolor - background color for sample image
* bgthreshold - background color threshold. Pixels those colors are in range
* [bgcolor-bgthreshold, bgcolor+bgthreshold] are considered as transparent
* bgfilename - background description file name. If not NULL samples
* will be put on arbitrary background
* count - desired number of samples
* invert - if not 0 sample foreground pixels will be inverted
* if invert == CV_RANDOM_INVERT then samples will be inverted randomly
* maxintensitydev - desired max intensity deviation of foreground samples pixels
* maxxangle - max rotation angles
* maxyangle
* maxzangle
* showsamples - if not 0 samples will be shown
* winwidth - desired samples width
* winheight - desired samples height
*/
#define CV_RANDOM_INVERT 0x7FFFFFFF
void cvCreateTrainingSamples( const char* filename,
const char* imgfilename, int bgcolor, int bgthreshold,
const char* bgfilename, int count,
int invert = 0, int maxintensitydev = 40,
double maxxangle = 1.1,
double maxyangle = 1.1,
double maxzangle = 0.5,
int showsamples = 0,
int winwidth = 24, int winheight = 24 );
void cvCreateTestSamples( const char* infoname,
const char* imgfilename, int bgcolor, int bgthreshold,
const char* bgfilename, int count,
int invert, int maxintensitydev,
double maxxangle, double maxyangle, double maxzangle,
int showsamples,
int winwidth, int winheight );
/*
* cvCreateTrainingSamplesFromInfo
*
* Create training samples from a set of marked up images and store them into .vec file
* infoname - file in which marked up image descriptions are stored
* num - desired number of samples
* showsamples - if not 0 samples will be shown
* winwidth - sample width
* winheight - sample height
*
* Return number of successfully created samples
*/
int cvCreateTrainingSamplesFromInfo( const char* infoname, const char* vecfilename,
int num,
int showsamples,
int winwidth, int winheight );
/*
* cvShowVecSamples
*
* Shows samples stored in .vec file
*
* filename
* .vec file name
* winwidth
* sample width
* winheight
* sample height
* scale
* the scale each sample is adjusted to
*/
void cvShowVecSamples( const char* filename, int winwidth, int winheight, double scale );
/*
* cvCreateCascadeClassifier
*
* Create cascade classifier
* dirname - directory name in which cascade classifier will be created.
* It must exist and contain subdirectories 0, 1, 2, ... (nstages-1).
* vecfilename - name of .vec file with object's images
* bgfilename - name of background description file
* bg_vecfile - true if bgfilename represents a vec file with discrete negatives
* npos - number of positive samples used in training of each stage
* nneg - number of negative samples used in training of each stage
* nstages - number of stages
* numprecalculated - number of features being precalculated. Each precalculated feature
* requires (number_of_samples*(sizeof( float ) + sizeof( short ))) bytes of memory
* numsplits - number of binary splits in each weak classifier
* 1 - stumps, 2 and more - trees.
* minhitrate - desired min hit rate of each stage
* maxfalsealarm - desired max false alarm of each stage
* weightfraction - weight trimming parameter
* mode - 0 - BASIC = Viola
* 1 - CORE = All upright
* 2 - ALL = All features
* symmetric - if not 0 vertical symmetry is assumed
* equalweights - if not 0 initial weights of all samples will be equal
* winwidth - sample width
* winheight - sample height
* boosttype - type of applied boosting algorithm
* 0 - Discrete AdaBoost
* 1 - Real AdaBoost
* 2 - LogitBoost
* 3 - Gentle AdaBoost
* stumperror - type of used error if Discrete AdaBoost algorithm is applied
* 0 - misclassification error
* 1 - gini error
* 2 - entropy error
*/
void cvCreateCascadeClassifier( const char* dirname,
const char* vecfilename,
const char* bgfilename,
int npos, int nneg, int nstages,
int numprecalculated,
int numsplits,
float minhitrate = 0.995F, float maxfalsealarm = 0.5F,
float weightfraction = 0.95F,
int mode = 0, int symmetric = 1,
int equalweights = 1,
int winwidth = 24, int winheight = 24,
int boosttype = 3, int stumperror = 0 );
void cvCreateTreeCascadeClassifier( const char* dirname,
const char* vecfilename,
const char* bgfilename,
int npos, int nneg, int nstages,
int numprecalculated,
int numsplits,
float minhitrate, float maxfalsealarm,
float weightfraction,
int mode, int symmetric,
int equalweights,
int winwidth, int winheight,
int boosttype, int stumperror,
int maxtreesplits, int minpos, bool bg_vecfile = false );
#endif /* _CVHAARTRAINING_H_ */
-953
View File
@@ -1,953 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
/*
* cvsamples.cpp
*
* support functions for training and test samples creation.
*/
#include "cvhaartraining.h"
#include "_cvhaartraining.h"
/* if ipl.h file is included then iplWarpPerspectiveQ function
is used for image transformation during samples creation;
otherwise internal cvWarpPerspective function is used */
//#include <ipl.h>
#include "cv.h"
#include "highgui.h"
/* Calculates coefficients of perspective transformation
* which maps <quad> into rectangle ((0,0), (w,0), (w,h), (h,0)):
*
* c00*xi + c01*yi + c02
* ui = ---------------------
* c20*xi + c21*yi + c22
*
* c10*xi + c11*yi + c12
* vi = ---------------------
* c20*xi + c21*yi + c22
*
* Coefficients are calculated by solving linear system:
* / x0 y0 1 0 0 0 -x0*u0 -y0*u0 \ /c00\ /u0\
* | x1 y1 1 0 0 0 -x1*u1 -y1*u1 | |c01| |u1|
* | x2 y2 1 0 0 0 -x2*u2 -y2*u2 | |c02| |u2|
* | x3 y3 1 0 0 0 -x3*u3 -y3*u3 |.|c10|=|u3|,
* | 0 0 0 x0 y0 1 -x0*v0 -y0*v0 | |c11| |v0|
* | 0 0 0 x1 y1 1 -x1*v1 -y1*v1 | |c12| |v1|
* | 0 0 0 x2 y2 1 -x2*v2 -y2*v2 | |c20| |v2|
* \ 0 0 0 x3 y3 1 -x3*v3 -y3*v3 / \c21/ \v3/
*
* where:
* (xi, yi) = (quad[i][0], quad[i][1])
* cij - coeffs[i][j], coeffs[2][2] = 1
* (ui, vi) - rectangle vertices
*/
static void cvGetPerspectiveTransform( CvSize src_size, double quad[4][2],
double coeffs[3][3] )
{
//CV_FUNCNAME( "cvWarpPerspective" );
__BEGIN__;
double a[8][8];
double b[8];
CvMat A = cvMat( 8, 8, CV_64FC1, a );
CvMat B = cvMat( 8, 1, CV_64FC1, b );
CvMat X = cvMat( 8, 1, CV_64FC1, coeffs );
int i;
for( i = 0; i < 4; ++i )
{
a[i][0] = quad[i][0]; a[i][1] = quad[i][1]; a[i][2] = 1;
a[i][3] = a[i][4] = a[i][5] = a[i][6] = a[i][7] = 0;
b[i] = 0;
}
for( i = 4; i < 8; ++i )
{
a[i][3] = quad[i-4][0]; a[i][4] = quad[i-4][1]; a[i][5] = 1;
a[i][0] = a[i][1] = a[i][2] = a[i][6] = a[i][7] = 0;
b[i] = 0;
}
int u = src_size.width - 1;
int v = src_size.height - 1;
a[1][6] = -quad[1][0] * u; a[1][7] = -quad[1][1] * u;
a[2][6] = -quad[2][0] * u; a[2][7] = -quad[2][1] * u;
b[1] = b[2] = u;
a[6][6] = -quad[2][0] * v; a[6][7] = -quad[2][1] * v;
a[7][6] = -quad[3][0] * v; a[7][7] = -quad[3][1] * v;
b[6] = b[7] = v;
cvSolve( &A, &B, &X );
coeffs[2][2] = 1;
__END__;
}
/* Warps source into destination by a perspective transform */
static void cvWarpPerspective( CvArr* src, CvArr* dst, double quad[4][2] )
{
CV_FUNCNAME( "cvWarpPerspective" );
__BEGIN__;
#ifdef __IPL_H__
IplImage src_stub, dst_stub;
IplImage* src_img;
IplImage* dst_img;
CV_CALL( src_img = cvGetImage( src, &src_stub ) );
CV_CALL( dst_img = cvGetImage( dst, &dst_stub ) );
iplWarpPerspectiveQ( src_img, dst_img, quad, IPL_WARP_R_TO_Q,
IPL_INTER_CUBIC | IPL_SMOOTH_EDGE );
#else
int fill_value = 0;
double c[3][3]; /* transformation coefficients */
double q[4][2]; /* rearranged quad */
int left = 0;
int right = 0;
int next_right = 0;
int next_left = 0;
double y_min = 0;
double y_max = 0;
double k_left, b_left, k_right, b_right;
uchar* src_data;
int src_step;
CvSize src_size;
uchar* dst_data;
int dst_step;
CvSize dst_size;
double d = 0;
int direction = 0;
int i;
if( !src || (!CV_IS_IMAGE( src ) && !CV_IS_MAT( src )) ||
cvGetElemType( src ) != CV_8UC1 ||
cvGetDims( src ) != 2 )
{
CV_ERROR( CV_StsBadArg,
"Source must be two-dimensional array of CV_8UC1 type." );
}
if( !dst || (!CV_IS_IMAGE( dst ) && !CV_IS_MAT( dst )) ||
cvGetElemType( dst ) != CV_8UC1 ||
cvGetDims( dst ) != 2 )
{
CV_ERROR( CV_StsBadArg,
"Destination must be two-dimensional array of CV_8UC1 type." );
}
CV_CALL( cvGetRawData( src, &src_data, &src_step, &src_size ) );
CV_CALL( cvGetRawData( dst, &dst_data, &dst_step, &dst_size ) );
CV_CALL( cvGetPerspectiveTransform( src_size, quad, c ) );
/* if direction > 0 then vertices in quad follow in a CW direction,
otherwise they follow in a CCW direction */
direction = 0;
for( i = 0; i < 4; ++i )
{
int ni = i + 1; if( ni == 4 ) ni = 0;
int pi = i - 1; if( pi == -1 ) pi = 3;
d = (quad[i][0] - quad[pi][0])*(quad[ni][1] - quad[i][1]) -
(quad[i][1] - quad[pi][1])*(quad[ni][0] - quad[i][0]);
int cur_direction = CV_SIGN(d);
if( direction == 0 )
{
direction = cur_direction;
}
else if( direction * cur_direction < 0 )
{
direction = 0;
break;
}
}
if( direction == 0 )
{
CV_ERROR( CV_StsBadArg, "Quadrangle is nonconvex or degenerated." );
}
/* <left> is the index of the topmost quad vertice
if there are two such vertices <left> is the leftmost one */
left = 0;
for( i = 1; i < 4; ++i )
{
if( (quad[i][1] < quad[left][1]) ||
((quad[i][1] == quad[left][1]) && (quad[i][0] < quad[left][0])) )
{
left = i;
}
}
/* rearrange <quad> vertices in such way that they follow in a CW
direction and the first vertice is the topmost one and put them
into <q> */
if( direction > 0 )
{
for( i = left; i < 4; ++i )
{
q[i-left][0] = quad[i][0];
q[i-left][1] = quad[i][1];
}
for( i = 0; i < left; ++i )
{
q[4-left+i][0] = quad[i][0];
q[4-left+i][1] = quad[i][1];
}
}
else
{
for( i = left; i >= 0; --i )
{
q[left-i][0] = quad[i][0];
q[left-i][1] = quad[i][1];
}
for( i = 3; i > left; --i )
{
q[4+left-i][0] = quad[i][0];
q[4+left-i][1] = quad[i][1];
}
}
left = right = 0;
/* if there are two topmost points, <right> is the index of the rightmost one
otherwise <right> */
if( q[left][1] == q[left+1][1] )
{
right = 1;
}
/* <next_left> follows <left> in a CCW direction */
next_left = 3;
/* <next_right> follows <right> in a CW direction */
next_right = right + 1;
/* subtraction of 1 prevents skipping of the first row */
y_min = q[left][1] - 1;
/* left edge equation: y = k_left * x + b_left */
k_left = (q[left][0] - q[next_left][0]) /
(q[left][1] - q[next_left][1]);
b_left = (q[left][1] * q[next_left][0] -
q[left][0] * q[next_left][1]) /
(q[left][1] - q[next_left][1]);
/* right edge equation: y = k_right * x + b_right */
k_right = (q[right][0] - q[next_right][0]) /
(q[right][1] - q[next_right][1]);
b_right = (q[right][1] * q[next_right][0] -
q[right][0] * q[next_right][1]) /
(q[right][1] - q[next_right][1]);
for(;;)
{
int x, y;
y_max = MIN( q[next_left][1], q[next_right][1] );
int iy_min = MAX( cvRound(y_min), 0 ) + 1;
int iy_max = MIN( cvRound(y_max), dst_size.height - 1 );
double x_min = k_left * iy_min + b_left;
double x_max = k_right * iy_min + b_right;
/* walk through the destination quadrangle row by row */
for( y = iy_min; y <= iy_max; ++y )
{
int ix_min = MAX( cvRound( x_min ), 0 );
int ix_max = MIN( cvRound( x_max ), dst_size.width - 1 );
for( x = ix_min; x <= ix_max; ++x )
{
/* calculate coordinates of the corresponding source array point */
double div = (c[2][0] * x + c[2][1] * y + c[2][2]);
double src_x = (c[0][0] * x + c[0][1] * y + c[0][2]) / div;
double src_y = (c[1][0] * x + c[1][1] * y + c[1][2]) / div;
int isrc_x = cvFloor( src_x );
int isrc_y = cvFloor( src_y );
double delta_x = src_x - isrc_x;
double delta_y = src_y - isrc_y;
uchar* s = src_data + isrc_y * src_step + isrc_x;
int i00, i10, i01, i11;
i00 = i10 = i01 = i11 = (int) fill_value;
/* linear interpolation using 2x2 neighborhood */
if( isrc_x >= 0 && isrc_x <= src_size.width &&
isrc_y >= 0 && isrc_y <= src_size.height )
{
i00 = s[0];
}
if( isrc_x >= -1 && isrc_x < src_size.width &&
isrc_y >= 0 && isrc_y <= src_size.height )
{
i10 = s[1];
}
if( isrc_x >= 0 && isrc_x <= src_size.width &&
isrc_y >= -1 && isrc_y < src_size.height )
{
i01 = s[src_step];
}
if( isrc_x >= -1 && isrc_x < src_size.width &&
isrc_y >= -1 && isrc_y < src_size.height )
{
i11 = s[src_step+1];
}
double i0 = i00 + (i10 - i00)*delta_x;
double i1 = i01 + (i11 - i01)*delta_x;
((uchar*)(dst_data + y * dst_step))[x] = (uchar) (i0 + (i1 - i0)*delta_y);
}
x_min += k_left;
x_max += k_right;
}
if( (next_left == next_right) ||
(next_left+1 == next_right && q[next_left][1] == q[next_right][1]) )
{
break;
}
if( y_max == q[next_left][1] )
{
left = next_left;
next_left = left - 1;
k_left = (q[left][0] - q[next_left][0]) /
(q[left][1] - q[next_left][1]);
b_left = (q[left][1] * q[next_left][0] -
q[left][0] * q[next_left][1]) /
(q[left][1] - q[next_left][1]);
}
if( y_max == q[next_right][1] )
{
right = next_right;
next_right = right + 1;
k_right = (q[right][0] - q[next_right][0]) /
(q[right][1] - q[next_right][1]);
b_right = (q[right][1] * q[next_right][0] -
q[right][0] * q[next_right][1]) /
(q[right][1] - q[next_right][1]);
}
y_min = y_max;
}
#endif /* #ifndef __IPL_H__ */
__END__;
}
static
void icvRandomQuad( int width, int height, double quad[4][2],
double maxxangle,
double maxyangle,
double maxzangle )
{
double distfactor = 3.0;
double distfactor2 = 1.0;
double halfw, halfh;
int i;
double rotVectData[3];
double vectData[3];
double rotMatData[9];
CvMat rotVect;
CvMat rotMat;
CvMat vect;
double d;
rotVect = cvMat( 3, 1, CV_64FC1, &rotVectData[0] );
rotMat = cvMat( 3, 3, CV_64FC1, &rotMatData[0] );
vect = cvMat( 3, 1, CV_64FC1, &vectData[0] );
rotVectData[0] = maxxangle * (2.0 * rand() / RAND_MAX - 1.0);
rotVectData[1] = ( maxyangle - fabs( rotVectData[0] ) )
* (2.0 * rand() / RAND_MAX - 1.0);
rotVectData[2] = maxzangle * (2.0 * rand() / RAND_MAX - 1.0);
d = (distfactor + distfactor2 * (2.0 * rand() / RAND_MAX - 1.0)) * width;
/*
rotVectData[0] = maxxangle;
rotVectData[1] = maxyangle;
rotVectData[2] = maxzangle;
d = distfactor * width;
*/
cvRodrigues2( &rotVect, &rotMat );
halfw = 0.5 * width;
halfh = 0.5 * height;
quad[0][0] = -halfw;
quad[0][1] = -halfh;
quad[1][0] = halfw;
quad[1][1] = -halfh;
quad[2][0] = halfw;
quad[2][1] = halfh;
quad[3][0] = -halfw;
quad[3][1] = halfh;
for( i = 0; i < 4; i++ )
{
rotVectData[0] = quad[i][0];
rotVectData[1] = quad[i][1];
rotVectData[2] = 0.0;
cvMatMulAdd( &rotMat, &rotVect, 0, &vect );
quad[i][0] = vectData[0] * d / (d + vectData[2]) + halfw;
quad[i][1] = vectData[1] * d / (d + vectData[2]) + halfh;
/*
quad[i][0] += halfw;
quad[i][1] += halfh;
*/
}
}
int icvStartSampleDistortion( const char* imgfilename, int bgcolor, int bgthreshold,
CvSampleDistortionData* data )
{
memset( data, 0, sizeof( *data ) );
data->src = cvLoadImage( imgfilename, 0 );
if( data->src != NULL && data->src->nChannels == 1
&& data->src->depth == IPL_DEPTH_8U )
{
int r, c;
uchar* pmask;
uchar* psrc;
uchar* perode;
uchar* pdilate;
uchar dd, de;
data->dx = data->src->width / 2;
data->dy = data->src->height / 2;
data->bgcolor = bgcolor;
data->mask = cvCloneImage( data->src );
data->erode = cvCloneImage( data->src );
data->dilate = cvCloneImage( data->src );
/* make mask image */
for( r = 0; r < data->mask->height; r++ )
{
for( c = 0; c < data->mask->width; c++ )
{
pmask = ( (uchar*) (data->mask->imageData + r * data->mask->widthStep)
+ c );
if( bgcolor - bgthreshold <= (int) (*pmask) &&
(int) (*pmask) <= bgcolor + bgthreshold )
{
*pmask = (uchar) 0;
}
else
{
*pmask = (uchar) 255;
}
}
}
/* extend borders of source image */
cvErode( data->src, data->erode, 0, 1 );
cvDilate( data->src, data->dilate, 0, 1 );
for( r = 0; r < data->mask->height; r++ )
{
for( c = 0; c < data->mask->width; c++ )
{
pmask = ( (uchar*) (data->mask->imageData + r * data->mask->widthStep)
+ c );
if( (*pmask) == 0 )
{
psrc = ( (uchar*) (data->src->imageData + r * data->src->widthStep)
+ c );
perode =
( (uchar*) (data->erode->imageData + r * data->erode->widthStep)
+ c );
pdilate =
( (uchar*)(data->dilate->imageData + r * data->dilate->widthStep)
+ c );
de = (uchar)(bgcolor - (*perode));
dd = (uchar)((*pdilate) - bgcolor);
if( de >= dd && de > bgthreshold )
{
(*psrc) = (*perode);
}
if( dd > de && dd > bgthreshold )
{
(*psrc) = (*pdilate);
}
}
}
}
data->img = cvCreateImage( cvSize( data->src->width + 2 * data->dx,
data->src->height + 2 * data->dy ),
IPL_DEPTH_8U, 1 );
data->maskimg = cvCloneImage( data->img );
return 1;
}
return 0;
}
void icvPlaceDistortedSample( CvArr* background,
int inverse, int maxintensitydev,
double maxxangle, double maxyangle, double maxzangle,
int inscribe, double maxshiftf, double maxscalef,
CvSampleDistortionData* data )
{
double quad[4][2];
int r, c;
uchar* pimg;
uchar* pbg;
uchar* palpha;
uchar chartmp;
int forecolordev;
float scale;
IplImage* img;
IplImage* maskimg;
CvMat stub;
CvMat* bgimg;
CvRect cr;
CvRect roi;
double xshift, yshift, randscale;
icvRandomQuad( data->src->width, data->src->height, quad,
maxxangle, maxyangle, maxzangle );
quad[0][0] += (double) data->dx;
quad[0][1] += (double) data->dy;
quad[1][0] += (double) data->dx;
quad[1][1] += (double) data->dy;
quad[2][0] += (double) data->dx;
quad[2][1] += (double) data->dy;
quad[3][0] += (double) data->dx;
quad[3][1] += (double) data->dy;
cvSet( data->img, cvScalar( data->bgcolor ) );
cvSet( data->maskimg, cvScalar( 0.0 ) );
cvWarpPerspective( data->src, data->img, quad );
cvWarpPerspective( data->mask, data->maskimg, quad );
cvSmooth( data->maskimg, data->maskimg, CV_GAUSSIAN, 3, 3 );
bgimg = cvGetMat( background, &stub );
cr.x = data->dx;
cr.y = data->dy;
cr.width = data->src->width;
cr.height = data->src->height;
if( inscribe )
{
/* quad's circumscribing rectangle */
cr.x = (int) MIN( quad[0][0], quad[3][0] );
cr.y = (int) MIN( quad[0][1], quad[1][1] );
cr.width = (int) (MAX( quad[1][0], quad[2][0] ) + 0.5F ) - cr.x;
cr.height = (int) (MAX( quad[2][1], quad[3][1] ) + 0.5F ) - cr.y;
}
xshift = maxshiftf * rand() / RAND_MAX;
yshift = maxshiftf * rand() / RAND_MAX;
cr.x -= (int) ( xshift * cr.width );
cr.y -= (int) ( yshift * cr.height );
cr.width = (int) ((1.0 + maxshiftf) * cr.width );
cr.height = (int) ((1.0 + maxshiftf) * cr.height);
randscale = maxscalef * rand() / RAND_MAX;
cr.x -= (int) ( 0.5 * randscale * cr.width );
cr.y -= (int) ( 0.5 * randscale * cr.height );
cr.width = (int) ((1.0 + randscale) * cr.width );
cr.height = (int) ((1.0 + randscale) * cr.height);
scale = MAX( ((float) cr.width) / bgimg->cols, ((float) cr.height) / bgimg->rows );
roi.x = (int) (-0.5F * (scale * bgimg->cols - cr.width) + cr.x);
roi.y = (int) (-0.5F * (scale * bgimg->rows - cr.height) + cr.y);
roi.width = (int) (scale * bgimg->cols);
roi.height = (int) (scale * bgimg->rows);
img = cvCreateImage( cvSize( bgimg->cols, bgimg->rows ), IPL_DEPTH_8U, 1 );
maskimg = cvCreateImage( cvSize( bgimg->cols, bgimg->rows ), IPL_DEPTH_8U, 1 );
cvSetImageROI( data->img, roi );
cvResize( data->img, img );
cvResetImageROI( data->img );
cvSetImageROI( data->maskimg, roi );
cvResize( data->maskimg, maskimg );
cvResetImageROI( data->maskimg );
forecolordev = (int) (maxintensitydev * (2.0 * rand() / RAND_MAX - 1.0));
for( r = 0; r < img->height; r++ )
{
for( c = 0; c < img->width; c++ )
{
pimg = (uchar*) img->imageData + r * img->widthStep + c;
pbg = (uchar*) bgimg->data.ptr + r * bgimg->step + c;
palpha = (uchar*) maskimg->imageData + r * maskimg->widthStep + c;
chartmp = (uchar) MAX( 0, MIN( 255, forecolordev + (*pimg) ) );
if( inverse )
{
chartmp ^= 0xFF;
}
*pbg = (uchar) (( chartmp*(*palpha )+(255 - (*palpha) )*(*pbg) ) / 255);
}
}
cvReleaseImage( &img );
cvReleaseImage( &maskimg );
}
void icvEndSampleDistortion( CvSampleDistortionData* data )
{
if( data->src )
{
cvReleaseImage( &data->src );
}
if( data->mask )
{
cvReleaseImage( &data->mask );
}
if( data->erode )
{
cvReleaseImage( &data->erode );
}
if( data->dilate )
{
cvReleaseImage( &data->dilate );
}
if( data->img )
{
cvReleaseImage( &data->img );
}
if( data->maskimg )
{
cvReleaseImage( &data->maskimg );
}
}
void icvWriteVecHeader( FILE* file, int count, int width, int height )
{
int vecsize;
short tmp;
/* number of samples */
fwrite( &count, sizeof( count ), 1, file );
/* vector size */
vecsize = width * height;
fwrite( &vecsize, sizeof( vecsize ), 1, file );
/* min/max values */
tmp = 0;
fwrite( &tmp, sizeof( tmp ), 1, file );
fwrite( &tmp, sizeof( tmp ), 1, file );
}
void icvWriteVecSample( FILE* file, CvArr* sample )
{
CvMat* mat, stub;
int r, c;
short tmp;
uchar chartmp;
mat = cvGetMat( sample, &stub );
chartmp = 0;
fwrite( &chartmp, sizeof( chartmp ), 1, file );
for( r = 0; r < mat->rows; r++ )
{
for( c = 0; c < mat->cols; c++ )
{
tmp = (short) (CV_MAT_ELEM( *mat, uchar, r, c ));
fwrite( &tmp, sizeof( tmp ), 1, file );
}
}
}
int cvCreateTrainingSamplesFromInfo( const char* infoname, const char* vecfilename,
int num,
int showsamples,
int winwidth, int winheight )
{
char fullname[PATH_MAX];
char* filename;
FILE* info;
FILE* vec;
IplImage* src=0;
IplImage* sample;
int line;
int error;
int i;
int x, y, width, height;
int total;
assert( infoname != NULL );
assert( vecfilename != NULL );
total = 0;
if( !icvMkDir( vecfilename ) )
{
#if CV_VERBOSE
fprintf( stderr, "Unable to create directory hierarchy: %s\n", vecfilename );
#endif /* CV_VERBOSE */
return total;
}
info = fopen( infoname, "r" );
if( info == NULL )
{
#if CV_VERBOSE
fprintf( stderr, "Unable to open file: %s\n", infoname );
#endif /* CV_VERBOSE */
return total;
}
vec = fopen( vecfilename, "wb" );
if( vec == NULL )
{
#if CV_VERBOSE
fprintf( stderr, "Unable to open file: %s\n", vecfilename );
#endif /* CV_VERBOSE */
fclose( info );
return total;
}
sample = cvCreateImage( cvSize( winwidth, winheight ), IPL_DEPTH_8U, 1 );
icvWriteVecHeader( vec, num, sample->width, sample->height );
if( showsamples )
{
cvNamedWindow( "Sample", CV_WINDOW_AUTOSIZE );
}
strcpy( fullname, infoname );
filename = strrchr( fullname, '\\' );
if( filename == NULL )
{
filename = strrchr( fullname, '/' );
}
if( filename == NULL )
{
filename = fullname;
}
else
{
filename++;
}
for( line = 1, error = 0, total = 0; total < num ;line++ )
{
int count;
error = ( fscanf( info, "%s %d", filename, &count ) != 2 );
if( !error )
{
src = cvLoadImage( fullname, 0 );
error = ( src == NULL );
if( error )
{
#if CV_VERBOSE
fprintf( stderr, "Unable to open image: %s\n", fullname );
#endif /* CV_VERBOSE */
}
}
for( i = 0; (i < count) && (total < num); i++, total++ )
{
error = ( fscanf( info, "%d %d %d %d", &x, &y, &width, &height ) != 4 );
if( error ) break;
cvSetImageROI( src, cvRect( x, y, width, height ) );
cvResize( src, sample, width >= sample->width &&
height >= sample->height ? CV_INTER_AREA : CV_INTER_LINEAR );
if( showsamples )
{
cvShowImage( "Sample", sample );
if( cvWaitKey( 0 ) == 27 )
{
showsamples = 0;
}
}
icvWriteVecSample( vec, sample );
}
if( src )
{
cvReleaseImage( &src );
}
if( error )
{
#if CV_VERBOSE
fprintf( stderr, "%s(%d) : parse error", infoname, line );
#endif /* CV_VERBOSE */
break;
}
}
if( sample )
{
cvReleaseImage( &sample );
}
fclose( vec );
fclose( info );
return total;
}
void cvShowVecSamples( const char* filename, int winwidth, int winheight,
double scale )
{
CvVecFile file;
short tmp;
int i;
CvMat* sample;
tmp = 0;
file.input = fopen( filename, "rb" );
if( file.input != NULL )
{
size_t elements_read1 = fread( &file.count, sizeof( file.count ), 1, file.input );
size_t elements_read2 = fread( &file.vecsize, sizeof( file.vecsize ), 1, file.input );
size_t elements_read3 = fread( &tmp, sizeof( tmp ), 1, file.input );
size_t elements_read4 = fread( &tmp, sizeof( tmp ), 1, file.input );
CV_Assert(elements_read1 == 1 && elements_read2 == 1 && elements_read3 == 1 && elements_read4 == 1);
if( file.vecsize != winwidth * winheight )
{
int guessed_w = 0;
int guessed_h = 0;
fprintf( stderr, "Warning: specified sample width=%d and height=%d "
"does not correspond to .vec file vector size=%d.\n",
winwidth, winheight, file.vecsize );
if( file.vecsize > 0 )
{
guessed_w = cvFloor( sqrt( (float) file.vecsize ) );
if( guessed_w > 0 )
{
guessed_h = file.vecsize / guessed_w;
}
}
if( guessed_w <= 0 || guessed_h <= 0 || guessed_w * guessed_h != file.vecsize)
{
fprintf( stderr, "Error: failed to guess sample width and height\n" );
fclose( file.input );
return;
}
else
{
winwidth = guessed_w;
winheight = guessed_h;
fprintf( stderr, "Guessed width=%d, guessed height=%d\n",
winwidth, winheight );
}
}
if( !feof( file.input ) && scale > 0 )
{
CvMat* scaled_sample = 0;
file.last = 0;
file.vector = (short*) cvAlloc( sizeof( *file.vector ) * file.vecsize );
sample = scaled_sample = cvCreateMat( winheight, winwidth, CV_8UC1 );
if( scale != 1.0 )
{
scaled_sample = cvCreateMat( MAX( 1, cvCeil( scale * winheight ) ),
MAX( 1, cvCeil( scale * winwidth ) ),
CV_8UC1 );
}
cvNamedWindow( "Sample", CV_WINDOW_AUTOSIZE );
for( i = 0; i < file.count; i++ )
{
icvGetHaarTraininDataFromVecCallback( sample, &file );
if( scale != 1.0 ) cvResize( sample, scaled_sample, CV_INTER_LINEAR);
cvShowImage( "Sample", scaled_sample );
if( cvWaitKey( 0 ) == 27 ) break;
}
if( scaled_sample && scaled_sample != sample ) cvReleaseMat( &scaled_sample );
cvReleaseMat( &sample );
cvFree( &file.vector );
}
fclose( file.input );
}
}
/* End of file. */
-284
View File
@@ -1,284 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
/*
* haartraining.cpp
*
* Train cascade classifier
*/
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;
#include "cvhaartraining.h"
int main( int argc, char* argv[] )
{
int i = 0;
char* nullname = (char*)"(NULL)";
char* vecname = NULL;
char* dirname = NULL;
char* bgname = NULL;
bool bg_vecfile = false;
int npos = 2000;
int nneg = 2000;
int nstages = 14;
int mem = 200;
int nsplits = 1;
float minhitrate = 0.995F;
float maxfalsealarm = 0.5F;
float weightfraction = 0.95F;
int mode = 0;
int symmetric = 1;
int equalweights = 0;
int width = 24;
int height = 24;
const char* boosttypes[] = { "DAB", "RAB", "LB", "GAB" };
int boosttype = 3;
const char* stumperrors[] = { "misclass", "gini", "entropy" };
int stumperror = 0;
int maxtreesplits = 0;
int minpos = 500;
if( argc == 1 )
{
printf( "Usage: %s\n -data <dir_name>\n"
" -vec <vec_file_name>\n"
" -bg <background_file_name>\n"
" [-bg-vecfile]\n"
" [-npos <number_of_positive_samples = %d>]\n"
" [-nneg <number_of_negative_samples = %d>]\n"
" [-nstages <number_of_stages = %d>]\n"
" [-nsplits <number_of_splits = %d>]\n"
" [-mem <memory_in_MB = %d>]\n"
" [-sym (default)] [-nonsym]\n"
" [-minhitrate <min_hit_rate = %f>]\n"
" [-maxfalsealarm <max_false_alarm_rate = %f>]\n"
" [-weighttrimming <weight_trimming = %f>]\n"
" [-eqw]\n"
" [-mode <BASIC (default) | CORE | ALL>]\n"
" [-w <sample_width = %d>]\n"
" [-h <sample_height = %d>]\n"
" [-bt <DAB | RAB | LB | GAB (default)>]\n"
" [-err <misclass (default) | gini | entropy>]\n"
" [-maxtreesplits <max_number_of_splits_in_tree_cascade = %d>]\n"
" [-minpos <min_number_of_positive_samples_per_cluster = %d>]\n",
argv[0], npos, nneg, nstages, nsplits, mem,
minhitrate, maxfalsealarm, weightfraction, width, height,
maxtreesplits, minpos );
return 0;
}
for( i = 1; i < argc; i++ )
{
if( !strcmp( argv[i], "-data" ) )
{
dirname = argv[++i];
}
else if( !strcmp( argv[i], "-vec" ) )
{
vecname = argv[++i];
}
else if( !strcmp( argv[i], "-bg" ) )
{
bgname = argv[++i];
}
else if( !strcmp( argv[i], "-bg-vecfile" ) )
{
bg_vecfile = true;
}
else if( !strcmp( argv[i], "-npos" ) )
{
npos = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-nneg" ) )
{
nneg = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-nstages" ) )
{
nstages = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-nsplits" ) )
{
nsplits = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-mem" ) )
{
mem = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-sym" ) )
{
symmetric = 1;
}
else if( !strcmp( argv[i], "-nonsym" ) )
{
symmetric = 0;
}
else if( !strcmp( argv[i], "-minhitrate" ) )
{
minhitrate = (float) atof( argv[++i] );
}
else if( !strcmp( argv[i], "-maxfalsealarm" ) )
{
maxfalsealarm = (float) atof( argv[++i] );
}
else if( !strcmp( argv[i], "-weighttrimming" ) )
{
weightfraction = (float) atof( argv[++i] );
}
else if( !strcmp( argv[i], "-eqw" ) )
{
equalweights = 1;
}
else if( !strcmp( argv[i], "-mode" ) )
{
char* tmp = argv[++i];
if( !strcmp( tmp, "CORE" ) )
{
mode = 1;
}
else if( !strcmp( tmp, "ALL" ) )
{
mode = 2;
}
else
{
mode = 0;
}
}
else if( !strcmp( argv[i], "-w" ) )
{
width = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-h" ) )
{
height = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-bt" ) )
{
i++;
if( !strcmp( argv[i], boosttypes[0] ) )
{
boosttype = 0;
}
else if( !strcmp( argv[i], boosttypes[1] ) )
{
boosttype = 1;
}
else if( !strcmp( argv[i], boosttypes[2] ) )
{
boosttype = 2;
}
else
{
boosttype = 3;
}
}
else if( !strcmp( argv[i], "-err" ) )
{
i++;
if( !strcmp( argv[i], stumperrors[0] ) )
{
stumperror = 0;
}
else if( !strcmp( argv[i], stumperrors[1] ) )
{
stumperror = 1;
}
else
{
stumperror = 2;
}
}
else if( !strcmp( argv[i], "-maxtreesplits" ) )
{
maxtreesplits = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-minpos" ) )
{
minpos = atoi( argv[++i] );
}
}
printf( "Data dir name: %s\n", ((dirname == NULL) ? nullname : dirname ) );
printf( "Vec file name: %s\n", ((vecname == NULL) ? nullname : vecname ) );
printf( "BG file name: %s, is a vecfile: %s\n", ((bgname == NULL) ? nullname : bgname ), bg_vecfile ? "yes" : "no" );
printf( "Num pos: %d\n", npos );
printf( "Num neg: %d\n", nneg );
printf( "Num stages: %d\n", nstages );
printf( "Num splits: %d (%s as weak classifier)\n", nsplits,
(nsplits == 1) ? "stump" : "tree" );
printf( "Mem: %d MB\n", mem );
printf( "Symmetric: %s\n", (symmetric) ? "TRUE" : "FALSE" );
printf( "Min hit rate: %f\n", minhitrate );
printf( "Max false alarm rate: %f\n", maxfalsealarm );
printf( "Weight trimming: %f\n", weightfraction );
printf( "Equal weights: %s\n", (equalweights) ? "TRUE" : "FALSE" );
printf( "Mode: %s\n", ( (mode == 0) ? "BASIC" : ( (mode == 1) ? "CORE" : "ALL") ) );
printf( "Width: %d\n", width );
printf( "Height: %d\n", height );
//printf( "Max num of precalculated features: %d\n", numprecalculated );
printf( "Applied boosting algorithm: %s\n", boosttypes[boosttype] );
printf( "Error (valid only for Discrete and Real AdaBoost): %s\n",
stumperrors[stumperror] );
printf( "Max number of splits in tree cascade: %d\n", maxtreesplits );
printf( "Min number of positive samples per cluster: %d\n", minpos );
cvCreateTreeCascadeClassifier( dirname, vecname, bgname,
npos, nneg, nstages, mem,
nsplits,
minhitrate, maxfalsealarm, weightfraction,
mode, symmetric,
equalweights, width, height,
boosttype, stumperror,
maxtreesplits, minpos, bg_vecfile );
return 0;
}
-377
View File
@@ -1,377 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
/*
* performance.cpp
*
* Measure performance of classifier
*/
#include "opencv2/core.hpp"
#include "cv.h"
#include "highgui.h"
#include <cstdio>
#include <cmath>
#include <ctime>
#ifdef _WIN32
/* use clock() function insted of time() */
#define time( arg ) (((double) clock()) / CLOCKS_PER_SEC)
#endif /* _WIN32 */
#ifndef PATH_MAX
#define PATH_MAX 512
#endif /* PATH_MAX */
typedef struct HidCascade
{
int size;
int count;
} HidCascade;
typedef struct ObjectPos
{
float x;
float y;
float width;
int found; /* for reference */
int neghbors;
} ObjectPos;
int main( int argc, char* argv[] )
{
int i, j;
char* classifierdir = NULL;
//char* samplesdir = NULL;
int saveDetected = 1;
double scale_factor = 1.2;
float maxSizeDiff = 1.5F;
float maxPosDiff = 0.3F;
/* number of stages. if <=0 all stages are used */
int nos = -1, nos0;
int width = 24;
int height = 24;
int rocsize;
FILE* info;
char* infoname;
char fullname[PATH_MAX];
char detfilename[PATH_MAX];
char* filename;
char detname[] = "det-";
CvHaarClassifierCascade* cascade;
CvMemStorage* storage;
CvSeq* objects;
double totaltime;
infoname = (char*)"";
rocsize = 40;
if( argc == 1 )
{
printf( "Usage: %s\n -data <classifier_directory_name>\n"
" -info <collection_file_name>\n"
" [-maxSizeDiff <max_size_difference = %f>]\n"
" [-maxPosDiff <max_position_difference = %f>]\n"
" [-sf <scale_factor = %f>]\n"
" [-ni]\n"
" [-nos <number_of_stages = %d>]\n"
" [-rs <roc_size = %d>]\n"
" [-w <sample_width = %d>]\n"
" [-h <sample_height = %d>]\n",
argv[0], maxSizeDiff, maxPosDiff, scale_factor, nos, rocsize,
width, height );
return 0;
}
for( i = 1; i < argc; i++ )
{
if( !strcmp( argv[i], "-data" ) )
{
classifierdir = argv[++i];
}
else if( !strcmp( argv[i], "-info" ) )
{
infoname = argv[++i];
}
else if( !strcmp( argv[i], "-maxSizeDiff" ) )
{
maxSizeDiff = (float) atof( argv[++i] );
}
else if( !strcmp( argv[i], "-maxPosDiff" ) )
{
maxPosDiff = (float) atof( argv[++i] );
}
else if( !strcmp( argv[i], "-sf" ) )
{
scale_factor = atof( argv[++i] );
}
else if( !strcmp( argv[i], "-ni" ) )
{
saveDetected = 0;
}
else if( !strcmp( argv[i], "-nos" ) )
{
nos = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-rs" ) )
{
rocsize = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-w" ) )
{
width = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-h" ) )
{
height = atoi( argv[++i] );
}
}
cascade = cvLoadHaarClassifierCascade( classifierdir, cvSize( width, height ) );
if( cascade == NULL )
{
printf( "Unable to load classifier from %s\n", classifierdir );
return 1;
}
int* numclassifiers = new int[cascade->count];
numclassifiers[0] = cascade->stage_classifier[0].count;
for( i = 1; i < cascade->count; i++ )
{
numclassifiers[i] = numclassifiers[i-1] + cascade->stage_classifier[i].count;
}
storage = cvCreateMemStorage();
nos0 = cascade->count;
if( nos <= 0 )
nos = nos0;
strcpy( fullname, infoname );
filename = strrchr( fullname, '\\' );
if( filename == NULL )
{
filename = strrchr( fullname, '/' );
}
if( filename == NULL )
{
filename = fullname;
}
else
{
filename++;
}
info = fopen( infoname, "r" );
totaltime = 0.0;
if( info != NULL )
{
int x, y;
IplImage* img;
int hits, missed, falseAlarms;
int totalHits, totalMissed, totalFalseAlarms;
int found;
float distance;
int refcount;
ObjectPos* ref;
int detcount;
ObjectPos* det;
int error=0;
int* pos;
int* neg;
pos = (int*) cvAlloc( rocsize * sizeof( *pos ) );
neg = (int*) cvAlloc( rocsize * sizeof( *neg ) );
for( i = 0; i < rocsize; i++ ) { pos[i] = neg[i] = 0; }
printf( "+================================+======+======+======+\n" );
printf( "| File Name | Hits |Missed| False|\n" );
printf( "+================================+======+======+======+\n" );
totalHits = totalMissed = totalFalseAlarms = 0;
while( !feof( info ) )
{
if( fscanf( info, "%s %d", filename, &refcount ) != 2 || refcount <= 0 ) break;
img = cvLoadImage( fullname );
if( !img ) continue;
ref = (ObjectPos*) cvAlloc( refcount * sizeof( *ref ) );
for( i = 0; i < refcount; i++ )
{
int w, h;
error = (fscanf( info, "%d %d %d %d", &x, &y, &w, &h ) != 4);
if( error ) break;
ref[i].x = 0.5F * w + x;
ref[i].y = 0.5F * h + y;
ref[i].width = sqrtf( 0.5F * (w * w + h * h) );
ref[i].found = 0;
ref[i].neghbors = 0;
}
if( !error )
{
cvClearMemStorage( storage );
cascade->count = nos;
totaltime -= time( 0 );
objects = cvHaarDetectObjects( img, cascade, storage, scale_factor, 1 );
totaltime += time( 0 );
cascade->count = nos0;
detcount = ( objects ? objects->total : 0);
det = (detcount > 0) ?
( (ObjectPos*)cvAlloc( detcount * sizeof( *det )) ) : NULL;
hits = missed = falseAlarms = 0;
for( i = 0; i < detcount; i++ )
{
CvAvgComp r = *((CvAvgComp*) cvGetSeqElem( objects, i ));
det[i].x = 0.5F * r.rect.width + r.rect.x;
det[i].y = 0.5F * r.rect.height + r.rect.y;
det[i].width = sqrtf( 0.5F * (r.rect.width * r.rect.width +
r.rect.height * r.rect.height) );
det[i].neghbors = r.neighbors;
if( saveDetected )
{
cvRectangle( img, cvPoint( r.rect.x, r.rect.y ),
cvPoint( r.rect.x + r.rect.width, r.rect.y + r.rect.height ),
CV_RGB( 255, 0, 0 ), 3 );
}
found = 0;
for( j = 0; j < refcount; j++ )
{
distance = sqrtf( (det[i].x - ref[j].x) * (det[i].x - ref[j].x) +
(det[i].y - ref[j].y) * (det[i].y - ref[j].y) );
if( (distance < ref[j].width * maxPosDiff) &&
(det[i].width > ref[j].width / maxSizeDiff) &&
(det[i].width < ref[j].width * maxSizeDiff) )
{
ref[j].found = 1;
ref[j].neghbors = MAX( ref[j].neghbors, det[i].neghbors );
found = 1;
}
}
if( !found )
{
falseAlarms++;
neg[MIN(det[i].neghbors, rocsize - 1)]++;
}
}
for( j = 0; j < refcount; j++ )
{
if( ref[j].found )
{
hits++;
pos[MIN(ref[j].neghbors, rocsize - 1)]++;
}
else
{
missed++;
}
}
totalHits += hits;
totalMissed += missed;
totalFalseAlarms += falseAlarms;
printf( "|%32.32s|%6d|%6d|%6d|\n", filename, hits, missed, falseAlarms );
printf( "+--------------------------------+------+------+------+\n" );
fflush( stdout );
if( saveDetected )
{
strcpy( detfilename, detname );
strcat( detfilename, filename );
strcpy( filename, detfilename );
cvvSaveImage( fullname, img );
}
if( det ) { cvFree( &det ); det = NULL; }
} /* if( !error ) */
cvReleaseImage( &img );
cvFree( &ref );
}
fclose( info );
printf( "|%32.32s|%6d|%6d|%6d|\n", "Total",
totalHits, totalMissed, totalFalseAlarms );
printf( "+================================+======+======+======+\n" );
printf( "Number of stages: %d\n", nos );
printf( "Number of weak classifiers: %d\n", numclassifiers[nos - 1] );
printf( "Total time: %f\n", totaltime );
/* print ROC to stdout */
for( i = rocsize - 1; i > 0; i-- )
{
pos[i-1] += pos[i];
neg[i-1] += neg[i];
}
fprintf( stderr, "%d\n", nos );
for( i = 0; i < rocsize; i++ )
{
fprintf( stderr, "\t%d\t%d\t%f\t%f\n", pos[i], neg[i],
((float)pos[i]) / (totalHits + totalMissed),
((float)neg[i]) / (totalHits + totalMissed) );
}
cvFree( &pos );
cvFree( &neg );
}
delete[] numclassifiers;
cvReleaseHaarClassifierCascade( &cascade );
cvReleaseMemStorage( &storage );
return 0;
}
-33
View File
@@ -1,33 +0,0 @@
set(name sft)
set(the_target opencv_${name})
set(OPENCV_${the_target}_DEPS opencv_core opencv_softcascade opencv_highgui opencv_imgproc opencv_ml)
ocv_check_dependencies(${OPENCV_${the_target}_DEPS})
if(NOT OCV_DEPENDENCIES_FOUND)
return()
endif()
project(${the_target})
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_include_modules(${OPENCV_${the_target}_DEPS})
file(GLOB ${the_target}_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
add_executable(${the_target} ${${the_target}_SOURCES})
target_link_libraries(${the_target} ${OPENCV_${the_target}_DEPS})
set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
INSTALL_NAME_DIR lib
OUTPUT_NAME "opencv_trainsoftcascade")
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${the_target} PROPERTIES FOLDER "applications")
endif()
install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)
-162
View File
@@ -1,162 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include <sft/config.hpp>
#include <iomanip>
sft::Config::Config(): seed(0) {}
void sft::Config::write(cv::FileStorage& fs) const
{
fs << "{"
<< "trainPath" << trainPath
<< "testPath" << testPath
<< "modelWinSize" << modelWinSize
<< "offset" << offset
<< "octaves" << octaves
<< "positives" << positives
<< "negatives" << negatives
<< "btpNegatives" << btpNegatives
<< "shrinkage" << shrinkage
<< "treeDepth" << treeDepth
<< "weaks" << weaks
<< "poolSize" << poolSize
<< "cascadeName" << cascadeName
<< "outXmlPath" << outXmlPath
<< "seed" << seed
<< "featureType" << featureType
<< "}";
}
void sft::Config::read(const cv::FileNode& node)
{
trainPath = (string)node["trainPath"];
testPath = (string)node["testPath"];
cv::FileNodeIterator nIt = node["modelWinSize"].end();
modelWinSize = cv::Size((int)*(--nIt), (int)*(--nIt));
nIt = node["offset"].end();
offset = cv::Point2i((int)*(--nIt), (int)*(--nIt));
node["octaves"] >> octaves;
positives = (int)node["positives"];
negatives = (int)node["negatives"];
btpNegatives = (int)node["btpNegatives"];
shrinkage = (int)node["shrinkage"];
treeDepth = (int)node["treeDepth"];
weaks = (int)node["weaks"];
poolSize = (int)node["poolSize"];
cascadeName = (std::string)node["cascadeName"];
outXmlPath = (std::string)node["outXmlPath"];
seed = (int)node["seed"];
featureType = (std::string)node["featureType"];
}
void sft::write(cv::FileStorage& fs, const string&, const Config& x)
{
x.write(fs);
}
void sft::read(const cv::FileNode& node, Config& x, const Config& default_value)
{
x = default_value;
if(!node.empty())
x.read(node);
}
namespace {
struct Out
{
Out(std::ostream& _out): out(_out) {}
template<typename T>
void operator ()(const T a) const {out << a << " ";}
std::ostream& out;
private:
Out& operator=(Out const& other);
};
}
std::ostream& sft::operator<<(std::ostream& out, const Config& m)
{
out << std::setw(14) << std::left << "trainPath" << m.trainPath << std::endl
<< std::setw(14) << std::left << "testPath" << m.testPath << std::endl
<< std::setw(14) << std::left << "modelWinSize" << m.modelWinSize << std::endl
<< std::setw(14) << std::left << "offset" << m.offset << std::endl
<< std::setw(14) << std::left << "octaves";
Out o(out);
for_each(m.octaves.begin(), m.octaves.end(), o);
out << std::endl
<< std::setw(14) << std::left << "positives" << m.positives << std::endl
<< std::setw(14) << std::left << "negatives" << m.negatives << std::endl
<< std::setw(14) << std::left << "btpNegatives" << m.btpNegatives << std::endl
<< std::setw(14) << std::left << "shrinkage" << m.shrinkage << std::endl
<< std::setw(14) << std::left << "treeDepth" << m.treeDepth << std::endl
<< std::setw(14) << std::left << "weaks" << m.weaks << std::endl
<< std::setw(14) << std::left << "poolSize" << m.poolSize << std::endl
<< std::setw(14) << std::left << "cascadeName" << m.cascadeName << std::endl
<< std::setw(14) << std::left << "outXmlPath" << m.outXmlPath << std::endl
<< std::setw(14) << std::left << "seed" << m.seed << std::endl
<< std::setw(14) << std::left << "featureType" << m.featureType << std::endl;
return out;
}
-77
View File
@@ -1,77 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include <sft/dataset.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <queue>
// in the default case data folders should be aligned as following:
// 1. positives: <train or test path>/octave_<octave number>/pos/*.png
// 2. negatives: <train or test path>/octave_<octave number>/neg/*.png
sft::ScaledDataset::ScaledDataset(const string& path, const int oct)
{
dprintf("%s\n", "get dataset file names...");
dprintf("%s\n", "Positives globing...");
cv::glob(path + "/pos/octave_" + cv::format("%d", oct) + "/*.png", pos);
dprintf("%s\n", "Negatives globing...");
cv::glob(path + "/neg/octave_" + cv::format("%d", oct) + "/*.png", neg);
// Check: files not empty
CV_Assert(pos.size() != size_t(0));
CV_Assert(neg.size() != size_t(0));
}
cv::Mat sft::ScaledDataset::get(SampleType type, int idx) const
{
const std::string& src = (type == POSITIVE)? pos[idx]: neg[idx];
return cv::imread(src);
}
int sft::ScaledDataset::available(SampleType type) const
{
return (int)((type == POSITIVE)? pos.size():neg.size());
}
sft::ScaledDataset::~ScaledDataset(){}
-138
View File
@@ -1,138 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __SFT_CONFIG_HPP__
#define __SFT_CONFIG_HPP__
#include <sft/common.hpp>
#include <ostream>
namespace sft {
struct Config
{
Config();
void write(cv::FileStorage& fs) const;
void read(const cv::FileNode& node);
// Scaled and shrunk model size.
cv::Size model(ivector::const_iterator it) const
{
float octave = powf(2.f, (float)(*it));
return cv::Size( cvRound(modelWinSize.width * octave) / shrinkage,
cvRound(modelWinSize.height * octave) / shrinkage );
}
// Scaled but, not shrunk bounding box for object in sample image.
cv::Rect bbox(ivector::const_iterator it) const
{
float octave = powf(2.f, (float)(*it));
return cv::Rect( cvRound(offset.x * octave), cvRound(offset.y * octave),
cvRound(modelWinSize.width * octave), cvRound(modelWinSize.height * octave));
}
string resPath(ivector::const_iterator it) const
{
return cv::format("%s%d.xml",cascadeName.c_str(), *it);
}
// Paths to a rescaled data
string trainPath;
string testPath;
// Original model size.
cv::Size modelWinSize;
// example offset into positive image
cv::Point2i offset;
// List of octaves for which have to be trained cascades (a list of powers of two)
ivector octaves;
// Maximum number of positives that should be used during training
int positives;
// Initial number of negatives used during training.
int negatives;
// Number of weak negatives to add each bootstrapping step.
int btpNegatives;
// Inverse of scale for feature resizing
int shrinkage;
// Depth on weak classifier's decision tree
int treeDepth;
// Weak classifiers number in resulted cascade
int weaks;
// Feature random pool size
int poolSize;
// file name to store cascade
string cascadeName;
// path to resulting cascade
string outXmlPath;
// seed for random generation
int seed;
// channel feature type
string featureType;
// // bounding rectangle for actual example into example window
// cv::Rect exampleWindow;
};
// required for cv::FileStorage serialization
void write(cv::FileStorage& fs, const string&, const Config& x);
void read(const cv::FileNode& node, Config& x, const Config& default_value);
std::ostream& operator<<(std::ostream& out, const Config& m);
}
#endif
-67
View File
@@ -1,67 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __SFT_OCTAVE_HPP__
#define __SFT_OCTAVE_HPP__
#include <sft/common.hpp>
namespace sft
{
using cv::softcascade::Dataset;
class ScaledDataset : public Dataset
{
public:
ScaledDataset(const sft::string& path, const int octave);
virtual cv::Mat get(SampleType type, int idx) const;
virtual int available(SampleType type) const;
virtual ~ScaledDataset();
private:
svector pos;
svector neg;
};
}
#endif
-168
View File
@@ -1,168 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
// Training application for Soft Cascades.
#include <sft/common.hpp>
#include <iostream>
#include <sft/dataset.hpp>
#include <sft/config.hpp>
#include <opencv2/core/core_c.h>
int main(int argc, char** argv)
{
using namespace sft;
const string keys =
"{help h usage ? | | print this message }"
"{config c | | path to configuration xml }"
;
cv::CommandLineParser parser(argc, argv, keys);
parser.about("Soft cascade training application.");
if (parser.has("help"))
{
parser.printMessage();
return 0;
}
if (!parser.check())
{
parser.printErrors();
return 1;
}
string configPath = parser.get<string>("config");
if (configPath.empty())
{
std::cout << "Configuration file is missing or empty. Could not start training." << std::endl;
return 0;
}
std::cout << "Read configuration from file " << configPath << std::endl;
cv::FileStorage fs(configPath, cv::FileStorage::READ);
if(!fs.isOpened())
{
std::cout << "Configuration file " << configPath << " can't be opened." << std::endl;
return 1;
}
// 1. load config
sft::Config cfg;
fs["config"] >> cfg;
std::cout << std::endl << "Training will be executed for configuration:" << std::endl << cfg << std::endl;
// 2. check and open output file
cv::FileStorage fso(cfg.outXmlPath, cv::FileStorage::WRITE);
if(!fso.isOpened())
{
std::cout << "Training stopped. Output classifier Xml file " << cfg.outXmlPath << " can't be opened." << std::endl;
return 1;
}
fso << cfg.cascadeName
<< "{"
<< "stageType" << "BOOST"
<< "featureType" << cfg.featureType
<< "octavesNum" << (int)cfg.octaves.size()
<< "width" << cfg.modelWinSize.width
<< "height" << cfg.modelWinSize.height
<< "shrinkage" << cfg.shrinkage
<< "octaves" << "[";
// 3. Train all octaves
for (ivector::const_iterator it = cfg.octaves.begin(); it != cfg.octaves.end(); ++it)
{
// a. create random feature pool
int nfeatures = cfg.poolSize;
cv::Size model = cfg.model(it);
std::cout << "Model " << model << std::endl;
int nchannels = (cfg.featureType == "HOG6MagLuv") ? 10: 8;
std::cout << "number of feature channels is " << nchannels << std::endl;
cv::Ptr<cv::FeaturePool> pool = cv::FeaturePool::create(model, nfeatures, nchannels);
nfeatures = pool->size();
int npositives = cfg.positives;
int nnegatives = cfg.negatives;
int shrinkage = cfg.shrinkage;
cv::Rect boundingBox = cfg.bbox(it);
std::cout << "Object bounding box" << boundingBox << std::endl;
typedef cv::Octave Octave;
cv::Ptr<cv::ChannelFeatureBuilder> builder = cv::ChannelFeatureBuilder::create(cfg.featureType);
std::cout << "Channel builder " << builder->info()->name() << std::endl;
cv::Ptr<Octave> boost = Octave::create(boundingBox, npositives, nnegatives, *it, shrinkage, builder);
std::string path = cfg.trainPath;
sft::ScaledDataset dataset(path, *it);
if (boost->train(&dataset, pool, cfg.weaks, cfg.treeDepth))
{
CvFileStorage* fout = cvOpenFileStorage(cfg.resPath(it).c_str(), 0, CV_STORAGE_WRITE);
boost->write(fout, cfg.cascadeName);
cvReleaseFileStorage( &fout);
cv::Mat thresholds;
boost->setRejectThresholds(thresholds);
boost->write(fso, pool, thresholds);
cv::FileStorage tfs(("thresholds." + cfg.resPath(it)).c_str(), cv::FileStorage::WRITE);
tfs << "thresholds" << thresholds;
std::cout << "Octave " << *it << " was successfully trained..." << std::endl;
}
}
fso << "]" << "}";
fso.release();
std::cout << "Training complete..." << std::endl;
return 0;
}
+12 -15
View File
@@ -1,4 +1,4 @@
set(OPENCV_TRAINCASCADE_DEPS opencv_core opencv_ml opencv_imgproc opencv_photo opencv_objdetect opencv_highgui opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy)
set(OPENCV_TRAINCASCADE_DEPS opencv_core opencv_imgproc opencv_objdetect opencv_imgcodecs opencv_highgui opencv_calib3d opencv_features2d)
ocv_check_dependencies(${OPENCV_TRAINCASCADE_DEPS})
if(NOT OCV_DEPENDENCIES_FOUND)
@@ -6,21 +6,18 @@ if(NOT OCV_DEPENDENCIES_FOUND)
endif()
project(traincascade)
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_include_modules(${OPENCV_TRAINCASCADE_DEPS})
set(traincascade_files traincascade.cpp
cascadeclassifier.cpp cascadeclassifier.h
boost.cpp boost.h features.cpp traincascade_features.h
haarfeatures.cpp haarfeatures.h
lbpfeatures.cpp lbpfeatures.h
HOGfeatures.cpp HOGfeatures.h
imagestorage.cpp imagestorage.h)
set(the_target opencv_traincascade)
add_executable(${the_target} ${traincascade_files})
target_link_libraries(${the_target} ${OPENCV_TRAINCASCADE_DEPS} opencv_haartraining_engine)
ocv_target_include_directories(${the_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_target_include_modules(${the_target} ${OPENCV_TRAINCASCADE_DEPS})
file(GLOB SRCS *.cpp)
file(GLOB HDRS *.h*)
set(traincascade_files ${SRCS} ${HDRS})
ocv_add_executable(${the_target} ${traincascade_files})
ocv_target_link_libraries(${the_target} ${OPENCV_TRAINCASCADE_DEPS})
set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
+8 -8
View File
@@ -187,11 +187,11 @@ void CvHOGEvaluator::integralHistogram(const Mat &img, vector<Mat> &histogram, M
for( y = 0; y < gradSize.height; y++ )
{
const uchar* currPtr = img.data + img.step*ymap[y];
const uchar* prevPtr = img.data + img.step*ymap[y-1];
const uchar* nextPtr = img.data + img.step*ymap[y+1];
float* gradPtr = (float*)grad.ptr(y);
uchar* qanglePtr = (uchar*)qangle.ptr(y);
const uchar* currPtr = img.ptr(ymap[y]);
const uchar* prevPtr = img.ptr(ymap[y-1]);
const uchar* nextPtr = img.ptr(ymap[y+1]);
float* gradPtr = grad.ptr<float>(y);
uchar* qanglePtr = qangle.ptr(y);
for( x = 0; x < width; x++ )
{
@@ -226,9 +226,9 @@ void CvHOGEvaluator::integralHistogram(const Mat &img, vector<Mat> &histogram, M
int magStep = (int)( grad.step / sizeof(float) );
for( binIdx = 0; binIdx < nbins; binIdx++ )
{
histBuf = (float*)histogram[binIdx].data;
magBuf = (const float*)grad.data;
binsBuf = (const uchar*)qangle.data;
histBuf = histogram[binIdx].ptr<float>();
magBuf = grad.ptr<float>();
binsBuf = qangle.ptr();
memset( histBuf, 0, histSize.width * sizeof(histBuf[0]) );
histBuf += histStep + 1;
+1 -1
View File
@@ -2,7 +2,7 @@
#define _OPENCV_BOOST_H_
#include "traincascade_features.h"
#include "ml.h"
#include "old_ml.hpp"
struct CvCascadeBoostParams : CvBoostParams
{
-2
View File
@@ -7,8 +7,6 @@
#include "lbpfeatures.h"
#include "HOGfeatures.h" //new
#include "boost.h"
#include "cv.h"
#include "cxcore.h"
#define CC_CASCADE_FILENAME "cascade.xml"
#define CC_PARAMS_FILENAME "params.xml"
+2 -2
View File
@@ -13,9 +13,9 @@ float calcNormFactor( const Mat& sum, const Mat& sqSum )
size_t p0, p1, p2, p3;
CV_SUM_OFFSETS( p0, p1, p2, p3, normrect, sum.step1() )
double area = normrect.width * normrect.height;
const int *sp = (const int*)sum.data;
const int *sp = sum.ptr<int>();
int valSum = sp[p0] - sp[p1] - sp[p2] + sp[p3];
const double *sqp = (const double *)sqSum.data;
const double *sqp = sqSum.ptr<double>();
double valSqSum = sqp[p0] - sqp[p1] - sqp[p2] + sqp[p3];
return (float) sqrt( (double) (area * valSqSum - (double)valSum * valSum) );
}
+3 -2
View File
@@ -1,6 +1,7 @@
#include "opencv2/core.hpp"
#include "opencv2/core/core_c.h"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgcodecs.hpp"
#include "imagestorage.h"
#include <stdio.h>
@@ -97,7 +98,7 @@ bool CvCascadeImageReader::NegReader::get( Mat& _img )
return false;
Mat mat( winSize.height, winSize.width, CV_8UC1,
(void*)(img.data + point.y * img.step + point.x * img.elemSize()), img.step );
(void*)(img.ptr(point.y) + point.x * img.elemSize()), img.step );
mat.copyTo(_img);
if( (int)( point.x + (1.0F + stepFactor ) * winSize.width ) < img.cols )
-3
View File
@@ -1,9 +1,6 @@
#ifndef _OPENCV_IMAGESTORAGE_H_
#define _OPENCV_IMAGESTORAGE_H_
#include "highgui.h"
class CvCascadeImageReader
{
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+792
View File
@@ -0,0 +1,792 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "old_ml_precomp.hpp"
#include <ctype.h>
#define MISS_VAL FLT_MAX
#define CV_VAR_MISS 0
CvTrainTestSplit::CvTrainTestSplit()
{
train_sample_part_mode = CV_COUNT;
train_sample_part.count = -1;
mix = false;
}
CvTrainTestSplit::CvTrainTestSplit( int _train_sample_count, bool _mix )
{
train_sample_part_mode = CV_COUNT;
train_sample_part.count = _train_sample_count;
mix = _mix;
}
CvTrainTestSplit::CvTrainTestSplit( float _train_sample_portion, bool _mix )
{
train_sample_part_mode = CV_PORTION;
train_sample_part.portion = _train_sample_portion;
mix = _mix;
}
////////////////
CvMLData::CvMLData()
{
values = missing = var_types = var_idx_mask = response_out = var_idx_out = var_types_out = 0;
train_sample_idx = test_sample_idx = 0;
header_lines_number = 0;
sample_idx = 0;
response_idx = -1;
train_sample_count = -1;
delimiter = ',';
miss_ch = '?';
//flt_separator = '.';
rng = &cv::theRNG();
}
CvMLData::~CvMLData()
{
clear();
}
void CvMLData::free_train_test_idx()
{
cvReleaseMat( &train_sample_idx );
cvReleaseMat( &test_sample_idx );
sample_idx = 0;
}
void CvMLData::clear()
{
class_map.clear();
cvReleaseMat( &values );
cvReleaseMat( &missing );
cvReleaseMat( &var_types );
cvReleaseMat( &var_idx_mask );
cvReleaseMat( &response_out );
cvReleaseMat( &var_idx_out );
cvReleaseMat( &var_types_out );
free_train_test_idx();
total_class_count = 0;
response_idx = -1;
train_sample_count = -1;
}
void CvMLData::set_header_lines_number( int idx )
{
header_lines_number = std::max(0, idx);
}
int CvMLData::get_header_lines_number() const
{
return header_lines_number;
}
static char *fgets_chomp(char *str, int n, FILE *stream)
{
char *head = fgets(str, n, stream);
if( head )
{
for(char *tail = head + strlen(head) - 1; tail >= head; --tail)
{
if( *tail != '\r' && *tail != '\n' )
break;
*tail = '\0';
}
}
return head;
}
int CvMLData::read_csv(const char* filename)
{
const int M = 1000000;
const char str_delimiter[3] = { ' ', delimiter, '\0' };
FILE* file = 0;
CvMemStorage* storage;
CvSeq* seq;
char *ptr;
float* el_ptr;
CvSeqReader reader;
int cols_count = 0;
uchar *var_types_ptr = 0;
clear();
file = fopen( filename, "rt" );
if( !file )
return -1;
std::vector<char> _buf(M);
char* buf = &_buf[0];
// skip header lines
for( int i = 0; i < header_lines_number; i++ )
{
if( fgets( buf, M, file ) == 0 )
{
fclose(file);
return -1;
}
}
// read the first data line and determine the number of variables
if( !fgets_chomp( buf, M, file ))
{
fclose(file);
return -1;
}
ptr = buf;
while( *ptr == ' ' )
ptr++;
for( ; *ptr != '\0'; )
{
if(*ptr == delimiter || *ptr == ' ')
{
cols_count++;
ptr++;
while( *ptr == ' ' ) ptr++;
}
else
ptr++;
}
cols_count++;
if ( cols_count == 0)
{
fclose(file);
return -1;
}
// create temporary memory storage to store the whole database
el_ptr = new float[cols_count];
storage = cvCreateMemStorage();
seq = cvCreateSeq( 0, sizeof(*seq), cols_count*sizeof(float), storage );
var_types = cvCreateMat( 1, cols_count, CV_8U );
cvZero( var_types );
var_types_ptr = var_types->data.ptr;
for(;;)
{
char *token = NULL;
int type;
token = strtok(buf, str_delimiter);
if (!token)
break;
for (int i = 0; i < cols_count-1; i++)
{
str_to_flt_elem( token, el_ptr[i], type);
var_types_ptr[i] |= type;
token = strtok(NULL, str_delimiter);
if (!token)
{
fclose(file);
delete [] el_ptr;
return -1;
}
}
str_to_flt_elem( token, el_ptr[cols_count-1], type);
var_types_ptr[cols_count-1] |= type;
cvSeqPush( seq, el_ptr );
if( !fgets_chomp( buf, M, file ) )
break;
}
fclose(file);
values = cvCreateMat( seq->total, cols_count, CV_32FC1 );
missing = cvCreateMat( seq->total, cols_count, CV_8U );
var_idx_mask = cvCreateMat( 1, values->cols, CV_8UC1 );
cvSet( var_idx_mask, cvRealScalar(1) );
train_sample_count = seq->total;
cvStartReadSeq( seq, &reader );
for(int i = 0; i < seq->total; i++ )
{
const float* sdata = (float*)reader.ptr;
float* ddata = values->data.fl + cols_count*i;
uchar* dm = missing->data.ptr + cols_count*i;
for( int j = 0; j < cols_count; j++ )
{
ddata[j] = sdata[j];
dm[j] = ( fabs( MISS_VAL - sdata[j] ) <= FLT_EPSILON );
}
CV_NEXT_SEQ_ELEM( seq->elem_size, reader );
}
if ( cvNorm( missing, 0, CV_L1 ) <= FLT_EPSILON )
cvReleaseMat( &missing );
cvReleaseMemStorage( &storage );
delete []el_ptr;
return 0;
}
const CvMat* CvMLData::get_values() const
{
return values;
}
const CvMat* CvMLData::get_missing() const
{
CV_FUNCNAME( "CvMLData::get_missing" );
__BEGIN__;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
__END__;
return missing;
}
const std::map<cv::String, int>& CvMLData::get_class_labels_map() const
{
return class_map;
}
void CvMLData::str_to_flt_elem( const char* token, float& flt_elem, int& type)
{
char* stopstring = NULL;
flt_elem = (float)strtod( token, &stopstring );
assert( stopstring );
type = CV_VAR_ORDERED;
if ( *stopstring == miss_ch && strlen(stopstring) == 1 ) // missed value
{
flt_elem = MISS_VAL;
type = CV_VAR_MISS;
}
else
{
if ( (*stopstring != 0) && (*stopstring != '\n') && (strcmp(stopstring, "\r\n") != 0) ) // class label
{
int idx = class_map[token];
if ( idx == 0)
{
total_class_count++;
idx = total_class_count;
class_map[token] = idx;
}
flt_elem = (float)idx;
type = CV_VAR_CATEGORICAL;
}
}
}
void CvMLData::set_delimiter(char ch)
{
CV_FUNCNAME( "CvMLData::set_delimited" );
__BEGIN__;
if (ch == miss_ch /*|| ch == flt_separator*/)
CV_ERROR(CV_StsBadArg, "delimited, miss_character and flt_separator must be different");
delimiter = ch;
__END__;
}
char CvMLData::get_delimiter() const
{
return delimiter;
}
void CvMLData::set_miss_ch(char ch)
{
CV_FUNCNAME( "CvMLData::set_miss_ch" );
__BEGIN__;
if (ch == delimiter/* || ch == flt_separator*/)
CV_ERROR(CV_StsBadArg, "delimited, miss_character and flt_separator must be different");
miss_ch = ch;
__END__;
}
char CvMLData::get_miss_ch() const
{
return miss_ch;
}
void CvMLData::set_response_idx( int idx )
{
CV_FUNCNAME( "CvMLData::set_response_idx" );
__BEGIN__;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
if ( idx >= values->cols)
CV_ERROR( CV_StsBadArg, "idx value is not correct" );
if ( response_idx >= 0 )
chahge_var_idx( response_idx, true );
if ( idx >= 0 )
chahge_var_idx( idx, false );
response_idx = idx;
__END__;
}
int CvMLData::get_response_idx() const
{
CV_FUNCNAME( "CvMLData::get_response_idx" );
__BEGIN__;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
__END__;
return response_idx;
}
void CvMLData::change_var_type( int var_idx, int type )
{
CV_FUNCNAME( "CvMLData::change_var_type" );
__BEGIN__;
int var_count = 0;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
var_count = values->cols;
if ( var_idx < 0 || var_idx >= var_count)
CV_ERROR( CV_StsBadArg, "var_idx is not correct" );
if ( type != CV_VAR_ORDERED && type != CV_VAR_CATEGORICAL)
CV_ERROR( CV_StsBadArg, "type is not correct" );
assert( var_types );
if ( var_types->data.ptr[var_idx] == CV_VAR_CATEGORICAL && type == CV_VAR_ORDERED)
CV_ERROR( CV_StsBadArg, "it`s impossible to assign CV_VAR_ORDERED type to categorical variable" );
var_types->data.ptr[var_idx] = (uchar)type;
__END__;
return;
}
void CvMLData::set_var_types( const char* str )
{
CV_FUNCNAME( "CvMLData::set_var_types" );
__BEGIN__;
const char* ord = 0, *cat = 0;
int var_count = 0, set_var_type_count = 0;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
var_count = values->cols;
assert( var_types );
ord = strstr( str, "ord" );
cat = strstr( str, "cat" );
if ( !ord && !cat )
CV_ERROR( CV_StsBadArg, "types string is not correct" );
if ( !ord && strlen(cat) == 3 ) // str == "cat"
{
cvSet( var_types, cvScalarAll(CV_VAR_CATEGORICAL) );
return;
}
if ( !cat && strlen(ord) == 3 ) // str == "ord"
{
cvSet( var_types, cvScalarAll(CV_VAR_ORDERED) );
return;
}
if ( ord ) // parse ord str
{
char* stopstring = NULL;
if ( ord[3] != '[')
CV_ERROR( CV_StsBadArg, "types string is not correct" );
ord += 4; // pass "ord["
do
{
int b1 = (int)strtod( ord, &stopstring );
if ( *stopstring == 0 || (*stopstring != ',' && *stopstring != ']' && *stopstring != '-') )
CV_ERROR( CV_StsBadArg, "types string is not correct" );
ord = stopstring + 1;
if ( (stopstring[0] == ',') || (stopstring[0] == ']'))
{
if ( var_types->data.ptr[b1] == CV_VAR_CATEGORICAL)
CV_ERROR( CV_StsBadArg, "it`s impossible to assign CV_VAR_ORDERED type to categorical variable" );
var_types->data.ptr[b1] = CV_VAR_ORDERED;
set_var_type_count++;
}
else
{
if ( stopstring[0] == '-')
{
int b2 = (int)strtod( ord, &stopstring);
if ( (*stopstring == 0) || (*stopstring != ',' && *stopstring != ']') )
CV_ERROR( CV_StsBadArg, "types string is not correct" );
ord = stopstring + 1;
for (int i = b1; i <= b2; i++)
{
if ( var_types->data.ptr[i] == CV_VAR_CATEGORICAL)
CV_ERROR( CV_StsBadArg, "it`s impossible to assign CV_VAR_ORDERED type to categorical variable" );
var_types->data.ptr[i] = CV_VAR_ORDERED;
}
set_var_type_count += b2 - b1 + 1;
}
else
CV_ERROR( CV_StsBadArg, "types string is not correct" );
}
}
while (*stopstring != ']');
if ( stopstring[1] != '\0' && stopstring[1] != ',')
CV_ERROR( CV_StsBadArg, "types string is not correct" );
}
if ( cat ) // parse cat str
{
char* stopstring = NULL;
if ( cat[3] != '[')
CV_ERROR( CV_StsBadArg, "types string is not correct" );
cat += 4; // pass "cat["
do
{
int b1 = (int)strtod( cat, &stopstring );
if ( *stopstring == 0 || (*stopstring != ',' && *stopstring != ']' && *stopstring != '-') )
CV_ERROR( CV_StsBadArg, "types string is not correct" );
cat = stopstring + 1;
if ( (stopstring[0] == ',') || (stopstring[0] == ']'))
{
var_types->data.ptr[b1] = CV_VAR_CATEGORICAL;
set_var_type_count++;
}
else
{
if ( stopstring[0] == '-')
{
int b2 = (int)strtod( cat, &stopstring);
if ( (*stopstring == 0) || (*stopstring != ',' && *stopstring != ']') )
CV_ERROR( CV_StsBadArg, "types string is not correct" );
cat = stopstring + 1;
for (int i = b1; i <= b2; i++)
var_types->data.ptr[i] = CV_VAR_CATEGORICAL;
set_var_type_count += b2 - b1 + 1;
}
else
CV_ERROR( CV_StsBadArg, "types string is not correct" );
}
}
while (*stopstring != ']');
if ( stopstring[1] != '\0' && stopstring[1] != ',')
CV_ERROR( CV_StsBadArg, "types string is not correct" );
}
if (set_var_type_count != var_count)
CV_ERROR( CV_StsBadArg, "types string is not correct" );
__END__;
}
const CvMat* CvMLData::get_var_types()
{
CV_FUNCNAME( "CvMLData::get_var_types" );
__BEGIN__;
uchar *var_types_out_ptr = 0;
int avcount, vt_size;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
assert( var_idx_mask );
avcount = cvFloor( cvNorm( var_idx_mask, 0, CV_L1 ) );
vt_size = avcount + (response_idx >= 0);
if ( avcount == values->cols || (avcount == values->cols-1 && response_idx == values->cols-1) )
return var_types;
if ( !var_types_out || ( var_types_out && var_types_out->cols != vt_size ) )
{
cvReleaseMat( &var_types_out );
var_types_out = cvCreateMat( 1, vt_size, CV_8UC1 );
}
var_types_out_ptr = var_types_out->data.ptr;
for( int i = 0; i < var_types->cols; i++)
{
if (i == response_idx || !var_idx_mask->data.ptr[i]) continue;
*var_types_out_ptr = var_types->data.ptr[i];
var_types_out_ptr++;
}
if ( response_idx >= 0 )
*var_types_out_ptr = var_types->data.ptr[response_idx];
__END__;
return var_types_out;
}
int CvMLData::get_var_type( int var_idx ) const
{
return var_types->data.ptr[var_idx];
}
const CvMat* CvMLData::get_responses()
{
CV_FUNCNAME( "CvMLData::get_responses_ptr" );
__BEGIN__;
int var_count = 0;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
var_count = values->cols;
if ( response_idx < 0 || response_idx >= var_count )
return 0;
if ( !response_out )
response_out = cvCreateMatHeader( values->rows, 1, CV_32FC1 );
else
cvInitMatHeader( response_out, values->rows, 1, CV_32FC1);
cvGetCol( values, response_out, response_idx );
__END__;
return response_out;
}
void CvMLData::set_train_test_split( const CvTrainTestSplit * spl)
{
CV_FUNCNAME( "CvMLData::set_division" );
__BEGIN__;
int sample_count = 0;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
sample_count = values->rows;
float train_sample_portion;
if (spl->train_sample_part_mode == CV_COUNT)
{
train_sample_count = spl->train_sample_part.count;
if (train_sample_count > sample_count)
CV_ERROR( CV_StsBadArg, "train samples count is not correct" );
train_sample_count = train_sample_count<=0 ? sample_count : train_sample_count;
}
else // dtype.train_sample_part_mode == CV_PORTION
{
train_sample_portion = spl->train_sample_part.portion;
if ( train_sample_portion > 1)
CV_ERROR( CV_StsBadArg, "train samples count is not correct" );
train_sample_portion = train_sample_portion <= FLT_EPSILON ||
1 - train_sample_portion <= FLT_EPSILON ? 1 : train_sample_portion;
train_sample_count = std::max(1, cvFloor( train_sample_portion * sample_count ));
}
if ( train_sample_count == sample_count )
{
free_train_test_idx();
return;
}
if ( train_sample_idx && train_sample_idx->cols != train_sample_count )
free_train_test_idx();
if ( !sample_idx)
{
int test_sample_count = sample_count- train_sample_count;
sample_idx = (int*)cvAlloc( sample_count * sizeof(sample_idx[0]) );
for (int i = 0; i < sample_count; i++ )
sample_idx[i] = i;
train_sample_idx = cvCreateMatHeader( 1, train_sample_count, CV_32SC1 );
*train_sample_idx = cvMat( 1, train_sample_count, CV_32SC1, &sample_idx[0] );
CV_Assert(test_sample_count > 0);
test_sample_idx = cvCreateMatHeader( 1, test_sample_count, CV_32SC1 );
*test_sample_idx = cvMat( 1, test_sample_count, CV_32SC1, &sample_idx[train_sample_count] );
}
mix = spl->mix;
if ( mix )
mix_train_and_test_idx();
__END__;
}
const CvMat* CvMLData::get_train_sample_idx() const
{
CV_FUNCNAME( "CvMLData::get_train_sample_idx" );
__BEGIN__;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
__END__;
return train_sample_idx;
}
const CvMat* CvMLData::get_test_sample_idx() const
{
CV_FUNCNAME( "CvMLData::get_test_sample_idx" );
__BEGIN__;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
__END__;
return test_sample_idx;
}
void CvMLData::mix_train_and_test_idx()
{
CV_FUNCNAME( "CvMLData::mix_train_and_test_idx" );
__BEGIN__;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
__END__;
if ( !sample_idx)
return;
if ( train_sample_count > 0 && train_sample_count < values->rows )
{
int n = values->rows;
for (int i = 0; i < n; i++)
{
int a = (*rng)(n);
int b = (*rng)(n);
int t;
CV_SWAP( sample_idx[a], sample_idx[b], t );
}
}
}
const CvMat* CvMLData::get_var_idx()
{
CV_FUNCNAME( "CvMLData::get_var_idx" );
__BEGIN__;
int avcount = 0;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
assert( var_idx_mask );
avcount = cvFloor( cvNorm( var_idx_mask, 0, CV_L1 ) );
int* vidx;
if ( avcount == values->cols )
return 0;
if ( !var_idx_out || ( var_idx_out && var_idx_out->cols != avcount ) )
{
cvReleaseMat( &var_idx_out );
var_idx_out = cvCreateMat( 1, avcount, CV_32SC1);
if ( response_idx >=0 )
var_idx_mask->data.ptr[response_idx] = 0;
}
vidx = var_idx_out->data.i;
for(int i = 0; i < var_idx_mask->cols; i++)
if ( var_idx_mask->data.ptr[i] )
{
*vidx = i;
vidx++;
}
__END__;
return var_idx_out;
}
void CvMLData::chahge_var_idx( int vi, bool state )
{
change_var_idx( vi, state );
}
void CvMLData::change_var_idx( int vi, bool state )
{
CV_FUNCNAME( "CvMLData::change_var_idx" );
__BEGIN__;
int var_count = 0;
if ( !values )
CV_ERROR( CV_StsInternal, "data is empty" );
var_count = values->cols;
if ( vi < 0 || vi >= var_count)
CV_ERROR( CV_StsBadArg, "variable index is not correct" );
assert( var_idx_mask );
var_idx_mask->data.ptr[vi] = state;
__END__;
}
/* End of file. */
File diff suppressed because it is too large Load Diff
+376
View File
@@ -0,0 +1,376 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__
#include "opencv2/core.hpp"
#include "old_ml.hpp"
#include "opencv2/core/core_c.h"
#include "opencv2/core/utility.hpp"
#include "opencv2/core/private.hpp"
#include <assert.h>
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#define ML_IMPL CV_IMPL
#define __BEGIN__ __CV_BEGIN__
#define __END__ __CV_END__
#define EXIT __CV_EXIT__
#define CV_MAT_ELEM_FLAG( mat, type, comp, vect, tflag ) \
(( tflag == CV_ROW_SAMPLE ) \
? (CV_MAT_ELEM( mat, type, comp, vect )) \
: (CV_MAT_ELEM( mat, type, vect, comp )))
/* Convert matrix to vector */
#define ICV_MAT2VEC( mat, vdata, vstep, num ) \
if( MIN( (mat).rows, (mat).cols ) != 1 ) \
CV_ERROR( CV_StsBadArg, "" ); \
(vdata) = ((mat).data.ptr); \
if( (mat).rows == 1 ) \
{ \
(vstep) = CV_ELEM_SIZE( (mat).type ); \
(num) = (mat).cols; \
} \
else \
{ \
(vstep) = (mat).step; \
(num) = (mat).rows; \
}
/* get raw data */
#define ICV_RAWDATA( mat, flags, rdata, sstep, cstep, m, n ) \
(rdata) = (mat).data.ptr; \
if( CV_IS_ROW_SAMPLE( flags ) ) \
{ \
(sstep) = (mat).step; \
(cstep) = CV_ELEM_SIZE( (mat).type ); \
(m) = (mat).rows; \
(n) = (mat).cols; \
} \
else \
{ \
(cstep) = (mat).step; \
(sstep) = CV_ELEM_SIZE( (mat).type ); \
(n) = (mat).rows; \
(m) = (mat).cols; \
}
#define ICV_IS_MAT_OF_TYPE( mat, mat_type) \
(CV_IS_MAT( mat ) && CV_MAT_TYPE( mat->type ) == (mat_type) && \
(mat)->cols > 0 && (mat)->rows > 0)
/*
uchar* data; int sstep, cstep; - trainData->data
uchar* classes; int clstep; int ncl;- trainClasses
uchar* tmask; int tmstep; int ntm; - typeMask
uchar* missed;int msstep, mcstep; -missedMeasurements...
int mm, mn; == m,n == size,dim
uchar* sidx;int sistep; - sampleIdx
uchar* cidx;int cistep; - compIdx
int k, l; == n,m == dim,size (length of cidx, sidx)
int m, n; == size,dim
*/
#define ICV_DECLARE_TRAIN_ARGS() \
uchar* data; \
int sstep, cstep; \
uchar* classes; \
int clstep; \
int ncl; \
uchar* tmask; \
int tmstep; \
int ntm; \
uchar* missed; \
int msstep, mcstep; \
int mm, mn; \
uchar* sidx; \
int sistep; \
uchar* cidx; \
int cistep; \
int k, l; \
int m, n; \
\
data = classes = tmask = missed = sidx = cidx = NULL; \
sstep = cstep = clstep = ncl = tmstep = ntm = msstep = mcstep = mm = mn = 0; \
sistep = cistep = k = l = m = n = 0;
#define ICV_TRAIN_DATA_REQUIRED( param, flags ) \
if( !ICV_IS_MAT_OF_TYPE( (param), CV_32FC1 ) ) \
{ \
CV_ERROR( CV_StsBadArg, "Invalid " #param " parameter" ); \
} \
else \
{ \
ICV_RAWDATA( *(param), (flags), data, sstep, cstep, m, n ); \
k = n; \
l = m; \
}
#define ICV_TRAIN_CLASSES_REQUIRED( param ) \
if( !ICV_IS_MAT_OF_TYPE( (param), CV_32FC1 ) ) \
{ \
CV_ERROR( CV_StsBadArg, "Invalid " #param " parameter" ); \
} \
else \
{ \
ICV_MAT2VEC( *(param), classes, clstep, ncl ); \
if( m != ncl ) \
{ \
CV_ERROR( CV_StsBadArg, "Unmatched sizes" ); \
} \
}
#define ICV_ARG_NULL( param ) \
if( (param) != NULL ) \
{ \
CV_ERROR( CV_StsBadArg, #param " parameter must be NULL" ); \
}
#define ICV_MISSED_MEASUREMENTS_OPTIONAL( param, flags ) \
if( param ) \
{ \
if( !ICV_IS_MAT_OF_TYPE( param, CV_8UC1 ) ) \
{ \
CV_ERROR( CV_StsBadArg, "Invalid " #param " parameter" ); \
} \
else \
{ \
ICV_RAWDATA( *(param), (flags), missed, msstep, mcstep, mm, mn ); \
if( mm != m || mn != n ) \
{ \
CV_ERROR( CV_StsBadArg, "Unmatched sizes" ); \
} \
} \
}
#define ICV_COMP_IDX_OPTIONAL( param ) \
if( param ) \
{ \
if( !ICV_IS_MAT_OF_TYPE( param, CV_32SC1 ) ) \
{ \
CV_ERROR( CV_StsBadArg, "Invalid " #param " parameter" ); \
} \
else \
{ \
ICV_MAT2VEC( *(param), cidx, cistep, k ); \
if( k > n ) \
CV_ERROR( CV_StsBadArg, "Invalid " #param " parameter" ); \
} \
}
#define ICV_SAMPLE_IDX_OPTIONAL( param ) \
if( param ) \
{ \
if( !ICV_IS_MAT_OF_TYPE( param, CV_32SC1 ) ) \
{ \
CV_ERROR( CV_StsBadArg, "Invalid " #param " parameter" ); \
} \
else \
{ \
ICV_MAT2VEC( *sampleIdx, sidx, sistep, l ); \
if( l > m ) \
CV_ERROR( CV_StsBadArg, "Invalid " #param " parameter" ); \
} \
}
/****************************************************************************************/
#define ICV_CONVERT_FLOAT_ARRAY_TO_MATRICE( array, matrice ) \
{ \
CvMat a, b; \
int dims = (matrice)->cols; \
int nsamples = (matrice)->rows; \
int type = CV_MAT_TYPE((matrice)->type); \
int i, offset = dims; \
\
CV_ASSERT( type == CV_32FC1 || type == CV_64FC1 ); \
offset *= ((type == CV_32FC1) ? sizeof(float) : sizeof(double));\
\
b = cvMat( 1, dims, CV_32FC1 ); \
cvGetRow( matrice, &a, 0 ); \
for( i = 0; i < nsamples; i++, a.data.ptr += offset ) \
{ \
b.data.fl = (float*)array[i]; \
CV_CALL( cvConvert( &b, &a ) ); \
} \
}
/****************************************************************************************\
* Auxiliary functions declarations *
\****************************************************************************************/
/* Generates a set of classes centers in quantity <num_of_clusters> that are generated as
uniform random vectors in parallelepiped, where <data> is concentrated. Vectors in
<data> should have horizontal orientation. If <centers> != NULL, the function doesn't
allocate any memory and stores generated centers in <centers>, returns <centers>.
If <centers> == NULL, the function allocates memory and creates the matrice. Centers
are supposed to be oriented horizontally. */
CvMat* icvGenerateRandomClusterCenters( int seed,
const CvMat* data,
int num_of_clusters,
CvMat* centers CV_DEFAULT(0));
/* Fills the <labels> using <probs> by choosing the maximal probability. Outliers are
fixed by <oulier_tresh> and have cluster label (-1). Function also controls that there
weren't "empty" clusters by filling empty clusters with the maximal probability vector.
If probs_sums != NULL, filles it with the sums of probabilities for each sample (it is
useful for normalizing probabilities' matrice of FCM) */
void icvFindClusterLabels( const CvMat* probs, float outlier_thresh, float r,
const CvMat* labels );
typedef struct CvSparseVecElem32f
{
int idx;
float val;
}
CvSparseVecElem32f;
/* Prepare training data and related parameters */
#define CV_TRAIN_STATMODEL_DEFRAGMENT_TRAIN_DATA 1
#define CV_TRAIN_STATMODEL_SAMPLES_AS_ROWS 2
#define CV_TRAIN_STATMODEL_SAMPLES_AS_COLUMNS 4
#define CV_TRAIN_STATMODEL_CATEGORICAL_RESPONSE 8
#define CV_TRAIN_STATMODEL_ORDERED_RESPONSE 16
#define CV_TRAIN_STATMODEL_RESPONSES_ON_OUTPUT 32
#define CV_TRAIN_STATMODEL_ALWAYS_COPY_TRAIN_DATA 64
#define CV_TRAIN_STATMODEL_SPARSE_AS_SPARSE 128
int
cvPrepareTrainData( const char* /*funcname*/,
const CvMat* train_data, int tflag,
const CvMat* responses, int response_type,
const CvMat* var_idx,
const CvMat* sample_idx,
bool always_copy_data,
const float*** out_train_samples,
int* _sample_count,
int* _var_count,
int* _var_all,
CvMat** out_responses,
CvMat** out_response_map,
CvMat** out_var_idx,
CvMat** out_sample_idx=0 );
void
cvSortSamplesByClasses( const float** samples, const CvMat* classes,
int* class_ranges, const uchar** mask CV_DEFAULT(0) );
void
cvCombineResponseMaps (CvMat* _responses,
const CvMat* old_response_map,
CvMat* new_response_map,
CvMat** out_response_map);
void
cvPreparePredictData( const CvArr* sample, int dims_all, const CvMat* comp_idx,
int class_count, const CvMat* prob, float** row_sample,
int as_sparse CV_DEFAULT(0) );
/* copies clustering [or batch "predict"] results
(labels and/or centers and/or probs) back to the output arrays */
void
cvWritebackLabels( const CvMat* labels, CvMat* dst_labels,
const CvMat* centers, CvMat* dst_centers,
const CvMat* probs, CvMat* dst_probs,
const CvMat* sample_idx, int samples_all,
const CvMat* comp_idx, int dims_all );
#define cvWritebackResponses cvWritebackLabels
#define XML_FIELD_NAME "_name"
CvFileNode* icvFileNodeGetChild(CvFileNode* father, const char* name);
CvFileNode* icvFileNodeGetChildArrayElem(CvFileNode* father, const char* name,int index);
CvFileNode* icvFileNodeGetNext(CvFileNode* n, const char* name);
void cvCheckTrainData( const CvMat* train_data, int tflag,
const CvMat* missing_mask,
int* var_all, int* sample_all );
CvMat* cvPreprocessIndexArray( const CvMat* idx_arr, int data_arr_size, bool check_for_duplicates=false );
CvMat* cvPreprocessVarType( const CvMat* type_mask, const CvMat* var_idx,
int var_all, int* response_type );
CvMat* cvPreprocessOrderedResponses( const CvMat* responses,
const CvMat* sample_idx, int sample_all );
CvMat* cvPreprocessCategoricalResponses( const CvMat* responses,
const CvMat* sample_idx, int sample_all,
CvMat** out_response_map, CvMat** class_counts=0 );
const float** cvGetTrainSamples( const CvMat* train_data, int tflag,
const CvMat* var_idx, const CvMat* sample_idx,
int* _var_count, int* _sample_count,
bool always_copy_data=false );
namespace cv
{
struct DTreeBestSplitFinder
{
DTreeBestSplitFinder(){ splitSize = 0, tree = 0; node = 0; }
DTreeBestSplitFinder( CvDTree* _tree, CvDTreeNode* _node);
DTreeBestSplitFinder( const DTreeBestSplitFinder& finder, Split );
virtual ~DTreeBestSplitFinder() {}
virtual void operator()(const BlockedRange& range);
void join( DTreeBestSplitFinder& rhs );
Ptr<CvDTreeSplit> bestSplit;
Ptr<CvDTreeSplit> split;
int splitSize;
CvDTree* tree;
CvDTreeNode* node;
};
struct ForestTreeBestSplitFinder : DTreeBestSplitFinder
{
ForestTreeBestSplitFinder() : DTreeBestSplitFinder() {}
ForestTreeBestSplitFinder( CvForestTree* _tree, CvDTreeNode* _node );
ForestTreeBestSplitFinder( const ForestTreeBestSplitFinder& finder, Split );
virtual void operator()(const BlockedRange& range);
};
}
#endif /* __ML_H__ */
File diff suppressed because it is too large Load Diff
+7 -2
View File
@@ -1,6 +1,4 @@
#include "opencv2/core.hpp"
#include "cv.h"
#include "cascadeclassifier.h"
using namespace std;
@@ -13,6 +11,7 @@ int main( int argc, char* argv[] )
int numPos = 2000;
int numNeg = 1000;
int numStages = 20;
int numThreads = getNumThreads();
int precalcValBufSize = 256,
precalcIdxBufSize = 256;
bool baseFormatSave = false;
@@ -36,6 +35,7 @@ int main( int argc, char* argv[] )
cout << " [-precalcValBufSize <precalculated_vals_buffer_size_in_Mb = " << precalcValBufSize << ">]" << endl;
cout << " [-precalcIdxBufSize <precalculated_idxs_buffer_size_in_Mb = " << precalcIdxBufSize << ">]" << endl;
cout << " [-baseFormatSave]" << endl;
cout << " [-numThreads <max_number_of_threads = " << numThreads << ">]" << endl;
cascadeParams.printDefaults();
stageParams.printDefaults();
for( int fi = 0; fi < fc; fi++ )
@@ -82,6 +82,10 @@ int main( int argc, char* argv[] )
{
baseFormatSave = true;
}
else if( !strcmp( argv[i], "-numThreads" ) )
{
numThreads = atoi(argv[++i]);
}
else if ( cascadeParams.scanAttr( argv[i], argv[i+1] ) ) { i++; }
else if ( stageParams.scanAttr( argv[i], argv[i+1] ) ) { i++; }
else if ( !set )
@@ -98,6 +102,7 @@ int main( int argc, char* argv[] )
}
}
setNumThreads( numThreads );
classifier.train( cascadeDirName,
vecName,
bgName,
@@ -2,9 +2,6 @@
#define _OPENCV_FEATURES_H_
#include "imagestorage.h"
#include "cxcore.h"
#include "cv.h"
#include "ml.h"
#include <stdio.h>
#define FEATURES "features"
+5
View File
@@ -185,6 +185,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_extra_compiler_option(-ffunction-sections)
endif()
if(ENABLE_COVERAGE)
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} --coverage")
set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} --coverage")
endif()
set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} -DNDEBUG")
set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -O0 -DDEBUG -D_DEBUG")
endif()
+1 -1
View File
@@ -11,7 +11,7 @@
#
# Or you can search for specific OpenCV modules:
#
# FIND_PACKAGE(OpenCV REQUIRED core highgui)
# FIND_PACKAGE(OpenCV REQUIRED core imgcodecs)
#
# If the module is found then OPENCV_<MODULE>_FOUND is set to TRUE.
#
+14 -5
View File
@@ -280,9 +280,6 @@ macro(add_android_project target path)
string(REGEX REPLACE "LOCAL_MODULE[ ]*:=[ ]*([a-zA-Z_][a-zA-Z_0-9]*)[ ]*" "\\1" JNI_LIB_NAME "${JNI_LIB_NAME}")
if(JNI_LIB_NAME)
ocv_include_modules_recurse(${android_proj_NATIVE_DEPS})
ocv_include_directories("${path}/jni")
if(NATIVE_APP_GLUE)
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
list(APPEND android_proj_jni_files ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
@@ -291,7 +288,9 @@ macro(add_android_project target path)
endif()
add_library(${JNI_LIB_NAME} MODULE ${android_proj_jni_files})
target_link_libraries(${JNI_LIB_NAME} ${OPENCV_LINKER_LIBS} ${android_proj_NATIVE_DEPS})
ocv_target_include_modules_recurse(${JNI_LIB_NAME} ${android_proj_NATIVE_DEPS})
ocv_target_include_directories(${JNI_LIB_NAME} "${path}/jni")
ocv_target_link_libraries(${JNI_LIB_NAME} ${OPENCV_LINKER_LIBS} ${android_proj_NATIVE_DEPS})
set_target_properties(${JNI_LIB_NAME} PROPERTIES
OUTPUT_NAME "${JNI_LIB_NAME}"
@@ -335,6 +334,16 @@ macro(add_android_project target path)
add_dependencies(${target} ${android_proj_native_deps})
endif()
if(ANDROID_EXAMPLES_WITH_LIBS)
add_custom_target(
${target}_copy_libs
COMMAND ${CMAKE_COMMAND} -DSRC_DIR=${OpenCV_BINARY_DIR}/lib -DDST_DIR=${android_proj_bin_dir}/libs -P ${OpenCV_SOURCE_DIR}/cmake/copyAndroidLibs.cmake
WORKING_DIRECTORY ${OpenCV_BINARY_DIR}/lib
DEPENDS "${OpenCV_BINARY_DIR}/bin/classes.jar.dephelper" opencv_java
)
add_dependencies(${target} ${target}_copy_libs)
endif()
if(__android_project_chain)
add_dependencies(${target} ${__android_project_chain})
endif()
@@ -365,7 +374,7 @@ macro(add_android_project target path)
endif()
install(CODE "EXECUTE_PROCESS(COMMAND ${ANDROID_EXECUTABLE} --silent update project --path . --target \"${android_proj_sdk_target}\" --name \"${target}\" ${inst_lib_opt}
WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}\"
)" COMPONENT dev)
)" COMPONENT samples)
#empty 'gen'
install(CODE "MAKE_DIRECTORY(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}/gen\")" COMPONENT samples)
endif()
+43 -3
View File
@@ -178,9 +178,8 @@ if(CUDA_FOUND)
# we remove -Wsign-promo as it generates warnings under linux
string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
# we remove -fvisibility-inlines-hidden because it's used for C++ compiler
# but NVCC uses C compiler by default
string(REPLACE "-fvisibility-inlines-hidden" "" ${var} "${${var}}")
# we remove -Wno-sign-promo as it generates warnings under linux
string(REPLACE "-Wno-sign-promo" "" ${var} "${${var}}")
# we remove -Wno-delete-non-virtual-dtor because it's used for C++ compiler
# but NVCC uses C compiler by default
@@ -189,6 +188,8 @@ if(CUDA_FOUND)
# we remove -frtti because it's used for C++ compiler
# but NVCC uses C compiler by default
string(REPLACE "-frtti" "" ${var} "${${var}}")
string(REPLACE "-fvisibility-inlines-hidden" "" ${var} "${${var}}")
endforeach()
if(BUILD_SHARED_LIBS)
@@ -218,3 +219,42 @@ else()
unset(CUDA_ARCH_BIN CACHE)
unset(CUDA_ARCH_PTX CACHE)
endif()
if(HAVE_CUDA)
set(CUDA_LIBS_PATH "")
foreach(p ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
get_filename_component(_tmp ${p} PATH)
list(APPEND CUDA_LIBS_PATH ${_tmp})
endforeach()
if(HAVE_CUBLAS)
foreach(p ${CUDA_cublas_LIBRARY})
get_filename_component(_tmp ${p} PATH)
list(APPEND CUDA_LIBS_PATH ${_tmp})
endforeach()
endif()
if(HAVE_CUFFT)
foreach(p ${CUDA_cufft_LIBRARY})
get_filename_component(_tmp ${p} PATH)
list(APPEND CUDA_LIBS_PATH ${_tmp})
endforeach()
endif()
list(REMOVE_DUPLICATES CUDA_LIBS_PATH)
link_directories(${CUDA_LIBS_PATH})
set(CUDA_LIBRARIES_ABS ${CUDA_LIBRARIES})
ocv_convert_to_lib_name(CUDA_LIBRARIES ${CUDA_LIBRARIES})
set(CUDA_npp_LIBRARY_ABS ${CUDA_npp_LIBRARY})
ocv_convert_to_lib_name(CUDA_npp_LIBRARY ${CUDA_npp_LIBRARY})
if(HAVE_CUBLAS)
set(CUDA_cublas_LIBRARY_ABS ${CUDA_cublas_LIBRARY})
ocv_convert_to_lib_name(CUDA_cublas_LIBRARY ${CUDA_cublas_LIBRARY})
endif()
if(HAVE_CUFFT)
set(CUDA_cufft_LIBRARY_ABS ${CUDA_cufft_LIBRARY})
ocv_convert_to_lib_name(CUDA_cufft_LIBRARY ${CUDA_cufft_LIBRARY})
endif()
endif()
+233 -94
View File
@@ -1,101 +1,240 @@
if(WIN32 AND NOT PYTHON_EXECUTABLE)
# search for executable with the same bitness as resulting binaries
# standard FindPythonInterp always prefers executable from system path
# this is really important because we are using the interpreter for numpy search and for choosing the install location
foreach(_CURRENT_VERSION ${Python_ADDITIONAL_VERSIONS} 2.7 "${MIN_VER_PYTHON}")
find_host_program(PYTHON_EXECUTABLE
NAMES python${_CURRENT_VERSION} python
PATHS
[HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\${_CURRENT_VERSION}\\\\InstallPath]
[HKEY_CURRENT_USER\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\${_CURRENT_VERSION}\\\\InstallPath]
NO_SYSTEM_ENVIRONMENT_PATH
)
endforeach()
endif()
find_host_package(PythonInterp 2.7)
if(NOT PYTHONINTERP_FOUND)
find_host_package(PythonInterp "${MIN_VER_PYTHON}")
# Find specified Python version
# Arguments:
# preferred_version (value): Version to check for first
# min_version (value): Minimum supported version
# library_env (value): Name of Python library ENV variable to check
# include_dir_env (value): Name of Python include directory ENV variable to check
# found (variable): Set if interpreter found
# executable (variable): Output of executable found
# version_string (variable): Output of found version
# version_major (variable): Output of found major version
# version_minor (variable): Output of found minor version
# libs_found (variable): Set if libs found
# libs_version_string (variable): Output of found libs version
# libraries (variable): Output of found Python libraries
# library (variable): Output of found Python library
# debug_libraries (variable): Output of found Python debug libraries
# debug_library (variable): Output of found Python debug library
# include_path (variable): Output of found Python include path
# include_dir (variable): Output of found Python include dir
# include_dir2 (variable): Output of found Python include dir2
# packages_path (variable): Output of found Python packages path
# numpy_include_dirs (variable): Output of found Python Numpy include dirs
# numpy_version (variable): Output of found Python Numpy version
function(find_python preferred_version min_version library_env include_dir_env
found executable version_string version_major version_minor
libs_found libs_version_string libraries library debug_libraries
debug_library include_path include_dir include_dir2 packages_path
numpy_include_dirs numpy_version)
ocv_check_environment_variables(${executable})
if(${executable})
set(PYTHON_EXECUTABLE "${${executable}}")
endif()
if(WIN32 AND NOT ${executable})
# search for executable with the same bitness as resulting binaries
# standard FindPythonInterp always prefers executable from system path
# this is really important because we are using the interpreter for numpy search and for choosing the install location
foreach(_CURRENT_VERSION ${Python_ADDITIONAL_VERSIONS} "${preferred_version}" "${min_version}")
find_host_program(executable
NAMES python${_CURRENT_VERSION} python
PATHS
[HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\${_CURRENT_VERSION}\\\\InstallPath]
[HKEY_CURRENT_USER\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\${_CURRENT_VERSION}\\\\InstallPath]
NO_SYSTEM_ENVIRONMENT_PATH
)
endforeach()
endif()
find_host_package(PythonInterp "${preferred_version}")
if(NOT PYTHONINTERP_FOUND)
find_host_package(PythonInterp "${min_version}")
endif()
if(PYTHONINTERP_FOUND)
# Copy outputs
set(_found ${PYTHONINTERP_FOUND})
set(_executable ${PYTHON_EXECUTABLE})
set(_version_string ${PYTHON_VERSION_STRING})
set(_version_major ${PYTHON_VERSION_MAJOR})
set(_version_minor ${PYTHON_VERSION_MINOR})
set(_version_patch ${PYTHON_VERSION_PATCH})
# Clear find_host_package side effects
unset(PYTHONINTERP_FOUND)
unset(PYTHON_EXECUTABLE CACHE)
unset(PYTHON_VERSION_STRING)
unset(PYTHON_VERSION_MAJOR)
unset(PYTHON_VERSION_MINOR)
unset(PYTHON_VERSION_PATCH)
endif()
if(_found)
set(_version_major_minor "${_version_major}.${_version_minor}")
if(NOT ANDROID AND NOT IOS)
ocv_check_environment_variables(${library_env} ${include_dir_env})
if(${library})
set(PYTHON_LIBRARY "${${library_env}}")
endif()
if(${include_dir})
set(PYTHON_INCLUDE_DIR "${${include_dir_env}}")
endif()
# not using _version_string here, because it might not conform to the CMake version format
find_host_package(PythonLibs "${_version_major_minor}.${_version_patch}" EXACT)
if(PYTHONLIBS_FOUND)
# Copy outputs
set(_libs_found ${PYTHONLIBS_FOUND})
set(_libraries ${PYTHON_LIBRARIES})
set(_include_path ${PYTHON_INCLUDE_PATH})
set(_include_dirs ${PYTHON_INCLUDE_DIRS})
set(_debug_libraries ${PYTHON_DEBUG_LIBRARIES})
set(_libs_version_string ${PYTHONLIBS_VERSION_STRING})
set(_debug_library ${PYTHON_DEBUG_LIBRARY})
set(_library ${PYTHON_LIBRARY})
set(_library_debug ${PYTHON_LIBRARY_DEBUG})
set(_library_release ${PYTHON_LIBRARY_RELEASE})
set(_include_dir ${PYTHON_INCLUDE_DIR})
set(_include_dir2 ${PYTHON_INCLUDE_DIR2})
# Clear find_host_package side effects
unset(PYTHONLIBS_FOUND)
unset(PYTHON_LIBRARIES)
unset(PYTHON_INCLUDE_PATH)
unset(PYTHON_INCLUDE_DIRS)
unset(PYTHON_DEBUG_LIBRARIES)
unset(PYTHONLIBS_VERSION_STRING)
unset(PYTHON_DEBUG_LIBRARY CACHE)
unset(PYTHON_LIBRARY)
unset(PYTHON_LIBRARY_DEBUG)
unset(PYTHON_LIBRARY_RELEASE)
unset(PYTHON_LIBRARY CACHE)
unset(PYTHON_LIBRARY_DEBUG CACHE)
unset(PYTHON_LIBRARY_RELEASE CACHE)
unset(PYTHON_INCLUDE_DIR CACHE)
unset(PYTHON_INCLUDE_DIR2 CACHE)
endif()
endif()
if(NOT ANDROID AND NOT IOS)
if(CMAKE_HOST_UNIX)
execute_process(COMMAND ${_executable} -c "from distutils.sysconfig import *; print(get_python_lib())"
RESULT_VARIABLE _cvpy_process
OUTPUT_VARIABLE _std_packages_path
OUTPUT_STRIP_TRAILING_WHITESPACE)
if("${_std_packages_path}" MATCHES "site-packages")
set(_packages_path "python${_version_major_minor}/site-packages")
else() #debian based assumed, install to the dist-packages.
set(_packages_path "python${_version_major_minor}/dist-packages")
endif()
if(EXISTS "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${${packages_path}}")
set(_packages_path "lib${LIB_SUFFIX}/${_packages_path}")
else()
set(_packages_path "lib/${_packages_path}")
endif()
elseif(CMAKE_HOST_WIN32)
get_filename_component(_path "${_executable}" PATH)
file(TO_CMAKE_PATH "${_path}" _path)
if(NOT EXISTS "${_path}/Lib/site-packages")
unset(_path)
get_filename_component(_path "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_version_major_minor}\\InstallPath]" ABSOLUTE)
if(NOT _path)
get_filename_component(_path "[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_version_major_minor}\\InstallPath]" ABSOLUTE)
endif()
file(TO_CMAKE_PATH "${_path}" _path)
endif()
set(_packages_path "${_path}/Lib/site-packages")
unset(_path)
endif()
set(_numpy_include_dirs ${${numpy_include_dirs}})
if(NOT _numpy_include_dirs)
if(CMAKE_CROSSCOMPILING)
message(STATUS "Cannot probe for Python/Numpy support (because we are cross-compiling OpenCV)")
message(STATUS "If you want to enable Python/Numpy support, set the following variables:")
message(STATUS " PYTHON2_INCLUDE_PATH")
message(STATUS " PYTHON2_LIBRARIES")
message(STATUS " PYTHON2_NUMPY_INCLUDE_DIRS")
message(STATUS " PYTHON3_INCLUDE_PATH")
message(STATUS " PYTHON3_LIBRARIES")
message(STATUS " PYTHON3_NUMPY_INCLUDE_DIRS")
else()
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
execute_process(COMMAND "${_executable}" -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print(os.pathsep.join(numpy.distutils.misc_util.get_numpy_include_dirs()))"
RESULT_VARIABLE _numpy_process
OUTPUT_VARIABLE _numpy_include_dirs
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT _numpy_process EQUAL 0)
unset(_numpy_include_dirs)
endif()
endif()
endif()
if(_numpy_include_dirs)
file(TO_CMAKE_PATH "${_numpy_include_dirs}" _numpy_include_dirs)
if(CMAKE_CROSSCOMPILING)
if(NOT _numpy_version)
set(_numpy_version "undefined - cannot be probed because of the cross-compilation")
endif()
else()
execute_process(COMMAND "${_executable}" -c "import numpy; print(numpy.version.version)"
RESULT_VARIABLE _numpy_process
OUTPUT_VARIABLE _numpy_version
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
endif()
endif(NOT ANDROID AND NOT IOS)
endif()
# Export return values
set(${found} "${_found}" PARENT_SCOPE)
set(${executable} "${_executable}" CACHE FILEPATH "Path to Python interpretor")
set(${version_string} "${_version_string}" PARENT_SCOPE)
set(${version_major} "${_version_major}" PARENT_SCOPE)
set(${version_minor} "${_version_minor}" PARENT_SCOPE)
set(${libs_found} "${_libs_found}" PARENT_SCOPE)
set(${libs_version_string} "${_libs_version_string}" PARENT_SCOPE)
set(${libraries} "${_libraries}" PARENT_SCOPE)
set(${library} "${_library}" CACHE FILEPATH "Path to Python library")
set(${debug_libraries} "${_debug_libraries}" PARENT_SCOPE)
set(${debug_library} "${_debug_library}" CACHE FILEPATH "Path to Python debug")
set(${include_path} "${_include_path}" PARENT_SCOPE)
set(${include_dir} "${_include_dir}" CACHE PATH "Python include dir")
set(${include_dir2} "${_include_dir2}" CACHE PATH "Python include dir 2")
set(${packages_path} "${_packages_path}" CACHE PATH "Where to install the python packages.")
set(${numpy_include_dirs} ${_numpy_include_dirs} CACHE PATH "Path to numpy headers")
set(${numpy_version} "${_numpy_version}" PARENT_SCOPE)
endfunction(find_python)
find_python(2.7 "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR
PYTHON2INTERP_FOUND PYTHON2_EXECUTABLE PYTHON2_VERSION_STRING
PYTHON2_VERSION_MAJOR PYTHON2_VERSION_MINOR PYTHON2LIBS_FOUND
PYTHON2LIBS_VERSION_STRING PYTHON2_LIBRARIES PYTHON2_LIBRARY
PYTHON2_DEBUG_LIBRARIES PYTHON2_LIBRARY_DEBUG PYTHON2_INCLUDE_PATH
PYTHON2_INCLUDE_DIR PYTHON2_INCLUDE_DIR2 PYTHON2_PACKAGES_PATH
PYTHON2_NUMPY_INCLUDE_DIRS PYTHON2_NUMPY_VERSION)
find_python(3.4 "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR
PYTHON3INTERP_FOUND PYTHON3_EXECUTABLE PYTHON3_VERSION_STRING
PYTHON3_VERSION_MAJOR PYTHON3_VERSION_MINOR PYTHON3LIBS_FOUND
PYTHON3LIBS_VERSION_STRING PYTHON3_LIBRARIES PYTHON3_LIBRARY
PYTHON3_DEBUG_LIBRARIES PYTHON3_LIBRARY_DEBUG PYTHON3_INCLUDE_PATH
PYTHON3_INCLUDE_DIR PYTHON3_INCLUDE_DIR2 PYTHON3_PACKAGES_PATH
PYTHON3_NUMPY_INCLUDE_DIRS PYTHON3_NUMPY_VERSION)
# Use Python 2 as default Python interpreter
if(PYTHON2LIBS_FOUND)
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON2_EXECUTABLE}")
endif()
unset(HAVE_SPHINX CACHE)
if(PYTHONINTERP_FOUND)
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
if(NOT ANDROID AND NOT IOS)
ocv_check_environment_variables(PYTHON_LIBRARY PYTHON_INCLUDE_DIR)
# not using PYTHON_VERSION_STRING here, because it might not conform to the CMake version format
find_host_package(PythonLibs "${PYTHON_VERSION_MAJOR_MINOR}.${PYTHON_VERSION_PATCH}" EXACT)
endif()
if(NOT ANDROID AND NOT IOS)
if(CMAKE_HOST_UNIX)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import *; print(get_python_lib())"
RESULT_VARIABLE PYTHON_CVPY_PROCESS
OUTPUT_VARIABLE PYTHON_STD_PACKAGES_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
if("${PYTHON_STD_PACKAGES_PATH}" MATCHES "site-packages")
set(_PYTHON_PACKAGES_PATH "python${PYTHON_VERSION_MAJOR_MINOR}/site-packages")
else() #debian based assumed, install to the dist-packages.
set(_PYTHON_PACKAGES_PATH "python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages")
endif()
if(EXISTS "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${PYTHON_PACKAGES_PATH}")
set(_PYTHON_PACKAGES_PATH "lib${LIB_SUFFIX}/${_PYTHON_PACKAGES_PATH}")
else()
set(_PYTHON_PACKAGES_PATH "lib/${_PYTHON_PACKAGES_PATH}")
endif()
elseif(CMAKE_HOST_WIN32)
get_filename_component(PYTHON_PATH "${PYTHON_EXECUTABLE}" PATH)
file(TO_CMAKE_PATH "${PYTHON_PATH}" PYTHON_PATH)
if(NOT EXISTS "${PYTHON_PATH}/Lib/site-packages")
unset(PYTHON_PATH)
get_filename_component(PYTHON_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE)
if(NOT PYTHON_PATH)
get_filename_component(PYTHON_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE)
endif()
file(TO_CMAKE_PATH "${PYTHON_PATH}" PYTHON_PATH)
endif()
set(_PYTHON_PACKAGES_PATH "${PYTHON_PATH}/Lib/site-packages")
endif()
SET(PYTHON_PACKAGES_PATH "${_PYTHON_PACKAGES_PATH}" CACHE PATH "Where to install the python packages.")
if(NOT PYTHON_NUMPY_INCLUDE_DIRS)
if(CMAKE_CROSSCOMPILING)
message(STATUS "Cannot probe for Python/Numpy support (because we are cross-compiling OpenCV)")
message(STATUS "If you want to enable Python/Numpy support, set the following variables:")
message(STATUS " PYTHON_INCLUDE_PATH")
message(STATUS " PYTHON_LIBRARIES")
message(STATUS " PYTHON_NUMPY_INCLUDE_DIRS")
else()
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print(os.pathsep.join(numpy.distutils.misc_util.get_numpy_include_dirs()))"
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT PYTHON_NUMPY_PROCESS EQUAL 0)
unset(PYTHON_NUMPY_INCLUDE_DIRS)
endif()
endif()
endif()
if(PYTHON_NUMPY_INCLUDE_DIRS)
file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIRS}" _PYTHON_NUMPY_INCLUDE_DIRS)
set(PYTHON_NUMPY_INCLUDE_DIRS ${_PYTHON_NUMPY_INCLUDE_DIRS} CACHE PATH "Path to numpy headers")
if(CMAKE_CROSSCOMPILING)
if(NOT PYTHON_NUMPY_VERSION)
set(PYTHON_NUMPY_VERSION "undefined - cannot be probed because of the cross-compilation")
endif()
else()
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import numpy; print(numpy.version.version)"
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
OUTPUT_VARIABLE PYTHON_NUMPY_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
endif()
endif(NOT ANDROID AND NOT IOS)
endif()
if(BUILD_DOCS)
find_host_program(SPHINX_BUILD sphinx-build)
find_host_program(PLANTUML plantuml)
+2
View File
@@ -63,6 +63,8 @@ if(NOT HAVE_TBB)
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc10")
elseif(MSVC11)
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc11")
elseif(MSVC12)
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc12")
endif()
set(TBB_LIB_DIR "${_TBB_LIB_PATH}" CACHE PATH "Full path of TBB library directory")
link_directories("${TBB_LIB_DIR}")
+44 -12
View File
@@ -2,20 +2,52 @@ if(NOT WITH_VTK OR ANDROID OR IOS)
return()
endif()
find_package(VTK 6.0 QUIET COMPONENTS vtkRenderingCore vtkInteractionWidgets vtkInteractionStyle vtkIOLegacy vtkIOPLY vtkRenderingFreeType vtkRenderingLOD vtkFiltersTexture vtkIOExport NO_MODULE)
# VTK 6.x components
find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
if(NOT DEFINED VTK_FOUND OR NOT VTK_FOUND)
find_package(VTK 5.10 QUIET COMPONENTS vtkCommon vtkFiltering vtkRendering vtkWidgets vtkImaging NO_MODULE)
# VTK 5.x components
if(NOT VTK_FOUND)
find_package(VTK QUIET COMPONENTS vtkCommon NO_MODULE)
endif()
if(NOT DEFINED VTK_FOUND OR NOT VTK_FOUND)
find_package(VTK 5.8 QUIET COMPONENTS vtkCommon vtkFiltering vtkRendering vtkWidgets vtkImaging NO_MODULE)
endif()
if(VTK_FOUND)
set(HAVE_VTK ON)
message(STATUS "Found VTK ver. ${VTK_VERSION} (usefile: ${VTK_USE_FILE})")
else()
if(NOT VTK_FOUND)
set(HAVE_VTK OFF)
message(STATUS "VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or set $VTK_DIR enviroment variable to VTK install subdirectory with VTKConfig.cmake file (for windows)")
message(STATUS "VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file")
return()
endif()
# Don't support ealier VTKs
if(${VTK_VERSION} VERSION_LESS "5.8.0")
message(STATUS "VTK support is disabled. VTK ver. 5.8.0 is minimum required, but found VTK ver. ${VTK_VERSION}")
return()
endif()
# Different Qt versions can't be linked together
if(HAVE_QT5 AND ${VTK_VERSION} VERSION_LESS "6.0.0")
if(VTK_USE_QT)
message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.${VTK_VERSION} + Qt4")
endif()
endif()
# Different Qt versions can't be linked together. VTK 6.0.0 doesn't provide a way to get Qt version it was linked with
if(HAVE_QT5 AND ${VTK_VERSION} VERSION_EQUAL "6.0.0" AND NOT DEFINED FORCE_VTK)
message(STATUS "VTK support is disabled. Possible incompatible combination: OpenCV+Qt5, and VTK ver.${VTK_VERSION} with Qt4")
message(STATUS "If it is known that VTK was compiled without Qt4, please define '-DFORCE_VTK=TRUE' flag in CMake")
return()
endif()
# Different Qt versions can't be linked together
if(HAVE_QT AND ${VTK_VERSION} VERSION_GREATER "6.0.0" AND NOT ${VTK_QT_VERSION} STREQUAL "")
if(HAVE_QT5 AND ${VTK_QT_VERSION} EQUAL "4")
message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.${VTK_VERSION} + Qt4")
return()
endif()
if(NOT HAVE_QT5 AND ${VTK_QT_VERSION} EQUAL "5")
message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt4 and VTK ver.${VTK_VERSION} + Qt5")
return()
endif()
endif()
set(HAVE_VTK ON)
message(STATUS "Found VTK ver. ${VTK_VERSION} (usefile: ${VTK_USE_FILE})")
+184 -290
View File
@@ -2,335 +2,229 @@
# The script to detect Intel(R) Integrated Performance Primitives (IPP)
# installation/package
#
# This will try to find Intel IPP libraries, and include path by automatic
# search through typical install locations and if failed it will
# examine IPPROOT environment variable.
# Note, IPPROOT is not set by IPP installer, it should be set manually.
# By default, ICV version will be used.
# To use standalone IPP update cmake command line:
# cmake ... -DIPPROOT=<path> ...
#
# Note: Backward compatibility is broken, IPPROOT environment path is ignored
#
#
# On return this will define:
#
# IPP_FOUND - True if Intel IPP found
# IPP_ROOT_DIR - root of IPP installation
# IPP_INCLUDE_DIRS - IPP include folder
# IPP_LIBRARY_DIRS - IPP libraries folder
# IPP_LIBRARIES - IPP libraries names that are used by OpenCV
# IPP_LATEST_VERSION_STR - string with the newest detected IPP version
# IPP_LATEST_VERSION_MAJOR - numbers of IPP version (MAJOR.MINOR.BUILD)
# IPP_LATEST_VERSION_MINOR
# IPP_LATEST_VERSION_BUILD
# HAVE_IPP - True if Intel IPP found
# HAVE_IPP_ICV_ONLY - True if Intel IPP ICV version is available
# IPP_ROOT_DIR - root of IPP installation
# IPP_INCLUDE_DIRS - IPP include folder
# IPP_LIBRARIES - IPP libraries that are used by OpenCV
# IPP_VERSION_STR - string with the newest detected IPP version
# IPP_VERSION_MAJOR - numbers of IPP version (MAJOR.MINOR.BUILD)
# IPP_VERSION_MINOR
# IPP_VERSION_BUILD
#
# Created: 30 Dec 2010 by Vladimir Dudnik (vladimir.dudnik@intel.com)
#
set(IPP_FOUND)
set(IPP_VERSION_STR "5.3.0.0") # will not detect earlier versions
set(IPP_VERSION_MAJOR 0)
set(IPP_VERSION_MINOR 0)
set(IPP_VERSION_BUILD 0)
set(IPP_ROOT_DIR)
set(IPP_INCLUDE_DIRS)
set(IPP_LIBRARY_DIRS)
set(IPP_LIBRARIES)
set(IPP_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
set(IPP_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
set(IPP_PREFIX "ipp")
set(IPP_SUFFIX "_l")
set(IPPCORE "core") # core functionality
set(IPPS "s") # signal processing
set(IPPI "i") # image processing
set(IPPCC "cc") # color conversion
set(IPPCV "cv") # computer vision
set(IPPVM "vm") # vector math
unset(HAVE_IPP CACHE)
unset(HAVE_IPP_ICV_ONLY)
unset(IPP_ROOT_DIR)
unset(IPP_INCLUDE_DIRS)
unset(IPP_LIBRARIES)
unset(IPP_VERSION_STR)
unset(IPP_VERSION_MAJOR)
unset(IPP_VERSION_MINOR)
unset(IPP_VERSION_BUILD)
set(IPP_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
set(IPP_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
set(IPP_X64 0)
if (CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
if(CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
set(IPP_X64 1)
endif()
if (CMAKE_CL_64)
if(CMAKE_CL_64)
set(IPP_X64 1)
endif()
# ------------------------------------------------------------------------
# This function detect IPP version by analyzing ippversion.h file
# Note, ippversion.h file was inroduced since IPP 5.3
# ------------------------------------------------------------------------
function(get_ipp_version _ROOT_DIR)
set(_VERSION_STR)
set(_MAJOR)
set(_MINOR)
set(_BUILD)
# This function detects IPP version by analyzing .h file
macro(ipp_get_version VERSION_FILE)
unset(_VERSION_STR)
unset(_MAJOR)
unset(_MINOR)
unset(_BUILD)
# read IPP version info from file
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR1 REGEX "IPP_VERSION_MAJOR")
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR2 REGEX "IPP_VERSION_MINOR")
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR3 REGEX "IPP_VERSION_BUILD")
if("${STR3}" STREQUAL "")
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR3 REGEX "IPP_VERSION_UPDATE")
# read IPP version info from file
file(STRINGS ${VERSION_FILE} STR1 REGEX "IPP_VERSION_MAJOR")
file(STRINGS ${VERSION_FILE} STR2 REGEX "IPP_VERSION_MINOR")
file(STRINGS ${VERSION_FILE} STR3 REGEX "IPP_VERSION_BUILD")
if("${STR3}" STREQUAL "")
file(STRINGS ${VERSION_FILE} STR3 REGEX "IPP_VERSION_UPDATE")
endif()
file(STRINGS ${VERSION_FILE} STR4 REGEX "IPP_VERSION_STR")
# extract info and assign to variables
string(REGEX MATCHALL "[0-9]+" _MAJOR ${STR1})
string(REGEX MATCHALL "[0-9]+" _MINOR ${STR2})
string(REGEX MATCHALL "[0-9]+" _BUILD ${STR3})
string(REGEX MATCHALL "[0-9]+[.]+[0-9]+[^\"]+|[0-9]+[.]+[0-9]+" _VERSION_STR ${STR4})
# export info to parent scope
set(IPP_VERSION_STR ${_VERSION_STR})
set(IPP_VERSION_MAJOR ${_MAJOR})
set(IPP_VERSION_MINOR ${_MINOR})
set(IPP_VERSION_BUILD ${_BUILD})
endmacro()
macro(_ipp_not_supported)
message(STATUS ${ARGN})
unset(HAVE_IPP)
unset(HAVE_IPP_ICV_ONLY)
unset(IPP_VERSION_STR)
return()
endmacro()
# This macro uses IPP_ROOT_DIR variable
# TODO Cleanup code after ICV package stabilization
macro(ipp_detect_version)
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include)
set(__msg)
if(EXISTS ${IPP_ROOT_DIR}/include/ippicv_redefs.h)
set(__msg " (ICV version)")
set(HAVE_IPP_ICV_ONLY 1)
elseif(EXISTS ${IPP_ROOT_DIR}/include/ipp.h)
# nothing
else()
_ipp_not_supported("Can't resolve IPP directory: ${IPP_ROOT_DIR}")
endif()
ipp_get_version(${IPP_INCLUDE_DIRS}/ippversion.h)
ocv_assert(IPP_VERSION_STR VERSION_GREATER "1.0")
message(STATUS "found IPP${__msg}: ${_MAJOR}.${_MINOR}.${_BUILD} [${IPP_VERSION_STR}]")
message(STATUS "at: ${IPP_ROOT_DIR}")
if(${IPP_VERSION_STR} VERSION_LESS "7.0")
_ipp_not_supported("IPP ${IPP_VERSION_STR} is not supported")
endif()
set(HAVE_IPP 1)
macro(_ipp_set_library_dir DIR)
if(NOT EXISTS ${DIR})
_ipp_not_supported("IPP library directory not found")
endif()
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR4 REGEX "IPP_VERSION_STR")
set(IPP_LIBRARY_DIR ${DIR})
endmacro()
# extract info and assign to variables
string(REGEX MATCHALL "[0-9]+" _MAJOR ${STR1})
string(REGEX MATCHALL "[0-9]+" _MINOR ${STR2})
string(REGEX MATCHALL "[0-9]+" _BUILD ${STR3})
string(REGEX MATCHALL "[0-9]+[.]+[0-9]+[^\"]+|[0-9]+[.]+[0-9]+" _VERSION_STR ${STR4})
if(APPLE)
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib)
elseif(IPP_X64)
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib/intel64)
else()
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib/ia32)
endif()
# export info to parent scope
set(IPP_VERSION_STR ${_VERSION_STR} PARENT_SCOPE)
set(IPP_VERSION_MAJOR ${_MAJOR} PARENT_SCOPE)
set(IPP_VERSION_MINOR ${_MINOR} PARENT_SCOPE)
set(IPP_VERSION_BUILD ${_BUILD} PARENT_SCOPE)
message(STATUS "found IPP: ${_MAJOR}.${_MINOR}.${_BUILD} [${_VERSION_STR}]")
message(STATUS "at: ${_ROOT_DIR}")
return()
endfunction()
# ------------------------------------------------------------------------
# This is auxiliary function called from set_ipp_variables()
# to set IPP_LIBRARIES variable in IPP 6.x style (IPP 5.3 should also work)
# ------------------------------------------------------------------------
function(set_ipp_old_libraries)
set(IPP_PREFIX "ipp")
set(IPP_SUFFIX) # old style static core libs suffix
set(IPP_ARCH) # architecture suffix
set(IPP_DISP "emerged") # old style dipatcher and cpu-specific
set(IPP_MRGD "merged") # static libraries
set(IPPCORE "core") # core functionality
set(IPPSP "s") # signal processing
set(IPPIP "i") # image processing
set(IPPCC "cc") # color conversion
set(IPPCV "cv") # computer vision
set(IPPVM "vm") # vector math
if (IPP_X64)
set(IPP_ARCH "em64t")
macro(_ipp_add_library name)
if (EXISTS ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
add_library(ipp${name} STATIC IMPORTED)
set_target_properties(ipp${name} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES ""
IMPORTED_LOCATION ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
)
list(APPEND IPP_LIBRARIES ipp${name})
# CMake doesn't support "install(TARGETS ipp${name} " command with imported targets
install(FILES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
string(TOUPPER ${name} uname)
set(IPP${uname}_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_3P_LIB_INSTALL_PATH}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}" CACHE INTERNAL "" FORCE)
set(IPP${uname}_LOCATION_PATH "${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}" CACHE INTERNAL "" FORCE)
else()
message(STATUS "Can't find IPP library: ${name} at ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}")
endif()
endmacro()
set(IPP_PREFIX "ipp")
if(${IPP_VERSION_STR} VERSION_LESS "8.0")
set(IPP_SUFFIX "_l") # static not threaded libs suffix IPP 7.x
else()
if(WIN32)
set(IPP_SUFFIX "l")
endif()
set(IPP_LIBRARIES
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPIP}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPIP}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPSP}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPSP}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_ARCH}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
PARENT_SCOPE)
return()
endfunction()
# ------------------------------------------------------------------------
# This is auxiliary function called from set_ipp_variables()
# to set IPP_LIBRARIES variable in IPP 7.x and 8.x style
# ------------------------------------------------------------------------
function(set_ipp_new_libraries _LATEST_VERSION)
set(IPP_PREFIX "ipp")
if(${_LATEST_VERSION} VERSION_LESS "8.0")
set(IPP_SUFFIX "_l") # static not threaded libs suffix IPP 7.x
set(IPP_SUFFIX "mt") # static not threaded libs suffix IPP 8.x for Windows
else()
if(WIN32)
set(IPP_SUFFIX "mt") # static not threaded libs suffix IPP 8.x for Windows
else()
set(IPP_SUFFIX "") # static not threaded libs suffix IPP 8.x for Linux/OS X
endif()
set(IPP_SUFFIX "") # static not threaded libs suffix IPP 8.x for Linux/OS X
endif()
set(IPPCORE "core") # core functionality
set(IPPSP "s") # signal processing
set(IPPIP "i") # image processing
set(IPPCC "cc") # color conversion
set(IPPCV "cv") # computer vision
set(IPPVM "vm") # vector math
endif()
set(IPP_LIBRARIES
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPI}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPS}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
PARENT_SCOPE)
if(HAVE_IPP_ICV_ONLY)
_ipp_add_library(icv)
else()
_ipp_add_library(core)
_ipp_add_library(s)
_ipp_add_library(i)
_ipp_add_library(cc)
_ipp_add_library(cv)
_ipp_add_library(vm)
_ipp_add_library(m)
return()
endfunction()
# ------------------------------------------------------------------------
# This function will set
# IPP_INCLUDE_DIRS, IPP_LIBRARY_DIRS and IPP_LIBRARIES variables depending
# on IPP version parameter.
# Since IPP 7.0 version library names and install folder structure
# was changed
# ------------------------------------------------------------------------
function(set_ipp_variables _LATEST_VERSION)
if(${_LATEST_VERSION} VERSION_LESS "7.0")
# message(STATUS "old")
# set INCLUDE and LIB folders
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib PARENT_SCOPE)
if (IPP_X64)
if(NOT EXISTS ${IPP_ROOT_DIR}/../em64t)
message(SEND_ERROR "IPP EM64T libraries not found")
endif()
if(UNIX)
get_filename_component(INTEL_COMPILER_LIBRARY_DIR ${IPP_ROOT_DIR}/../lib REALPATH)
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR})
get_filename_component(INTEL_COMPILER_LIBRARY_DIR ${IPP_ROOT_DIR}/../compiler/lib REALPATH)
endif()
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR})
_ipp_not_supported("IPP configuration error: can't find Intel compiler library dir ${INTEL_COMPILER_LIBRARY_DIR}")
endif()
if(NOT APPLE)
if(IPP_X64)
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/intel64)
message(SEND_ERROR "Intel compiler EM64T libraries not found")
endif()
set(INTEL_COMPILER_LIBRARY_DIR ${INTEL_COMPILER_LIBRARY_DIR}/intel64)
else()
if(NOT EXISTS ${IPP_ROOT_DIR}/../ia32)
message(SEND_ERROR "IPP IA32 libraries not found")
endif()
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/ia32)
message(SEND_ERROR "Intel compiler IA32 libraries not found")
endif()
set(INTEL_COMPILER_LIBRARY_DIR ${INTEL_COMPILER_LIBRARY_DIR}/ia32)
endif()
endif()
# set IPP_LIBRARIES variable (6.x lib names)
set_ipp_old_libraries()
set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
message(STATUS "IPP libs: ${IPP_LIBRARIES}")
else()
# message(STATUS "new")
# set INCLUDE and LIB folders
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
if (APPLE)
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib PARENT_SCOPE)
elseif (IPP_X64)
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/intel64)
message(SEND_ERROR "IPP EM64T libraries not found")
endif()
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/intel64 PARENT_SCOPE)
macro(_ipp_add_compiler_library name)
if (EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/${IPP_LIB_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX})
list(APPEND IPP_LIBRARIES ${INTEL_COMPILER_LIBRARY_DIR}/${IPP_LIB_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX})
else()
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/ia32)
message(SEND_ERROR "IPP IA32 libraries not found")
endif()
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32 PARENT_SCOPE)
message(STATUS "Can't find compiler library: ${name}")
endif()
endmacro()
# set IPP_LIBRARIES variable (7.x or 8.x lib names)
set_ipp_new_libraries(${_LATEST_VERSION})
set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
message(STATUS "IPP libs: ${IPP_LIBRARIES}")
_ipp_add_compiler_library(irc)
_ipp_add_compiler_library(imf)
_ipp_add_compiler_library(svml)
endif(UNIX)
endif()
endif()
#message(STATUS "IPP libs: ${IPP_LIBRARIES}")
endmacro()
# OPENCV_IPP_PATH is an environment variable for internal usage only, do not use it
if(DEFINED ENV{OPENCV_IPP_PATH} AND NOT DEFINED IPPROOT)
set(IPPROOT "$ENV{OPENCV_IPP_PATH}")
endif()
if(NOT DEFINED IPPROOT)
include("${OpenCV_SOURCE_DIR}/3rdparty/ippicv/downloader.cmake")
if(DEFINED OPENCV_ICV_PATH)
set(IPPROOT "${OPENCV_ICV_PATH}")
else()
return()
endif()
endif()
endfunction()
# ------------------------------------------------------------------------
# This section will look for IPP through IPPROOT env variable
# Note, IPPROOT is not set by IPP installer, you may need to set it manually
# ------------------------------------------------------------------------
find_path(
IPP_H_PATH
NAMES ippversion.h
PATHS $ENV{IPPROOT}
PATH_SUFFIXES include
DOC "The path to Intel(R) IPP header files"
NO_DEFAULT_PATH
NO_CMAKE_PATH)
if(IPP_H_PATH)
set(IPP_FOUND 1)
# traverse up to IPPROOT level
get_filename_component(IPP_ROOT_DIR ${IPP_H_PATH} PATH)
# extract IPP version info
get_ipp_version(${IPP_ROOT_DIR})
# keep info in the same vars for auto search and search by IPPROOT
set(IPP_LATEST_VERSION_STR ${IPP_VERSION_STR})
set(IPP_LATEST_VERSION_MAJOR ${IPP_VERSION_MAJOR})
set(IPP_LATEST_VERSION_MINOR ${IPP_VERSION_MINOR})
set(IPP_LATEST_VERSION_BUILD ${IPP_VERSION_BUILD})
# set IPP INCLUDE, LIB dirs and library names
set_ipp_variables(${IPP_LATEST_VERSION_STR})
file(TO_CMAKE_PATH "${IPPROOT}" __IPPROOT)
if(EXISTS "${__IPPROOT}/include/ippversion.h")
set(IPP_ROOT_DIR ${__IPPROOT})
ipp_detect_version()
endif()
if(NOT IPP_FOUND)
# reset var from previous search
set(IPP_H_PATH)
# ------------------------------------------------------------------------
# This section will look for IPP through system program folders
# Note, if several IPP installations found the newest version will be
# selected
# ------------------------------------------------------------------------
foreach(curdir ${CMAKE_SYSTEM_PREFIX_PATH})
set(curdir ${curdir}/intel)
file(TO_CMAKE_PATH ${curdir} CURDIR)
if(EXISTS ${curdir})
file(GLOB_RECURSE IPP_H_DIR ${curdir}/ippversion.h)
if(IPP_H_DIR)
set(IPP_FOUND 1)
endif()
# init IPP_LATEST_VERSION version with oldest detectable version (5.3.0.0)
# IPP prior 5.3 did not have ippversion.h file
set(IPP_LATEST_VERSION_STR ${IPP_VERSION_STR})
# look through all dirs where ippversion.h was found
foreach(item ${IPP_H_DIR})
# traverse up to IPPROOT level
get_filename_component(_FILE_PATH ${item} PATH)
get_filename_component(_ROOT_DIR ${_FILE_PATH} PATH)
# extract IPP version info
get_ipp_version(${_ROOT_DIR})
# remember the latest version (if many found)
if(${IPP_LATEST_VERSION_STR} VERSION_LESS ${IPP_VERSION_STR})
set(IPP_LATEST_VERSION_STR ${IPP_VERSION_STR})
set(IPP_LATEST_VERSION_MAJOR ${IPP_VERSION_MAJOR})
set(IPP_LATEST_VERSION_MINOR ${IPP_VERSION_MINOR})
set(IPP_LATEST_VERSION_BUILD ${IPP_VERSION_BUILD})
set(IPP_ROOT_DIR ${_ROOT_DIR})
endif()
endforeach()
endif()
endforeach()
endif()
if(IPP_FOUND)
# set IPP INCLUDE, LIB dirs and library names
set_ipp_variables(${IPP_LATEST_VERSION_STR})
# set CACHE variable IPP_H_PATH,
# path to IPP header files for the latest version
find_path(
IPP_H_PATH
NAMES ippversion.h
PATHS ${IPP_ROOT_DIR}
PATH_SUFFIXES include
DOC "The path to Intel(R) IPP header files"
NO_DEFAULT_PATH
NO_CMAKE_PATH)
endif()
if(WIN32 AND MINGW AND NOT IPP_LATEST_VERSION_MAJOR LESS 7)
if(WIN32 AND MINGW AND NOT IPP_VERSION_MAJOR LESS 7)
# Since IPP built with Microsoft compiler and /GS option
# ======================================================
# From Windows SDK 7.1
+45
View File
@@ -0,0 +1,45 @@
# Main variables:
# IPP_A_LIBRARIES and IPP_A_INCLUDE to use IPP Async
# HAVE_IPP_A for conditional compilation OpenCV with/without IPP Async
# IPP_ASYNC_ROOT - root of IPP Async installation
if(X86_64)
find_path(
IPP_A_INCLUDE_DIR
NAMES ipp_async_defs.h
PATHS $ENV{IPP_ASYNC_ROOT}
PATH_SUFFIXES include
DOC "Path to Intel IPP Async interface headers")
find_file(
IPP_A_LIBRARIES
NAMES ipp_async_preview.lib
PATHS $ENV{IPP_ASYNC_ROOT}
PATH_SUFFIXES lib/intel64
DOC "Path to Intel IPP Async interface libraries")
else()
find_path(
IPP_A_INCLUDE_DIR
NAMES ipp_async_defs.h
PATHS $ENV{IPP_ASYNC_ROOT}
PATH_SUFFIXES include
DOC "Path to Intel IPP Async interface headers")
find_file(
IPP_A_LIBRARIES
NAMES ipp_async_preview.lib
PATHS $ENV{IPP_ASYNC_ROOT}
PATH_SUFFIXES lib/ia32
DOC "Path to Intel IPP Async interface libraries")
endif()
if(IPP_A_INCLUDE_DIR AND IPP_A_LIBRARIES)
set(HAVE_IPP_A TRUE)
else()
set(HAVE_IPP_A FALSE)
message(WARNING "Intel IPP Async library directory (set by IPP_A_LIBRARIES_DIR variable) is not found or does not have Intel IPP Async libraries.")
endif()
mark_as_advanced(FORCE IPP_A_LIBRARIES IPP_A_INCLUDE_DIR)
+19 -4
View File
@@ -39,11 +39,26 @@ if(WITH_QT)
endif()
# --- GTK ---
ocv_clear_vars(HAVE_GTK HAVE_GTHREAD HAVE_GTKGLEXT)
ocv_clear_vars(HAVE_GTK HAVE_GTK3 HAVE_GTHREAD HAVE_GTKGLEXT)
if(WITH_GTK AND NOT HAVE_QT)
CHECK_MODULE(gtk+-2.0 HAVE_GTK)
if(NOT WITH_GTK_2_X)
CHECK_MODULE(gtk+-3.0 HAVE_GTK3)
if(HAVE_GTK3)
set(HAVE_GTK TRUE)
endif()
endif()
if(NOT HAVE_GTK)
CHECK_MODULE(gtk+-2.0 HAVE_GTK)
if(HAVE_GTK AND (ALIASOF_gtk+-2.0_VERSION VERSION_LESS MIN_VER_GTK))
message (FATAL_ERROR "GTK support requires a minimum version of ${MIN_VER_GTK} (${ALIASOF_gtk+-2.0_VERSION} found)")
set(HAVE_GTK FALSE)
endif()
endif()
CHECK_MODULE(gthread-2.0 HAVE_GTHREAD)
if(WITH_OPENGL)
if(HAVE_GTK AND NOT HAVE_GTHREAD)
message(FATAL_ERROR "gthread not found. This library is required when building with GTK support")
endif()
if(WITH_OPENGL AND NOT HAVE_GTK3)
CHECK_MODULE(gtkglext-1.0 HAVE_GTKGLEXT)
endif()
endif()
@@ -69,7 +84,7 @@ endif(WITH_OPENGL)
if(APPLE)
if(WITH_CARBON)
set(HAVE_CARBON YES)
elseif(NOT IOS)
elseif(NOT IOS AND CMAKE_COMPILER_IS_CLANGCXX)
set(HAVE_COCOA YES)
endif()
endif()
+12
View File
@@ -198,3 +198,15 @@ if(WITH_OPENEXR)
set(HAVE_OPENEXR YES)
endif()
# --- GDAL (optional) ---
if(WITH_GDAL)
find_package(GDAL)
if(NOT GDAL_FOUND)
ocv_clear_vars(GDAL_LIBRARY GDAL_INCLUDE_DIR)
set(HAVE_GDAL NO)
else()
set(HAVE_GDAL YES)
endif()
endif()
+14 -6
View File
@@ -8,16 +8,24 @@ if(WITH_TBB)
endif(WITH_TBB)
# --- IPP ---
ocv_clear_vars(IPP_FOUND)
if(WITH_IPP)
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIPP.cmake")
if(IPP_FOUND)
add_definitions(-DHAVE_IPP)
if(HAVE_IPP)
ocv_include_directories(${IPP_INCLUDE_DIRS})
link_directories(${IPP_LIBRARY_DIRS})
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${IPP_LIBRARIES})
list(APPEND OPENCV_LINKER_LIBS ${IPP_LIBRARIES})
endif()
endif(WITH_IPP)
endif()
# --- IPP Async ---
if(WITH_IPP_A)
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIPPAsync.cmake")
if(IPP_A_INCLUDE_DIR AND IPP_A_LIBRARIES)
ocv_include_directories(${IPP_A_INCLUDE_DIR})
link_directories(${IPP_A_LIBRARIES})
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${IPP_A_LIBRARIES})
endif()
endif(WITH_IPP_A)
# --- CUDA ---
if(WITH_CUDA)
+14 -8
View File
@@ -131,7 +131,7 @@ if(WITH_1394)
if(HAVE_DC1394_2)
ocv_parse_pkg("libdc1394-2" "${DC1394_2_LIB_DIR}/pkgconfig" "")
ocv_include_directories(${DC1394_2_INCLUDE_PATH})
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES}
set(VIDEOIO_LIBRARIES ${VIDEOIO_LIBRARIES}
"${DC1394_2_LIB_DIR}/libdc1394.a"
"${CMU1394_LIB_DIR}/lib1394camera.a")
endif(HAVE_DC1394_2)
@@ -166,6 +166,11 @@ if(WITH_OPENNI)
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindOpenNI.cmake")
endif(WITH_OPENNI)
ocv_clear_vars(HAVE_OPENNI2)
if(WITH_OPENNI2)
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindOpenNI2.cmake")
endif(WITH_OPENNI2)
# --- XIMEA ---
ocv_clear_vars(HAVE_XIMEA)
if(WITH_XIMEA)
@@ -234,7 +239,7 @@ if(WITH_FFMPEG)
endif()
endif(FFMPEG_INCLUDE_DIR)
if(HAVE_FFMPEG)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
set(VIDEOIO_LIBRARIES ${VIDEOIO_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
"${FFMPEG_LIB_DIR}/libavformat.a" "${FFMPEG_LIB_DIR}/libavutil.a"
"${FFMPEG_LIB_DIR}/libswscale.a")
ocv_include_directories(${FFMPEG_INCLUDE_DIR})
@@ -253,14 +258,15 @@ if(WITH_MSMF)
check_include_file(Mfapi.h HAVE_MSMF)
endif(WITH_MSMF)
# --- Extra HighGUI libs on Windows ---
# --- Extra HighGUI and VideoIO libs on Windows ---
if(WIN32)
list(APPEND HIGHGUI_LIBRARIES comctl32 gdi32 ole32 setupapi ws2_32 vfw32)
list(APPEND HIGHGUI_LIBRARIES comctl32 gdi32 ole32 setupapi ws2_32)
list(APPEND VIDEOIO_LIBRARIES vfw32)
if(MINGW64)
list(APPEND HIGHGUI_LIBRARIES avifil32 avicap32 winmm msvfw32)
list(REMOVE_ITEM HIGHGUI_LIBRARIES vfw32)
list(APPEND VIDEOIO_LIBRARIES avifil32 avicap32 winmm msvfw32)
list(REMOVE_ITEM VIDEOIO_LIBRARIES vfw32)
elseif(MINGW)
list(APPEND HIGHGUI_LIBRARIES winmm)
list(APPEND VIDEOIO_LIBRARIES winmm)
endif()
endif(WIN32)
@@ -273,7 +279,7 @@ endif()
if (NOT IOS)
if(WITH_QUICKTIME)
set(HAVE_QUICKTIME YES)
elseif(APPLE)
elseif(APPLE AND CMAKE_COMPILER_IS_CLANGCXX)
set(HAVE_QTKIT YES)
endif()
endif()
+61
View File
@@ -0,0 +1,61 @@
# Main variables:
# OPENNI2_LIBRARY and OPENNI2_INCLUDES to link OpenCV modules with OpenNI2
# HAVE_OPENNI2 for conditional compilation OpenCV with/without OpenNI2
if(NOT "${OPENNI2_LIB_DIR}" STREQUAL "${OPENNI2_LIB_DIR_INTERNAL}")
unset(OPENNI2_LIBRARY CACHE)
unset(OPENNI2_LIB_DIR CACHE)
endif()
if(NOT "${OPENNI2_INCLUDE_DIR}" STREQUAL "${OPENNI2_INCLUDE_DIR_INTERNAL}")
unset(OPENNI2_INCLUDES CACHE)
unset(OPENNI2_INCLUDE_DIR CACHE)
endif()
if(WIN32)
if(NOT (MSVC64 OR MINGW64))
find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS "$ENV{OPEN_NI_INSTALL_PATH}Include" DOC "OpenNI2 c++ interface header")
find_library(OPENNI2_LIBRARY "OpenNI2" PATHS $ENV{OPENNI2_LIB} DOC "OpenNI2 library")
else()
find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS "$ENV{OPEN_NI_INSTALL_PATH64}Include" DOC "OpenNI2 c++ interface header")
find_library(OPENNI2_LIBRARY "OpenNI2" PATHS $ENV{OPENNI2_LIB64} DOC "OpenNI2 library")
endif()
elseif(UNIX OR APPLE)
find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS "/usr/include/ni2" "/usr/include/openni2" DOC "OpenNI2 c++ interface header")
find_library(OPENNI2_LIBRARY "OpenNI2" PATHS "/usr/lib" DOC "OpenNI2 library")
endif()
if(OPENNI2_LIBRARY AND OPENNI2_INCLUDES)
set(HAVE_OPENNI2 TRUE)
endif() #if(OPENNI2_LIBRARY AND OPENNI2_INCLUDES)
get_filename_component(OPENNI2_LIB_DIR "${OPENNI2_LIBRARY}" PATH)
get_filename_component(OPENNI2_INCLUDE_DIR ${OPENNI2_INCLUDES} PATH)
if(HAVE_OPENNI2)
set(OPENNI2_LIB_DIR "${OPENNI2_LIB_DIR}" CACHE PATH "Path to OpenNI2 libraries" FORCE)
set(OPENNI2_INCLUDE_DIR "${OPENNI2_INCLUDE_DIR}" CACHE PATH "Path to OpenNI2 headers" FORCE)
endif()
if(OPENNI2_LIBRARY)
set(OPENNI2_LIB_DIR_INTERNAL "${OPENNI2_LIB_DIR}" CACHE INTERNAL "This is the value of the last time OPENNI_LIB_DIR was set successfully." FORCE)
else()
message( WARNING, " OpenNI2 library directory (set by OPENNI2_LIB_DIR variable) is not found or does not have OpenNI2 libraries." )
endif()
if(OPENNI2_INCLUDES)
set(OPENNI2_INCLUDE_DIR_INTERNAL "${OPENNI2_INCLUDE_DIR}" CACHE INTERNAL "This is the value of the last time OPENNI2_INCLUDE_DIR was set successfully." FORCE)
else()
message( WARNING, " OpenNI2 include directory (set by OPENNI2_INCLUDE_DIR variable) is not found or does not have OpenNI2 include files." )
endif()
mark_as_advanced(FORCE OPENNI2_LIBRARY)
mark_as_advanced(FORCE OPENNI2_INCLUDES)
if(HAVE_OPENNI2)
ocv_parse_header("${OPENNI2_INCLUDE_DIR}/OniVersion.h" ONI_VERSION_LINE ONI_VERSION_MAJOR ONI_VERSION_MINOR ONI_VERSION_MAINTENANCE ONI_VERSION_BUILD)
if(ONI_VERSION_MAJOR)
set(OPENNI2_VERSION_STRING ${ONI_VERSION_MAJOR}.${ONI_VERSION_MINOR}.${ONI_VERSION_MAINTENANCE} CACHE INTERNAL "OpenNI2 version")
set(OPENNI2_VERSION_BUILD ${ONI_VERSION_BUILD} CACHE INTERNAL "OpenNI2 build version")
endif()
endif()
+24 -3
View File
@@ -83,6 +83,14 @@ endif()
export(TARGETS ${OpenCVModules_TARGETS} FILE "${CMAKE_BINARY_DIR}/OpenCVModules${modules_file_suffix}.cmake")
if(TARGET ippicv)
set(USE_IPPICV TRUE)
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV ${CMAKE_BINARY_DIR} ${IPPICV_LOCATION_PATH})
else()
set(USE_IPPICV FALSE)
set(INSTALL_PATH_RELATIVE_IPPICV "non-existed-path")
endif()
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig.cmake" @ONLY)
#support for version checking when finding opencv. find_package(OpenCV 2.3.1 EXACT) should now work.
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig-version.cmake" @ONLY)
@@ -98,9 +106,6 @@ if(INSTALL_TO_MANGLED_PATHS)
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE}\"")
endif()
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY)
if(UNIX) # ANDROID configuration is created here also
#http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference
# For a command "find_package(<name> [major[.minor]] [EXACT] [REQUIRED|QUIET])"
@@ -108,6 +113,15 @@ if(UNIX) # ANDROID configuration is created here also
# <prefix>/(share|lib)/cmake/<name>*/ (U)
# <prefix>/(share|lib)/<name>*/ (U)
# <prefix>/(share|lib)/<name>*/(cmake|CMake)/ (U)
if(USE_IPPICV)
if(INSTALL_TO_MANGLED_PATHS)
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/" ${IPPICV_INSTALL_PATH})
else()
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}/" ${IPPICV_INSTALL_PATH})
endif()
endif()
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY)
if(INSTALL_TO_MANGLED_PATHS)
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ COMPONENT dev)
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ COMPONENT dev)
@@ -131,6 +145,13 @@ if(WIN32)
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/win-install/\"" OUTPUT_VARIABLE RET_VAL)
if(USE_IPPICV)
if(BUILD_SHARED_LIBS)
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OpenCV_INSTALL_BINARIES_PREFIX}lib" ${IPPICV_INSTALL_PATH})
else()
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" ${IPPICV_INSTALL_PATH})
endif()
endif()
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" @ONLY)
if(BUILD_SHARED_LIBS)
+3
View File
@@ -1,4 +1,7 @@
if(IOS)
configure_file("${OpenCV_SOURCE_DIR}/platforms/ios/Info.plist.in"
"${CMAKE_BINARY_DIR}/ios/Info.plist")
elseif(APPLE)
configure_file("${OpenCV_SOURCE_DIR}/platforms/osx/Info.plist.in"
"${CMAKE_BINARY_DIR}/osx/Info.plist")
endif()
+3 -1
View File
@@ -1,4 +1,6 @@
set(MIN_VER_CMAKE 2.8.7)
set(MIN_VER_CUDA 4.2)
set(MIN_VER_PYTHON 2.6)
set(MIN_VER_PYTHON2 2.6)
set(MIN_VER_PYTHON3 3.2)
set(MIN_VER_ZLIB 1.2.3)
set(MIN_VER_GTK 2.18.0)
+238 -187
View File
@@ -6,16 +6,19 @@
# Global variables:
#
# OPENCV_MODULE_${the_module}_LOCATION
# OPENCV_MODULE_${the_module}_BINARY_DIR
# OPENCV_MODULE_${the_module}_DESCRIPTION
# OPENCV_MODULE_${the_module}_CLASS - PUBLIC|INTERNAL|BINDINGS
# OPENCV_MODULE_${the_module}_HEADERS
# OPENCV_MODULE_${the_module}_SOURCES
# OPENCV_MODULE_${the_module}_DEPS - final flattened set of module dependencies
# OPENCV_MODULE_${the_module}_DEPS_TO_LINK - differs from above for world build only
# OPENCV_MODULE_${the_module}_DEPS_EXT - non-module dependencies
# OPENCV_MODULE_${the_module}_REQ_DEPS
# OPENCV_MODULE_${the_module}_OPT_DEPS
# OPENCV_MODULE_${the_module}_PRIVATE_REQ_DEPS
# OPENCV_MODULE_${the_module}_PRIVATE_OPT_DEPS
# OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD
# HAVE_${the_module} - for fast check of module availability
# To control the setup of the module you could also set:
@@ -27,7 +30,8 @@
# The verbose template for OpenCV module:
#
# ocv_add_module(modname <dependencies>)
# ocv_glob_module_sources() or glob them manually and ocv_set_module_sources(...)
# ocv_glob_module_sources(([EXCLUDE_CUDA] <extra sources&headers>)
# or glob them manually and ocv_set_module_sources(...)
# ocv_module_include_directories(<extra include directories>)
# ocv_create_module()
# <add extra link dependencies, compiler options, etc>
@@ -52,6 +56,7 @@ foreach(mod ${OPENCV_MODULES_BUILD} ${OPENCV_MODULES_DISABLED_USER} ${OPENCV_MOD
unset(OPENCV_MODULE_${mod}_OPT_DEPS CACHE)
unset(OPENCV_MODULE_${mod}_PRIVATE_REQ_DEPS CACHE)
unset(OPENCV_MODULE_${mod}_PRIVATE_OPT_DEPS CACHE)
unset(OPENCV_MODULE_${mod}_LINK_DEPS CACHE)
endforeach()
# clean modules info which needs to be recalculated
@@ -60,6 +65,7 @@ set(OPENCV_MODULES_BUILD "" CACHE INTERNAL "List of OpenCV modules incl
set(OPENCV_MODULES_DISABLED_USER "" CACHE INTERNAL "List of OpenCV modules explicitly disabled by user")
set(OPENCV_MODULES_DISABLED_AUTO "" CACHE INTERNAL "List of OpenCV modules implicitly disabled due to dependencies")
set(OPENCV_MODULES_DISABLED_FORCE "" CACHE INTERNAL "List of OpenCV modules which can not be build in current configuration")
unset(OPENCV_WORLD_MODULES CACHE)
# adds dependencies to OpenCV module
# Usage:
@@ -67,6 +73,7 @@ set(OPENCV_MODULES_DISABLED_FORCE "" CACHE INTERNAL "List of OpenCV modules whic
# Notes:
# * <list of dependencies> - can include full names of modules or full pathes to shared/static libraries or cmake targets
macro(ocv_add_dependencies full_modname)
ocv_debug_message("ocv_add_dependencies(" ${full_modname} ${ARGN} ")")
#we don't clean the dependencies here to allow this macro several times for every module
foreach(d "REQUIRED" ${ARGN})
if(d STREQUAL "REQUIRED")
@@ -104,6 +111,7 @@ endmacro()
# Example:
# ocv_add_module(yaom INTERNAL opencv_core opencv_highgui opencv_flann OPTIONAL opencv_cuda)
macro(ocv_add_module _name)
ocv_debug_message("ocv_add_module(" ${_name} ${ARGN} ")")
string(TOLOWER "${_name}" name)
string(REGEX REPLACE "^opencv_" "" ${name} "${name}")
set(the_module opencv_${name})
@@ -133,15 +141,17 @@ macro(ocv_add_module _name)
set(OPENCV_MODULE_${the_module}_DESCRIPTION "${the_description}" CACHE INTERNAL "Brief description of ${the_module} module")
set(OPENCV_MODULE_${the_module}_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Location of ${the_module} module sources")
set(OPENCV_MODULE_${the_module}_LINK_DEPS "" CACHE INTERNAL "")
# parse list of dependencies
if("${ARGV1}" STREQUAL "INTERNAL" OR "${ARGV1}" STREQUAL "BINDINGS")
set(OPENCV_MODULE_${the_module}_CLASS "${ARGV1}" CACHE INTERNAL "The cathegory of the module")
set(OPENCV_MODULE_${the_module}_CLASS "${ARGV1}" CACHE INTERNAL "The category of the module")
set(__ocv_argn__ ${ARGN})
list(REMOVE_AT __ocv_argn__ 0)
ocv_add_dependencies(${the_module} ${__ocv_argn__})
unset(__ocv_argn__)
else()
set(OPENCV_MODULE_${the_module}_CLASS "PUBLIC" CACHE INTERNAL "The cathegory of the module")
set(OPENCV_MODULE_${the_module}_CLASS "PUBLIC" CACHE INTERNAL "The category of the module")
ocv_add_dependencies(${the_module} ${ARGN})
if(BUILD_${the_module})
set(OPENCV_MODULES_PUBLIC ${OPENCV_MODULES_PUBLIC} "${the_module}" CACHE INTERNAL "List of OpenCV modules marked for export")
@@ -149,8 +159,14 @@ macro(ocv_add_module _name)
endif()
# add self to the world dependencies
if(NOT DEFINED OPENCV_MODULE_IS_PART_OF_WORLD AND NOT OPENCV_MODULE_${the_module}_CLASS STREQUAL "BINDINGS" OR OPENCV_MODULE_IS_PART_OF_WORLD)
if((NOT DEFINED OPENCV_MODULE_IS_PART_OF_WORLD AND NOT OPENCV_MODULE_${the_module}_CLASS STREQUAL "BINDINGS"
AND NOT OPENCV_PROCESSING_EXTRA_MODULES)
OR OPENCV_MODULE_IS_PART_OF_WORLD
)
set(OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD ON CACHE INTERNAL "")
ocv_add_dependencies(opencv_world OPTIONAL ${the_module})
else()
set(OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD OFF CACHE INTERNAL "")
endif()
if(BUILD_${the_module})
@@ -163,12 +179,15 @@ macro(ocv_add_module _name)
# stop processing of current file
return()
else(OPENCV_INITIAL_PASS)
else()
set(OPENCV_MODULE_${the_module}_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "")
if(NOT BUILD_${the_module})
return() # extra protection from redefinition
endif()
project(${the_module})
endif(OPENCV_INITIAL_PASS)
if((NOT OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD AND NOT ${the_module} STREQUAL opencv_world) OR NOT ${BUILD_opencv_world})
project(${the_module})
endif()
endif()
endmacro()
# excludes module from current configuration
@@ -199,7 +218,11 @@ macro(ocv_glob_modules)
# collect modules
set(OPENCV_INITIAL_PASS ON)
set(OPENCV_PROCESSING_EXTRA_MODULES 0)
foreach(__path ${ARGN})
if("${__path}" STREQUAL "EXTRA")
set(OPENCV_PROCESSING_EXTRA_MODULES 1)
endif()
get_filename_component(__path "${__path}" ABSOLUTE)
list(FIND __directories_observed "${__path}" __pathIdx)
@@ -221,16 +244,7 @@ macro(ocv_glob_modules)
endif()
list(APPEND __directories_observed "${__modpath}")
if(OCV_MODULE_RELOCATE_ON_INITIAL_PASS)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
file(COPY "${__modpath}/CMakeLists.txt" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
add_subdirectory("${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}" "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
if("${OPENCV_MODULE_opencv_${mod}_LOCATION}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
set(OPENCV_MODULE_opencv_${mod}_LOCATION "${__modpath}" CACHE PATH "" FORCE)
endif()
else()
add_subdirectory("${__modpath}" "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
endif()
add_subdirectory("${__modpath}" "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
endif()
endforeach()
endif()
@@ -243,15 +257,31 @@ macro(ocv_glob_modules)
# create modules
set(OPENCV_INITIAL_PASS OFF PARENT_SCOPE)
set(OPENCV_INITIAL_PASS OFF)
foreach(m ${OPENCV_MODULES_BUILD})
if(m MATCHES "^opencv_")
string(REGEX REPLACE "^opencv_" "" __shortname "${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${__shortname}")
else()
message(WARNING "Check module name: ${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${m}")
endif()
endforeach()
if(${BUILD_opencv_world})
add_subdirectory("${OPENCV_MODULE_opencv_world_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/world")
foreach(m ${OPENCV_MODULES_BUILD})
if(NOT OPENCV_MODULE_${m}_IS_PART_OF_WORLD AND NOT ${m} STREQUAL opencv_world)
message(STATUS "Processing module ${m}...")
if(m MATCHES "^opencv_")
string(REGEX REPLACE "^opencv_" "" __shortname "${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${__shortname}")
else()
message(WARNING "Check module name: ${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${m}")
endif()
endif()
endforeach()
else()
foreach(m ${OPENCV_MODULES_BUILD})
if(m MATCHES "^opencv_")
string(REGEX REPLACE "^opencv_" "" __shortname "${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${__shortname}")
else()
message(WARNING "Check module name: ${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${m}")
endif()
endforeach()
endif()
unset(__shortname)
endmacro()
@@ -393,11 +423,36 @@ function(__ocv_resolve_dependencies)
__ocv_sort_modules_by_deps(OPENCV_MODULE_${m}_DEPS)
ocv_list_sort(OPENCV_MODULE_${m}_DEPS_EXT)
set(LINK_DEPS ${OPENCV_MODULE_${m}_DEPS})
# process world
if(BUILD_opencv_world)
if(OPENCV_MODULE_${m}_IS_PART_OF_WORLD)
list(APPEND OPENCV_WORLD_MODULES ${m})
endif()
foreach(m2 ${OPENCV_MODULES_BUILD})
if(OPENCV_MODULE_${m2}_IS_PART_OF_WORLD)
if(";${LINK_DEPS};" MATCHES ";${m2};")
list(REMOVE_ITEM LINK_DEPS ${m2})
if(NOT (";${LINK_DEPS};" MATCHES ";opencv_world;") AND NOT (${m} STREQUAL opencv_world))
list(APPEND LINK_DEPS opencv_world)
endif()
endif()
if(${m} STREQUAL opencv_world)
list(APPEND OPENCV_MODULE_opencv_world_DEPS_EXT ${OPENCV_MODULE_${m2}_DEPS_EXT})
endif()
endif()
endforeach()
endif()
set(OPENCV_MODULE_${m}_DEPS ${OPENCV_MODULE_${m}_DEPS} CACHE INTERNAL "Flattened dependencies of ${m} module")
set(OPENCV_MODULE_${m}_DEPS_EXT ${OPENCV_MODULE_${m}_DEPS_EXT} CACHE INTERNAL "Extra dependencies of ${m} module")
set(OPENCV_MODULE_${m}_DEPS_TO_LINK ${LINK_DEPS} CACHE INTERNAL "Flattened dependencies of ${m} module (for linker)")
# message(STATUS " module deps: ${OPENCV_MODULE_${m}_DEPS}")
# message(STATUS " extra deps: ${OPENCV_MODULE_${m}_DEPS_EXT}")
# message(STATUS " module deps of ${m}: ${OPENCV_MODULE_${m}_DEPS}")
# message(STATUS " module link deps of ${m}: ${OPENCV_MODULE_${m}_DEPS_TO_LINK}")
# message(STATUS " extra deps of ${m}: ${OPENCV_MODULE_${m}_DEPS_EXT}")
# message(STATUS "")
endforeach()
__ocv_sort_modules_by_deps(OPENCV_MODULES_BUILD)
@@ -405,6 +460,7 @@ function(__ocv_resolve_dependencies)
set(OPENCV_MODULES_PUBLIC ${OPENCV_MODULES_PUBLIC} CACHE INTERNAL "List of OpenCV modules marked for export")
set(OPENCV_MODULES_BUILD ${OPENCV_MODULES_BUILD} CACHE INTERNAL "List of OpenCV modules included into the build")
set(OPENCV_MODULES_DISABLED_AUTO ${OPENCV_MODULES_DISABLED_AUTO} CACHE INTERNAL "List of OpenCV modules implicitly disabled due to dependencies")
set(OPENCV_WORLD_MODULES ${OPENCV_WORLD_MODULES} CACHE INTERNAL "List of OpenCV modules included into the world")
endfunction()
@@ -421,18 +477,31 @@ macro(ocv_include_modules)
endforeach()
endmacro()
# setup include paths for the list of passed modules and recursively add dependent modules
macro(ocv_include_modules_recurse)
# setup include paths for the list of passed modules
macro(ocv_target_include_modules target)
foreach(d ${ARGN})
if(d MATCHES "^opencv_" AND HAVE_${d})
if (EXISTS "${OPENCV_MODULE_${d}_LOCATION}/include")
ocv_include_directories("${OPENCV_MODULE_${d}_LOCATION}/include")
endif()
if(OPENCV_MODULE_${d}_DEPS)
ocv_include_modules(${OPENCV_MODULE_${d}_DEPS})
ocv_target_include_directories(${target} "${OPENCV_MODULE_${d}_LOCATION}/include")
endif()
elseif(EXISTS "${d}")
ocv_include_directories("${d}")
ocv_target_include_directories(${target} "${d}")
endif()
endforeach()
endmacro()
# setup include paths for the list of passed modules and recursively add dependent modules
macro(ocv_target_include_modules_recurse target)
foreach(d ${ARGN})
if(d MATCHES "^opencv_" AND HAVE_${d})
if (EXISTS "${OPENCV_MODULE_${d}_LOCATION}/include")
ocv_target_include_directories(${target} "${OPENCV_MODULE_${d}_LOCATION}/include")
endif()
if(OPENCV_MODULE_${d}_DEPS)
ocv_target_include_modules(${target} ${OPENCV_MODULE_${d}_DEPS})
endif()
elseif(EXISTS "${d}")
ocv_target_include_directories(${target} "${d}")
endif()
endforeach()
endmacro()
@@ -440,11 +509,12 @@ endmacro()
# setup include path for OpenCV headers for specified module
# ocv_module_include_directories(<extra include directories/extra include modules>)
macro(ocv_module_include_directories)
ocv_include_directories("${OPENCV_MODULE_${the_module}_LOCATION}/include"
"${OPENCV_MODULE_${the_module}_LOCATION}/src"
"${CMAKE_CURRENT_BINARY_DIR}" # for precompiled headers
)
ocv_include_modules(${OPENCV_MODULE_${the_module}_DEPS} ${ARGN})
ocv_target_include_directories(${the_module}
"${OPENCV_MODULE_${the_module}_LOCATION}/include"
"${OPENCV_MODULE_${the_module}_LOCATION}/src"
"${CMAKE_CURRENT_BINARY_DIR}" # for precompiled headers
)
ocv_target_include_modules(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${ARGN})
endmacro()
@@ -453,6 +523,8 @@ endmacro()
# Usage:
# ocv_set_module_sources([HEADERS] <list of files> [SOURCES] <list of files>)
macro(ocv_set_module_sources)
ocv_debug_message("ocv_set_module_sources(" ${ARGN} ")")
set(OPENCV_MODULE_${the_module}_HEADERS "")
set(OPENCV_MODULE_${the_module}_SOURCES "")
@@ -478,71 +550,109 @@ endmacro()
# finds and sets headers and sources for the standard OpenCV module
# Usage:
# ocv_glob_module_sources(<extra sources&headers in the same format as used in ocv_set_module_sources>)
# ocv_glob_module_sources([EXCLUDE_CUDA] <extra sources&headers in the same format as used in ocv_set_module_sources>)
macro(ocv_glob_module_sources)
file(GLOB_RECURSE lib_srcs "src/*.cpp")
file(GLOB_RECURSE lib_int_hdrs "src/*.hpp" "src/*.h")
file(GLOB lib_hdrs "include/opencv2/*.hpp" "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h")
file(GLOB lib_hdrs_detail "include/opencv2/${name}/detail/*.hpp" "include/opencv2/${name}/detail/*.h")
ocv_source_group("Src" DIRBASE "${CMAKE_CURRENT_SOURCE_DIR}/src" FILES ${lib_srcs} ${lib_int_hdrs})
ocv_source_group("Include" DIRBASE "${CMAKE_CURRENT_SOURCE_DIR}/include" FILES ${lib_hdrs} ${lib_hdrs_detail})
file(GLOB lib_cuda_srcs "src/cuda/*.cu")
set(cuda_objs "")
set(lib_cuda_hdrs "")
if(HAVE_CUDA AND lib_cuda_srcs)
ocv_include_directories(${CUDA_INCLUDE_DIRS})
file(GLOB lib_cuda_hdrs "src/cuda/*.hpp")
ocv_cuda_compile(cuda_objs ${lib_cuda_srcs} ${lib_cuda_hdrs})
source_group("Src\\Cuda" FILES ${lib_cuda_srcs} ${lib_cuda_hdrs})
ocv_debug_message("ocv_glob_module_sources(" ${ARGN} ")")
set(_argn ${ARGN})
list(FIND _argn "EXCLUDE_CUDA" exclude_cuda)
if(NOT exclude_cuda EQUAL -1)
list(REMOVE_AT _argn ${exclude_cuda})
endif()
file(GLOB cl_kernels "src/opencl/*.cl")
file(GLOB_RECURSE lib_srcs
"${CMAKE_CURRENT_LIST_DIR}/src/*.cpp"
)
file(GLOB_RECURSE lib_int_hdrs
"${CMAKE_CURRENT_LIST_DIR}/src/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/src/*.h"
)
file(GLOB lib_hdrs
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.h"
)
file(GLOB lib_hdrs_detail
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/detail/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/detail/*.h"
)
if (APPLE)
file(GLOB_RECURSE lib_srcs_apple
"${CMAKE_CURRENT_LIST_DIR}/src/*.mm"
)
list(APPEND lib_srcs ${lib_srcs_apple})
endif()
ocv_source_group("Src" DIRBASE "${CMAKE_CURRENT_LIST_DIR}/src" FILES ${lib_srcs} ${lib_int_hdrs})
ocv_source_group("Include" DIRBASE "${CMAKE_CURRENT_LIST_DIR}/include" FILES ${lib_hdrs} ${lib_hdrs_detail})
set(lib_cuda_srcs "")
set(lib_cuda_hdrs "")
if(HAVE_CUDA AND exclude_cuda EQUAL -1)
file(GLOB lib_cuda_srcs
"${CMAKE_CURRENT_LIST_DIR}/src/cuda/*.cu"
)
file(GLOB lib_cuda_hdrs
"${CMAKE_CURRENT_LIST_DIR}/src/cuda/*.hpp"
)
source_group("Src\\Cuda" FILES ${lib_cuda_srcs} ${lib_cuda_hdrs})
endif()
file(GLOB cl_kernels
"${CMAKE_CURRENT_LIST_DIR}/src/opencl/*.cl"
)
if(cl_kernels)
set(OCL_NAME opencl_kernels_${name})
ocv_include_directories(${OPENCL_INCLUDE_DIRS})
string(REGEX REPLACE "opencv_" "" the_module_barename "${the_module}")
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp"
COMMAND ${CMAKE_COMMAND} -DMODULE_NAME="${the_module_barename}" -DCL_DIR="${CMAKE_CURRENT_SOURCE_DIR}/src/opencl" -DOUTPUT="${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" -P "${OpenCV_SOURCE_DIR}/cmake/cl2cpp.cmake"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.cpp" "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.hpp"
COMMAND ${CMAKE_COMMAND} -DMODULE_NAME="${name}" -DCL_DIR="${CMAKE_CURRENT_LIST_DIR}/src/opencl" -DOUTPUT="${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.cpp" -P "${OpenCV_SOURCE_DIR}/cmake/cl2cpp.cmake"
DEPENDS ${cl_kernels} "${OpenCV_SOURCE_DIR}/cmake/cl2cpp.cmake")
ocv_source_group("Src\\opencl\\kernels" FILES ${cl_kernels})
ocv_source_group("Src\\opencl\\kernels\\autogenerated" FILES "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp")
list(APPEND lib_srcs ${cl_kernels} "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp")
ocv_source_group("Src\\opencl\\kernels\\autogenerated" FILES "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.cpp" "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.hpp")
list(APPEND lib_srcs ${cl_kernels} "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.cpp" "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.hpp")
endif()
ocv_set_module_sources(${ARGN} HEADERS ${lib_hdrs} ${lib_hdrs_detail}
SOURCES ${lib_srcs} ${lib_int_hdrs} ${cuda_objs} ${lib_cuda_srcs} ${lib_cuda_hdrs})
ocv_set_module_sources(${_argn} HEADERS ${lib_hdrs} ${lib_hdrs_detail}
SOURCES ${lib_srcs} ${lib_int_hdrs} ${lib_cuda_srcs} ${lib_cuda_hdrs})
endmacro()
# creates OpenCV module in current folder
# creates new target, configures standard dependencies, compilers flags, install rules
# Usage:
# ocv_create_module(<extra link dependencies>)
# ocv_create_module(SKIP_LINK)
# ocv_create_module()
macro(ocv_create_module)
ocv_debug_message("ocv_create_module(" ${ARGN} ")")
set(OPENCV_MODULE_${the_module}_LINK_DEPS "${OPENCV_MODULE_${the_module}_LINK_DEPS};${ARGN}" CACHE INTERNAL "")
if(${BUILD_opencv_world} AND OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD)
# nothing
set(the_module_target opencv_world)
else()
_ocv_create_module(${ARGN})
set(the_module_target ${the_module})
endif()
endmacro()
macro(_ocv_create_module)
# The condition we ought to be testing here is whether ocv_add_precompiled_headers will
# be called at some point in the future. We can't look into the future, though,
# so this will have to do.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.hpp")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.hpp" AND NOT ${the_module} STREQUAL opencv_world)
get_native_precompiled_header(${the_module} precomp.hpp)
endif()
add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}
ocv_add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}
"${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp"
${${the_module}_pch})
if(NOT the_module STREQUAL opencv_ts)
set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS OPENCV_NOSTL)
endif()
if(NOT "${ARGN}" STREQUAL "SKIP_LINK")
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()
ocv_target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK})
ocv_target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK})
ocv_target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
if (HAVE_CUDA)
ocv_target_link_libraries(${the_module} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
endif()
add_dependencies(opencv_modules ${the_module})
@@ -597,13 +707,16 @@ macro(ocv_create_module)
endif()
endforeach()
endif()
_ocv_add_precompiled_headers(${the_module})
endmacro()
# opencv precompiled headers macro (can add pch to modules and tests)
# this macro must be called after any "add_definitions" commands, otherwise precompiled headers will not work
# Usage:
# ocv_add_precompiled_headers(${the_module})
macro(ocv_add_precompiled_headers the_target)
macro(_ocv_add_precompiled_headers the_target)
ocv_debug_message("ocv_add_precompiled_headers(" ${the_target} ${ARGN} ")")
if("${the_target}" MATCHES "^opencv_test_.*$")
SET(pch_path "test/test_")
elseif("${the_target}" MATCHES "^opencv_perf_.*$")
@@ -618,13 +731,22 @@ endmacro()
# short command for adding simple OpenCV module
# see ocv_add_module for argument details
# Usage:
# ocv_define_module(module_name [INTERNAL] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
# ocv_define_module(module_name [INTERNAL] [EXCLUDE_CUDA] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
macro(ocv_define_module module_name)
ocv_add_module(${module_name} ${ARGN})
ocv_debug_message("ocv_define_module(" ${module_name} ${ARGN} ")")
set(_argn ${ARGN})
set(exclude_cuda "")
foreach(arg ${_argn})
if("${arg}" STREQUAL "EXCLUDE_CUDA")
set(exclude_cuda "${arg}")
list(REMOVE_ITEM _argn ${arg})
endif()
endforeach()
ocv_add_module(${module_name} ${_argn})
ocv_glob_module_sources(${exclude_cuda})
ocv_module_include_directories()
ocv_glob_module_sources()
ocv_create_module()
ocv_add_precompiled_headers(${the_module})
ocv_add_accuracy_tests()
ocv_add_perf_tests()
@@ -659,7 +781,7 @@ macro(__ocv_parse_test_sources tests_type)
set(__file_group_name "")
set(__file_group_sources "")
elseif(arg STREQUAL "DEPENDS_ON")
set(__currentvar "OPENCV_TEST_${the_module}_DEPS")
set(__currentvar "OPENCV_${tests_type}_${the_module}_DEPS")
elseif("${__currentvar}" STREQUAL "__file_group_sources" AND NOT __file_group_name)
set(__file_group_name "${arg}")
else()
@@ -674,20 +796,20 @@ endmacro()
# this is a command for adding OpenCV performance tests to the module
# ocv_add_perf_tests(<extra_dependencies>)
function(ocv_add_perf_tests)
set(perf_path "${CMAKE_CURRENT_SOURCE_DIR}/perf")
ocv_debug_message("ocv_add_perf_tests(" ${ARGN} ")")
set(perf_path "${CMAKE_CURRENT_LIST_DIR}/perf")
if(BUILD_PERF_TESTS AND EXISTS "${perf_path}")
__ocv_parse_test_sources(PERF ${ARGN})
# opencv_highgui is required for imread/imwrite
set(perf_deps ${the_module} opencv_ts opencv_highgui ${OPENCV_PERF_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
# opencv_imgcodecs is required for imread/imwrite
set(perf_deps ${the_module} opencv_ts opencv_imgcodecs ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
ocv_check_dependencies(${perf_deps})
if(OCV_DEPENDENCIES_FOUND)
set(the_target "opencv_perf_${name}")
# project(${the_target})
ocv_module_include_directories(${perf_deps} "${perf_path}")
if(NOT OPENCV_PERF_${the_module}_SOURCES)
file(GLOB_RECURSE perf_srcs "${perf_path}/*.cpp")
file(GLOB_RECURSE perf_hdrs "${perf_path}/*.hpp" "${perf_path}/*.h")
@@ -696,10 +818,13 @@ function(ocv_add_perf_tests)
set(OPENCV_PERF_${the_module}_SOURCES ${perf_srcs} ${perf_hdrs})
endif()
get_native_precompiled_header(${the_target} perf_precomp.hpp)
if(NOT BUILD_opencv_world)
get_native_precompiled_header(${the_target} perf_precomp.hpp)
endif()
add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch})
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${perf_deps} ${OPENCV_LINKER_LIBS})
ocv_add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch})
ocv_target_include_modules(${the_target} ${perf_deps} "${perf_path}")
ocv_target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${perf_deps} ${OPENCV_LINKER_LIBS})
add_dependencies(opencv_perf_tests ${the_target})
# Additional target properties
@@ -712,8 +837,9 @@ function(ocv_add_perf_tests)
set_target_properties(${the_target} PROPERTIES FOLDER "tests performance")
endif()
ocv_add_precompiled_headers(${the_target})
if(NOT BUILD_opencv_world)
_ocv_add_precompiled_headers(${the_target})
endif()
else(OCV_DEPENDENCIES_FOUND)
# TODO: warn about unsatisfied dependencies
endif(OCV_DEPENDENCIES_FOUND)
@@ -726,21 +852,19 @@ endfunction()
# this is a command for adding OpenCV accuracy/regression tests to the module
# ocv_add_accuracy_tests([FILES <source group name> <list of sources>] [DEPENDS_ON] <list of extra dependencies>)
function(ocv_add_accuracy_tests)
set(test_path "${CMAKE_CURRENT_SOURCE_DIR}/test")
ocv_check_dependencies(${test_deps})
ocv_debug_message("ocv_add_accuracy_tests(" ${ARGN} ")")
set(test_path "${CMAKE_CURRENT_LIST_DIR}/test")
if(BUILD_TESTS AND EXISTS "${test_path}")
__ocv_parse_test_sources(TEST ${ARGN})
# opencv_highgui is required for imread/imwrite
set(test_deps ${the_module} opencv_ts opencv_highgui ${OPENCV_TEST_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
# opencv_imgcodecs is required for imread/imwrite
set(test_deps ${the_module} opencv_ts opencv_imgcodecs opencv_videoio ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
ocv_check_dependencies(${test_deps})
if(OCV_DEPENDENCIES_FOUND)
set(the_target "opencv_test_${name}")
# project(${the_target})
ocv_module_include_directories(${test_deps} "${test_path}")
if(NOT OPENCV_TEST_${the_module}_SOURCES)
file(GLOB_RECURSE test_srcs "${test_path}/*.cpp")
file(GLOB_RECURSE test_hdrs "${test_path}/*.hpp" "${test_path}/*.h")
@@ -749,10 +873,13 @@ function(ocv_add_accuracy_tests)
set(OPENCV_TEST_${the_module}_SOURCES ${test_srcs} ${test_hdrs})
endif()
get_native_precompiled_header(${the_target} test_precomp.hpp)
if(NOT BUILD_opencv_world)
get_native_precompiled_header(${the_target} test_precomp.hpp)
endif()
add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch})
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
ocv_add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch})
ocv_target_include_modules(${the_target} ${test_deps} "${test_path}")
ocv_target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
add_dependencies(opencv_tests ${the_target})
# Additional target properties
@@ -769,7 +896,9 @@ function(ocv_add_accuracy_tests)
get_target_property(LOC ${the_target} LOCATION)
add_test(${the_target} "${LOC}")
ocv_add_precompiled_headers(${the_target})
if(NOT BUILD_opencv_world)
_ocv_add_precompiled_headers(${the_target})
endif()
else(OCV_DEPENDENCIES_FOUND)
# TODO: warn about unsatisfied dependencies
endif(OCV_DEPENDENCIES_FOUND)
@@ -781,24 +910,25 @@ function(ocv_add_accuracy_tests)
endfunction()
function(ocv_add_samples)
ocv_debug_message("ocv_add_samples(" ${ARGN} ")")
set(samples_path "${CMAKE_CURRENT_SOURCE_DIR}/samples")
string(REGEX REPLACE "^opencv_" "" module_id ${the_module})
if(BUILD_EXAMPLES AND EXISTS "${samples_path}")
set(samples_deps ${the_module} ${OPENCV_MODULE_${the_module}_DEPS} opencv_highgui ${ARGN})
set(samples_deps ${the_module} ${OPENCV_MODULE_${the_module}_DEPS} opencv_imgcodecs opencv_videoio opencv_highgui ${ARGN})
ocv_check_dependencies(${samples_deps})
if(OCV_DEPENDENCIES_FOUND)
file(GLOB sample_sources "${samples_path}/*.cpp")
ocv_include_modules(${OPENCV_MODULE_${the_module}_DEPS})
foreach(source ${sample_sources})
get_filename_component(name "${source}" NAME_WE)
set(the_target "example_${module_id}_${name}")
add_executable(${the_target} "${source}")
target_link_libraries(${the_target} ${samples_deps})
ocv_add_executable(${the_target} "${source}")
ocv_target_include_modules(${the_target} ${samples_deps})
ocv_target_link_libraries(${the_target} ${samples_deps})
set_target_properties(${the_target} PROPERTIES PROJECT_LABEL "(sample) ${name}")
if(ENABLE_SOLUTION_FOLDERS)
@@ -821,82 +951,3 @@ function(ocv_add_samples)
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
endif()
endfunction()
# internal macro; finds all link dependencies of the module
# should be used at the end of CMake processing
macro(__ocv_track_module_link_dependencies the_module optkind)
set(${the_module}_MODULE_DEPS_${optkind} "")
set(${the_module}_EXTRA_DEPS_${optkind} "")
get_target_property(__module_type ${the_module} TYPE)
if(__module_type STREQUAL "STATIC_LIBRARY")
#in case of static library we have to inherit its dependencies (in right order!!!)
if(NOT DEFINED ${the_module}_LIB_DEPENDS_${optkind})
ocv_split_libs_list(${the_module}_LIB_DEPENDS ${the_module}_LIB_DEPENDS_DBG ${the_module}_LIB_DEPENDS_OPT)
endif()
set(__resolved_deps "")
set(__mod_depends ${${the_module}_LIB_DEPENDS_${optkind}})
set(__has_cycle FALSE)
while(__mod_depends)
list(GET __mod_depends 0 __dep)
list(REMOVE_AT __mod_depends 0)
if(__dep STREQUAL the_module)
set(__has_cycle TRUE)
else()#if("${OPENCV_MODULES_BUILD}" MATCHES "(^|;)${__dep}(;|$)")
ocv_regex_escape(__rdep "${__dep}")
if(__resolved_deps MATCHES "(^|;)${__rdep}(;|$)")
#all dependencies of this module are already resolved
list(APPEND ${the_module}_MODULE_DEPS_${optkind} "${__dep}")
else()
get_target_property(__module_type ${__dep} TYPE)
if(__module_type STREQUAL "STATIC_LIBRARY")
if(NOT DEFINED ${__dep}_LIB_DEPENDS_${optkind})
ocv_split_libs_list(${__dep}_LIB_DEPENDS ${__dep}_LIB_DEPENDS_DBG ${__dep}_LIB_DEPENDS_OPT)
endif()
list(INSERT __mod_depends 0 ${${__dep}_LIB_DEPENDS_${optkind}} ${__dep})
list(APPEND __resolved_deps "${__dep}")
elseif(NOT __module_type)
list(APPEND ${the_module}_EXTRA_DEPS_${optkind} "${__dep}")
endif()
endif()
#else()
# get_target_property(__dep_location "${__dep}" LOCATION)
endif()
endwhile()
ocv_list_unique(${the_module}_MODULE_DEPS_${optkind})
#ocv_list_reverse(${the_module}_MODULE_DEPS_${optkind})
ocv_list_unique(${the_module}_EXTRA_DEPS_${optkind})
#ocv_list_reverse(${the_module}_EXTRA_DEPS_${optkind})
if(__has_cycle)
# not sure if it can work
list(APPEND ${the_module}_MODULE_DEPS_${optkind} "${the_module}")
endif()
unset(__dep_location)
unset(__mod_depends)
unset(__resolved_deps)
unset(__has_cycle)
unset(__rdep)
endif()#STATIC_LIBRARY
unset(__module_type)
#message("${the_module}_MODULE_DEPS_${optkind}")
#message(" ${${the_module}_MODULE_DEPS_${optkind}}")
#message(" ${OPENCV_MODULE_${the_module}_DEPS}")
#message("")
#message("${the_module}_EXTRA_DEPS_${optkind}")
#message(" ${${the_module}_EXTRA_DEPS_${optkind}}")
#message("")
endmacro()
# creates lists of build dependencies needed for external projects
macro(ocv_track_build_dependencies)
foreach(m ${OPENCV_MODULES_BUILD})
__ocv_track_module_link_dependencies("${m}" OPT)
__ocv_track_module_link_dependencies("${m}" DBG)
endforeach()
endmacro()
+12
View File
@@ -68,6 +68,15 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
endif()
ENDFOREACH(item)
get_target_property(DIRINC ${_PCH_current_target} INCLUDE_DIRECTORIES )
FOREACH(item ${DIRINC})
if(item MATCHES "^${OpenCV_SOURCE_DIR}/modules/")
LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}\"${item}\"")
else()
LIST(APPEND ${_out_compile_flags} "${_PCH_isystem_prefix}\"${item}\"")
endif()
ENDFOREACH(item)
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
GET_DIRECTORY_PROPERTY(_global_definitions DIRECTORY ${OpenCV_SOURCE_DIR} DEFINITIONS)
#MESSAGE("_directory_flags ${_directory_flags} ${_global_definitions}" )
@@ -254,6 +263,9 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
endif()
endif()
get_target_property(DIRINC ${_targetName} INCLUDE_DIRECTORIES)
set_target_properties(${_targetName}_pch_dephelp PROPERTIES INCLUDE_DIRECTORIES "${DIRINC}")
#MESSAGE("_compile_FLAGS: ${_compile_FLAGS}")
#message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}")
+126 -11
View File
@@ -42,6 +42,11 @@ macro(ocv_assert)
endif()
endmacro()
macro(ocv_debug_message)
# string(REPLACE ";" " " __msg "${ARGN}")
# message(STATUS "${__msg}")
endmacro()
macro(ocv_check_environment_variables)
foreach(_var ${ARGN})
if(NOT DEFINED ${_var} AND DEFINED ENV{${_var}})
@@ -53,8 +58,18 @@ macro(ocv_check_environment_variables)
endforeach()
endmacro()
# rename modules target to world if needed
macro(_ocv_fix_target target_var)
if(BUILD_opencv_world)
if(OPENCV_MODULE_${${target_var}}_IS_PART_OF_WORLD)
set(${target_var} opencv_world)
endif()
endif()
endmacro()
# adds include directories in such way that directories from the OpenCV source tree go first
function(ocv_include_directories)
ocv_debug_message("ocv_include_directories( ${ARGN} )")
set(__add_before "")
foreach(dir ${ARGN})
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
@@ -67,6 +82,30 @@ function(ocv_include_directories)
include_directories(BEFORE ${__add_before})
endfunction()
# adds include directories in such way that directories from the OpenCV source tree go first
function(ocv_target_include_directories target)
_ocv_fix_target(target)
set(__params "")
foreach(dir ${ARGN})
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}")
list(APPEND __params "${__abs_dir}")
else()
list(APPEND __params "${dir}")
endif()
endforeach()
if(HAVE_CUDA OR CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories(${__params})
else()
if(TARGET ${target})
target_include_directories(${target} PRIVATE ${__params})
else()
set(__new_inc "${OCV_TARGET_INCLUDE_DIRS_${target}};${__params}")
set(OCV_TARGET_INCLUDE_DIRS_${target} "${__new_inc}" CACHE INTERNAL "")
endif()
endif()
endfunction()
# clears all passed variables
macro(ocv_clear_vars)
foreach(_var ${ARGN})
@@ -265,16 +304,19 @@ macro(CHECK_MODULE module_name define)
set(${define} 1)
foreach(P "${ALIAS_INCLUDE_DIRS}")
if(${P})
list(APPEND VIDEOIO_INCLUDE_DIRS ${${P}})
list(APPEND HIGHGUI_INCLUDE_DIRS ${${P}})
endif()
endforeach()
foreach(P "${ALIAS_LIBRARY_DIRS}")
if(${P})
list(APPEND VIDEOIO_LIBRARY_DIRS ${${P}})
list(APPEND HIGHGUI_LIBRARY_DIRS ${${P}})
endif()
endforeach()
list(APPEND VIDEOIO_LIBRARIES ${${ALIAS_LIBRARIES}})
list(APPEND HIGHGUI_LIBRARIES ${${ALIAS_LIBRARIES}})
endif()
endif()
@@ -292,8 +334,8 @@ endfunction()
macro(ocv_finalize_status)
if(NOT OPENCV_SKIP_STATUS_FINALIZATION)
if(TARGET opencv_core)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENCV_BUILD_INFO_FILE}" "${opencv_core_BINARY_DIR}/version_string.inc" OUTPUT_QUIET)
if(DEFINED OPENCV_MODULE_opencv_core_BINARY_DIR)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENCV_BUILD_INFO_FILE}" "${OPENCV_MODULE_opencv_core_BINARY_DIR}/version_string.inc" OUTPUT_QUIET)
endif()
endif()
endmacro()
@@ -467,6 +509,20 @@ macro(ocv_convert_to_full_paths VAR)
endmacro()
# convert list of paths to libraries names without lib prefix
macro(ocv_convert_to_lib_name var)
set(__tmp "")
foreach(path ${ARGN})
get_filename_component(__tmp_name "${path}" NAME_WE)
string(REGEX REPLACE "^lib" "" __tmp_name ${__tmp_name})
list(APPEND __tmp "${__tmp_name}")
endforeach()
set(${var} ${__tmp})
unset(__tmp)
unset(__tmp_name)
endmacro()
# add install command
function(ocv_install_target)
install(TARGETS ${ARGN})
@@ -516,16 +572,20 @@ function(ocv_install_target)
# message(STATUS "Process ${__target} dst=${__dst}...")
if(DEFINED __dst)
get_target_property(fname ${__target} LOCATION_DEBUG)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Debug)
endif()
if(CMAKE_VERSION VERSION_LESS 2.8.12)
get_target_property(fname ${__target} LOCATION_DEBUG)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Debug)
endif()
get_target_property(fname ${__target} LOCATION_RELEASE)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Release)
get_target_property(fname ${__target} LOCATION_RELEASE)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Release)
endif()
else()
# CMake 2.8.12 brokes PDB support in STATIC libraries for MSVS
endif()
endif()
endif()
@@ -620,6 +680,9 @@ endmacro()
################################################################################################
# short command to setup source group
function(ocv_source_group group)
if(BUILD_opencv_world AND OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD)
set(group "${the_module}\\${group}")
endif()
cmake_parse_arguments(SG "" "DIRBASE" "GLOB;GLOB_RECURSE;FILES" ${ARGN})
set(files "")
if(SG_FILES)
@@ -652,3 +715,55 @@ function(ocv_source_group group)
source_group(${group} FILES ${files})
endif()
endfunction()
function(ocv_target_link_libraries target)
_ocv_fix_target(target)
set(LINK_DEPS ${ARGN})
# process world
if(BUILD_opencv_world)
foreach(m ${OPENCV_MODULES_BUILD})
if(OPENCV_MODULE_${m}_IS_PART_OF_WORLD)
if(";${LINK_DEPS};" MATCHES ";${m};")
list(REMOVE_ITEM LINK_DEPS ${m})
if(NOT (";${LINK_DEPS};" MATCHES ";opencv_world;"))
list(APPEND LINK_DEPS opencv_world)
endif()
endif()
endif()
endforeach()
endif()
target_link_libraries(${target} ${LINK_DEPS})
endfunction()
function(_ocv_append_target_includes target)
if(DEFINED OCV_TARGET_INCLUDE_DIRS_${target})
target_include_directories(${target} PRIVATE ${OCV_TARGET_INCLUDE_DIRS_${target}})
unset(OCV_TARGET_INCLUDE_DIRS_${target} CACHE)
endif()
endfunction()
function(ocv_add_executable target)
add_executable(${target} ${ARGN})
_ocv_append_target_includes(${target})
endfunction()
function(ocv_add_library target)
set(cuda_objs "")
if(HAVE_CUDA)
set(cuda_srcs "")
foreach(var ${ARGN})
if(var MATCHES ".cu")
list(APPEND cuda_srcs ${var})
endif()
endforeach()
if(cuda_srcs)
ocv_include_directories(${CUDA_INCLUDE_DIRS})
ocv_cuda_compile(cuda_objs ${lib_cuda_srcs} ${lib_cuda_hdrs})
endif()
endif()
add_library(${target} ${ARGN} ${cuda_objs})
_ocv_append_target_includes(${target})
endfunction()
+8
View File
@@ -0,0 +1,8 @@
# helper file for Android samples build
file(GLOB_RECURSE LIBS RELATIVE ${SRC_DIR} "*.so")
foreach(l ${LIBS})
message(STATUS " Copying: ${l} ...")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SRC_DIR}/${l} ${DST_DIR}/${l})
endforeach()
+15 -1
View File
@@ -2,6 +2,13 @@
# you might need to define NDK_USE_CYGPATH=1 before calling the ndk-build
USER_LOCAL_PATH:=$(LOCAL_PATH)
USER_LOCAL_C_INCLUDES:=$(LOCAL_C_INCLUDES)
USER_LOCAL_CFLAGS:=$(LOCAL_CFLAGS)
USER_LOCAL_STATIC_LIBRARIES:=$(LOCAL_STATIC_LIBRARIES)
USER_LOCAL_SHARED_LIBRARIES:=$(LOCAL_SHARED_LIBRARIES)
USER_LOCAL_LDLIBS:=$(LOCAL_LDLIBS)
LOCAL_PATH:=$(subst ?,,$(firstword ?$(subst \, ,$(subst /, ,$(call my-dir)))))
OPENCV_TARGET_ARCH_ABI:=$(TARGET_ARCH_ABI)
@@ -47,7 +54,7 @@ else
endif
endif
ifeq (${OPENCV_CAMERA_MODULES},on)
ifeq ($(OPENCV_CAMERA_MODULES),on)
ifeq ($(TARGET_ARCH_ABI),armeabi)
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_CONFIGCMAKE@
endif
@@ -113,6 +120,13 @@ ifeq ($(OPENCV_LOCAL_CFLAGS),)
endif
include $(CLEAR_VARS)
LOCAL_C_INCLUDES:=$(USER_LOCAL_C_INCLUDES)
LOCAL_CFLAGS:=$(USER_LOCAL_CFLAGS)
LOCAL_STATIC_LIBRARIES:=$(USER_LOCAL_STATIC_LIBRARIES)
LOCAL_SHARED_LIBRARIES:=$(USER_LOCAL_SHARED_LIBRARIES)
LOCAL_LDLIBS:=$(USER_LOCAL_LDLIBS)
LOCAL_C_INCLUDES += $(OPENCV_LOCAL_C_INCLUDES)
LOCAL_CFLAGS += $(OPENCV_LOCAL_CFLAGS)
+86 -28
View File
@@ -12,15 +12,15 @@
#
# Or you can search for specific OpenCV modules:
#
# find_package(OpenCV REQUIRED core highgui)
# find_package(OpenCV REQUIRED core videoio)
#
# If the module is found then OPENCV_<MODULE>_FOUND is set to TRUE.
#
# This file will define the following variables:
# - OpenCV_LIBS : The list of all imported targets for OpenCV modules.
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability
# - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability.
# - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API.
# - OpenCV_VERSION : The version of this OpenCV build: "@OPENCV_VERSION_PLAIN@"
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION: "@OPENCV_VERSION_MAJOR@"
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION: "@OPENCV_VERSION_MINOR@"
@@ -28,25 +28,41 @@
# - OpenCV_VERSION_STATUS : Development status of this build: "@OPENCV_VERSION_STATUS@"
#
# Advanced variables:
# - OpenCV_SHARED
# - OpenCV_CONFIG_PATH
# - OpenCV_INSTALL_PATH (not set on Windows)
# - OpenCV_LIB_COMPONENTS
# - OpenCV_USE_MANGLED_PATHS
# - OpenCV_HAVE_ANDROID_CAMERA
# - OpenCV_SHARED : Use OpenCV as shared library
# - OpenCV_CONFIG_PATH : Path to this OpenCVConfig.cmake
# - OpenCV_INSTALL_PATH : OpenCV location (not set on Windows)
# - OpenCV_LIB_COMPONENTS : Present OpenCV modules list
# - OpenCV_USE_MANGLED_PATHS : Mangled OpenCV path flag
# - OpenCV_MODULES_SUFFIX : The suffix for OpenCVModules-XXX.cmake file
# - OpenCV_HAVE_ANDROID_CAMERA : Presence of Android native camera wrappers
#
# Deprecated variables:
# - OpenCV_VERSION_TWEAK : Always "0"
#
# ===================================================================================
set(modules_file_suffix "")
if(ANDROID)
string(REPLACE - _ modules_file_suffix "_${ANDROID_NDK_ABI_NAME}")
if(NOT DEFINED OpenCV_MODULES_SUFFIX)
if(ANDROID)
string(REPLACE - _ OpenCV_MODULES_SUFFIX "_${ANDROID_NDK_ABI_NAME}")
else()
set(OpenCV_MODULES_SUFFIX "")
endif()
endif()
if(@USE_IPPICV@) # value is defined by package builder
if(NOT TARGET ippicv)
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_PATH_RELATIVE_IPPICV@")
add_library(ippicv STATIC IMPORTED)
set_target_properties(ippicv PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES ""
IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_PATH_RELATIVE_IPPICV@"
)
endif()
endif()
endif()
if(NOT TARGET opencv_core)
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${modules_file_suffix}.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${OpenCV_MODULES_SUFFIX}.cmake)
endif()
# TODO All things below should be reviewed. What is about of moving this code into related modules (special vars/hooks/files)
@@ -60,7 +76,11 @@ set(OpenCV_USE_CUFFT @HAVE_CUFFT@)
set(OpenCV_USE_NVCUVID @HAVE_NVCUVID@)
# Android API level from which OpenCV has been compiled is remembered
set(OpenCV_ANDROID_NATIVE_API_LEVEL @OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE@)
if(ANDROID)
set(OpenCV_ANDROID_NATIVE_API_LEVEL @OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE@)
else()
set(OpenCV_ANDROID_NATIVE_API_LEVEL 0)
endif()
# Some additional settings are required if OpenCV is built as static libs
set(OpenCV_SHARED @BUILD_SHARED_LIBS@)
@@ -71,8 +91,8 @@ set(OpenCV_USE_MANGLED_PATHS @OpenCV_USE_MANGLED_PATHS_CONFIGCMAKE@)
# Extract the directory where *this* file has been installed (determined at cmake run-time)
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE)
if(NOT WIN32 OR OpenCV_ANDROID_NATIVE_API_LEVEL GREATER 0)
if(OpenCV_ANDROID_NATIVE_API_LEVEL GREATER 0)
if(NOT WIN32 OR ANDROID)
if(ANDROID)
set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../..")
else()
set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../..")
@@ -121,6 +141,7 @@ SET(OpenCV_VERSION_STATUS "@OPENCV_VERSION_STATUS@")
# ====================================================================
SET(OpenCV_LIB_COMPONENTS @OPENCV_MODULES_CONFIGCMAKE@)
SET(OpenCV_WORLD_COMPONENTS @OPENCV_WORLD_MODULES@)
# ==============================================================
# Extra include directories, needed by OpenCV 2 new structure
@@ -180,8 +201,8 @@ foreach(__cvcomponent ${OpenCV_FIND_COMPONENTS})
message(WARNING "${__cvcomponent} is required but was not found")
endif()
#indicate that module is NOT found
string(TOUPPER "${__cvcomponent}" __cvcomponent)
set(${__cvcomponent}_FOUND "${__cvcomponent}_FOUND-NOTFOUND")
string(TOUPPER "${__cvcomponent}" __cvcomponentUP)
set(${__cvcomponentUP}_FOUND "${__cvcomponentUP}_FOUND-NOTFOUND")
else()
list(APPEND OpenCV_FIND_COMPONENTS_ ${__cvcomponent})
# Not using list(APPEND) here, because OpenCV_LIBS may not exist yet.
@@ -189,8 +210,31 @@ foreach(__cvcomponent ${OpenCV_FIND_COMPONENTS})
# 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)
string(TOUPPER "${__cvcomponent}" __cvcomponentUP)
set(${__cvcomponentUP}_FOUND 1)
endif()
if(OpenCV_SHARED AND ";${OpenCV_WORLD_COMPONENTS};" MATCHES ";${__cvcomponent};" AND NOT TARGET ${__cvcomponent})
get_target_property(__implib_dbg opencv_world IMPORTED_IMPLIB_DEBUG)
get_target_property(__implib_release opencv_world IMPORTED_IMPLIB_RELEASE)
get_target_property(__location_dbg opencv_world IMPORTED_LOCATION_DEBUG)
get_target_property(__location_release opencv_world IMPORTED_LOCATION_RELEASE)
add_library(${__cvcomponent} SHARED IMPORTED)
if(__location_dbg)
set_property(TARGET ${__cvcomponent} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(${__cvcomponent} PROPERTIES
IMPORTED_IMPLIB_DEBUG "${__implib_dbg}"
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG ""
IMPORTED_LOCATION_DEBUG "${__location_dbg}"
)
endif()
if(__location_release)
set_property(TARGET ${__cvcomponent} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(${__cvcomponent} PROPERTIES
IMPORTED_IMPLIB_RELEASE "${__implib_release}"
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE ""
IMPORTED_LOCATION_RELEASE "${__location_release}"
)
endif()
endif()
endforeach()
set(OpenCV_FIND_COMPONENTS ${OpenCV_FIND_COMPONENTS_})
@@ -209,7 +253,7 @@ foreach(__opttype OPT DBG)
SET(OpenCV_EXTRA_LIBS_${__opttype} "")
# CUDA
if(OpenCV_CUDA_VERSION AND (CMAKE_CROSSCOMPILING OR (WIN32 AND NOT OpenCV_SHARED)))
if(OpenCV_CUDA_VERSION)
if(NOT CUDA_FOUND)
find_package(CUDA ${OpenCV_CUDA_VERSION} EXACT REQUIRED)
else()
@@ -218,32 +262,41 @@ foreach(__opttype OPT DBG)
endif()
endif()
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_LIBRARIES})
set(OpenCV_CUDA_LIBS_ABSPATH ${CUDA_LIBRARIES})
if(${CUDA_VERSION} VERSION_LESS "5.5")
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_npp_LIBRARY})
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_npp_LIBRARY})
else()
find_cuda_helper_libs(nppc)
find_cuda_helper_libs(nppi)
find_cuda_helper_libs(npps)
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_nppc_LIBRARY} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY})
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nppc_LIBRARY} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY})
endif()
if(OpenCV_USE_CUBLAS)
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_CUBLAS_LIBRARIES})
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUBLAS_LIBRARIES})
endif()
if(OpenCV_USE_CUFFT)
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_CUFFT_LIBRARIES})
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUFFT_LIBRARIES})
endif()
if(OpenCV_USE_NVCUVID)
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_nvcuvid_LIBRARIES})
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvid_LIBRARIES})
endif()
if(WIN32)
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_nvcuvenc_LIBRARIES})
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvenc_LIBRARIES})
endif()
set(OpenCV_CUDA_LIBS_RELPATH "")
foreach(l ${OpenCV_CUDA_LIBS_ABSPATH})
get_filename_component(_tmp ${l} PATH)
list(APPEND OpenCV_CUDA_LIBS_RELPATH ${_tmp})
endforeach()
list(REMOVE_DUPLICATES OpenCV_CUDA_LIBS_RELPATH)
link_directories(${OpenCV_CUDA_LIBS_RELPATH})
endif()
endforeach()
@@ -292,6 +345,7 @@ macro(ocv_check_dependencies)
set(OCV_DEPENDENCIES_FOUND TRUE)
foreach(d ${ARGN})
if(NOT TARGET ${d})
message(WARNING "OpenCV: Can't resolve dependency: ${d}")
set(OCV_DEPENDENCIES_FOUND FALSE)
break()
endif()
@@ -317,6 +371,10 @@ macro(ocv_include_modules)
include_directories(BEFORE "${OpenCV_INCLUDE_DIRS}")
endmacro()
macro(ocv_target_link_libraries)
target_link_libraries(${ARGN})
endmacro()
# remove all matching elements from the list
macro(ocv_list_filterout lst regex)
foreach(item ${${lst}})
+11 -1
View File
@@ -76,6 +76,9 @@
/* ffmpeg in Gentoo */
#cmakedefine HAVE_GENTOO_FFMPEG
/* Geospatial Data Abstraction Library */
#cmakedefine HAVE_GDAL
/* GStreamer multimedia framework */
#cmakedefine HAVE_GSTREAMER
@@ -93,6 +96,10 @@
/* Intel Integrated Performance Primitives */
#cmakedefine HAVE_IPP
#cmakedefine HAVE_IPP_ICV_ONLY
/* Intel IPP Async */
#cmakedefine HAVE_IPP_A
/* JPEG-2000 codec */
#cmakedefine HAVE_JASPER
@@ -125,6 +132,9 @@
/* OpenNI library */
#cmakedefine HAVE_OPENNI
/* OpenNI library */
#cmakedefine HAVE_OPENNI2
/* PNG codec */
#cmakedefine HAVE_PNG
@@ -167,6 +177,6 @@
/* Xine video library */
#cmakedefine HAVE_XINE
/* Define to 1 if your processor stores words with the most significant byte
/* Define if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#cmakedefine WORDS_BIGENDIAN

Some files were not shown because too many files have changed in this diff Show More