220 Commits

Autor SHA1 Mensagem Data
Roman Donchenko d8a4d3a2eb Merge pull request #1921 from SpecLad:defined-msc-ver 2013-12-04 15:46:56 +04:00
Roman Donchenko 3e1586a1c6 Merge pull request #1919 from SpecLad:platfrom 2013-12-04 13:55:45 +04:00
Roman Donchenko fa2cd93ecf Merge pull request #1915 from jet47:gpu-color-test-fix 2013-12-04 13:55:28 +04:00
Roman Donchenko 11c7053b0f Fixed a -Wundef warning in cl_platform.h.
_MSC_VER -> defined _MSC_VER. Fixes building with MinGW.
Similar to fbc91c5ee.
2013-12-04 12:39:20 +04:00
Andrey Pavlenko 8752414718 Merge pull request #1911 from apavlenko:2.4_fix_vc12 2013-12-03 19:20:05 +04:00
Roman Donchenko 3509018bd6 Merge pull request #1916 from alalek:ocl_moments_fix_perf 2013-12-03 17:58:04 +04:00
Andrey Pavlenko 1966e7cea9 fixing compilation on Linux 2013-12-03 17:46:09 +04:00
Roman Donchenko 2b31055914 Fixed the "platfrom" typo everywhere. 2013-12-03 17:33:28 +04:00
Andrey Pavlenko b5dbe9e04b Added patch from master for fixing VS2013 in 3rd party lib OpenEXR 2013-12-03 16:08:57 +04:00
Alexander Alekhin c962a9d61c ocl:perf: fix moments test for plain impl 2013-12-03 16:02:55 +04:00
Vladislav Vinogradov adb2040980 added additional check in cv::gpu::demosaicing that source is not empty 2013-12-03 15:55:47 +04:00
Vladislav Vinogradov 14ee306b9e fix gpu test for Demosaicing:
check that input images was loaded correctly
2013-12-03 15:55:10 +04:00
Roman Donchenko df136339ff Merge pull request #1907 from severin-lemaignan:emscripten-2.4 2013-12-03 13:38:10 +04:00
Andrey Pavlenko bd9d3dd561 fixing build of 2.4 branch with VC12 (aka 2013)
(master branch was fixed before, no need to merge this to master!)
- disable openexr (numerous undefined std::min & std::max)
- workaround for two compilator bugs
2013-12-03 13:16:44 +04:00
Séverin Lemaignan 9ce9fc3361 Ensure compilation to Javascript with Emscripten 2013-12-03 09:18:59 +01:00
Andrey Pavlenko 3ff1620086 Merge pull request #1899 from berak:b_3171_24 2013-12-03 11:32:31 +04:00
Andrey Pavlenko 8db6d9f9b2 Merge pull request #1906 from asmorkalov:android_ocl_warn_fix 2013-12-03 11:20:48 +04:00
Andrey Pavlenko 368bac7af6 Merge pull request #1744 from liuxing6666:2.4_fix_harris_test 2013-12-02 20:38:49 +04:00
Andrey Pavlenko 19ceab13f2 Merge pull request #1590 from ilya-lavrenov:cmd_parser_fix 2013-12-02 20:07:47 +04:00
Roman Donchenko 790f53f12a Merge pull request #1887 from jet47:android-cuda-6.0 2013-12-02 18:53:26 +04:00
Roman Donchenko f7f194e5dd Merge pull request #1797 from moodoki:bugfix_3344 2013-12-02 17:53:34 +04:00
Alexander Smorkalov eab7603096 Warning fixes and suppression in ocl module for gcc 4.6 from Android NDK. 2013-12-02 17:51:29 +04:00
Roman Donchenko 838961a289 Merge pull request #1897 from berak:b_3393_24 2013-12-02 17:11:56 +04:00
Roman Donchenko fb568755a1 Merge pull request #1898 from berak:b_3349_24 2013-12-02 14:14:41 +04:00
Roman Donchenko 0bbd768d9d Merge pull request #1884 from asmorkalov:winrt_img_proc_sample 2013-12-02 12:27:51 +04:00
Roman Donchenko f20af817d4 Merge pull request #1894 from asmorkalov:ocv_debug_build 2013-12-02 12:17:30 +04:00
berak 34a390fbc2 CV_WRAP for BackgroundSubtractorMOG2 2013-11-30 13:35:23 +01:00
berak 059bf1d9e5 corrected initialization of output_folder in facereco examples 2013-11-30 13:09:42 +01:00
berak 773616ee04 swapped x,y in elbp_ 2013-11-30 12:00:22 +01:00
Andrey Pavlenko 429ab8ebee Merge pull request #1845 from StevenPuttemans:bugfix_3306 2013-11-29 23:08:20 +04:00
Alexander Smorkalov d39e73365c Some debug options are removed because they are installed by Cmake automatically.
Also forcing -ggdb3 on android leads to debuging issues.
2013-11-29 15:34:50 +04:00
Roman Donchenko f8801cfdb8 Merge pull request #1892 from asmorkalov:android_native_camera_close_fix 2013-11-29 15:10:13 +04:00
Vladislav Vinogradov fc1d38ced8 fixed compilation of gpu-basics-similarity tutorial:
initialize TIMES variable with some default value (10)
2013-11-29 14:53:33 +04:00
Alexander Smorkalov a13db7c8fa Android native camera destruction fixed for Android 4.4. 2013-11-29 10:38:26 +04:00
Alexander Smorkalov 6b09345232 Filter selection and several filters implemented for WinRT sample. 2013-11-29 09:47:25 +04:00
Roman Donchenko 41154b30de Merge pull request #1885 from jet47:gpu-bgfg-test-fix 2013-11-28 14:11:40 +04:00
Vladislav Vinogradov 5ac8444c22 fixed CUDA_TOOLKIT_TARGET_DIR for android:
use targets/armv7-linux-androideabi is exists
2013-11-28 13:35:23 +04:00
Roman Donchenko 70c1b700d9 Merge pull request #1879 from LeszekSwirski:traincascade-2.4 2013-11-28 12:24:45 +04:00
Roman Donchenko 19b88a17bf Merge pull request #1873 from abak:hough_24 2013-11-28 12:11:24 +04:00
Vladislav Vinogradov 81acc5e73e added -Xptxas;-dlcm=ca and -target-os-variant=Android to nvcc flags 2013-11-28 10:00:55 +04:00
Vladislav Vinogradov 26cb0ce1d5 fixed compilation warnings in .cu files 2013-11-28 10:00:48 +04:00
Vladislav Vinogradov 20641b4a0b fixed CC arch/pts for android (used sm_32) 2013-11-28 10:00:47 +04:00
Vladislav Vinogradov 51663f5612 enable CUDA support for android 2013-11-28 10:00:47 +04:00
Alexander Smorkalov 2cfd635e9e Image processing sample for WinRT added. 2013-11-27 21:54:11 -08:00
Vladislav Vinogradov 7537521f53 disabled MOG2 performance test (sanity check fails on CUDA 6.0) 2013-11-28 09:50:05 +04:00
Vladislav Vinogradov 7c43daccba fixed perf tests for bgfg segmentation 2013-11-28 09:49:50 +04:00
Adrien BAK 38904c9a11 fix exception being thrown when no arguments are passed 2013-11-28 12:09:17 +09:00
Adrien BAK 094d7c4926 build fix 2013-11-28 11:42:44 +09:00
Anatoly Baksheev 37a754621a Fixed compilation errors: removed using namespace from hpp file. This led to pulling cv::ACCESS_MASK to global namespace where conflict with the same name in 'windows.h'
Conflicts:
	apps/traincascade/boost.cpp
2013-11-27 14:53:21 +00:00
Andrey Kamaev bef34093aa Remove all using directives for STL namespace and members
Made all STL usages explicit to be able automatically find all usages of
particular class or function.

(cherry picked from commit 2a6fb2867e)
(only cherry picked "apps/trancascade")
2013-11-27 14:46:47 +00:00
Roman Donchenko d5ead208b7 Merge pull request #1858 from StevenPuttemans:updates_traincascade 2013-11-27 17:37:36 +04:00
Roman Donchenko 935f973575 Merge pull request #1877 from tim36272:patch-2 2013-11-27 17:35:53 +04:00
tim36272 7539156109 Fixed minor documentation typo
In section "How do we get an Affine Transformation" subsection 2 there was a ' where there should have been a ` which caused the math to be rendered incorrectly.
2013-11-27 04:09:40 -08:00
StevenPuttemans a4239f972b Added extras to traincascade functionality 2013-11-27 12:54:11 +01:00
Roman Donchenko 10aec14a4d Merge pull request #1849 from StevenPuttemans:feature_3375_documentation 2013-11-27 13:22:31 +04:00
Andrey Pavlenko 1253c2101b Merge pull request #1875 from asmorkalov:android_bin_compat_fix 2013-11-26 23:17:28 +04:00
Alexander Smorkalov 8fe4ab280b Build error fix for binary-complience-checker tool. 2013-11-26 17:39:40 +04:00
Adrien BAK dda3b534ad fix indent 2013-11-26 16:09:59 +09:00
Adrien BAK 1c025be068 fix typos 2013-11-26 16:09:42 +09:00
Adrien BAK 514f1fae95 improved error handling 2013-11-26 16:09:29 +09:00
Adrien BAK 8a2de2ecca modified HoughCircleDemo to introduce variable params via trackbars
Conflicts:
	samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp
2013-11-26 16:09:04 +09:00
Andrey Pavlenko d45ce086c1 Merge pull request #1856 from alalek:ocl_fix_mt 2013-11-26 09:58:22 +04:00
StevenPuttemans 6f892b10ff Applied feature #3375 and fix of pull 1842 to avoid merging problems later 2013-11-25 10:53:03 +01:00
Roman Donchenko 16a11cfb27 Merge pull request #1842 from StevenPuttemans:bugfix_3315 2013-11-25 12:38:56 +04:00
StevenPuttemans 1b0297d92b Added fixes mentioned in bugreport 3306
- Added author provided fixes
- Added code example
- Added documentation fixes
2013-11-25 09:35:23 +01:00
Roman Donchenko 75fba08042 Merge pull request #1822 from SpecLad:msvc12 2013-11-25 12:19:58 +04:00
Roman Donchenko 4c5593b633 Merge pull request #1837 from asmorkalov:android_opencl 2013-11-25 12:19:20 +04:00
Roman Donchenko 06f6f74e61 Merge pull request #1839 from pmiecielica:memory_leaks 2013-11-25 12:17:08 +04:00
Roman Donchenko 59aa516ca5 Merge pull request #1860 from alalek:ocl_fix_undef_warn 2013-11-25 12:00:25 +04:00
Roman Donchenko 0537747f79 Merge pull request #1853 from StevenPuttemans:bugfix_3346 2013-11-22 18:26:16 +04:00
Alexander Alekhin ddc9be9170 ocl: don't disable Undef warnings 2013-11-22 18:24:50 +04:00
Alexander Alekhin fbc91c5ee9 ocl: fix cl_platform.h:95: #elif _WIN32 -> #elif defined(_WIN32) 2013-11-22 18:24:20 +04:00
Roman Donchenko 901dc3b878 Merge pull request #1854 from asmorkalov:android_engine_tegra4i5 2013-11-22 18:15:49 +04:00
Piotr Miecielica a19cc6cb64 Added pointer initialization 2013-11-22 13:33:33 +01:00
Alexander Smorkalov 514e97223c Some hacks to build and run OpenCL on Qualcomm S800.
Some of functions were enabled on Qualcomm S800 by changing grid size;
OpenCL kernel grid size unification for different platfroms;
Test pass rate improvements by inclreasing threshold;
Some tests were disabled for Android;
run.py was adopted for devices with brackets in in name.
2013-11-22 16:13:38 +04:00
Alexander Alekhin d650efc069 ocl: multi-threading: opencl buffer memory guard 2013-11-22 14:39:51 +04:00
Alexander Alekhin 96a4a7b339 ocl: multi-threading: fix bug in intialization 2013-11-22 14:39:33 +04:00
Alexander Smorkalov bd314bf955 VFPv4 detection implemented. Some Tegra5 related updates. 2013-11-22 14:30:23 +04:00
StevenPuttemans 2427c03625 Wrong example at the visual studio tutorial. Fixed link, fixed sample
content and renamed to a more sensible name. Also fixed a wrong link in the
actual display_image tutorial.
2013-11-22 10:41:17 +01:00
StevenPuttemans 7a8bd31657 Fixed bug in report #3346 2013-11-22 09:57:47 +01:00
Alexander Smorkalov fd759223fa Package selection for Tegra 4i fixed. Initial Tegra5 support added. 2013-11-22 11:46:18 +04:00
Piotr Miecielica 923698d700 Fixes of some memory leaks 2013-11-21 18:55:09 +01:00
Andrey Pavlenko 8a4f35704a Merge pull request #1840 from ilya-lavrenov:ocl_cvtColor 2013-11-21 17:32:53 +04:00
Roman Donchenko 2509b7954e Merge pull request #1838 from alekcac:ios64_fix 2013-11-21 17:11:29 +04:00
Ilya Lavrenov d764af5318 added extra parameters to ocl::cvtColor performance test 2013-11-21 12:53:21 +04:00
Roman Donchenko 6b23cb5b02 Merge pull request #1795 from alalek:perf_report_progress 2013-11-21 12:31:36 +04:00
Roman Donchenko b8f5fcf3f9 Merge pull request #1776 from philippefoubert:merge_upstream_2.4_ximea 2013-11-21 12:03:02 +04:00
Roman Donchenko 623a02c69f Merge pull request #1834 from SpecLad:svm-copy-ctor 2013-11-21 11:55:20 +04:00
Alexander Alekhin c1541c9e79 perf report: summary.py: added --progress mode 2013-11-20 19:57:20 +04:00
Roman Donchenko 70a4de20d7 Merge pull request #1836 from ilya-lavrenov:ocl_norm_workaround 2013-11-20 18:19:08 +04:00
Alexander Shishkov 9631cb6de9 fix for supporting 64-bit architecture 2013-11-20 18:08:05 +04:00
Roman Donchenko f6283432ff Merge pull request #1833 from SpecLad:fix-qt-sample 2013-11-20 17:59:35 +04:00
Roman Donchenko 8ac3ddf421 Merge pull request #1829 from SpecLad:config-components-libs 2013-11-20 15:57:14 +04:00
Ilya Lavrenov 60b59eeb73 workaround for AMD bug: UNREACHABLE EXECUTED 2013-11-20 15:40:56 +04:00
Roman Donchenko cf00349b5b Gave CvSVM a private copy constructor & assignment operator.
The implicitly generated ones don't work properly, and I don't want to
write proper ones. :-)

"Fixes" <http://code.opencv.org/issues/3358>.
2013-11-20 14:59:42 +04:00
Roman Donchenko b8283edfca Fix the Qt sample, broken after #1722. 2013-11-20 14:57:21 +04:00
Roman Donchenko b197ec9413 Merge pull request #1761 from bhuroc:qtkit-video-file-2.4 2013-11-20 13:36:37 +04:00
Philippe FOUBERT 78e16a906b Back to the previous coding way (using the macro with the goto). 2013-11-19 21:51:47 +01:00
Roman Donchenko 4037a4f227 Fixed OpenCV_LIBS when find_package has been used with explicit components.
Fixes <http://answers.opencv.org/question/23997/opencv-247-cmake-includes-all-modules-even-if-i/>.
2013-11-19 18:44:17 +04:00
Roman Donchenko e69d2c1bb1 Merge pull request #1819 from ilya-lavrenov:ocl_resize_AREA 2013-11-19 16:25:47 +04:00
Roman Donchenko 5c77784ac9 Merge pull request #1827 from asmorkalov:android_ndk_r9b 2013-11-19 14:53:16 +04:00
Roman Donchenko 0a90a36a1f Merge pull request #1793 from SpecLad:external-docs-1 2013-11-19 14:21:48 +04:00
Roman Donchenko c47190ef90 Merge pull request #1787 from hs3180:2.4 2013-11-19 14:21:25 +04:00
Ilya Lavrenov 198cd1a40d added area fast mode to ocl::resize 2013-11-19 13:43:50 +04:00
Roman Donchenko 4746a710bb Merge pull request #1820 from asmorkalov:android_native_camera_44 2013-11-19 12:47:48 +04:00
Roman Donchenko 3e55d705cc Merge pull request #1823 from ilya-lavrenov:ocl_abs_sum 2013-11-19 12:34:09 +04:00
Roman Donchenko 56f791679b Merge pull request #1825 from jet47:fix-opengl-mem-leak 2013-11-19 12:31:53 +04:00
Roman Donchenko 68d1110cde Merge pull request #1821 from SpecLad:watch-your-slashes 2013-11-19 12:29:55 +04:00
Alexander Smorkalov e08b075db0 Android NDK r9b support added. 2013-11-19 11:46:29 +04:00
Vladislav Vinogradov 66221a32b9 fixed memory leak in ogl::Texture2D 2013-11-19 10:12:22 +04:00
Ilya Lavrenov c0456df611 workaround for ocl::absSum (eliminated error: unreachable executed) 2013-11-18 20:38:39 +04:00
Roman Donchenko 85f92fabbd Merge pull request #1815 from asmorkalov:android_native_camera_build_automation 2013-11-18 19:44:33 +04:00
Roman Donchenko 239704f986 Added Visual Studio 2013 detection. 2013-11-18 19:39:39 +04:00
Roman Donchenko 7973594a01 Removed all slashes after ${OpenCV_INSTALL_BINARIES_PREFIX}.
If it's followed by a slash and OpenCV_INSTALL_BINARIES_PREFIX is empty,
then the resulting path becomes absolute.

Fixes <http://code.opencv.org/issues/3350>.
2013-11-18 19:21:31 +04:00
Ilya Lavrenov f70d63e4c9 added INTER_AREA interpolation to ocl::resize 2013-11-18 18:28:49 +04:00
Alexander Smorkalov 26d3a1a036 Prebuilt libnative_camera_xxx updated. 2013-11-18 18:19:38 +04:00
Alexander Smorkalov 04d293d2c4 Initial NativeCamera support for Android 4.4 KitKat. 2013-11-18 18:07:26 +04:00
Roman Donchenko cdf4e4e0b5 Merge pull request #1810 from Nerei:2.4 2013-11-18 17:49:40 +04:00
Alexander Smorkalov e3f450cffb NativeCamera build with AndroidStub backported from OpenCV master. 2013-11-18 17:43:21 +04:00
Roman Donchenko 8b99a1e850 Merge pull request #1806 from akarsakov:ffmpeg_without_iconv 2013-11-18 17:26:40 +04:00
Roman Donchenko 7703b63cae Merge pull request #1722 from StevenPuttemans:feature_1631_second 2013-11-18 15:48:27 +04:00
Roman Donchenko 4fd1960425 Merge pull request #1807 from KonstantinMatskevich:intel_bug 2013-11-18 15:16:37 +04:00
Roman Donchenko 3f927abb4d Merge pull request #1809 from ilya-lavrenov:ocl_resize_nn 2013-11-18 14:55:24 +04:00
Alexander Karsakov 83cefcb92a FFmpeg 2.0.2 32-bit builded with mingw (4.6.1) with following additional options: --enable-w32threads --disable-iconv --cpu=i686 (workaroud for http://trac.ffmpeg.org/ticket/2363) 2013-11-18 13:56:02 +04:00
Konstantin Matskevich 327d9f274b fixed Split for device version equals 78712 2013-11-18 13:20:57 +04:00
Konstantin Matskevich 0e1717c14c fixing bugs for Intel platform CPU device 2013-11-18 13:20:54 +04:00
Roman Donchenko f5ded41016 Merge pull request #1808 from alalek:ocl_fix_cvtcolor_xyz 2013-11-18 12:20:58 +04:00
StevenPuttemans 2b106db02f Applied all fixes related to translating C to C++ code
Also fixed some typos and code alignment
Also adapted tutorial CPP samples
Fixed some identation problems
2013-11-17 20:34:50 +01:00
Anatoly Baksheev 13bb236ad5 fixed some warnings 2013-11-16 21:18:36 +04:00
Anatoly Baksheev 8f6f9c3e58 compilation for VS2008 2013-11-16 20:14:01 +04:00
Alexander Alekhin 0a698bf145 ocl: fix cvtColor XYZ: variables on stack 2013-11-16 13:45:39 +04:00
Ilya Lavrenov cc237b7aba generalized ocl::resize for all data types (INTER_NEAREST mode) 2013-11-15 22:52:29 +04:00
Roman Donchenko f95ff0a352 Merge pull request #1802 from SpecLad:cmake-templates 2013-11-15 16:52:56 +04:00
Roman Donchenko 4e2ec7b97d Merge pull request #1803 from ilya-lavrenov:ocl_cvtColor 2013-11-15 15:55:29 +04:00
Roman Donchenko 2e79dde357 Merge pull request #1799 from SpecLad:avformat-53-6 2013-11-15 11:51:59 +04:00
moodoki cebf109d39 Replaced code in .rst file with literalinclude as suggested 2013-11-15 00:27:07 +08:00
Roman Donchenko 428fb72625 Made the generated file templates' naming more consistent.
The general convention is <output file name> + ".in".
2013-11-14 19:14:38 +04:00
Roman Donchenko 3b7acf2657 Fix building with FFmpeg 0.8.
avformat_find_stream_info was introduced in Libav avformat 53.3,
but it was only merged to FFmpeg in avformat 53.6.

In Libav avformat 53.3-53.5 av_find_stream_info is not removed
(only deprecated), so this shouldn't break building with that.
2013-11-14 17:25:46 +04:00
Roman Donchenko 01f8645bc8 Merge pull request #1794 from vrabaud:2.4 2013-11-14 16:43:50 +04:00
Roman Donchenko be88b20154 Merge pull request #1796 from ilya-lavrenov:ocl_cvtColor 2013-11-14 14:46:43 +04:00
Roman Donchenko 84da6ca265 Merge pull request #1792 from ilya-lavrenov:ocl_warp_eps 2013-11-14 14:46:06 +04:00
Roman Donchenko 19b3064706 Merge pull request #1790 from ilya-lavrenov:ocl_ref 2013-11-14 14:45:50 +04:00
Vincent Rabaud 8e944cfe70 cleaner fix 2013-11-14 11:45:42 +01:00
Ilya Lavrenov fe76b2116a added RGBA <-> mRGBA 2013-11-14 12:02:59 +04:00
moodoki b8de81749c Slight modification to example code for FLANN matcher with comment on #3344 2013-11-14 00:22:20 +08:00
Ilya Lavrenov 1b7c5b201d added HLS -> RGB[A][FULL] conversion 2013-11-13 19:35:24 +04:00
Ilya Lavrenov 98915e06bc added HSV -> RGB[A][FULL] conversion 2013-11-13 19:10:06 +04:00
Ilya Lavrenov 3bdd9626f3 added RGB[A] -> HLS[FULL] conversion 2013-11-13 17:41:40 +04:00
Roman Donchenko 15f4292a1f Merge pull request #1788 from alalek:perf_test_skip 2013-11-13 17:21:52 +04:00
Vincent Rabaud ee7c74ceeb return when OpenCV is found 2013-11-13 14:20:09 +01:00
Ilya Lavrenov af7c614438 added RGB[A] -> HSV[FULL] conversion 2013-11-13 17:09:05 +04:00
Roman Donchenko 411629a57d Merge pull request #1786 from SpecLad:cap-images-file-pattern 2013-11-13 17:00:20 +04:00
Roman Donchenko 54ea5bbac7 Merge pull request #1779 from perping:integral_2.4 2013-11-13 15:53:42 +04:00
Roman Donchenko 28e0d3d771 Merge pull request #1784 from SpecLad:ffmpeg-no-png 2013-11-13 15:52:42 +04:00
Vincent Rabaud 9007a02302 fixes http://code.opencv.org/issues/3367 2013-11-13 12:25:44 +01:00
Alexander Alekhin fb326a58fc ocl: perf tests: skip tests if we fail check for maxMemoryAllocSize 2013-11-13 14:17:57 +04:00
Alexander Alekhin f1873bbca1 perf tests: allow to skip performance tests 2013-11-13 14:17:56 +04:00
Ilya Lavrenov 6770c04073 refactored some functions from ocl arithm 2013-11-13 13:56:49 +04:00
Ilya Lavrenov c38e4f9639 added eps to ocl::buildWarpPerspectiveMaps perf test 2013-11-13 13:04:02 +04:00
Roman Donchenko 376993be4c Merge pull request #1785 from ilya-lavrenov:ocl_kern_warn 2013-11-13 12:20:09 +04:00
Roman Donchenko df6bce372b Merge pull request #1789 from ilya-lavrenov:ocl_minMaxLoc 2013-11-13 12:16:02 +04:00
perping 185059959b fix haar 2013-11-13 10:19:09 +08:00
perping 1e2fb6de30 fix match_template and haar 2013-11-13 10:09:39 +08:00
Roman Donchenko 3314bc94b6 Reworked documentation building to work with extra modules.
The main problem with extra modules is that they're located outside
of the OpenCV root, while Sphinx requires that all documents are
within the documentation root. To circumvent this, we create a
"fake root" and copy all documentation (as well as all files that
it depends on) there. It's a bit messy, but what can you do.

As a bonus, this eliminates the need to generate modules/refman.rst
inside the source tree.
2013-11-12 19:38:59 +04:00
Ilya Lavrenov 0bf7350615 fixed compilation of ocl::minMaxLoc for Intel device 2013-11-12 19:14:40 +04:00
huangs f02ce90559 minX1 should be max(-maxD,0) not max(maxD,0), avoid black band at left 2013-11-12 22:37:23 +08:00
Roman Donchenko b8e3d3f791 In the image sequence capture, only search for the ordinal in the file name.
Searching in directory names can yield confusing results; e.g. if
the input is "jpeg2000/image1.jp2", it will infer the pattern
"jpeg%04d/image1.jp2", which is likely not what the user intended.

If the user really desires for the variable part to be in the
directory name, it can always use an explicit pattern.
2013-11-12 16:26:21 +04:00
Ilya Lavrenov 96121a66c5 kernel warnings on AMD 2013-11-12 15:06:46 +04:00
Roman Donchenko a81efdbb25 Merge pull request #1775 from ilya-lavrenov:ocl_cvtColor 2013-11-12 14:26:50 +04:00
perping d6e0ef2710 fix linux warning. 2013-11-12 18:13:44 +08:00
perping dee584ee15 fix haar 2013-11-12 17:54:03 +08:00
Roman Donchenko 834705490e Merge pull request #1782 from ilya-lavrenov:ocl_adapBilat 2013-11-12 12:53:34 +04:00
Roman Donchenko ef4eadd5d3 Merge pull request #1766 from ilya-lavrenov:ocl_remap_linear 2013-11-12 12:40:14 +04:00
Roman Donchenko 46e423d217 Merge pull request #1773 from ilya-lavrenov:ocl_buildWarpPerspectiveMaps 2013-11-12 12:26:37 +04:00
Roman Donchenko 6773914144 Merge pull request #1783 from SpecLad:cap-no-pattern 2013-11-12 11:52:50 +04:00
perping 8af626d295 fix some bug about haar and match_template. 2013-11-12 13:56:47 +08:00
Ilya Lavrenov eda6360fa3 added RGB5x5 <-> Gray 2013-11-12 00:32:10 +04:00
Philippe FOUBERT 93120775cd Using four spaces for indentation. 2013-11-11 20:40:18 +01:00
Roman Donchenko 405227d531 Replaced the image used in the Highgui_Video.ffmpeg_image test.
Our prebuilt FFmpeg Windows binaries don't have PNG support enabled
(because that requires zlib), so that makes a PNG image a bad choice
for this test.

When FFmpeg doesn't support PNG, VideoCapture falls back to the
"image sequence" implementation, which doesn't work for single images.
2013-11-11 18:30:04 +04:00
Ilya Lavrenov daedc6f454 removed 2000x2000, 4000x4000 from test sizes of ocl::adaptiveBilateralFilter 2013-11-11 18:14:44 +04:00
Roman Donchenko eff53e95f9 Fixed the "image sequence" capture not failing when a pattern isn't found.
at can't be a null pointer, so the condition was always false, and
a nonsensical pattern like "image.png%00d" was being inferred.
2013-11-11 18:12:49 +04:00
Ilya Lavrenov 3727168b50 added a performance test for ocl::buildWarpPerspectiveMaps; moved warps to a separate file 2013-11-11 18:07:23 +04:00
Roman Donchenko e4dee5b372 Merge pull request #1780 from ilya-lavrenov:ocl_m_pi 2013-11-11 17:00:31 +04:00
Ilya Lavrenov 1f421fce01 added RGB5x5 <-> RGB conversion 2013-11-11 14:50:44 +04:00
Philippe FOUBERT 05d9375759 Trailing whitespace removal. 2013-11-11 10:26:28 +01:00
perping 73b34e3f85 fix warning. 2013-11-11 15:06:58 +08:00
perping 50579d2524 Make Integral sum support cv_32f, sqsum support cv_64f. 2013-11-11 14:31:02 +08:00
Ilya Lavrenov 5beb887247 replaced custom PI by OpenCL M_PI constant 2013-11-11 00:55:59 +04:00
Ilya Lavrenov 3cc9502c90 added RGB[A] <-> BGR[A] conversion to ocl::cvtColor 2013-11-10 23:14:36 +04:00
Philippe FOUBERT 8b0fc04d93 Fix the build of OpenCV with XIMEA on Windows 64 bits:
- crosses initializations in "cap_ximea.cpp" (which also contained some awfull "goto" instructions)
  - the "CMAKE_CL_64" variable is not initialized when using mingw

PR#1039 modified to be able to merge on branch 2.4
2013-11-10 17:46:59 +01:00
Ilya Lavrenov 581a3e444d added XYZ to RGB conversion to ocl::cvtColor 2013-11-10 14:37:21 +04:00
Ilya Lavrenov 5e02b20482 added RGB -> XYZ conversion to ocl::cvtColor 2013-11-10 13:38:09 +04:00
Ilya Lavrenov 33ae64201c color.cpp refactoring: created generic interface for toRGB and fromRGB callers 2013-11-10 00:44:37 +04:00
Ilya Lavrenov a57030a0cd added YCrCb to RGB, BGR, RGBA, BGRA modes to ocl::cvtColor 2013-11-09 17:03:30 +04:00
Ilya Lavrenov eba6754b06 fixed ocl::cvtColor for CV_YUV2BGRA and CV_YUV2RGBA 2013-11-09 00:40:45 +04:00
Ilya Lavrenov 8b57893e40 added an accuracy test for ocl::buildWarpPerspectiveMaps 2013-11-08 18:42:13 +04:00
Ilya Lavrenov 4248f82211 added ROI support to ocl::buildWarp*Maps functions 2013-11-08 18:40:53 +04:00
Roman Donchenko 0ac61240c5 Merge pull request #1771 from kiranpradeep:2.4 2013-11-08 17:16:20 +04:00
Kiran Pradeep 5852a913a8 CMake's get_filename_component with NAME_WE parameters, interprets first period as start of extension. For. e.g file name with out extension of 'this.is.a.text.file.txt' will be taken as 'this'. Hence using NAME with regex replacement to get 'this.is.a.text.file' 2013-11-08 14:09:34 +05:30
Roman Donchenko 800d53f76b Merge pull request #1759 from ilya-lavrenov:ocl_distanceToCenters 2013-11-08 12:39:14 +04:00
Roman Donchenko 0be2752366 Merge pull request #1755 from KonstantinMatskevich:dump_info 2013-11-08 12:31:04 +04:00
Roman Donchenko 0fb629915f Merge pull request #1763 from SpecLad:cv-func 2013-11-08 12:29:50 +04:00
Baichuan Su 9a0d06247a Fix the whitespace warning. 2013-11-07 15:04:17 -08:00
Ilya Lavrenov 760b718981 added CV_16SC2 && CV_16UC1 map types support to ocl::remap (INTER_LINEAR mode) 2013-11-08 01:42:48 +04:00
Baichuan Su 99a00d3dd9 Fix merge conflicts 2013-11-07 09:56:59 -08:00
Baichuan Su befcbf56fe A minor fix. 2013-11-07 08:52:40 -08:00
Baichuan Su f0de1a08b8 Fix ocl::calcHarris not support CV_32FC1 bug. 2013-11-07 08:52:39 -08:00
Roman Donchenko 07db81a4bb Merge pull request #1760 from ilya-lavrenov:ocl_remap_nn 2013-11-07 17:29:16 +04:00
Roman Donchenko 2c38be079e Enabled CV_Assert and such to print the function name with Visual C++.
Also, I made a separate macro for the current function name, which
helps simplify a lot of code that uses it.
2013-11-07 17:22:02 +04:00
Konstantin Matskevich e9edfd1c54 update 2013-11-07 17:21:56 +04:00
Roman Donchenko 641bb7ac6b Merge pull request #1737 from vrabaud:2.4 2013-11-07 12:03:30 +04:00
Bo Hu c88fa27b1d Removed trailing whitespace in cap_qtkit.mm. 2013-11-06 13:33:17 -08:00
Bo Hu 114579c33b Added proper testing of the end of quicktime video files.
CvCaptureFile::grabFrame() always returns 1 regardless, which causes
dead loop when relying on the return value of VideoCapture::read().
2013-11-06 13:32:11 -08:00
Ilya Lavrenov fa15769f39 added CV_16SC2 && CV_16UC1 maps support to ocl::remap (nearest neighbour only) 2013-11-06 23:14:04 +04:00
Ilya Lavrenov 56d943388d speeded up ocl::distanceToCenters 2013-11-06 20:02:31 +04:00
Konstantin Matskevich 5304e9f259 extending openCL info dump 2013-11-06 15:20:05 +04:00
Vincent Rabaud 0b1df62215 add VERBATIM as advised by @SpecLad 2013-11-05 12:02:22 +01:00
Vincent Rabaud 3b0108e4c1 fix the crash as suggested by @SpecLad 2013-11-05 11:18:20 +01:00
Vincent Rabaud e1b2f593d6 fix crash when path has spaces
The paths are defined properly with an escape "\ " but you cannot have an escape and
quotes when piping (otherwise, escapes are understood as 2 characters).
So just remove the quotes.
2013-11-01 19:30:58 +01:00
Ilya Lavrenov d57a7008f1 fixed cmd parser when arg is like -+ 2013-10-09 17:42:36 +04:00
401 arquivos alterados com 8062 adições e 3117 exclusões
-1
Ver Arquivo
@@ -4,6 +4,5 @@
.*.swp
.DS_Store
.sw[a-z]
/modules/refman.rst
tags
tegra/
+1 -1
Ver Arquivo
@@ -1,2 +1,2 @@
set path=c:\dev\msys32\bin;%path% & gcc -Wall -shared -o opencv_ffmpeg.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat -lavcodec -lavdevice -lswscale -lavutil -liconv -lws2_32
set path=c:\dev\msys32\bin;%path% & gcc -Wall -shared -o opencv_ffmpeg.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat -lavcodec -lavdevice -lswscale -lavutil -lws2_32
set path=c:\dev\msys64\bin;%path% & gcc -m64 -Wall -shared -o opencv_ffmpeg_64.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat64 -lavcodec64 -lavdevice64 -lswscale64 -lavutil64 -lws2_32
Arquivo binário não exibido.
+2 -2
Ver Arquivo
@@ -92,7 +92,7 @@ extern "C" {
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED __attribute__((deprecated))
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#endif
#elif _WIN32
#elif defined(_WIN32)
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
@@ -454,7 +454,7 @@ typedef unsigned int cl_GLenum;
/* Define alignment keys */
#if defined( __GNUC__ )
#define CL_ALIGNED(_x) __attribute__ ((aligned(_x)))
#elif defined( _WIN32) && (_MSC_VER)
#elif defined( _WIN32) && defined(_MSC_VER)
/* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements */
/* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx */
/* #include <crtdefs.h> */
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
+1
Ver Arquivo
@@ -42,6 +42,7 @@
#include <ImfRgbaFile.h>
#include <ImfStandardAttributes.h>
#include <Iex.h>
#include <algorithm> // for std::max()
using namespace std;
using namespace Imath;
+1
Ver Arquivo
@@ -58,6 +58,7 @@
#include <vector>
#include <fstream>
#include <assert.h>
#include <algorithm> // for std::max()
namespace Imf {
+1
Ver Arquivo
@@ -56,6 +56,7 @@
#include <string>
#include <vector>
#include <assert.h>
#include <algorithm> // for std::max()
namespace Imf {
+1
Ver Arquivo
@@ -43,6 +43,7 @@
#include "Iex.h"
#include <ImfMisc.h>
#include <ImfChannelList.h>
#include <algorithm> // for std::max()
namespace Imf {
+1
Ver Arquivo
@@ -63,6 +63,7 @@
#include <fstream>
#include <assert.h>
#include <map>
#include <algorithm> // for std::max()
namespace Imf {
+1
Ver Arquivo
@@ -44,6 +44,7 @@
#include "ImathMatrixAlgo.h"
#include <cmath>
#include <algorithm> // for std::max()
#if defined(OPENEXR_DLL)
#define EXPORT_CONST __declspec(dllexport)
+72
Ver Arquivo
@@ -0,0 +1,72 @@
diff --git a/3rdparty/openexr/IlmImf/ImfAcesFile.cpp b/3rdparty/openexr/IlmImf/ImfAcesFile.cpp
index de4bf83..9418b9d 100644
--- a/3rdparty/openexr/IlmImf/ImfAcesFile.cpp
+++ b/3rdparty/openexr/IlmImf/ImfAcesFile.cpp
@@ -42,6 +42,7 @@
#include <ImfRgbaFile.h>
#include <ImfStandardAttributes.h>
#include <Iex.h>
+#include <algorithm> // for std::max()
using namespace std;
using namespace Imath;
diff --git a/3rdparty/openexr/IlmImf/ImfOutputFile.cpp b/3rdparty/openexr/IlmImf/ImfOutputFile.cpp
index 8831ec9..e69b92b 100644
--- a/3rdparty/openexr/IlmImf/ImfOutputFile.cpp
+++ b/3rdparty/openexr/IlmImf/ImfOutputFile.cpp
@@ -58,6 +58,7 @@
#include <vector>
#include <fstream>
#include <assert.h>
+#include <algorithm> // for std::max()
namespace Imf {
diff --git a/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp b/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp
index f7a12a3..5d8b522 100644
--- a/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp
+++ b/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp
@@ -56,6 +56,7 @@
#include <string>
#include <vector>
#include <assert.h>
+#include <algorithm> // for std::max()
namespace Imf {
diff --git a/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp b/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp
index 57f52f1..9588e78 100644
--- a/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp
+++ b/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp
@@ -43,6 +43,7 @@
#include "Iex.h"
#include <ImfMisc.h>
#include <ImfChannelList.h>
+#include <algorithm> // for std::max()
namespace Imf {
diff --git a/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp b/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp
index 0882106..0bc3cb3 100644
--- a/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp
+++ b/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp
@@ -63,6 +63,7 @@
#include <fstream>
#include <assert.h>
#include <map>
+#include <algorithm> // for std::max()
namespace Imf {
diff --git a/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp b/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp
index f0d2ed6..7ddc649 100644
--- a/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp
+++ b/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp
@@ -44,6 +44,7 @@
#include "ImathMatrixAlgo.h"
#include <cmath>
+#include <algorithm> // for std::max()
#if defined(OPENEXR_DLL)
#define EXPORT_CONST __declspec(dllexport)
+4 -4
Ver Arquivo
@@ -127,9 +127,9 @@ endif()
OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O" ON IF IOS)
OCV_OPTION(WITH_CARBON "Use Carbon for UI instead of Cocoa" OFF IF APPLE )
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS AND NOT APPLE) )
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF WIN32 )
@@ -160,7 +160,7 @@ OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON
OCV_OPTION(WITH_MSMF "Build HighGUI with Media Foundation support" OFF IF WIN32 )
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE) )
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT IOS) )
OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON IF (NOT ANDROID AND NOT IOS) )
+2
Ver Arquivo
@@ -4,6 +4,8 @@
#include "HOGfeatures.h"
#include "cascadeclassifier.h"
using namespace std;
using namespace cv;
CvHOGFeatureParams::CvHOGFeatureParams()
{
+12 -12
Ver Arquivo
@@ -20,33 +20,33 @@ class CvHOGEvaluator : public CvFeatureEvaluator
public:
virtual ~CvHOGEvaluator() {}
virtual void init(const CvFeatureParams *_featureParams,
int _maxSampleCount, Size _winSize );
virtual void setImage(const Mat& img, uchar clsLabel, int idx);
int _maxSampleCount, cv::Size _winSize );
virtual void setImage(const cv::Mat& img, uchar clsLabel, int idx);
virtual float operator()(int varIdx, int sampleIdx) const;
virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const;
virtual void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
protected:
virtual void generateFeatures();
virtual void integralHistogram(const Mat &img, vector<Mat> &histogram, Mat &norm, int nbins) const;
virtual void integralHistogram(const cv::Mat &img, std::vector<cv::Mat> &histogram, cv::Mat &norm, int nbins) const;
class Feature
{
public:
Feature();
Feature( int offset, int x, int y, int cellW, int cellH );
float calc( const vector<Mat> &_hists, const Mat &_normSum, size_t y, int featComponent ) const;
void write( FileStorage &fs ) const;
void write( FileStorage &fs, int varIdx ) const;
float calc( const std::vector<cv::Mat> &_hists, const cv::Mat &_normSum, size_t y, int featComponent ) const;
void write( cv::FileStorage &fs ) const;
void write( cv::FileStorage &fs, int varIdx ) const;
Rect rect[N_CELLS]; //cells
cv::Rect rect[N_CELLS]; //cells
struct
{
int p0, p1, p2, p3;
} fastRect[N_CELLS];
};
vector<Feature> features;
std::vector<Feature> features;
Mat normSum; //for nomalization calculation (L1 or L2)
vector<Mat> hist;
cv::Mat normSum; //for nomalization calculation (L1 or L2)
std::vector<cv::Mat> hist;
};
inline float CvHOGEvaluator::operator()(int varIdx, int sampleIdx) const
@@ -57,7 +57,7 @@ inline float CvHOGEvaluator::operator()(int varIdx, int sampleIdx) const
return features[featureIdx].calc( hist, normSum, sampleIdx, componentIdx);
}
inline float CvHOGEvaluator::Feature::calc( const vector<Mat>& _hists, const Mat& _normSum, size_t y, int featComponent ) const
inline float CvHOGEvaluator::Feature::calc( const std::vector<cv::Mat>& _hists, const cv::Mat& _normSum, size_t y, int featComponent ) const
{
float normFactor;
float res;
+19 -6
Ver Arquivo
@@ -1,6 +1,19 @@
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
using cv::Size;
using cv::Mat;
using cv::Point;
using cv::FileStorage;
using cv::Rect;
using cv::Ptr;
using cv::FileNode;
using cv::Mat_;
using cv::Range;
using cv::FileNodeIterator;
using cv::ParallelLoopBody;
#include "boost.h"
#include "cascadeclassifier.h"
#include <queue>
@@ -160,10 +173,10 @@ CvCascadeBoostParams::CvCascadeBoostParams( int _boostType,
void CvCascadeBoostParams::write( FileStorage &fs ) const
{
String boostTypeStr = boost_type == CvBoost::DISCRETE ? CC_DISCRETE_BOOST :
string boostTypeStr = boost_type == CvBoost::DISCRETE ? CC_DISCRETE_BOOST :
boost_type == CvBoost::REAL ? CC_REAL_BOOST :
boost_type == CvBoost::LOGIT ? CC_LOGIT_BOOST :
boost_type == CvBoost::GENTLE ? CC_GENTLE_BOOST : String();
boost_type == CvBoost::GENTLE ? CC_GENTLE_BOOST : string();
CV_Assert( !boostTypeStr.empty() );
fs << CC_BOOST_TYPE << boostTypeStr;
fs << CC_MINHITRATE << minHitRate;
@@ -175,7 +188,7 @@ void CvCascadeBoostParams::write( FileStorage &fs ) const
bool CvCascadeBoostParams::read( const FileNode &node )
{
String boostTypeStr;
string boostTypeStr;
FileNode rnode = node[CC_BOOST_TYPE];
rnode >> boostTypeStr;
boost_type = !boostTypeStr.compare( CC_DISCRETE_BOOST ) ? CvBoost::DISCRETE :
@@ -213,10 +226,10 @@ void CvCascadeBoostParams::printDefaults() const
void CvCascadeBoostParams::printAttrs() const
{
String boostTypeStr = boost_type == CvBoost::DISCRETE ? CC_DISCRETE_BOOST :
string boostTypeStr = boost_type == CvBoost::DISCRETE ? CC_DISCRETE_BOOST :
boost_type == CvBoost::REAL ? CC_REAL_BOOST :
boost_type == CvBoost::LOGIT ? CC_LOGIT_BOOST :
boost_type == CvBoost::GENTLE ? CC_GENTLE_BOOST : String();
boost_type == CvBoost::GENTLE ? CC_GENTLE_BOOST : string();
CV_Assert( !boostTypeStr.empty() );
cout << "boostType: " << boostTypeStr << endl;
cout << "minHitRate: " << minHitRate << endl;
@@ -226,7 +239,7 @@ void CvCascadeBoostParams::printAttrs() const
cout << "maxWeakCount: " << weak_count << endl;
}
bool CvCascadeBoostParams::scanAttr( const String prmName, const String val)
bool CvCascadeBoostParams::scanAttr( const string prmName, const string val)
{
bool res = true;
+10 -10
Ver Arquivo
@@ -13,11 +13,11 @@ struct CvCascadeBoostParams : CvBoostParams
CvCascadeBoostParams( int _boostType, float _minHitRate, float _maxFalseAlarm,
double _weightTrimRate, int _maxDepth, int _maxWeakCount );
virtual ~CvCascadeBoostParams() {}
void write( FileStorage &fs ) const;
bool read( const FileNode &node );
void write( cv::FileStorage &fs ) const;
bool read( const cv::FileNode &node );
virtual void printDefaults() const;
virtual void printAttrs() const;
virtual bool scanAttr( const String prmName, const String val);
virtual bool scanAttr( const std::string prmName, const std::string val);
};
struct CvCascadeBoostTrainData : CvDTreeTrainData
@@ -45,7 +45,7 @@ struct CvCascadeBoostTrainData : CvDTreeTrainData
virtual void free_train_data();
const CvFeatureEvaluator* featureEvaluator;
Mat valCache; // precalculated feature values (CV_32FC1)
cv::Mat valCache; // precalculated feature values (CV_32FC1)
CvMat _resp; // for casting
int numPrecalcVal, numPrecalcIdx;
};
@@ -54,9 +54,9 @@ class CvCascadeBoostTree : public CvBoostTree
{
public:
virtual CvDTreeNode* predict( int sampleIdx ) const;
void write( FileStorage &fs, const Mat& featureMap );
void read( const FileNode &node, CvBoost* _ensemble, CvDTreeTrainData* _data );
void markFeaturesInMap( Mat& featureMap );
void write( cv::FileStorage &fs, const cv::Mat& featureMap );
void read( const cv::FileNode &node, CvBoost* _ensemble, CvDTreeTrainData* _data );
void markFeaturesInMap( cv::Mat& featureMap );
protected:
virtual void split_node_data( CvDTreeNode* n );
};
@@ -70,10 +70,10 @@ public:
virtual float predict( int sampleIdx, bool returnSum = false ) const;
float getThreshold() const { return threshold; }
void write( FileStorage &fs, const Mat& featureMap ) const;
bool read( const FileNode &node, const CvFeatureEvaluator* _featureEvaluator,
void write( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
bool read( const cv::FileNode &node, const CvFeatureEvaluator* _featureEvaluator,
const CvCascadeBoostParams& _params );
void markUsedFeaturesInMap( Mat& featureMap );
void markUsedFeaturesInMap( cv::Mat& featureMap );
protected:
virtual bool set_params( const CvBoostParams& _params );
virtual void update_weights( CvBoostTree* tree );
+22 -9
Ver Arquivo
@@ -5,6 +5,7 @@
#include <queue>
using namespace std;
using namespace cv;
static const char* stageTypes[] = { CC_BOOST };
static const char* featureTypes[] = { CC_HAAR, CC_LBP, CC_HOG };
@@ -24,10 +25,10 @@ CvCascadeParams::CvCascadeParams( int _stageType, int _featureType ) : stageType
void CvCascadeParams::write( FileStorage &fs ) const
{
String stageTypeStr = stageType == BOOST ? CC_BOOST : String();
string stageTypeStr = stageType == BOOST ? CC_BOOST : string();
CV_Assert( !stageTypeStr.empty() );
fs << CC_STAGE_TYPE << stageTypeStr;
String featureTypeStr = featureType == CvFeatureParams::HAAR ? CC_HAAR :
string featureTypeStr = featureType == CvFeatureParams::HAAR ? CC_HAAR :
featureType == CvFeatureParams::LBP ? CC_LBP :
featureType == CvFeatureParams::HOG ? CC_HOG :
0;
@@ -41,7 +42,7 @@ bool CvCascadeParams::read( const FileNode &node )
{
if ( node.empty() )
return false;
String stageTypeStr, featureTypeStr;
string stageTypeStr, featureTypeStr;
FileNode rnode = node[CC_STAGE_TYPE];
if ( !rnode.isString() )
return false;
@@ -96,7 +97,7 @@ void CvCascadeParams::printAttrs() const
cout << "sampleHeight: " << winSize.height << endl;
}
bool CvCascadeParams::scanAttr( const String prmName, const String val )
bool CvCascadeParams::scanAttr( const string prmName, const string val )
{
bool res = true;
if( !prmName.compare( "-stageType" ) )
@@ -126,9 +127,9 @@ bool CvCascadeParams::scanAttr( const String prmName, const String val )
//---------------------------- CascadeClassifier --------------------------------------
bool CvCascadeClassifier::train( const String _cascadeDirName,
const String _posFilename,
const String _negFilename,
bool CvCascadeClassifier::train( const string _cascadeDirName,
const string _posFilename,
const string _negFilename,
int _numPos, int _numNeg,
int _precalcValBufSize, int _precalcIdxBufSize,
int _numStages,
@@ -137,6 +138,9 @@ bool CvCascadeClassifier::train( const String _cascadeDirName,
const CvCascadeBoostParams& _stageParams,
bool baseFormatSave )
{
// Start recording clock ticks for training time output
const clock_t begin_time = clock();
if( _cascadeDirName.empty() || _posFilename.empty() || _negFilename.empty() )
CV_Error( CV_StsBadArg, "_cascadeDirName or _bgfileName or _vecFileName is NULL" );
@@ -247,6 +251,14 @@ bool CvCascadeClassifier::train( const String _cascadeDirName,
fs << FileStorage::getDefaultObjectName(stageFilename) << "{";
tempStage->write( fs, Mat() );
fs << "}";
// Output training time up till now
float seconds = float( clock () - begin_time ) / CLOCKS_PER_SEC;
int days = int(seconds) / 60 / 60 / 24;
int hours = (int(seconds) / 60 / 60) % 24;
int minutes = (int(seconds) / 60) % 60;
int seconds_left = int(seconds) % 60;
cout << "Training until now has taken " << days << " days " << hours << " hours " << minutes << " minutes " << seconds_left <<" seconds." << endl;
}
if(stageClassifiers.size() == 0)
@@ -310,6 +322,7 @@ int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositiv
if( predict( i ) == 1.0F )
{
getcount++;
printf("%s current samples: %d\r", isPositive ? "POS":"NEG", getcount);
break;
}
}
@@ -399,7 +412,7 @@ bool CvCascadeClassifier::readStages( const FileNode &node)
#define ICV_HAAR_PARENT_NAME "parent"
#define ICV_HAAR_NEXT_NAME "next"
void CvCascadeClassifier::save( const String filename, bool baseFormat )
void CvCascadeClassifier::save( const string filename, bool baseFormat )
{
FileStorage fs( filename, FileStorage::WRITE );
@@ -491,7 +504,7 @@ void CvCascadeClassifier::save( const String filename, bool baseFormat )
fs << "}";
}
bool CvCascadeClassifier::load( const String cascadeDirName )
bool CvCascadeClassifier::load( const string cascadeDirName )
{
FileStorage fs( cascadeDirName + CC_PARAMS_FILENAME, FileStorage::READ );
if ( !fs.isOpened() )
+19 -19
Ver Arquivo
@@ -72,24 +72,24 @@ public:
CvCascadeParams();
CvCascadeParams( int _stageType, int _featureType );
void write( FileStorage &fs ) const;
bool read( const FileNode &node );
void write( cv::FileStorage &fs ) const;
bool read( const cv::FileNode &node );
void printDefaults() const;
void printAttrs() const;
bool scanAttr( const String prmName, const String val );
bool scanAttr( const std::string prmName, const std::string val );
int stageType;
int featureType;
Size winSize;
cv::Size winSize;
};
class CvCascadeClassifier
{
public:
bool train( const String _cascadeDirName,
const String _posFilename,
const String _negFilename,
bool train( const std::string _cascadeDirName,
const std::string _posFilename,
const std::string _negFilename,
int _numPos, int _numNeg,
int _precalcValBufSize, int _precalcIdxBufSize,
int _numStages,
@@ -99,25 +99,25 @@ public:
bool baseFormatSave = false );
private:
int predict( int sampleIdx );
void save( const String cascadeDirName, bool baseFormat = false );
bool load( const String cascadeDirName );
void save( const std::string cascadeDirName, bool baseFormat = false );
bool load( const std::string cascadeDirName );
bool updateTrainingSet( double& acceptanceRatio );
int fillPassedSamples( int first, int count, bool isPositive, int64& consumed );
void writeParams( FileStorage &fs ) const;
void writeStages( FileStorage &fs, const Mat& featureMap ) const;
void writeFeatures( FileStorage &fs, const Mat& featureMap ) const;
bool readParams( const FileNode &node );
bool readStages( const FileNode &node );
void writeParams( cv::FileStorage &fs ) const;
void writeStages( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
bool readParams( const cv::FileNode &node );
bool readStages( const cv::FileNode &node );
void getUsedFeaturesIdxMap( Mat& featureMap );
void getUsedFeaturesIdxMap( cv::Mat& featureMap );
CvCascadeParams cascadeParams;
Ptr<CvFeatureParams> featureParams;
Ptr<CvCascadeBoostParams> stageParams;
cv::Ptr<CvFeatureParams> featureParams;
cv::Ptr<CvCascadeBoostParams> stageParams;
Ptr<CvFeatureEvaluator> featureEvaluator;
vector< Ptr<CvCascadeBoost> > stageClassifiers;
cv::Ptr<CvFeatureEvaluator> featureEvaluator;
std::vector< cv::Ptr<CvCascadeBoost> > stageClassifiers;
CvCascadeImageReader imgReader;
int numStages, curNumSamples;
int numPos, numNeg;
+2 -1
Ver Arquivo
@@ -5,6 +5,7 @@
#include "cascadeclassifier.h"
using namespace std;
using namespace cv;
float calcNormFactor( const Mat& sum, const Mat& sqSum )
{
@@ -24,7 +25,7 @@ CvParams::CvParams() : name( "params" ) {}
void CvParams::printDefaults() const
{ cout << "--" << name << "--" << endl; }
void CvParams::printAttrs() const {}
bool CvParams::scanAttr( const String, const String ) { return false; }
bool CvParams::scanAttr( const string, const string ) { return false; }
//---------------------------- FeatureParams --------------------------------------
+6 -5
Ver Arquivo
@@ -5,6 +5,7 @@
#include "cascadeclassifier.h"
using namespace std;
using namespace cv;
CvHaarFeatureParams::CvHaarFeatureParams() : mode(BASIC)
{
@@ -25,9 +26,9 @@ void CvHaarFeatureParams::init( const CvFeatureParams& fp )
void CvHaarFeatureParams::write( FileStorage &fs ) const
{
CvFeatureParams::write( fs );
String modeStr = mode == BASIC ? CC_MODE_BASIC :
string modeStr = mode == BASIC ? CC_MODE_BASIC :
mode == CORE ? CC_MODE_CORE :
mode == ALL ? CC_MODE_ALL : String();
mode == ALL ? CC_MODE_ALL : string();
CV_Assert( !modeStr.empty() );
fs << CC_MODE << modeStr;
}
@@ -40,7 +41,7 @@ bool CvHaarFeatureParams::read( const FileNode &node )
FileNode rnode = node[CC_MODE];
if( !rnode.isString() )
return false;
String modeStr;
string modeStr;
rnode >> modeStr;
mode = !modeStr.compare( CC_MODE_BASIC ) ? BASIC :
!modeStr.compare( CC_MODE_CORE ) ? CORE :
@@ -58,13 +59,13 @@ void CvHaarFeatureParams::printDefaults() const
void CvHaarFeatureParams::printAttrs() const
{
CvFeatureParams::printAttrs();
String mode_str = mode == BASIC ? CC_MODE_BASIC :
string mode_str = mode == BASIC ? CC_MODE_BASIC :
mode == CORE ? CC_MODE_CORE :
mode == ALL ? CC_MODE_ALL : 0;
cout << "mode: " << mode_str << endl;
}
bool CvHaarFeatureParams::scanAttr( const String prmName, const String val)
bool CvHaarFeatureParams::scanAttr( const string prmName, const string val)
{
if ( !CvFeatureParams::scanAttr( prmName, val ) )
{
+15 -15
Ver Arquivo
@@ -18,12 +18,12 @@ public:
CvHaarFeatureParams( int _mode );
virtual void init( const CvFeatureParams& fp );
virtual void write( FileStorage &fs ) const;
virtual bool read( const FileNode &node );
virtual void write( cv::FileStorage &fs ) const;
virtual bool read( const cv::FileNode &node );
virtual void printDefaults() const;
virtual void printAttrs() const;
virtual bool scanAttr( const String prm, const String val);
virtual bool scanAttr( const std::string prm, const std::string val);
int mode;
};
@@ -32,11 +32,11 @@ class CvHaarEvaluator : public CvFeatureEvaluator
{
public:
virtual void init(const CvFeatureParams *_featureParams,
int _maxSampleCount, Size _winSize );
virtual void setImage(const Mat& img, uchar clsLabel, int idx);
int _maxSampleCount, cv::Size _winSize );
virtual void setImage(const cv::Mat& img, uchar clsLabel, int idx);
virtual float operator()(int featureIdx, int sampleIdx) const;
virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const;
void writeFeature( FileStorage &fs, int fi ) const; // for old file fornat
virtual void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
void writeFeature( cv::FileStorage &fs, int fi ) const; // for old file fornat
protected:
virtual void generateFeatures();
@@ -48,13 +48,13 @@ protected:
int x0, int y0, int w0, int h0, float wt0,
int x1, int y1, int w1, int h1, float wt1,
int x2 = 0, int y2 = 0, int w2 = 0, int h2 = 0, float wt2 = 0.0F );
float calc( const Mat &sum, const Mat &tilted, size_t y) const;
void write( FileStorage &fs ) const;
float calc( const cv::Mat &sum, const cv::Mat &tilted, size_t y) const;
void write( cv::FileStorage &fs ) const;
bool tilted;
struct
{
Rect r;
cv::Rect r;
float weight;
} rect[CV_HAAR_FEATURE_MAX];
@@ -64,10 +64,10 @@ protected:
} fastRect[CV_HAAR_FEATURE_MAX];
};
vector<Feature> features;
Mat sum; /* sum images (each row represents image) */
Mat tilted; /* tilted sum images (each row represents image) */
Mat normfactor; /* normalization factor */
std::vector<Feature> features;
cv::Mat sum; /* sum images (each row represents image) */
cv::Mat tilted; /* tilted sum images (each row represents image) */
cv::Mat normfactor; /* normalization factor */
};
inline float CvHaarEvaluator::operator()(int featureIdx, int sampleIdx) const
@@ -76,7 +76,7 @@ inline float CvHaarEvaluator::operator()(int featureIdx, int sampleIdx) const
return !nf ? 0.0f : (features[featureIdx].calc( sum, tilted, sampleIdx)/nf);
}
inline float CvHaarEvaluator::Feature::calc( const Mat &_sum, const Mat &_tilted, size_t y) const
inline float CvHaarEvaluator::Feature::calc( const cv::Mat &_sum, const cv::Mat &_tilted, size_t y) const
{
const int* img = tilted ? _tilted.ptr<int>((int)y) : _sum.ptr<int>((int)y);
float ret = rect[0].weight * (img[fastRect[0].p0] - img[fastRect[0].p1] - img[fastRect[0].p2] + img[fastRect[0].p3] ) +
+11 -8
Ver Arquivo
@@ -7,7 +7,10 @@
#include <iostream>
#include <fstream>
bool CvCascadeImageReader::create( const String _posFilename, const String _negFilename, Size _winSize )
using namespace std;
using namespace cv;
bool CvCascadeImageReader::create( const string _posFilename, const string _negFilename, Size _winSize )
{
return posReader.create(_posFilename) && negReader.create(_negFilename, _winSize);
}
@@ -22,21 +25,21 @@ CvCascadeImageReader::NegReader::NegReader()
stepFactor = 0.5F;
}
bool CvCascadeImageReader::NegReader::create( const String _filename, Size _winSize )
bool CvCascadeImageReader::NegReader::create( const string _filename, Size _winSize )
{
String dirname, str;
string dirname, str;
std::ifstream file(_filename.c_str());
if ( !file.is_open() )
return false;
size_t pos = _filename.rfind('\\');
char dlmrt = '\\';
if (pos == String::npos)
if (pos == string::npos)
{
pos = _filename.rfind('/');
dlmrt = '/';
}
dirname = pos == String::npos ? "" : _filename.substr(0, pos) + dlmrt;
dirname = pos == string::npos ? "" : _filename.substr(0, pos) + dlmrt;
while( !file.eof() )
{
std::getline(file, str);
@@ -64,8 +67,8 @@ bool CvCascadeImageReader::NegReader::nextImg()
round = round % (winSize.width * winSize.height);
last %= count;
_offset.x = min( (int)round % winSize.width, src.cols - winSize.width );
_offset.y = min( (int)round / winSize.width, src.rows - winSize.height );
_offset.x = std::min( (int)round % winSize.width, src.cols - winSize.width );
_offset.y = std::min( (int)round / winSize.width, src.rows - winSize.height );
if( !src.empty() && src.type() == CV_8UC1
&& offset.x >= 0 && offset.y >= 0 )
break;
@@ -126,7 +129,7 @@ CvCascadeImageReader::PosReader::PosReader()
vec = 0;
}
bool CvCascadeImageReader::PosReader::create( const String _filename )
bool CvCascadeImageReader::PosReader::create( const string _filename )
{
if ( file )
fclose( file );
+12 -12
Ver Arquivo
@@ -3,15 +3,15 @@
#include "highgui.h"
using namespace cv;
class CvCascadeImageReader
{
public:
bool create( const String _posFilename, const String _negFilename, Size _winSize );
bool create( const std::string _posFilename, const std::string _negFilename, cv::Size _winSize );
void restart() { posReader.restart(); }
bool getNeg(Mat &_img) { return negReader.get( _img ); }
bool getPos(Mat &_img) { return posReader.get( _img ); }
bool getNeg(cv::Mat &_img) { return negReader.get( _img ); }
bool getPos(cv::Mat &_img) { return posReader.get( _img ); }
private:
class PosReader
@@ -19,8 +19,8 @@ private:
public:
PosReader();
virtual ~PosReader();
bool create( const String _filename );
bool get( Mat &_img );
bool create( const std::string _filename );
bool get( cv::Mat &_img );
void restart();
short* vec;
@@ -35,18 +35,18 @@ private:
{
public:
NegReader();
bool create( const String _filename, Size _winSize );
bool get( Mat& _img );
bool create( const std::string _filename, cv::Size _winSize );
bool get( cv::Mat& _img );
bool nextImg();
Mat src, img;
vector<String> imgFilenames;
Point offset, point;
cv::Mat src, img;
std::vector<std::string> imgFilenames;
cv::Point offset, point;
float scale;
float scaleFactor;
float stepFactor;
size_t last, round;
Size winSize;
cv::Size winSize;
} negReader;
};
+2
Ver Arquivo
@@ -4,6 +4,8 @@
#include "lbpfeatures.h"
#include "cascadeclassifier.h"
using namespace cv;
CvLBPFeatureParams::CvLBPFeatureParams()
{
maxCatCount = 256;
+9 -9
Ver Arquivo
@@ -15,11 +15,11 @@ class CvLBPEvaluator : public CvFeatureEvaluator
public:
virtual ~CvLBPEvaluator() {}
virtual void init(const CvFeatureParams *_featureParams,
int _maxSampleCount, Size _winSize );
virtual void setImage(const Mat& img, uchar clsLabel, int idx);
int _maxSampleCount, cv::Size _winSize );
virtual void setImage(const cv::Mat& img, uchar clsLabel, int idx);
virtual float operator()(int featureIdx, int sampleIdx) const
{ return (float)features[featureIdx].calc( sum, sampleIdx); }
virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const;
virtual void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
protected:
virtual void generateFeatures();
@@ -28,18 +28,18 @@ protected:
public:
Feature();
Feature( int offset, int x, int y, int _block_w, int _block_h );
uchar calc( const Mat& _sum, size_t y ) const;
void write( FileStorage &fs ) const;
uchar calc( const cv::Mat& _sum, size_t y ) const;
void write( cv::FileStorage &fs ) const;
Rect rect;
cv::Rect rect;
int p[16];
};
vector<Feature> features;
std::vector<Feature> features;
Mat sum;
cv::Mat sum;
};
inline uchar CvLBPEvaluator::Feature::calc(const Mat &_sum, size_t y) const
inline uchar CvLBPEvaluator::Feature::calc(const cv::Mat &_sum, size_t y) const
{
const int* psum = _sum.ptr<int>((int)y);
int cval = psum[p[5]] - psum[p[6]] - psum[p[9]] + psum[p[10]];
+2 -1
Ver Arquivo
@@ -5,11 +5,12 @@
#include "cascadeclassifier.h"
using namespace std;
using namespace cv;
int main( int argc, char* argv[] )
{
CvCascadeClassifier classifier;
String cascadeDirName, vecName, bgName;
string cascadeDirName, vecName, bgName;
int numPos = 2000;
int numNeg = 1000;
int numStages = 20;
+17 -17
Ver Arquivo
@@ -30,13 +30,13 @@
(p3) = (rect).x + (rect).width - (rect).height \
+ (step) * ((rect).y + (rect).width + (rect).height);
float calcNormFactor( const Mat& sum, const Mat& sqSum );
float calcNormFactor( const cv::Mat& sum, const cv::Mat& sqSum );
template<class Feature>
void _writeFeatures( const vector<Feature> features, FileStorage &fs, const Mat& featureMap )
void _writeFeatures( const std::vector<Feature> features, cv::FileStorage &fs, const cv::Mat& featureMap )
{
fs << FEATURES << "[";
const Mat_<int>& featureMap_ = (const Mat_<int>&)featureMap;
const cv::Mat_<int>& featureMap_ = (const cv::Mat_<int>&)featureMap;
for ( int fi = 0; fi < featureMap.cols; fi++ )
if ( featureMap_(0, fi) >= 0 )
{
@@ -53,13 +53,13 @@ public:
CvParams();
virtual ~CvParams() {}
// from|to file
virtual void write( FileStorage &fs ) const = 0;
virtual bool read( const FileNode &node ) = 0;
virtual void write( cv::FileStorage &fs ) const = 0;
virtual bool read( const cv::FileNode &node ) = 0;
// from|to screen
virtual void printDefaults() const;
virtual void printAttrs() const;
virtual bool scanAttr( const String prmName, const String val );
String name;
virtual bool scanAttr( const std::string prmName, const std::string val );
std::string name;
};
class CvFeatureParams : public CvParams
@@ -68,9 +68,9 @@ public:
enum { HAAR = 0, LBP = 1, HOG = 2 };
CvFeatureParams();
virtual void init( const CvFeatureParams& fp );
virtual void write( FileStorage &fs ) const;
virtual bool read( const FileNode &node );
static Ptr<CvFeatureParams> create( int featureType );
virtual void write( cv::FileStorage &fs ) const;
virtual bool read( const cv::FileNode &node );
static cv::Ptr<CvFeatureParams> create( int featureType );
int maxCatCount; // 0 in case of numerical features
int featSize; // 1 in case of simple features (HAAR, LBP) and N_BINS(9)*N_CELLS(4) in case of Dalal's HOG features
};
@@ -80,25 +80,25 @@ class CvFeatureEvaluator
public:
virtual ~CvFeatureEvaluator() {}
virtual void init(const CvFeatureParams *_featureParams,
int _maxSampleCount, Size _winSize );
virtual void setImage(const Mat& img, uchar clsLabel, int idx);
virtual void writeFeatures( FileStorage &fs, const Mat& featureMap ) const = 0;
int _maxSampleCount, cv::Size _winSize );
virtual void setImage(const cv::Mat& img, uchar clsLabel, int idx);
virtual void writeFeatures( cv::FileStorage &fs, const cv::Mat& featureMap ) const = 0;
virtual float operator()(int featureIdx, int sampleIdx) const = 0;
static Ptr<CvFeatureEvaluator> create(int type);
static cv::Ptr<CvFeatureEvaluator> create(int type);
int getNumFeatures() const { return numFeatures; }
int getMaxCatCount() const { return featureParams->maxCatCount; }
int getFeatureSize() const { return featureParams->featSize; }
const Mat& getCls() const { return cls; }
const cv::Mat& getCls() const { return cls; }
float getCls(int si) const { return cls.at<float>(si, 0); }
protected:
virtual void generateFeatures() = 0;
int npos, nneg;
int numFeatures;
Size winSize;
cv::Size winSize;
CvFeatureParams *featureParams;
Mat cls;
cv::Mat cls;
};
#endif
+8 -4
Ver Arquivo
@@ -759,11 +759,15 @@ endif()
set(CUDA_VERSION_STRING "${CUDA_VERSION}")
# Support for arm cross compilation with CUDA 5.5
if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf" CACHE PATH "Toolkit target location.")
else()
set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}" CACHE PATH "Toolkit target location.")
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}")
if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
if(ANDROID AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-androideabi")
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-androideabi")
elseif(EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
endif()
endif()
set(CUDA_TOOLKIT_TARGET_DIR "${__cuda_toolkit_target_dir_initial}" CACHE PATH "Toolkit target location.")
mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR)
# Target CPU architecture
-3
Ver Arquivo
@@ -183,9 +183,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} -DNDEBUG")
set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -O0 -DDEBUG -D_DEBUG")
if(BUILD_WITH_DEBUG_INFO)
set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -ggdb3")
endif()
endif()
if(MSVC)
+2
Ver Arquivo
@@ -77,6 +77,8 @@ if(MSVC)
set(OpenCV_RUNTIME vc10)
elseif(MSVC_VERSION EQUAL 1700)
set(OpenCV_RUNTIME vc11)
elseif(MSVC_VERSION EQUAL 1800)
set(OpenCV_RUNTIME vc12)
endif()
elseif(MINGW)
set(OpenCV_RUNTIME mingw)
+22 -4
Ver Arquivo
@@ -90,12 +90,17 @@ if(CUDA_FOUND)
endif()
if(NOT DEFINED __cuda_arch_bin)
if(${CUDA_VERSION} VERSION_LESS "5.0")
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
if(ANDROID)
set(__cuda_arch_bin "3.2")
set(__cuda_arch_ptx "")
else()
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
if(${CUDA_VERSION} VERSION_LESS "5.0")
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
else()
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
endif()
set(__cuda_arch_ptx "3.0")
endif()
set(__cuda_arch_ptx "3.0")
endif()
set(CUDA_ARCH_BIN ${__cuda_arch_bin} CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
@@ -147,6 +152,11 @@ if(CUDA_FOUND)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ${NVCC_FLAGS_EXTRA})
set(OpenCV_CUDA_CC "${NVCC_FLAGS_EXTRA}")
if(ANDROID)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xptxas;-dlcm=ca")
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-target-os-variant=Android")
endif()
message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}")
OCV_OPTION(CUDA_FAST_MATH "Enable --use_fast_math for CUDA compiler " OFF)
@@ -169,6 +179,14 @@ if(CUDA_FOUND)
# we remove -Wsign-promo as it generates warnings under linux
string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
# we remove -Wno-delete-non-virtual-dtor because it's used for C++ compiler
# but NVCC uses C compiler by default
string(REPLACE "-Wno-delete-non-virtual-dtor" "" ${var} "${${var}}")
# we remove -frtti because it's used for C++ compiler
# but NVCC uses C compiler by default
string(REPLACE "-frtti" "" ${var} "${${var}}")
endforeach()
if(BUILD_SHARED_LIBS)
+2
Ver Arquivo
@@ -136,6 +136,8 @@ if(MSVC)
set(OpenCV_RUNTIME vc10)
elseif(MSVC_VERSION EQUAL 1700)
set(OpenCV_RUNTIME vc11)
elseif(MSVC_VERSION EQUAL 1800)
set(OpenCV_RUNTIME vc12)
endif()
elseif(MINGW)
set(OpenCV_RUNTIME mingw)
+1 -1
Ver Arquivo
@@ -23,7 +23,7 @@ if(WIN32)
if(EXISTS ${XIMEA_PATH})
set(XIMEA_FOUND 1)
# set LIB folders
if(CMAKE_CL_64)
if(X86_64)
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}/x64")
else()
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}/x86")
+4 -4
Ver Arquivo
@@ -134,11 +134,11 @@ if(WIN32)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" IMMEDIATE @ONLY)
if(BUILD_SHARED_LIBS)
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/lib")
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/lib" FILE OpenCVModules${modules_file_suffix}.cmake)
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib")
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" FILE OpenCVModules${modules_file_suffix}.cmake)
else()
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/staticlib")
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/staticlib" FILE OpenCVModules${modules_file_suffix}.cmake)
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib")
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" FILE OpenCVModules${modules_file_suffix}.cmake)
endif()
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}")
install(FILES "${OpenCV_SOURCE_DIR}/cmake/OpenCVConfig.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/")
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
# platform-specific config file
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.cmake" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h")
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h")
# ----------------------------------------------------------------------------
# opencv_modules.hpp based on actual modules list
+3 -1
Ver Arquivo
@@ -76,7 +76,9 @@ if(INSTALL_TO_MANGLED_PATHS)
else()
set(OPENCV_PC_FILE_NAME opencv.pc)
endif()
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/opencv-XXX.pc.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME}" @ONLY IMMEDIATE)
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/opencv-XXX.pc.in"
"${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME}"
@ONLY IMMEDIATE)
if(UNIX AND NOT ANDROID)
install(FILES ${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME} DESTINATION ${OPENCV_LIB_INSTALL_PATH}/pkgconfig)
+7 -3
Ver Arquivo
@@ -41,7 +41,9 @@ if(ANDROID)
string(REPLACE - _ modules_file_suffix "_${ANDROID_NDK_ABI_NAME}")
endif()
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${modules_file_suffix}.cmake)
if(NOT TARGET opencv_core)
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${modules_file_suffix}.cmake)
endif()
# TODO All things below should be reviewed. What is about of moving this code into related modules (special vars/hooks/files)
@@ -179,6 +181,10 @@ foreach(__cvcomponent ${OpenCV_FIND_COMPONENTS})
set(${__cvcomponent}_FOUND "${__cvcomponent}_FOUND-NOTFOUND")
else()
list(APPEND OpenCV_FIND_COMPONENTS_ ${__cvcomponent})
# Not using list(APPEND) here, because OpenCV_LIBS may not exist yet.
# Also not clearing OpenCV_LIBS anywhere, so that multiple calls
# to find_package(OpenCV) with different component lists add up.
set(OpenCV_LIBS ${OpenCV_LIBS} "${__cvcomponent}")
#indicate that module is found
string(TOUPPER "${__cvcomponent}" __cvcomponent)
set(${__cvcomponent}_FOUND 1)
@@ -195,8 +201,6 @@ else()
set(OpenCV_LIB_SUFFIX "")
endif()
SET(OpenCV_LIBS "${OpenCV_LIB_COMPONENTS}")
foreach(__opttype OPT DBG)
SET(OpenCV_LIBS_${__opttype} "${OpenCV_LIBS}")
SET(OpenCV_EXTRA_LIBS_${__opttype} "")
+62 -40
Ver Arquivo
@@ -2,9 +2,6 @@
# CMake file for OpenCV docs
#
file(GLOB FILES_TEX *.tex *.sty *.bib)
file(GLOB FILES_TEX_PICS pics/*.png pics/*.jpg)
if(BUILD_DOCS AND HAVE_SPHINX)
project(opencv_docs)
@@ -23,59 +20,84 @@ if(BUILD_DOCS AND HAVE_SPHINX)
set(OPTIONAL_DOC_LIST "")
set(OPENCV2_BASE_MODULES core imgproc highgui video calib3d features2d objdetect ml flann gpu photo stitching nonfree contrib legacy)
# build lists of modules to be documented
set(OPENCV2_MODULES "")
set(OPENCV_MODULES "")
set(BASE_MODULES "")
set(EXTRA_MODULES "")
foreach(mod ${OPENCV_MODULES_BUILD} ${OPENCV_MODULES_DISABLED_USER} ${OPENCV_MODULES_DISABLED_AUTO} ${OPENCV_MODULES_DISABLED_FORCE})
string(REGEX REPLACE "^opencv_" "" mod "${mod}")
if("${OPENCV_MODULE_opencv_${mod}_LOCATION}" STREQUAL "${OpenCV_SOURCE_DIR}/modules/${mod}")
list(APPEND OPENCV2_MODULES ${mod})
list(APPEND BASE_MODULES ${mod})
else()
list(APPEND OPENCV_MODULES ${mod})
list(APPEND EXTRA_MODULES ${mod})
endif()
endforeach()
list(REMOVE_ITEM OPENCV2_MODULES ${OPENCV2_BASE_MODULES})
ocv_list_sort(OPENCV2_MODULES)
ocv_list_sort(OPENCV_MODULES)
set(FIXED_ORDER_MODULES core imgproc highgui video calib3d features2d objdetect ml flann gpu photo stitching nonfree contrib legacy)
list(REMOVE_ITEM BASE_MODULES ${FIXED_ORDER_MODULES})
ocv_list_sort(BASE_MODULES)
ocv_list_sort(EXTRA_MODULES)
set(BASE_MODULES ${FIXED_ORDER_MODULES} ${BASE_MODULES})
# build lists of documentation files and generate table of contents for reference manual
set(OPENCV_FILES_REF "")
set(OPENCV_FILES_REF_PICT "")
set(DOC_FAKE_ROOT "${CMAKE_CURRENT_BINARY_DIR}/fake-root")
set(DOC_FAKE_ROOT_FILES "")
function(ocv_doc_add_file_to_fake_root source destination)
add_custom_command(
OUTPUT "${DOC_FAKE_ROOT}/${destination}"
COMMAND "${CMAKE_COMMAND}" -E copy "${source}" "${DOC_FAKE_ROOT}/${destination}"
DEPENDS "${source}"
COMMENT "Copying ${destination} to fake root..."
VERBATIM
)
list(APPEND DOC_FAKE_ROOT_FILES "${DOC_FAKE_ROOT}/${destination}")
set(DOC_FAKE_ROOT_FILES "${DOC_FAKE_ROOT_FILES}" PARENT_SCOPE)
endfunction()
function(ocv_doc_add_to_fake_root source)
if(ARGC GREATER 1)
set(destination "${ARGV1}")
else()
file(RELATIVE_PATH destination "${OpenCV_SOURCE_DIR}" "${source}")
endif()
if(IS_DIRECTORY "${source}")
file(GLOB_RECURSE files RELATIVE "${source}" "${source}/*")
foreach(file ${files})
ocv_doc_add_file_to_fake_root("${source}/${file}" "${destination}/${file}")
endforeach()
else()
ocv_doc_add_file_to_fake_root("${source}" "${destination}")
endif()
set(DOC_FAKE_ROOT_FILES "${DOC_FAKE_ROOT_FILES}" PARENT_SCOPE)
endfunction()
set(OPENCV_REFMAN_TOC "")
foreach(mod ${OPENCV2_BASE_MODULES} ${OPENCV2_MODULES} ${OPENCV_MODULES})
file(GLOB_RECURSE _OPENCV_FILES_REF "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/*.rst")
file(GLOB_RECURSE _OPENCV_FILES_REF_PICT "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/*.png" "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/*.jpg")
list(APPEND OPENCV_FILES_REF ${_OPENCV_FILES_REF})
list(APPEND OPENCV_FILES_REF_PICT ${_OPENCV_FILES_REF_PICT})
set(toc_file "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/${mod}.rst")
if(EXISTS "${toc_file}")
file(RELATIVE_PATH toc_file "${OpenCV_SOURCE_DIR}/modules" "${toc_file}")
set(OPENCV_REFMAN_TOC "${OPENCV_REFMAN_TOC} ${toc_file}\n")
foreach(mod ${BASE_MODULES} ${EXTRA_MODULES})
if(EXISTS "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/${mod}.rst")
ocv_doc_add_to_fake_root("${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc" modules/${mod}/doc)
set(OPENCV_REFMAN_TOC "${OPENCV_REFMAN_TOC} ${mod}/doc/${mod}.rst\n")
endif()
endforeach()
file(GLOB_RECURSE _OPENCV_FILES_REF "${OpenCV_SOURCE_DIR}/platforms/android/service/doc/*.rst")
file(GLOB_RECURSE _OPENCV_FILES_REF_PICT "${OpenCV_SOURCE_DIR}/platforms/android/service/doc/*.png" "${OpenCV_SOURCE_DIR}/platforms/android/service/doc/*.jpg")
list(APPEND OPENCV_FILES_REF ${_OPENCV_FILES_REF})
list(APPEND OPENCV_FILES_REF_PICT ${_OPENCV_FILES_REF_PICT})
configure_file("${OpenCV_SOURCE_DIR}/modules/refman.rst.in" "${DOC_FAKE_ROOT}/modules/refman.rst" @ONLY)
configure_file("${OpenCV_SOURCE_DIR}/modules/refman.rst.in" "${OpenCV_SOURCE_DIR}/modules/refman.rst" IMMEDIATE @ONLY)
file(GLOB_RECURSE OPENCV_FILES_UG user_guide/*.rst)
file(GLOB_RECURSE OPENCV_FILES_TUT tutorials/*.rst)
file(GLOB_RECURSE OPENCV_FILES_TUT_PICT tutorials/*.png tutorials/*.jpg)
set(OPENCV_DOC_DEPS conf.py ${OPENCV_FILES_REF} ${OPENCV_FILES_REF_PICT}
${OPENCV_FILES_UG} ${OPENCV_FILES_TUT} ${OPENCV_FILES_TUT_PICT})
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/index.rst")
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/doc")
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/platforms/android")
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/samples")
if(PDFLATEX_COMPILER)
add_custom_target(docs
COMMAND ${SPHINX_BUILD} -b latex -c ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. .
COMMAND ${SPHINX_BUILD} -b latex -c "${CMAKE_CURRENT_SOURCE_DIR}" "${DOC_FAKE_ROOT}" .
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/pics ${CMAKE_CURRENT_BINARY_DIR}/doc/opencv1/pics
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/patch_refman_latex.py" opencv2refman.tex
@@ -95,7 +117,7 @@ if(BUILD_DOCS AND HAVE_SPHINX)
COMMAND ${CMAKE_COMMAND} -E echo "Generating opencv_cheatsheet.pdf"
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode "${CMAKE_CURRENT_SOURCE_DIR}/opencv_cheatsheet.tex"
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode "${CMAKE_CURRENT_SOURCE_DIR}/opencv_cheatsheet.tex"
DEPENDS ${OPENCV_DOC_DEPS}
DEPENDS ${DOC_FAKE_ROOT_FILES}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating the PDF Manuals"
)
@@ -109,9 +131,9 @@ if(BUILD_DOCS AND HAVE_SPHINX)
endif()
add_custom_target(html_docs
COMMAND ${SPHINX_BUILD} -b html -c ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. ./_html
COMMAND "${SPHINX_BUILD}" -b html -c "${CMAKE_CURRENT_SOURCE_DIR}" "${DOC_FAKE_ROOT}" ./_html
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${OPENCV_DOC_DEPS}
DEPENDS ${DOC_FAKE_ROOT_FILES}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating Online Documentation"
)
+8 -8
Ver Arquivo
@@ -437,7 +437,7 @@ Example. Decimate image by factor of $\sqrt{2}$:\\
\texttt{\href{http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html\#watershed}{watershed()}},
\texttt{\href{http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html\#grabcut}{grabCut()}}
& marker-based image segmentation algorithms.
See the samples \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/watershed.cpp}{watershed.cpp}} and \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/grabcut.cpp}{grabcut.cpp}}.
See the samples \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/watershed.cpp}{watershed.cpp}} and \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/grabcut.cpp}{grabcut.cpp}}.
\end{tabular}
@@ -465,7 +465,7 @@ Example. Compute Hue-Saturation histogram of an image:\\
\end{tabbing}
\subsection{Contours}
See \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/contours2.cpp}{contours2.cpp}} and \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/squares.cpp}{squares.cpp}}
See \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/contours2.cpp}{contours2.cpp}} and \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/squares.cpp}{squares.cpp}}
samples on what are the contours and how to use them.
\section{Data I/O}
@@ -559,7 +559,7 @@ samples on what are the contours and how to use them.
\end{tabular}
See \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/camshiftdemo.cpp}{camshiftdemo.cpp}} and other \href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/}{OpenCV samples} on how to use the GUI functions.
See \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/camshiftdemo.cpp}{camshiftdemo.cpp}} and other \href{https://github.com/Itseez/opencv/tree/master/samples/}{OpenCV samples} on how to use the GUI functions.
\section{Camera Calibration, Pose Estimation and Depth Estimation}
@@ -586,10 +586,10 @@ See \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/ma
\end{tabular}
To calibrate a camera, you can use \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/calibration.cpp}{calibration.cpp}} or
\texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/stereo\_calib.cpp}{stereo\_calib.cpp}} samples.
To calibrate a camera, you can use \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/calibration.cpp}{calibration.cpp}} or
\texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/stereo\_calib.cpp}{stereo\_calib.cpp}} samples.
To get the disparity maps and the point clouds, use
\texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/stereo\_match.cpp}{stereo\_match.cpp}} sample.
\texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/stereo\_match.cpp}{stereo\_match.cpp}} sample.
\section{Object Detection}
@@ -597,9 +597,9 @@ To get the disparity maps and the point clouds, use
@{}p{\linewidth-\the\MyLen}@{}}
\texttt{\href{http://docs.opencv.org/modules/imgproc/doc/object_detection.html\#matchtemplate}{matchTemplate}} & Compute proximity map for given template.\\
\texttt{\href{http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html\#cascadeclassifier}{CascadeClassifier}} & Viola's Cascade of Boosted classifiers using Haar or LBP features. Suits for detecting faces, facial features and some other objects without diverse textures. See \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/c/facedetect.cpp}{facedetect.cpp}}\\
\texttt{\href{http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html\#cascadeclassifier}{CascadeClassifier}} & Viola's Cascade of Boosted classifiers using Haar or LBP features. Suits for detecting faces, facial features and some other objects without diverse textures. See \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/c/facedetect.cpp}{facedetect.cpp}}\\
\texttt{{HOGDescriptor}} & N. Dalal's object detector using Histogram-of-Oriented-Gradients (HOG) features. Suits for detecting people, cars and other objects with well-defined silhouettes. See \texttt{\href{http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/peopledetect.cpp}{peopledetect.cpp}}\\
\texttt{{HOGDescriptor}} & N. Dalal's object detector using Histogram-of-Oriented-Gradients (HOG) features. Suits for detecting people, cars and other objects with well-defined silhouettes. See \texttt{\href{https://github.com/Itseez/opencv/tree/master/samples/cpp/peopledetect.cpp}{peopledetect.cpp}}\\
\end{tabular}
@@ -56,7 +56,7 @@ Scalar
Code
=====
* This code is in your OpenCV sample folder. Otherwise you can grab it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp>`_
* This code is in your OpenCV sample folder. Otherwise you can grab it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp>`_
Explanation
=============
@@ -23,7 +23,7 @@ Theory
Code
====
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/features2D/SURF_descriptor.cpp>`_
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/features2D/SURF_descriptor.cpp>`_
.. code-block:: cpp
@@ -19,97 +19,10 @@ Theory
Code
====
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp>`_
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp>`_
.. code-block:: cpp
#include <stdio.h>
#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/nonfree.hpp"
using namespace cv;
void readme();
/** @function main */
int main( int argc, char** argv )
{
if( argc != 3 )
{ readme(); return -1; }
Mat img_1 = imread( argv[1], CV_LOAD_IMAGE_GRAYSCALE );
Mat img_2 = imread( argv[2], CV_LOAD_IMAGE_GRAYSCALE );
if( !img_1.data || !img_2.data )
{ std::cout<< " --(!) Error reading images " << std::endl; return -1; }
//-- Step 1: Detect the keypoints using SURF Detector
int minHessian = 400;
SurfFeatureDetector detector( minHessian );
std::vector<KeyPoint> keypoints_1, keypoints_2;
detector.detect( img_1, keypoints_1 );
detector.detect( img_2, keypoints_2 );
//-- Step 2: Calculate descriptors (feature vectors)
SurfDescriptorExtractor extractor;
Mat descriptors_1, descriptors_2;
extractor.compute( img_1, keypoints_1, descriptors_1 );
extractor.compute( img_2, keypoints_2, descriptors_2 );
//-- Step 3: Matching descriptor vectors using FLANN matcher
FlannBasedMatcher matcher;
std::vector< DMatch > matches;
matcher.match( descriptors_1, descriptors_2, matches );
double max_dist = 0; double min_dist = 100;
//-- Quick calculation of max and min distances between keypoints
for( int i = 0; i < descriptors_1.rows; i++ )
{ double dist = matches[i].distance;
if( dist < min_dist ) min_dist = dist;
if( dist > max_dist ) max_dist = dist;
}
printf("-- Max dist : %f \n", max_dist );
printf("-- Min dist : %f \n", min_dist );
//-- Draw only "good" matches (i.e. whose distance is less than 2*min_dist )
//-- PS.- radiusMatch can also be used here.
std::vector< DMatch > good_matches;
for( int i = 0; i < descriptors_1.rows; i++ )
{ if( matches[i].distance <= 2*min_dist )
{ good_matches.push_back( matches[i]); }
}
//-- Draw only "good" matches
Mat img_matches;
drawMatches( img_1, keypoints_1, img_2, keypoints_2,
good_matches, img_matches, Scalar::all(-1), Scalar::all(-1),
vector<char>(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS );
//-- Show detected matches
imshow( "Good Matches", img_matches );
for( int i = 0; i < good_matches.size(); i++ )
{ printf( "-- Good Match [%d] Keypoint 1: %d -- Keypoint 2: %d \n", i, good_matches[i].queryIdx, good_matches[i].trainIdx ); }
waitKey(0);
return 0;
}
/** @function readme */
void readme()
{ std::cout << " Usage: ./SURF_FlannMatcher <img1> <img2>" << std::endl; }
.. literalinclude:: ../../../../samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp
:language: cpp
Explanation
============
@@ -19,7 +19,7 @@ Theory
Code
====
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp>`_
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp>`_
.. code-block:: cpp
@@ -20,7 +20,7 @@ Theory
Code
====
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp>`_
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp>`_
.. literalinclude:: ../../../../../samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp
:language: cpp
@@ -18,7 +18,7 @@ Theory
Code
====
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp>`_
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp>`_
.. code-block:: cpp
@@ -151,7 +151,7 @@ How does it work?
Code
====
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp>`_
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp>`_
.. code-block:: cpp
@@ -70,7 +70,7 @@ Erosion
Code
======
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp>`_
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp>`_
.. code-block:: cpp
@@ -115,7 +115,7 @@ Code
* Applies 4 different kinds of filters (explained in Theory) and show the filtered images sequentially
* **Downloadable code**:
Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp>`_
Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp>`_
* **Code at glance:**
@@ -99,9 +99,9 @@ Code
* **Downloadable code**:
a. Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp>`_ for the basic version (explained in this tutorial).
b. For stuff slightly fancier (using H-S histograms and floodFill to define a mask for the skin area) you can check the `improved demo <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo2.cpp>`_
c. ...or you can always check out the classical `camshiftdemo <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/camshiftdemo.cpp>`_ in samples.
a. Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp>`_ for the basic version (explained in this tutorial).
b. For stuff slightly fancier (using H-S histograms and floodFill to define a mask for the skin area) you can check the `improved demo <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo2.cpp>`_
c. ...or you can always check out the classical `camshiftdemo <https://github.com/Itseez/opencv/tree/master/samples/cpp/camshiftdemo.cpp>`_ in samples.
* **Code at glance:**
@@ -82,7 +82,7 @@ Code
* Plot the three histograms in a window
* **Downloadable code**:
Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp>`_
Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp>`_
* **Code at glance:**
@@ -80,7 +80,7 @@ Code
* Display the numerical matching parameters obtained.
* **Downloadable code**:
Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp>`_
Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp>`_
* **Code at glance:**
@@ -83,7 +83,7 @@ Code
* Display the source and equalized images in a window.
* **Downloadable code**:
Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp>`_
Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp>`_
* **Code at glance:**
@@ -125,7 +125,7 @@ Code
* Draw a rectangle around the area corresponding to the highest match
* **Downloadable code**:
Click `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp>`_
Click `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp>`_
* **Code at glance:**
@@ -86,7 +86,7 @@ Code
* Applies the *Canny Detector* and generates a **mask** (bright lines representing the edges on a black background).
* Applies the mask obtained on the original image and display it in a window.
#. The tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp>`_
#. The tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp>`_
.. code-block:: cpp
@@ -47,7 +47,7 @@ Code
The user chooses either option by pressing 'c' (constant) or 'r' (replicate)
* The program finishes when the user presses 'ESC'
#. The tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp>`_
#. The tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp>`_
.. code-block:: cpp
@@ -72,7 +72,7 @@ Code
* The filter output (with each kernel) will be shown during 500 milliseconds
#. The tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp>`_
#. The tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp>`_
.. code-block:: cpp
@@ -40,9 +40,9 @@ Code
* Display the detected circle in a window.
.. |TutorialHoughCirclesSimpleDownload| replace:: here
.. _TutorialHoughCirclesSimpleDownload: http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/houghcircles.cpp
.. _TutorialHoughCirclesSimpleDownload: https://github.com/Itseez/opencv/tree/master/samples/cpp/houghcircles.cpp
.. |TutorialHoughCirclesFancyDownload| replace:: here
.. _TutorialHoughCirclesFancyDownload: http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp
.. _TutorialHoughCirclesFancyDownload: https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp
#. The sample code that we will explain can be downloaded from |TutorialHoughCirclesSimpleDownload|_. A slightly fancier version (which shows both Hough standard and probabilistic with trackbars for changing the threshold values) can be found |TutorialHoughCirclesFancyDownload|_.
@@ -89,9 +89,9 @@ Code
======
.. |TutorialHoughLinesSimpleDownload| replace:: here
.. _TutorialHoughLinesSimpleDownload: http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/houghlines.cpp
.. _TutorialHoughLinesSimpleDownload: https://github.com/Itseez/opencv/tree/master/samples/cpp/houghlines.cpp
.. |TutorialHoughLinesFancyDownload| replace:: here
.. _TutorialHoughLinesFancyDownload: http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp
.. _TutorialHoughLinesFancyDownload: https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp
#. **What does this program do?**
@@ -55,7 +55,7 @@ Code
* Applies a Laplacian operator to the grayscale image and stores the output image
* Display the result in a window
#. The tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp>`_
#. The tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp>`_
.. code-block:: cpp
+1 -1
Ver Arquivo
@@ -59,7 +59,7 @@ Code
* Each second, apply 1 of 4 different remapping processes to the image and display them indefinitely in a window.
* Wait for the user to exit the program
#. The tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp>`_
#. The tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp>`_
.. code-block:: cpp
@@ -121,7 +121,7 @@ Code
* Applies the *Sobel Operator* and generates as output an image with the detected *edges* bright on a darker background.
#. The tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp>`_
#. The tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp>`_
.. code-block:: cpp
@@ -71,7 +71,7 @@ How do we get an Affine Transformation?
a. We know both :math:`X` and `T` and we also know that they are related. Then our job is to find :math:`M`
b. We know :math:`M` and :math:'X`. To obtain :math:`T` we only need to apply :math:`T = M \cdot X`. Our information for :math:`M` may be explicit (i.e. have the 2-by-3 matrix) or it can come as a geometric relation between points.
b. We know :math:`M` and :math:`X`. To obtain :math:`T` we only need to apply :math:`T = M \cdot X`. Our information for :math:`M` may be explicit (i.e. have the 2-by-3 matrix) or it can come as a geometric relation between points.
2. Let's explain a little bit better (b). Since :math:`M` relates 02 images, we can analyze the simplest case in which it relates three points in both images. Look at the figure below:
@@ -93,7 +93,7 @@ Code
* Applies a Rotation to the image after being transformed. This rotation is with respect to the image center
* Waits until the user exits the program
#. The tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp>`_
#. The tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp>`_
.. code-block:: cpp
@@ -111,7 +111,7 @@ Black Hat
Code
======
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp>`_
This tutorial code's is shown lines below. You can also download it from `here <https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp>`_
.. code-block:: cpp

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais