581 Commits

Autor SHA1 Mensagem Data
Andrey Kamaev facab40745 Disable -fomit-frame-pointer for OS X Clang as it leads to crash on exception thrown 2013-03-01 19:44:17 +04:00
Andrey Kamaev 08545b8f96 Merge pull request #603 from taka-no-me:avoid_deps_on_missing_lib 2013-03-01 17:10:46 +04:00
Andrey Kamaev f22ee8fc19 Merge pull request #602 from bitwangyaoyao:2.4_fixAdd 2013-03-01 17:10:11 +04:00
Andrey Kamaev e6cb44edc3 Merge pull request #600 from taka-no-me:fix_build_warnings 2013-03-01 17:09:56 +04:00
Andrey Kamaev 1094179155 Avoid build falure in armeabi build with Android SDK 2013-03-01 16:50:42 +04:00
cuda-geek a706de2446 Merge pull request #601 from apavlenko:android_tutorial_update 2013-03-01 16:09:25 +04:00
yao 65bb4250a4 Fix a bug in addWeighted x64 mode
And a potential problem in remap
2013-03-01 18:08:53 +08:00
Andrey Pavlenko 07b1ccdeb0 removing redundant picture resize 2013-03-01 13:56:50 +04:00
Andrey Kamaev 2128b82c6b Merge pull request #598 from asmorkalov:lib_info_fix 2013-03-01 13:52:57 +04:00
Andrey Pavlenko 978132edc1 minor Android tutorial fixes 2013-03-01 13:52:14 +04:00
Andrey Kamaev 22d33373fa Fix build warnings on MSVC x64 and OS X clang 2013-03-01 13:29:43 +04:00
Andrey Kamaev eaaba1336a Merge pull request #595 from bitwangyaoyao:2.4_perfTest 2013-03-01 12:49:43 +04:00
Andrey Kamaev 85c7a36f93 Merge pull request #594 from asmorkalov:android_all_build_fix 2013-03-01 12:49:27 +04:00
Andrey Kamaev 6be6adbbed Merge pull request #593 from apavlenko:java_tutorial_fixes 2013-03-01 12:49:15 +04:00
Alexander Smorkalov da455efc26 Full package version fixed. 2013-03-01 12:44:14 +04:00
Vadim Pisarevsky a910360689 Merge pull request #586 from bitwangyaoyao:2.4_FixBFMatcher 2013-03-01 10:55:11 +04:00
yao 8f3883a28d fix a compile warning 2013-03-01 10:06:51 +08:00
yao 82b9854837 fix compile warnings 2013-03-01 08:47:20 +08:00
Alexander 3cfd3d3ee0 Build with OpenCV.mk for all terget fixed. 2013-02-28 21:43:57 +04:00
Andrey Pavlenko af2552d72c fixing issues from http://www.code.opencv.org/issues/2807 2013-02-28 19:11:24 +04:00
Andrey Kamaev c865b28243 Merge pull request #591 from jet47:gpu-sanity-tests 2013-02-28 18:08:11 +04:00
Andrey Kamaev 79cf292d78 Merge pull request #590 from apavlenko:java_fixes 2013-02-28 18:07:33 +04:00
Andrey Kamaev 1018d110d6 Merge pull request #589 from taka-no-me:2digit_pyversion 2013-02-28 18:06:43 +04:00
Andrey Kamaev fba0e6fc5c Merge pull request #587 from bitwangyaoyao:2.4_fixHog 2013-02-28 18:06:28 +04:00
Andrey Kamaev 4811988caf Merge pull request #585 from bitwangyaoyao:2.4_SURF 2013-02-28 18:06:14 +04:00
Andrey Kamaev 2a73a6c445 Merge pull request #525 from odeniz:2.4 2013-02-28 18:05:55 +04:00
Andrey Pavlenko d18b2c2502 patch -> revision 2013-02-28 17:19:52 +04:00
Andrey Pavlenko c24d7cc066 adding more version-related variables 2013-02-28 16:56:53 +04:00
Vladislav Vinogradov f533f0dca9 fixed gpu sanity tests 2013-02-28 16:54:37 +04:00
Andrey Kamaev bd38a1945d Honor 2-digit python version 2013-02-28 16:32:13 +04:00
Andrey Pavlenko 29b763dc60 updating samples to load JNI lib with correct suffix 2013-02-28 16:24:52 +04:00
Andrey Pavlenko 5321da92cb adding/fixing version suffix for desktop java library on all OSes 2013-02-28 16:12:44 +04:00
Andrey Kamaev f4b413e830 Merge pull request #570 from taka-no-me:fix_android_cmakeconfig 2013-02-28 15:45:45 +04:00
Andrey Kamaev 1f411b5a2b Merge pull request #572 from asmorkalov:manager_4_digit_version 2013-02-28 15:44:57 +04:00
Andrey Kamaev bf4c8c6ff1 Merge pull request #584 from bitwangyaoyao:2.4_perfTest 2013-02-28 15:44:06 +04:00
Andrey Kamaev d0e340bc80 Merge pull request #582 from bitwangyaoyao:2.4_fixBlend 2013-02-28 15:43:51 +04:00
Alexander Smorkalov ddc2e334da OpenCV version swithed to 4 digit in GUI and package revision number. 2013-02-28 12:59:24 +04:00
yao f12369a53c Fix ocl::HOG crash on Intel OCL 2013-02-28 16:56:39 +08:00
Andrey Kamaev 831580ef31 Merge pull request #578 from jet47:nmake-ffmpeg-copy 2013-02-28 12:56:26 +04:00
Andrey Kamaev 6ce51d88a4 Merge pull request #573 from jet47:config-cross-compilation 2013-02-28 12:56:08 +04:00
cuda-geek 0771fd82c0 Merge pull request #557 from jet47:gpu-sanity 2013-02-28 11:17:12 +04:00
yao f791344810 linux warning fix 2013-02-28 14:37:37 +08:00
Vladislav Vinogradov 61ef48eee6 fixed OpenCVConfig for cross-compilation:
* added CUDA to EXTRA libs if OpenCV uses it
* added -rpath-link option for linker if OpenCV was built as SHARED libs
2013-02-28 10:33:05 +04:00
yao 504008dbe0 Fix ocl::bruteforcematcher crash on Intel OCL 2013-02-28 14:31:08 +08:00
Vladislav Vinogradov df456245e7 fixed ffmpeg destination folder for NMake generator 2013-02-28 10:16:41 +04:00
yao 7c1f1d8837 fix bug #2787 2013-02-28 14:05:36 +08:00
yao ed3c3822fc adjust some test cases, use original template file name in Haar 2013-02-28 12:15:13 +08:00
yao 69eebdd608 fix the blend crash in some cases 2013-02-28 09:03:10 +08:00
Andrey Kamaev 2be893a21e Revise git attributes 2013-02-28 03:18:54 +04:00
Andrey Kamaev a5d2253be8 Merge pull request #544 from AnnaKogan8:added-regressions-only-option 2013-02-28 00:38:47 +04:00
Andrey Kamaev 5b7a4cd955 Merge pull request #579 from bitwangyaoyao:2.4_perfTest 2013-02-27 19:34:17 +04:00
Andrey Kamaev 0a8711d76b Merge pull request #576 from bitwangyaoyao:2.4_customMat2 2013-02-27 19:33:54 +04:00
Andrey Kamaev af13c8604d Merge pull request #568 from bitwangyaoyao:2.4_moments 2013-02-27 19:33:26 +04:00
yao cbff75db9e fix build errors 2013-02-27 21:56:03 +08:00
yao bf427c01c1 adjust matchTemplate in performance sample, as current version is too slow when template size isn't small 2013-02-27 21:41:04 +08:00
Andrey Kamaev 024185b9ed Fix OpenCVConfig.cmake generated for Android platform (issue #2496)
* fix path to libraries in Android SDK
* allow to link to opencv_java.so as Android.mk does

To link to opencv_java.so you can either change your cmake to find OpenCV as

    find_package(OpenCV opencv_java)

or pass -DOpenCV_FIND_COMPONENTS=opencv_java to your cmake command
2013-02-27 15:04:29 +04:00
yao 9ccf27c7f5 add interfaces enable custom oclMat device memory type 2013-02-27 17:32:32 +08:00
cuda-geek 5d43ce853e Merge pull request #559 from jet47:gpu-hough-circles 2013-02-27 12:29:45 +04:00
Andrey Kamaev 1a82ceac9c Merge pull request #563 from taka-no-me:perf_classify_speedups 2013-02-27 11:37:18 +04:00
Andrey Kamaev b836e3c65b Merge pull request #556 from bitwangyaoyao:2.4_SURF 2013-02-27 11:37:04 +04:00
Andrey Kamaev f03c04c151 Merge pull request #554 from bitwangyaoyao:2.4_impvInterFrame 2013-02-27 11:36:40 +04:00
Andrey Kamaev c54c7c8b2c Merge pull request #553 from bitwangyaoyao:2.4_perfTest 2013-02-27 11:36:23 +04:00
yao dba2ec0539 remove the compile warnings 2013-02-27 14:53:27 +08:00
yao 6df23428af Add moments function 2013-02-27 13:45:16 +08:00
yao 6409a4b112 fix the compile warnings 2013-02-27 11:16:46 +08:00
yao 9ec5333a9b pyrlk also take advantages of cl_image support detection 2013-02-27 10:45:07 +08:00
yao da47ccec9c Put the cl_image support detection in utils 2013-02-27 10:24:03 +08:00
Andrey Kamaev 8304f17d63 Merge pull request #565 from cuda-geek:auto-arch 2013-02-27 00:05:16 +04:00
Andrey Kamaev e9307259d7 Merge pull request #564 from apavlenko:eclipse_import_fix 2013-02-27 00:05:02 +04:00
marina.kolpakova 7a08bbbcc7 add CUDA_GENERATION macro 2013-02-26 20:13:47 +04:00
cuda-geek 0e5255d4fb Merge pull request #561 from asmorkalov:android_tutorial_2_4_4_update 2013-02-26 19:58:34 +04:00
Andrey Pavlenko 1c1c3c29c3 fixing eclipse import errors 2013-02-26 19:52:59 +04:00
Andrey Kamaev 4d2c864bea Add option --with-score to summary.py to automatically classify speedups
Legend for new column is:
* FASTER - strong speedup
* faster - spedup is detected but it is unreliable
* <empty> - no change in speed
* slower - slowdown is detected but it is unreliable
* SLOWER - strong slowdown
2013-02-26 19:42:51 +04:00
Andrey Kamaev 2304d5367f Merge pull request #549 from asmorkalov:android_mips_static_build_fix 2013-02-26 19:03:43 +04:00
Andrey Kamaev f6dd3651ea Merge pull request #552 from taka-no-me:fix_invert 2013-02-26 18:31:30 +04:00
Andrey Kamaev dcf7a69430 Merge pull request #555 from bitwangyaoyao:2.4_fixFft 2013-02-26 18:31:17 +04:00
yao 04faaa9e35 Fix ocl::dft the compile warning on Linux 2013-02-26 21:18:51 +08:00
Alexander Smorkalov 8458f5c489 Android tutorial updated
OpenCV version incremented;
New CvCameraViewListener interface description added.
2013-02-26 16:35:02 +04:00
yao 3ff5689fe5 Merge branch '2.4_fixFft' of https://github.com/bitwangyaoyao/opencv into 2.4 2013-02-26 20:30:42 +08:00
Vladislav Vinogradov 10402c8a85 fixed gpu HoughCircles test 2013-02-26 16:10:35 +04:00
Vladislav Vinogradov c9868fc01f fixed warp tests 2013-02-26 13:53:39 +04:00
Vladislav Vinogradov 4f7cfbc26e fixed gpu bitwise operations with scalars 2013-02-26 13:53:39 +04:00
Vladislav Vinogradov a138e12a26 refactored gpu perf tests and fixed sanity tests 2013-02-26 13:53:38 +04:00
yao ea433cc496 remove the device specific logic 2013-02-26 17:53:08 +08:00
yao 62f8b0fc48 Fix ocl::dft error when program end on Linux 2013-02-26 17:44:19 +08:00
yao 0ac7f0d374 Simplify the bind texture logic of interpolate frame function 2013-02-26 17:12:03 +08:00
yao e3a715882e fix the mismatch of perf_test, add a performance sample for ocl module 2013-02-26 16:52:30 +08:00
Alexander Smorkalov 11885e86ee Feature #2833 Sepia size in Image Manipulations demo implemented. 2013-02-26 11:25:33 +04:00
Andrey Kamaev ab221e94c0 Fix invert under MSVC 2013-02-26 11:16:57 +04:00
Anna Kogan a9b1c5db78 Added --regressions-only=X-FACTOR option 2013-02-26 11:09:17 +04:00
Alexander Smorkalov 3c7bc6a51e Static ANdroid samples build for MIPS fixed 2013-02-26 10:32:10 +04:00
Andrey Kamaev 0d12f451be Merge pull request #524 from LeonidBeynenson:add_float_and_unsigned_parameters_to_cv_algorithm 2013-02-26 01:00:55 +04:00
Andrey Kamaev 11b83d4000 Merge pull request #547 from vpisarev:fixes_244 2013-02-26 01:00:36 +04:00
Vadim Pisarevsky 416432a8e5 replaced tabs with spaces 2013-02-25 23:10:38 +04:00
Vadim Pisarevsky 087537463d attempt to make the ultimate fix for the failure in Core_Invert.small 2013-02-25 22:46:30 +04:00
Vadim Pisarevsky 25bbcba0ea fixed Core_MulSpectrums failure 2013-02-25 22:02:24 +04:00
Andrey Kamaev 9f15daf0a0 Merge pull request #542 from asmorkalov:manager_2.4.4_filter 2013-02-25 18:00:14 +04:00
LeonidBeynenson 41dc829341 Made changes to avoid warnings (Windows compilation). 2013-02-25 15:38:59 +04:00
Alexander Smorkalov bb7af3f78e OpenCV Manager preparation to 2.4.4 release
2.4.4 constant added to Manager filter;
Added additional native tests.
2013-02-25 15:34:06 +04:00
Andrey Kamaev 6082f351ab Merge pull request #541 from bitwangyaoyao:2.4_fixCvtColor 2013-02-25 14:04:02 +04:00
Andrey Kamaev b6cdc849db Merge pull request #540 from hgaspar:244 2013-02-25 14:03:36 +04:00
yao 59ebf4ed9f Fix the ocl::cvtColor mismatch on some devices 2013-02-25 15:19:39 +08:00
hgaspar 60981565fa updated the ocl module introduction 2013-02-24 22:34:44 -05:00
Andrey Kamaev 620c699456 Merge pull request #538 from NCBee:patch-2 2013-02-24 15:27:01 +04:00
Andrey Kamaev cfd019e2a2 Merge pull request #537 from bitwangyaoyao:2.4_fixWarpAffine 2013-02-24 15:26:42 +04:00
Andrey Kamaev 7047c23489 Merge pull request #535 from bitwangyaoyao:2.4_clean 2013-02-24 15:26:24 +04:00
Andrey Kamaev 3b1fc16f36 Merge pull request #536 from bitwangyaoyao:2.4_fixHaar 2013-02-24 15:26:06 +04:00
NCBee 7249457771 Update doc/tutorials/core/adding_images/adding_images.rst
Quick fix for: http://code.opencv.org/issues/2803
2013-02-23 10:28:24 -05:00
yao f1a5c1328c remove the empty implementation when HAVE_OPENCL not defined 2013-02-23 20:50:03 +08:00
yao b7ebedc23e fix mismatch of WarpAffine 2013-02-23 17:43:10 +08:00
yao 9bbf170054 some cleanup 2013-02-23 15:34:43 +08:00
yao 720eaf1e1a fix the haar kernel problems on Nvidia and Intel OCL 2013-02-23 15:19:46 +08:00
yao d050159f07 Remove the perf running from ocl::matchTemplate accuracy tests 2013-02-23 14:30:04 +08:00
Oscar Deniz Suarez 07ea88b8c6 Update samples/c/smiledetect.cpp
Fixed isdigit() Android build error
2013-02-22 16:23:42 +01:00
OpenCV Buildbot e6dd4e840d Update FFMPEG wrapper binaries 2013-02-22 16:56:01 +04:00
Andrey Kamaev dfbd5f6a02 Merge pull request #506 from asmorkalov:crosscompile_tutorial 2013-02-22 16:41:16 +04:00
Andrey Kamaev 9bbb0ed060 Merge pull request #531 from asmorkalov:android_mips_fix 2013-02-22 16:40:20 +04:00
Andrey Kamaev 051aa4cb98 Merge pull request #530 from bitwangyaoyao:2.4_fixEqHist 2013-02-22 16:40:06 +04:00
Andrey Kamaev 58f546dd93 Merge pull request #529 from bitwangyaoyao:2.4_fixGemm 2013-02-22 16:39:50 +04:00
Andrey Kamaev 3406832aa2 Merge pull request #528 from bitwangyaoyao:2.4_fixPyrLK 2013-02-22 16:35:30 +04:00
Andrey Kamaev b1975fb13d Merge pull request #527 from bitwangyaoyao:2.4_fixMeanShift 2013-02-22 16:35:18 +04:00
Andrey Kamaev e68901bbce Merge pull request #523 from taka-no-me:fix_2815 2013-02-22 16:34:28 +04:00
Andrey Kamaev 7cd4edd695 Merge pull request #518 from asmorkalov:ts_refactor 2013-02-22 16:34:14 +04:00
yao 1a488c0542 fix the warning on Linux when OpenCL 1.2 not supported 2013-02-22 18:33:16 +08:00
Alexander Smorkalov 4bbdfbc9e7 Bug #2821 Installation of OpenCV modules breaks build on MIPS Android fixed.
Native camera libs for MIPS installation fixed.
2013-02-22 11:57:42 +04:00
yao 7810254198 Fix ocl::equalizeHist mismatch 2013-02-22 15:48:31 +08:00
yao 3316d0bfb2 Fix the compiling errors of gemm on Linux 2013-02-22 15:05:49 +08:00
cuda-geek dea6148a1a Merge pull request #526 from taka-no-me:fix_compatibility 2013-02-22 09:18:19 +04:00
yao 2e3f4fdada fix pyrLK's mismatch on Linux 2013-02-22 11:23:43 +08:00
yao f4ef0c1598 fix meanShift mismatch on none-double GPUs 2013-02-22 10:13:20 +08:00
Andrey Kamaev c17e9ef7ba Repair binary compatibility of ocl module 2013-02-22 01:58:01 +04:00
Oscar Deniz Suarez 8cfba6456b Update samples/c/smiledetect.cpp
- Changed to floating neighbor maximum mode
- Fixed some previous errors.
2013-02-21 22:55:28 +01:00
Andrey Kamaev 995154d10d Fix binary compatibility of gpu module 2013-02-22 00:14:58 +04:00
Oscar Deniz Suarez 379dcf87d5 Added smile detector 2013-02-21 17:17:34 +01:00
LeonidBeynenson bfb644ac04 Changed error message in Algorithm::get. 2013-02-21 20:10:42 +04:00
LeonidBeynenson e7b214b6d2 Removed urequired functions 2013-02-21 19:49:37 +04:00
Andrey Kamaev eda2a76ee9 Merge pull request #520 from jet47:gpu-updates 2013-02-21 18:03:06 +04:00
gferry e3803f9985 fix for OpenCV issue #2815
- libavcodec issue
- some decoders alter AVCodecContext width/height values, in a wrong way
- eg. in issue 2815, vp6f decoder changes these values, resulting in distorted / invalid frames
- this patch forces default AVCodecContext values
2013-02-21 17:37:24 +04:00
Andrey Kamaev f0dce1fa35 Merge pull request #521 from asmorkalov:2.4.4_preparation 2013-02-21 17:25:21 +04:00
Vladislav Vinogradov 73ffd71a22 Fixed documentation build 2013-02-21 17:06:53 +04:00
Vladislav Vinogradov 8b1f88c40f updated gpu module API 2013-02-21 16:12:33 +04:00
Andrey Kamaev afa993316f Merge pull request #502 from jet47:opengl-updates 2013-02-21 15:12:43 +04:00
Alexander Smorkalov 9f39c8eaa1 OpenCV 2.4.4 preparation
Manager verison incremented;
Additional constatnt for library intialization added;
Documents updated.
2013-02-21 14:42:28 +04:00
Andrey Kamaev 16461247ce Merge pull request #498 from asmorkalov:doc_ptr 2013-02-21 13:30:34 +04:00
Andrey Kamaev ff0d23e55b Merge pull request #519 from bitwangyaoyao:2.4_findOCL 2013-02-21 13:30:20 +04:00
Vladislav Vinogradov 21f95a3b11 restored source compatibility 2013-02-21 12:38:12 +04:00
Andrey Kamaev d4e7bec29a Merge pull request #440 from AnnaKogan8:fixed-perfomance-tests 2013-02-21 12:29:57 +04:00
Andrey Kamaev decf04dfec Merge pull request #512 from jet47:core-gpu-updates 2013-02-21 12:22:04 +04:00
Vladislav Vinogradov a938534a7e restored binary compatibility 2013-02-21 12:18:08 +04:00
Alexander 4091eab45e cv::Ptr description extended. 2013-02-21 12:14:42 +04:00
yao f816e10ac9 Add auto detection to Intel OCL 2013-02-21 16:11:18 +08:00
Alexander Smorkalov e21a1d3124 Test system refactoring
cmpEps replaced on cmpEps2 to reduce code dublication;
Constants for cmpEps return values added.
2013-02-21 12:07:04 +04:00
Andrey Kamaev c1a5d1c44a Merge pull request #508 from bitwangyaoyao:2.4_interpKernel 2013-02-21 11:51:06 +04:00
Vladislav Vinogradov ce2559b332 optimized DeviceInfo class and ensureSizeIsEnough 2013-02-20 19:30:57 +04:00
Anna Kogan f6e0d327b0 Increased time limits 2013-02-20 17:34:00 +04:00
Anna Kogan a567c03fdf Switched to TEST_CYCLE_MULTIRUN for fast tests 2013-02-20 17:05:54 +04:00
yao 429ae44ae3 add openCLExecuteKernelInterop method 2013-02-20 17:46:43 +08:00
Alexander Smorkalov 637b48eec8 Tutorial for ARM Linux cross compilation added. 2013-02-20 12:48:30 +04:00
Andrey Kamaev 6ebb0e2ad2 Merge pull request #505 from abidrahmank:2.4 2013-02-20 12:29:53 +04:00
Abid K 96b2898f38 Update samples/python2/hist.py
range in calcHist() changed from [0,255] to [0,256]. Otherwise, it won't count pixels with value 255. It can be verified taking sum of histogram values and checking it with image size.
2013-02-19 19:31:53 +05:30
Andrey Kamaev 5691fd3abe Merge pull request #503 from taka-no-me:fix_docs 2013-02-19 18:01:51 +04:00
Andrey Kamaev 5cc2a6bdbf Merge pull request #500 from nielsgm:predict_python_wrapper_to_docs 2013-02-19 18:01:30 +04:00
Andrey Kamaev afa8e4e645 Merge pull request #492 from taka-no-me:fix_warnings_gcov 2013-02-19 18:01:06 +04:00
Andrey Kamaev 60f7b1d98d Whitelist functions/structs in check_docs2 that are impossible to fix in 2.4 2013-02-19 16:22:20 +04:00
Andrey Kamaev 2fe7482b73 Add support for enums into rst ocv domain 2013-02-19 16:22:20 +04:00
Andrey Kamaev ff7b604a25 Fix several inconsistent declarations identified by check_doc2 script 2013-02-19 16:22:20 +04:00
Vladislav Vinogradov e06c3ec7c5 updated OpenGL functionality:
* removed OpenGLFuncTab, now extensions are loaded internally
* added support of GlBuffer and GlTexture2D to InputArray/OutputArray
* added ELEMENT_ARRAY_BUFFER and PIXEL_PACK_BUFFER targets
* added copyFrom/copyTo method for GlBuffer and GlTexture2D
* removed GlFont
* removed pointCloudShow
* removed OpenGLCleanCallback
* added Access parameter to GlBuffer::mapHost
* added autoRelease parameter to all create methods
2013-02-19 14:13:11 +04:00
Andrey Kamaev 2bbb777d95 Fix warnings about missing parent for class members 2013-02-19 11:49:05 +04:00
Andrey Kamaev 535f1fb2e2 Hack to stop parsing of problematic CvStatModel::train definition 2013-02-19 10:39:31 +04:00
Andrey Kamaev 0570aa6494 Avoid problem of old sphinx reporting an error on lines starting from :
See http://sourceforge.net/tracker/?func=detail&aid=3484857&group_id=38414&atid=422030
2013-02-19 10:34:43 +04:00
Niels Gerlif Myrtue 7697d79d93 Added the predict_all function wrapper for python that was missing from the documentation
Copied the docstring description
2013-02-19 13:11:30 +11:00
Andrey Kamaev 39baa2237e Merge pull request #499 from vpisarev:zeroelem_fix 2013-02-18 18:05:02 +04:00
Andrey Kamaev c6f6f9ab35 Merge pull request #451 from bitwangyaoyao:2.4_operator 2013-02-18 18:04:44 +04:00
Vadim Pisarevsky a1c7e0368c fixed problem reported by Thouis (Ray) Jones 2013-02-18 17:01:21 +04:00
Andrey Kamaev 6503836b4d Merge pull request #469 from asmorkalov:android_manager_4number_version 2013-02-18 15:41:25 +04:00
yao 9613135e8d fix compiling errors on Linux
more operators use oclMatExpr
2013-02-16 18:41:43 +08:00
yao 69fd2d8273 add oclMatExpr class to prevent extra allocations 2013-02-16 11:05:23 +08:00
Andrey Kamaev 7e5eee5bf1 Merge pull request #301 from emchristiansen:javasample2.4 2013-02-15 18:38:25 +04:00
Andrey Kamaev 3ead4449ad Fix several warnings about uninitialized variables from gcov build 2013-02-15 17:28:23 +04:00
Andrey Pavlenko 2853bab471 converting images to PNG 2013-02-15 16:46:30 +04:00
Andrey Pavlenko edb15dee3d review feed-back considered 2013-02-15 16:33:13 +04:00
Andrey Kamaev f58dffe31f Merge pull request #401 from Daniil-Osokin:bugfix_doc_setNumThreads 2013-02-14 19:07:41 +04:00
OpenCV Buildbot 50d3e565c5 Update FFMPEG wrapper binaries 2013-02-14 18:39:24 +04:00
Andrey Kamaev 49c664fad4 Merge pull request #489 from jet47:carma-obsolete 2013-02-14 18:20:31 +04:00
Andrey Pavlenko a8c2fc6908 changing layout, adding ant and eclipse sections, more pictures 2013-02-14 17:54:37 +04:00
Daniil Osokin 5f32e0e24d Rewrote doc for set-get number of threads functionality with support new frameworks (bug #2064) 2013-02-14 17:11:16 +04:00
Daniil Osokin 6deda2531c Fixed getNumThreads() for C= 2013-02-14 17:07:36 +04:00
Andrey Kamaev da1ddc752b Merge pull request #487 from asmorkalov:manager_localref_fix 2013-02-14 16:50:16 +04:00
Vladislav Vinogradov 78c924baad removed obsolete CARMA toolchain and CMake variable 2013-02-14 16:27:17 +04:00
Andrey Kamaev f3874abf68 Merge pull request #488 from AnnaKogan8:updated-ABI-compliance-descriptor-script 2013-02-14 16:08:05 +04:00
Andrey Kamaev 37c6357b97 Merge pull request #485 from jet47:gpu-new-functionality 2013-02-14 16:00:55 +04:00
Anna Kogan f9cf70e93e Updated script for ABI compliance check 2013-02-14 14:59:26 +04:00
Alexander Smorkalov 6619941c90 Issues in management of local reference to jni objects fixed. 2013-02-14 13:29:51 +04:00
Vladislav Vinogradov a3a09cf4d1 refactored OpticalFlowDual_TVL1:
* added DenseOpticalFlow interface
* moved OpticalFlowDual_TVL1 to src folder
2013-02-14 13:26:47 +04:00
Andrey Kamaev 8547984d29 Merge pull request #486 from amroamroamro:2.4 2013-02-14 11:21:16 +04:00
Andrey Kamaev 37e2664cf0 Merge pull request #479 from ilya-lavrenov:TestHighGUI 2013-02-14 11:21:01 +04:00
Amro 42a2cb0a38 add description of ddepth param of cv::boxFilter
bug #2709
2013-02-13 15:16:17 +03:00
Vladislav Vinogradov 2181a41a07 added perf4au app 2013-02-13 15:58:24 +04:00
Vladislav Vinogradov aa73bf6079 added gpu optical flow sample 2013-02-13 15:58:12 +04:00
Vladislav Vinogradov 50f28c9e25 added Warp::reduce function 2013-02-13 15:57:55 +04:00
Vladislav Vinogradov 36e42084f0 added gpu BM optical flow implementation 2013-02-13 15:57:40 +04:00
Vladislav Vinogradov fe2e89df1b added gpu::HoughLinesP function 2013-02-13 15:56:58 +04:00
Vladislav Vinogradov 86bd325131 added gpu::normalize function 2013-02-13 15:55:58 +04:00
Vladislav Vinogradov 61b54149b1 added mask support to gpu norm and sum 2013-02-13 15:54:50 +04:00
Vladislav Vinogradov 08914aa708 added gpu compare with scalar 2013-02-13 15:53:03 +04:00
Vladislav Vinogradov a828b60765 added enqueueHostCallback method to gpu::Stream 2013-02-13 15:51:27 +04:00
Vladislav Vinogradov ce2fd7fec9 added dual tvl1 optical flow gpu implementation 2013-02-13 15:50:05 +04:00
Andrey Kamaev 54a0e5085c Merge pull request #483 from taka-no-me:cmake_tweaks 2013-02-13 15:50:02 +04:00
Vladislav Vinogradov 1498d2f427 added dual tvl1 optical flow implementation 2013-02-13 15:42:58 +04:00
Andrey Kamaev c7df17e77b Detect and report parallel framework used 2013-02-13 15:09:30 +04:00
Andrey Kamaev 0b20faf3d2 Use git describe to get source control version 2013-02-13 14:50:32 +04:00
Andrey Kamaev 9e4792af1f Add separate status section for java 2013-02-13 14:36:56 +04:00
Andrey Kamaev 82313b3f6c Add OpenCL section to status report 2013-02-13 14:27:12 +04:00
Andrey Kamaev 247df9f3fc Detect version of clang compiler 2013-02-13 14:11:56 +04:00
Andrey Kamaev ca5e6f9522 Merge pull request #480 from taka-no-me:ffmpeg_warnings 2013-02-12 20:29:03 +04:00
Andrey Kamaev ac389507a0 Fix warnings from ffmpeg wrapper 2013-02-12 19:58:59 +04:00
Andrey Kamaev 8b7a28a7e4 Merge pull request #477 from asmorkalov:android_version_info 2013-02-12 17:06:27 +04:00
Andrey Kamaev 0cf9c16adc Merge pull request #478 from jet47:gpu-reduction-fix 2013-02-12 17:06:07 +04:00
Andrey Kamaev 7c77b402db Merge pull request #468 from kirill-kornyakov:test-for-saturate-cast 2013-02-12 17:04:54 +04:00
Ilya Lavrenov 5512f91d08 removed libstdc++ dependency 2013-02-12 14:20:23 +04:00
Alexander Smorkalov 1751a963f2 Build info output for all android apps added.
OpenCV build information output to logcat added to OpenCV initialization code;
Documenation for cv::getBuildInformation() added.
2013-02-12 11:19:05 +04:00
Vladislav Vinogradov fdb07a0ac1 fix performance issue of gpu reduction 2013-02-12 09:50:41 +04:00
Andrey Kamaev b6e7aeabe0 Merge pull request #476 from apavlenko:eclipse_import_fix 2013-02-11 21:38:07 +04:00
Andrey Kamaev 3990564a83 Merge pull request #470 from kirill-kornyakov:bug_2788_testing_add_method_for_column 2013-02-11 21:16:39 +04:00
Andrey Kamaev 2495b23a7d Merge pull request #473 from prclibo:2.4 2013-02-11 20:48:03 +04:00
Andrey Kamaev 059ea5bebe Merge pull request #471 from apavlenko:jar_install 2013-02-11 20:46:48 +04:00
Andrey Pavlenko 54bcaa4934 fixing eclipse import errors that can also be fixed via 'Fix Project Properties' menu 2013-02-11 19:49:18 +04:00
Andrey Kamaev 80d760c96e Merge pull request #467 from asmorkalov:manager_jni_overflow 2013-02-11 19:17:41 +04:00
Andrey Kamaev a370404d9c Merge pull request #416 from asmaloney:mat-docs-cleanup 2013-02-11 18:51:03 +04:00
Bo Li 92e7e7d8e8 fix issue 2788 2013-02-11 15:09:42 +01:00
Kirill Kornyakov 74e5650350 Reenabled second test 2013-02-11 16:53:41 +04:00
Andrey Kamaev 5cae645ba1 Temporary disabled parallel_writers_and_readers test 2013-02-11 16:52:20 +04:00
Andrey Pavlenko b337d84adf configure desktop Java install, making JNI library name correct, and making it fat when possible 2013-02-11 16:28:19 +04:00
Alexander Smorkalov 9f9c333a26 Bug #2759 android.os.DeadObjectException on OpenCV Manager connection fixed.
DeleteLocalRef calls for jclass objects added.
2013-02-11 16:03:19 +04:00
Kirill Kornyakov 7071bd63ab Added two tests to highlight bug #2788 2013-02-11 15:25:15 +04:00
Alexander Smorkalov 9f01074f4c Bug in hardware ratings fixed. 2013-02-11 15:03:52 +04:00
Alexander Smorkalov 8c44e1ff81 Native testing for OpenCV Manager enabled
All tests added to CMake;
All tests ported on 4 digit version support;
Some test fixes and bug fixes were done.
2013-02-11 15:03:52 +04:00
Kirill Kornyakov 81b9f9b16b Added a test that documents that negative numbers are not clipped by cv::saturate_cast 2013-02-11 14:58:38 +04:00
Andrey Kamaev 1869f77c0f Merge pull request #457 from taka-no-me:fix_vars_expansion 2013-02-11 14:37:14 +04:00
Andrey Kamaev ffb3b5ddbe Adjust OpenCV version to 2.4.4 2013-02-11 14:17:29 +04:00
Andrey Kamaev 2ed6bc8aaf Revert ffmpeg related changes from "thread-safe VideoWriter and VideoCapture"
This reverts commit 4abf0b3193.

Changes are reverted because they break build of proxy dlls on Windows
2013-02-11 14:15:29 +04:00
Andrey Kamaev 9d7300f003 Merge pull request #465 from asmorkalov:android_camera_connect 2013-02-11 14:05:37 +04:00
Andrey Kamaev c61d7088ae Merge pull request #466 from taka-no-me:fix_android_package 2013-02-11 14:04:07 +04:00
Andrey Kamaev 5335c2f920 Merge pull request #464 from asmaloney:missing_fclose 2013-02-11 14:03:51 +04:00
Andrey Kamaev d92a56ee2d Merge pull request #458 from taka-no-me:tbb_4.1u2 2013-02-11 14:03:11 +04:00
Andrey Kamaev cc79f40e2b Merge pull request #454 from asmorkalov:android_samples_reorganize 2013-02-11 14:02:54 +04:00
Andrey Kamaev 2a98c1f89c Merge pull request #446 from AnnaKogan8:updated-perf-timing-script 2013-02-11 14:02:39 +04:00
Andrey Kamaev 81832d76a8 Fix build of package for Google Play 2013-02-11 12:59:37 +04:00
Alexander Smorkalov d067dc5a05 Code review notes fixed. 2013-02-11 11:36:12 +04:00
Alexander Smorkalov 283b26e2db Issue in NativeCameraView and JavaCameraView fixed.
In previous version getWidth() and getHeight() values were used instead method parameters.
2013-02-11 09:43:44 +04:00
Andy Maloney 2075236757 If generating a bin file (second half of conditional), make sure the file is closed
(Also fix spelling in comment)
2013-02-10 21:55:20 -05:00
Andrey Kamaev 716e0192b3 Merge pull request #456 from vpisarev:python_ptseq_fix 2013-02-08 18:52:04 +04:00
Andrey Kamaev 3ed6c09485 Merge pull request #428 from bitwangyaoyao:2.4_erode_dilate 2013-02-08 18:48:37 +04:00
Andrey Kamaev 504264ab7b Merge pull request #402 from asmorkalov:samples_data_rase_fix 2013-02-08 18:48:13 +04:00
Andrey Kamaev 4045e6e588 Update tbb to version 4.1 update 2 2013-02-08 18:45:24 +04:00
Andrey Kamaev 46ca5c32cd Merge pull request #455 from AlexeySpizhevoy:2.4 2013-02-08 18:45:24 +04:00
Andrey Kamaev bb25111d23 Merge pull request #452 from asmorkalov:android_tutorial_update 2013-02-08 18:43:57 +04:00
Andrey Kamaev 4f4fe553bc Merge pull request #450 from bitwangyaoyao:2.4_dft 2013-02-08 18:43:34 +04:00
Andrey Kamaev 571665b559 Fix CMake variables substitution in Android project files 2013-02-08 18:21:49 +04:00
Vadim Pisarevsky 43d61d961e fixed problem with Nx2 numpy arrays in geometrical functions (#2783) 2013-02-08 18:11:56 +04:00
Alexey Spizhevoy e0ead7b606 fixed assertion failure (vector out of range) for the 'vc10,debug' build (#2775) 2013-02-08 17:44:57 +04:00
Alexander Smorkalov c7e7b77093 Tutorial for Android synchronized with actual application framework. 2013-02-08 16:53:06 +04:00
Andrey Kamaev 6ffd5edfb5 Merge pull request #442 from asmorkalov:linux_cross_compile 2013-02-08 14:37:09 +04:00
Andrey Kamaev 9591fb8f63 Merge pull request #448 from Nerei:bp_doc_change_24 2013-02-08 14:29:56 +04:00
Alexander Smorkalov 9a2d6f854b Tutorial-1-Java -> Tutorial-1-CameraPreview
Issues fix.
2013-02-08 13:13:37 +04:00
Alexander Smorkalov 507e2dc0ad Project files for Eclipse updated. 2013-02-08 12:50:58 +04:00
Alexander Smorkalov b558bb4894 Tutorial-5 -> Tutorial-3 2013-02-08 12:50:58 +04:00
Alexander Smorkalov 902463b6e9 Tutorial4 sample renamed to Tutorial-2-MixedProcessing 2013-02-08 12:50:07 +04:00
Alexander Smorkalov 08cd51df1f Tutorial-3 removed as dublicate part of tutorial-4. 2013-02-08 12:47:45 +04:00
Alexander Smorkalov b943277559 Tutorial-2 removed as dublicate of tutorial-1 and image manipulations sample. 2013-02-08 12:47:23 +04:00
Alexander Smorkalov 33502c86ac Tutorial 1 renamed 2013-02-08 12:45:48 +04:00
Alexander Smorkalov 192ee15520 Code review notes fixed;
HardFP and SoftFP toolchains joined to one;
RPATH skiping added.
2013-02-08 12:42:03 +04:00
Alexander Smorkalov 076941bb07 15-puzzle app reverted to usage of old CvCameraViewListener implementation;
super.onPause() call moved to begining of onPause method according Google recomandations.
2013-02-08 12:36:33 +04:00
yao 0b365f6aa5 add +-*/ operators to oclMat 2013-02-08 11:41:46 +08:00
yao 4d6827212d some bugs fix in using AmdFft library 2013-02-08 10:46:43 +08:00
Anatoly Baksheev 79d5724794 BP doc change according to Adrian's request (OpenCV book co-author) 2013-02-07 22:31:39 +04:00
Anna Kogan 51e58aeb25 Added --failed-only option and multiple input files support 2013-02-07 19:08:31 +04:00
Alexander Smorkalov f8720ec60e Code review issues fixed. Compatibility issues fixed. 2013-02-07 13:11:08 +04:00
Andrey Kamaev 03f7d2f1ca Merge pull request #444 from taka-no-me:fix_o0_warnings 2013-02-07 00:15:52 +04:00
Andrey Kamaev afe85e7e51 Fix some warnings from -O0 build 2013-02-06 20:57:36 +04:00
LeonidBeynenson 203849d5e4 The next attempt to fix a build error on Mac. 2013-02-06 18:07:02 +04:00
Andrey Kamaev 93d4abecf8 Merge pull request #443 from taka-no-me:fix_cascade_test 2013-02-06 16:40:38 +04:00
LeonidBeynenson 50cd5d9ce7 Try to fix Mac compilation issue. 2013-02-06 15:31:51 +04:00
Andrey Kamaev 6e4aeff4c9 Merge pull request #441 from jet47:filter-speckles-8u 2013-02-06 15:12:02 +04:00
Andrey Kamaev 37d695a62e Use gtest assertions in cascade test
This simplifies test debugging a lot
2013-02-06 15:07:31 +04:00
Alexander Smorkalov b81f0887f0 Carma board support fixed. 2013-02-06 14:47:42 +04:00
Alexander Smorkalov 4e243e1759 TBB build for arm linux fixed. Processors count detected correctly. 2013-02-06 14:43:57 +04:00
Alexander Smorkalov 6645f50dd0 CUDA toolkit support added to crosscompilation toolchain. 2013-02-06 14:43:57 +04:00
Alexander Smorkalov 1120289fdb Compiler and linker flags for arm cross compilation fixed. 2013-02-06 14:43:57 +04:00
Alexander Smorkalov 3ed99b7700 Code review notes applied.
Toolchain for arm hardfp added.
2013-02-06 14:43:57 +04:00
Alexander Smorkalov ffb9da14fb TBB build defines for Linux added. 2013-02-06 14:43:57 +04:00
Alexander Smorkalov 60f056061a Cross compilation toolchain for arm linux added. 2013-02-06 14:43:57 +04:00
Alexander Smorkalov 7882aba7af TBB download and build option enabled for non Android platfroms. 2013-02-06 14:43:57 +04:00
Alexander Smorkalov 2e2e1355ac Video IO perf tests guarded. 2013-02-06 14:43:57 +04:00
Vladislav Vinogradov bb3b1441c5 added 8u type support to filterSpeckles function 2013-02-06 14:14:45 +04:00
Andrey Kamaev bf575ba7fb Merge pull request #434 from taka-no-me:fix_parallel_writer_test 2013-02-06 14:04:59 +04:00
Andrey Kamaev 7cdede0c55 Merge pull request #438 from bitwangyaoyao:2.4_fixwarings 2013-02-06 14:04:28 +04:00
yao e31e924cf7 remove the warnings in accuracy test 2013-02-06 09:12:40 +08:00
Andrey Kamaev fe0516c877 Merge pull request #432 from bitwangyaoyao:2.4_blend 2013-02-05 14:53:49 +04:00
Andrey Kamaev 53e77ed468 Merge pull request #431 from snosov1:matchTemplate-tegra 2013-02-05 14:50:15 +04:00
yao 568b935246 remove a warning on Linux
fix a error in doc
2013-02-05 17:16:40 +08:00
LeonidBeynenson b85a098d9c Added float, uint64, and uchar params to Algorithm
Made changes to work in cv::Algorithm with parameters of these types.
Also fixed SimpleBlobDetector -- now it can be created by
cv::Algorithm::create and it can work with cv::Algorithm::set/get.
2013-02-04 20:25:18 +04:00
Alexander Smorkalov 6b5eac328f Android samples updated according onCameraFrame callback signature change.
FpsMeter class removed from Image Manipulations and Face Detection examples as unused code.
2013-02-04 17:43:46 +04:00
Alexander Smorkalov 3ef588b877 onCameraFrame callback signature changed. CvCameraFame interface added.
New interface allows to get one RGBA or Gray frame from camera or both in the same time;
New interface fixes data rase in samples also.
2013-02-04 17:43:45 +04:00
Andrey Kamaev f608df9640 Merge pull request #427 from vrabaud:brisk_fixes_2.4 2013-02-04 17:10:02 +04:00
Sergei Nosov c0e3d48ebc stricter eps for normed methods 2013-02-04 16:02:01 +04:00
Andrey Kamaev 7244fc1f6a Merge pull request #404 from asmorkalov:android_opencvmk_fix 2013-02-04 15:49:48 +04:00
Andrey Kamaev 727b6a7259 Merge pull request #408 from asmorkalov:giganetix_cams_patch 2013-02-04 14:56:54 +04:00
Andrey Kamaev 3c39e146a3 Make parallel video writer test pass if compiled without threading support 2013-02-04 14:34:44 +04:00
Vincent Rabaud d235c3a678 define the default remapping in the right scope 2013-02-04 11:08:00 +01:00
Vincent Rabaud 0b1599d88a write documentation for BRISK 2013-02-04 11:07:53 +01:00
yao 9711ef6dee blend use vector to optimize 2013-02-04 17:29:20 +08:00
Sergei Nosov 15d0484485 matchTemplate perf tests added 2013-02-04 12:57:22 +04:00
Sergei Nosov c768731e89 enable Tegra optimizations 2013-02-04 12:57:03 +04:00
Andrey Kamaev 9c939a8dcf Merge pull request #420 from asmaloney:check-mem-alloc 2013-02-04 12:56:36 +04:00
Alexander Smorkalov e58f4e44c8 Modules redifinition in case of multiple includes of OpenCV.mk in single Android.mk fixed. 2013-02-04 12:22:22 +04:00
Andrey Kamaev 650609aaeb Merge pull request #429 from bitwangyaoyao:2.4_setdevEx 2013-02-04 12:03:24 +04:00
Andrey Kamaev 6dc3b662f6 Merge pull request #425 from asmaloney:vector_empty 2013-02-04 12:03:03 +04:00
Andrey Kamaev 58c4d5f4b4 Merge pull request #424 from asmaloney:additional-checks 2013-02-04 12:02:43 +04:00
Andrey Kamaev fc4a2244fa Merge pull request #421 from asmaloney:check-mem-alloc2 2013-02-04 12:02:28 +04:00
Andrey Kamaev 37460acb21 Merge pull request #410 from taka-no-me:fix_cap_dshow_setfps 2013-02-04 11:57:33 +04:00
Andrey Kamaev e2536f1c35 Merge pull request #395 from LeonidBeynenson:fix_ml_large_data_bug__2.4 2013-02-04 11:54:43 +04:00
yao a639a1ae5c add setDeviceEx interface
simplify the logic of save binary
2013-02-04 15:06:36 +08:00
yao 3c5cb4931e simplify the kernel logic when using rect kernel or without ROI 2013-02-04 13:33:27 +08:00
Andy Maloney ac8744af6a No need to check vector size before clear() 2013-02-02 19:00:41 -05:00
Andy Maloney c8cad0857e Remove unused constructor
Add checks for valid values
Fix wording on some errors
2013-02-02 16:09:10 -05:00
Andy Maloney b79e8053c1 Check memory allocation
Declare vars as locally as possible
2013-02-02 08:44:25 -05:00
Andy Maloney b497380a68 Check memory allocation
Initialize local variables
2013-02-02 08:33:40 -05:00
Andrey Kamaev 2a669555de Merge pull request #414 from asmaloney:remove-unused-vars2 2013-02-02 14:34:47 +04:00
Andrey Kamaev 7e06b4755b Merge pull request #415 from asmaloney:cvCopyHist-fix 2013-02-02 14:34:33 +04:00
Andy Maloney e7ea90f87f Mat tutorial - grammar and spelling fixes 2013-02-01 23:39:40 -05:00
Andy Maloney 3154cdf8ac Fix subtle bug when src & dst agree on sparsity but have different dimensions
Remove unused var "total"
Declare vars as locally as possible
2013-02-01 22:57:22 -05:00
Andy Maloney bc68dfb4e8 Remove unused vars 2013-02-01 18:09:58 -05:00
Andrey Kamaev 0cd8684ade Fix setting of FPS after frame width and height with DShow cameras
Issue #2114
2013-02-01 18:01:13 +04:00
cuda-geek db9de43fa5 Merge pull request #407 from taka-no-me:fix_java_after_surf_change 2013-02-01 17:48:21 +04:00
Andrey Kamaev 6f1961031c Update regression checks in Java test
This follows SURF changes in 1f261c2
2013-02-01 17:16:28 +04:00
LeonidBeynenson 87b0126e0d Fixed dummy warning. 2013-02-01 16:16:43 +04:00
Alexander Smorkalov 25086ed257 Smartek Giganetix Cameras support (Patch #2192) integrated. 2013-02-01 16:07:32 +04:00
Andrey Kamaev 9e32c6993a Merge pull request #405 from vpisarev:znah_patch 2013-02-01 16:06:54 +04:00
LeonidBeynenson 013d54c230 Changed types of some variables from int64 back to int.
Also corrected some indexes to be size_t.
2013-02-01 14:41:14 +04:00
Vadim Pisarevsky 51eba617a8 a part of PR269 (parallelization of several functions) by Alexander Mordvintsev 2013-02-01 14:01:44 +04:00
Andrey Kamaev b179e2dd2d Merge pull request #396 from vpisarev:facedetect_fixes 2013-02-01 12:49:48 +04:00
Andrey Kamaev 992d47e9dc Merge pull request #400 from ilysenkov:bugfix_2560 2013-02-01 12:05:48 +04:00
Andrey Kamaev 5ef58a474a Merge pull request #397 from ilysenkov:bugfix_2677 2013-02-01 12:04:38 +04:00
Andrey Kamaev 0b6677f6d3 Merge pull request #398 from ilysenkov:bugfix_2330 2013-02-01 11:19:33 +04:00
Vadim Pisarevsky 638c0d1bf4 fixed compile warnings 2013-02-01 10:47:27 +04:00
Andrey Kamaev 57aa089ad6 Merge pull request #392 from vpisarev:python_fixes2 2013-02-01 10:20:52 +04:00
Ilya Lysenkov b24e4bddb1 Documented the TermCriteria class (#2560) 2013-02-01 10:16:30 +04:00
Ilya Lysenkov 7745c8806c Added info() method in descriptor matchers (#2330) 2013-02-01 02:23:40 +04:00
Ilya Lysenkov 098ea6fcb7 Checked key_size in LSH table for validness (#2677) 2013-01-31 23:19:19 +04:00
Ilya Lysenkov 1becbd9fcc Added a test for invalid key sizes in LSH tables 2013-01-31 23:17:07 +04:00
Vadim Pisarevsky 50299c1d5e disabled the use of SSE4 instructions as well to make the code compatible with the old Intel and AMD chips 2013-01-31 22:57:46 +04:00
Vadim Pisarevsky 18039d7829 added test for the old cvHaarDetectObjects. disabled AVX optimization in haar.cpp. it should cover tickets #2534, #2591, #2669 2013-01-31 22:55:04 +04:00
Andrey Kamaev 39b4bf1828 Merge pull request #390 from taka-no-me:fix_relative_error_check 2013-01-31 21:32:45 +04:00
Andrey Kamaev a8c014de33 Merge pull request #318 from AnnaKogan8:fixed-perf-tests 2013-01-31 21:01:44 +04:00
Andrey Kamaev 13d2412d24 Merge pull request #394 from taka-no-me:fix_tiff_test 2013-01-31 20:52:35 +04:00
Andrey Kamaev 34ef209940 Merge pull request #393 from Daniil-Osokin:bugfix_doc_multi_issues 2013-01-31 20:30:33 +04:00
Vadim Pisarevsky 54e0765d80 yet another minor fix in cv::transpose() 2013-01-31 20:26:16 +04:00
Vadim Pisarevsky 7ca38d63d9 fixed failure of the C++ test for estimateAffine3D 2013-01-31 19:44:16 +04:00
LeonidBeynenson 6de422701a Made changes to allow ml module to work with big data. 2013-01-31 19:37:20 +04:00
Andrey Kamaev 92460adebe Merge pull request #391 from taka-no-me:fix_buildbot_issues 2013-01-31 18:55:09 +04:00
Andrey Kamaev 55b90d7bae Modify decode_tile16384x16384 test to not fail when available memory is not enough for test 2013-01-31 18:51:24 +04:00
Daniil Osokin fe5b9df45f Fixed multiple issues in docs (bug #2410) 2013-01-31 17:34:40 +04:00
Vadim Pisarevsky 79e278c008 applied patch #2587 2013-01-31 16:19:20 +04:00
Anna Kogan ed4c687d45 Increased time limits, eliminated extra params 2013-01-31 16:18:52 +04:00
Vadim Pisarevsky 82b6419d12 added tests for fast (ticket #2613) and estimateAffine3D (#2375) 2013-01-31 16:15:40 +04:00
Andrey Kamaev e3b45910aa Temporary disable unstable Features2d_RotationInvariance_Detector_SIFT test 2013-01-31 16:06:22 +04:00
Andrey Kamaev e63b4591ff Suppress clang build warning 2013-01-31 16:01:04 +04:00
Andrey Kamaev 4f1913ed26 Correct tolerance value for sanity checks with ERROR_RELATIVE
Use min/max bounds instead of local value to calculate acceptance threshold.
Threshold based on local values somethimes does not work because cancellation
of big values may produce error bigger than local value.
2013-01-31 15:47:14 +04:00
Vadim Pisarevsky abd9675a99 fixed bugs #1718, #2375; attached the new tests to test.py. 2013-01-31 15:34:09 +04:00
Andrey Kamaev acb2cb5bf0 Merge pull request #389 from Daniil-Osokin:bugfix_doc_opencv_with_cmake 2013-01-31 15:04:56 +04:00
cuda-geek 53b0df87f1 Merge pull request #385 from etalanin:bug2607 2013-01-31 13:46:01 +04:00
cuda-geek bf53ebd590 Merge pull request #381 from vpisarev:surf_fixes 2013-01-31 13:36:10 +04:00
Daniil Osokin b5ed86c6a1 Fixed sample files in "Using OpenCV with gcc and CMake" tutorial (bug #2663, #2588) 2013-01-31 13:26:29 +04:00
cuda-geek fe30da6e2c Merge pull request #387 from taka-no-me:fix_dshow_fourcc_conversion 2013-01-31 13:26:26 +04:00
Andrey Kamaev fda32d3d8d Merge pull request #382 from cuda-geek:fix-broken-links-bug-2689 2013-01-31 13:08:01 +04:00
Evgeny Talanin 50c2f87add Fix and test for #2607 2013-01-31 12:23:08 +04:00
cuda-geek f3ae185fd0 Merge pull request #383 from cuda-geek:apply-opencv-macosx-patch 2013-01-31 12:04:13 +04:00
Andrey Kamaev 2d6253609c Fix truncation of fourcc value in dshow capture property setter (bug #2535)
Added test checking that all valid fourcc values are converted properly
2013-01-31 12:00:04 +04:00
Andrey Kamaev e0426148ba Merge pull request #374 from ivan-korolev:fix_estimateRigidTransform 2013-01-30 20:26:54 +04:00
marina.kolpakova 8b3c717e8f apply patch #2686 2013-01-30 20:20:06 +04:00
cuda-geek e72c7736e7 Merge pull request #375 from taka-no-me:fix_opticalflow_2075 2013-01-30 20:18:53 +04:00
Andrey Kamaev 9b4f2d1b53 Merge pull request #373 from ilysenkov:bugfix_2440 2013-01-30 19:37:16 +04:00
Andrey Kamaev 33c26a93c6 Merge pull request #376 from taka-no-me:solve_tiff_conflict 2013-01-30 19:36:09 +04:00
marina.kolpakova 5b03d47fb8 fix broken links in cascade classification documentation 2013-01-30 19:28:16 +04:00
Andrey Kamaev 4ceb8dd149 Merge pull request #378 from ivan-korolev:fix_OpenCVDetectTBB_cmake 2013-01-30 19:16:31 +04:00
cuda-geek bc53a054f2 Merge pull request #380 from asmorkalov:java_test_fix2 2013-01-30 19:03:35 +04:00
cuda-geek 31d3c508db Merge pull request #377 from ivan-korolev:fix_v4l_yes-yes_build 2013-01-30 18:59:56 +04:00
Vadim Pisarevsky 1f261c2f9d changed default parameters of SURF, which improved its performance. Restored bi-linear interpolation in SURF descriptor extractor. Added test for SURF homography + check for non-zero (positive) responses. 2013-01-30 18:07:37 +04:00
Andrey Kamaev f65a14d1ef Merge pull request #379 from taka-no-me:fix_ocl_samples_warnings 2013-01-30 18:06:49 +04:00
Alexander Smorkalov 5bc6365ba5 TestCheckVector java test fixed. Warning fixed. 2013-01-30 17:28:22 +04:00
Andrey Kamaev f489eb9a5d Fix build warnings in OpenCL samples 2013-01-30 17:25:03 +04:00
Ivan Korolev 26c7e7f292 fix default include dirs for TBB 2013-01-30 17:17:04 +04:00
Ivan Korolev eaa5012163 fix v4l yes-yes build 2013-01-30 17:04:33 +04:00
Andrey Kamaev 11871528ce Solve conflict between tiff.h and opencv2/core/types_c.h
Сonflict exists between some versions of libtiff and opencv headers
2013-01-30 16:36:50 +04:00
Andrey Kamaev c9d8e9900f Allow input of calcOpticalFlowPyrLK be submats of different size images
This fixes bug #2075
2013-01-30 16:07:55 +04:00
Andrey Kamaev 6a29b13c45 Add test for issue #2075 2013-01-30 16:07:38 +04:00
Ivan Korolev b362affd13 Fixed bug in the cv::estimateRigidTransform (#1949) 2013-01-30 15:27:23 +04:00
Ilya Lysenkov 3c8787980c Fixed cvDestroyAllWindows() without windows in QT (#2440) 2013-01-30 15:26:49 +04:00
Ilya Lysenkov 56fbcc541f Tested cvDestroyAllWindows() without windows 2013-01-30 15:25:10 +04:00
Andrey Kamaev 3a55fb9d1b Merge pull request #365 from ivan-korolev:fix_HoughLines_segfault 2013-01-30 15:16:30 +04:00
Andrey Kamaev 52b32ba8f0 Merge pull request #371 from taka-no-me:fix_build 2013-01-30 15:06:19 +04:00
Andrey Kamaev b6de1fccc3 Merge pull request #370 from ilysenkov:bugfix_1747 2013-01-30 14:42:10 +04:00
Andrey Kamaev d7874238f6 Merge pull request #369 from asmorkalov:corner_detection_tutorial 2013-01-30 14:41:56 +04:00
Andrey Kamaev 62b9180c50 Merge pull request #368 from ilysenkov:checkSubset-fix 2013-01-30 14:41:37 +04:00
Andrey Kamaev 81f5e72630 Merge pull request #366 from asmorkalov:gstreamer_codec_list 2013-01-30 14:41:22 +04:00
Andrey Kamaev 8d9af7de61 Merge pull request #362 from Daniil-Osokin:bugfix_doc_StereoSGBM 2013-01-30 14:41:06 +04:00
Andrey Kamaev ae7460440e Merge pull request #361 from taka-no-me:tiff_big_tile 2013-01-30 14:40:51 +04:00
Andrey Kamaev 86b4b30a6d Merge pull request #358 from taka-no-me:objc_exceptions 2013-01-30 14:40:32 +04:00
Andrey Kamaev 68be50bbab Fix clang build warning 2013-01-30 13:31:00 +04:00
Andrey Kamaev e79e81c6cd Fix Windows build warnings 2013-01-30 13:24:49 +04:00
Ilya Lysenkov 6feade3110 Added support of different resolution in rectify3Collinear 2013-01-30 13:19:12 +04:00
Andrey Kamaev eeb865ee8a Fix Android build warnings 2013-01-30 13:11:33 +04:00
Alexander Smorkalov 627b441022 Bugfix #2532 patch 4 corner detection sample possible bug solved.
Tutorial text was not consistent with tutorial source code in samples directory.
Inline source code was replaced on "includeliteral" directive with link to cpp file.
2013-01-30 13:05:57 +04:00
Andrey Kamaev 7e5f877ad9 Merge pull request #364 from Daniil-Osokin:bugfix_doc_features2d_tutorial 2013-01-30 13:05:47 +04:00
Andrey Kamaev d0350402de Merge pull request #356 from Daniil-Osokin:bugfix_imread_tutorial 2013-01-30 13:05:31 +04:00
Ilya Lysenkov 9ce2197e9d Added processing of trivial subsets 2013-01-30 13:03:03 +04:00
Andrey Kamaev 9690ed8232 Fix build of OpenCV samples (Linux) 2013-01-30 12:48:01 +04:00
Alexander Smorkalov 82e325cbfa Patch #2721 More FourCC for gstreamer applied. 2013-01-30 11:44:14 +04:00
Ivan Korolev 9908ff33de Added regression test for HoughLines algorithm 2013-01-30 11:27:19 +04:00
Daniil Osokin 7305f955a5 Added nonfree header in "Feature description" tutorial code sample (bug #2527) 2013-01-30 11:07:09 +04:00
Daniil Osokin f9de98ec64 Fixed proposed values for speckleRange in StereoSGBM docs (bug #1937) 2013-01-30 09:02:17 +04:00
Daniil Osokin 568591670c Fixed color code in cvtColor in "Load, Modify, and Save an Image" tutorial (bug #2739) 2013-01-30 08:16:47 +04:00
Andrey Kamaev 62ce815197 Fix rollover when computing buffer size in tiff decoder (bug #2161) 2013-01-30 00:07:33 +04:00
Andrey Kamaev b4d0dff4c5 Added minimal support for tiff encoder parameters and test for issue #2161 2013-01-30 00:07:30 +04:00
Andrey Kamaev daa02aaa98 Merge pull request #360 from vpisarev:sift_fixes 2013-01-29 20:39:13 +04:00
Vadim Pisarevsky c69312ea0d fixed #2580, #2210. some work on #2025.
modified SIFT to 1) double image before finding keypoints, 2) use floating-point internally instead of 16-bit integers, 3) set the keypoint response to the abs(interpolated_DoG_value). step 1) increases the number of detected keypoints significantly and together with 2) and 3) it improves some detection benchmarks. On the other hand, the stability of the small keypoints is lower, so the rotation and scale invariance tests now struggle a bit. In 2.5 need to make this feature optional and add some more intelligence to the algorithm.

added test that finds a planar object using SIFT.
2013-01-29 19:38:56 +04:00
Andrey Kamaev 3dbb98e454 Merge pull request #357 from taka-no-me:build_opencv_apps 2013-01-29 19:25:52 +04:00
Andrey Kamaev c78cb21999 Merge pull request #346 from taka-no-me:decouple_V4L2 2013-01-29 19:25:30 +04:00
Andrey Kamaev 0b1fe53a46 Add -fobjc-exceptions flag to ObjectiveC sources if supported (bug #2657) 2013-01-29 17:09:23 +04:00
Andrey Kamaev daead680cd Add option to control build of applications (feature #2568) 2013-01-29 16:38:59 +04:00
Andrey Kamaev ab8d92e1b8 Rebase and merge pull request #342 from ilysenkov/bugfix_2470 2013-01-29 15:53:42 +04:00
Ilya Lysenkov 5021a792b1 Fixed #2470 2013-01-29 15:53:28 +04:00
Ilya Lysenkov fe86f31f44 Added a test of CvModelEstimator2::checkSubset(...) 2013-01-29 15:53:28 +04:00
Andrey Kamaev 98fdd70466 Merge pull request #339 from vpisarev:core_fixes 2013-01-29 15:51:22 +04:00
Andrey Kamaev 287fb2c611 Fix build warning 2013-01-29 14:52:03 +04:00
Andrey Kamaev 63873a8393 Merge pull request #355 from asmaloney:copy_paste_cond 2013-01-29 14:13:01 +04:00
Andrey Kamaev 519e23bf0b Merge pull request #354 from asmaloney:fix_mem_dealloc 2013-01-29 14:12:12 +04:00
Andrey Kamaev da884b4e1d Merge pull request #347 from asmorkalov:WITH_FFMPEG_logic 2013-01-29 14:00:10 +04:00
Vadim Pisarevsky e7cbf65280 Merge pull request #351 from vpisarev:python_fixes 2013-01-29 13:34:50 +04:00
Alexander Smorkalov 8c45b9d03d Video IO perf tests guarded. 2013-01-29 11:09:49 +04:00
cuda-geek 04f01ed21d Merge pull request #353 from asmaloney:arg_checks 2013-01-29 11:04:33 +04:00
cuda-geek 11dfceb2c9 Merge pull request #328 from jet47:new-gpu-fixes 2013-01-29 11:00:37 +04:00
Andy Maloney bdf189faac {calib3d} Fix copy-paste error in conditional 2013-01-28 18:09:10 -05:00
Andy Maloney 5bd56e7464 Fix mem leak and mismatched new/delete 2013-01-28 17:57:19 -05:00
Andy Maloney 7a6475c3f9 Check pointers before using them in var init 2013-01-28 16:51:28 -05:00
Andrey Kamaev 2b4ffd1161 Merge pull request #350 from asmorkalov:android_java_warnings 2013-01-28 23:57:14 +04:00
Andrey Kamaev d7ea27b279 Merge pull request #349 from Daniil-Osokin:bugfix_opencv_cheatsheet 2013-01-28 23:56:55 +04:00
Andrey Kamaev 3a9c978b5e Merge pull request #348 from Daniil-Osokin:bugfix_YCrCb_formula 2013-01-28 23:56:42 +04:00
Andrey Kamaev 6abb69bd25 Merge pull request #345 from Daniil-Osokin:bugfix_2550 2013-01-28 23:56:26 +04:00
Andrey Kamaev 17130477c9 Merge pull request #344 from taka-no-me:improve_jpeg_encoder_errors 2013-01-28 23:56:01 +04:00
Vadim Pisarevsky 4044fbcb33 hopefully fixed handling of 'long' Python type in OpenCV bindings (bug #2193). added the corresponding test 2013-01-28 21:03:59 +04:00
Vadim Pisarevsky 2320ec76b4 Extended python bindings to support scalar values and tuples in place of InputArray (i.e. Mat) - ticket #2658. Added tests for #2611, #2505, #2658 2013-01-28 20:45:00 +04:00
Vadim Pisarevsky a519bbc617 Extended python bindings to support scalar values and tuples in place of InputArray (i.e. Mat) - ticket #2658. Added tests for #2611, #2505, #2658 2013-01-28 20:44:47 +04:00
Andrey Kamaev 09d93af975 Merge pull request #343 from taka-no-me:fix_nlmeans_2646 2013-01-28 20:35:39 +04:00
Alexander Smorkalov ca98710640 Resolve warning in OpenCV Library project in Eclipse (Bug #2714)
Warning in auto generated code was suppressed by project settings.
2013-01-28 19:44:58 +04:00
Daniil Osokin e33f3e8345 Fixed cheatsheet for loop (bug #2701) 2013-01-28 18:41:59 +04:00
Vadim Pisarevsky cd46a674d1 applied patch #2611 that also likely fixes #2505 2013-01-28 18:30:20 +04:00
Daniil Osokin 4c9c27b244 Fixed formula of YCrCb to RGB conversion (bug #2725) 2013-01-28 18:29:01 +04:00
Andrey Kamaev cf407c2ec0 Don't check for EINTR and replace xioctl with ioctl
This should be safe todo unless we are writing a signal handler.
2013-01-28 17:58:57 +04:00
Daniil Osokin f9bff103dd Removed obsolete steps from Windows installation tutorial (bug #2550) 2013-01-28 17:46:03 +04:00
Vadim Pisarevsky 146ca61a27 added tests for #1373, #2629, #2719; fixed another bug in determinant(Matx<T,n,n>) 2013-01-28 17:27:08 +04:00
Patrick Welche 1a84bcc565 NetBSD video(4) support, patch 3 of 3
xioctl() assumes that ioctl takes int request. Cope with
  int ioctl(int d, unsigned long request, ...)
to avoid "invalid argument".
2013-01-28 17:11:44 +04:00
Patrick Welche 681ffd9a21 NetBSD video(4) support, patch 2 of 3
* Decouple Video4Linux2 support from Video4Linux as existence of
  v4l2 on a system does not imply support for v4l.
* Don't use V4L's struct video_window in V4L2 code.
* Removed __USE_GNU as comment says:
      /* support for MJPEG is only available with libjpeg and gcc,
         because it's use libjepg and fmemopen()
  so replace with test for fmemopen() if found necessary.
2013-01-28 17:11:41 +04:00
Patrick Welche d90b8d615c NetBSD video(4) support, patch 1 of 3
The video(4) driver provides a Video4Linux2 compatible API for
various video peripherals. This patch propagates HAVE_VIDEOIO if
the sys/videoio.h include file is found, which is the signature of
video(4).
2013-01-28 17:11:36 +04:00
Andrey Kamaev 255cd61a8c Improve error reporting of JPEG image encoder
OpenCV issue #2604

After this patch applied an attempt to encode empty images produces exception
saying "Raw image encoder error: Empty JPEG image (DNL not supported)"
2013-01-28 16:55:00 +04:00
Andrey Kamaev 7374445398 Fix integer overflow in NL-Means denoising on white input
Issues #2646
2013-01-28 14:35:51 +04:00
Andrey Kamaev 7e92826efc Add test for issue #2646 2013-01-28 14:35:51 +04:00
Andrey Kamaev d83914d478 Change Imgproc_ prefix to Photo_ in all accuracy tests of photo module 2013-01-28 14:01:22 +04:00
Andrey Kamaev 8521ac5d21 Merge branch 'fix_jpg2000' into 2.4 2013-01-28 12:41:35 +04:00
Andy Maloney e87355463f {highgui} Fix copy-paste error in conditional 2013-01-26 16:38:01 -05:00
Vadim Pisarevsky 1df10553bb fixed bugs #1373, #2629, #2719 2013-01-25 23:45:41 +04:00
Andrey Kamaev d8f749da52 Merge pull request #337 from taka-no-me:ocl_appsdk 2013-01-25 16:23:36 +04:00
Andrey Kamaev 9509dfd1de Fix OpenCL build warnings 2013-01-25 16:19:59 +04:00
Andrey Kamaev b445f4b01d Find OpenCL in AMD APP SDK 2013-01-25 14:15:26 +04:00
Andrey Kamaev dc11acf041 Merge pull request #336 from ivan-korolev:fix_relative_error_formula 2013-01-25 14:10:06 +04:00
Ivan Korolev 6385b0f7ed Fixed a formula to calculate the relative error 2013-01-25 11:19:38 +04:00
Andrey Kamaev ed949bc211 Merge pull request #324 from bitwangyaoyao:2.4_cvtcolor 2013-01-25 00:53:42 +04:00
Andrey Kamaev 20de2f35f9 Merge pull request #325 from bitwangyaoyao:2.4_fixcanny 2013-01-25 00:46:35 +04:00
Andrey Kamaev f9ed0037b3 Merge pull request #327 from bitwangyaoyao:2.4_vs2012 2013-01-25 00:46:20 +04:00
Andrey Kamaev 14c31bfda0 Merge pull request #334 from asmaloney:2.4 2013-01-25 00:45:34 +04:00
Andy Maloney 5d65d000ab Docs: Fix invalid conversion format in example (CV_BGR2GREY -> CV_BGR2GRAY) 2013-01-24 10:08:58 -05:00
Andrey Kamaev 94e2b5c140 Merge pull request #305 from stephenfalken:2.4 2013-01-24 18:24:36 +04:00
Andrey Kamaev 7ad81ed46f Merge pull request #332 from taka-no-me:fix_ocl_warnings 2013-01-24 17:44:11 +04:00
Andrey Kamaev d5b15d6523 Fix ocl build warnings 2013-01-24 17:08:30 +04:00
Andrey Kamaev 33ca4ba5c7 Merge pull request #331 from taka-no-me:fix_java_debug 2013-01-24 15:49:14 +04:00
Siegfried Hochdorfer 195d501b43 fixed broken indentation 2013-01-24 11:40:35 +01:00
Andrey Kamaev cc399e2ade Merge pull request #330 from sromberg:2.4 2013-01-24 14:26:54 +04:00
Andrey Kamaev a441980d68 Fix debug build of Java warppers 2013-01-24 13:25:12 +04:00
Andrey Kamaev 3c4cfccc88 Merge pull request #321 from apavlenko:warp_sanity_check 2013-01-24 13:05:54 +04:00
Stefan Romberg 9f417268b3 Fixed visualization by choosing the color appropriate to the detection
Fixed visualization by choosing the color appropriate to the detection
score.
Previously the example showed all detections with the same color
disregarding the confidence. This led to the impression that the object
detection did not work at all because there are many detections with low
confidences.

PR to master was
https://github.com/Itseez/opencv/pull/320
2013-01-24 10:01:18 +01:00
yao 2aae501234 make ocl module compile on VS2012 2013-01-24 15:45:29 +08:00
yao d574e6dc09 fix canny crash in bug #2279 2013-01-24 14:58:41 +08:00
yao 4f778436b5 ocl::cvtColor support YUV and YCbCr formats 2013-01-24 14:33:28 +08:00
Vladislav Vinogradov 395f0201e3 fixed build for CARMA:
- added CMake toolchain file
- added WITH_NVCUVID flag
2013-01-23 21:05:08 +04:00
Vladislav Vinogradov 9cb4292d5c implemented Luv/Lab <-> RGB conversion 2013-01-23 21:05:08 +04:00
Vladislav Vinogradov e446903aac added more types support for gpu separable filters 2013-01-23 21:05:07 +04:00
Vladislav Vinogradov 281d036fcf optimizations:
- new reduce implementation (with kepler optimizations)
- saturate_cast via asm command
- video SIMD instructions in element operations
- float arithmetics instead of double
- new deviceSupports function
2013-01-23 21:05:07 +04:00
Vladislav Vinogradov ae6266e101 fixes for gpu module:
- fixed printCudaDeviceInfo for new CC
- fixed some compilation errors and warnings
- removed unset command from CMake script
- removed unused std imports
2013-01-23 21:05:06 +04:00
Vladislav Vinogradov b7e6b5af1b fixed tests (call resetDevice, if there was a gpu failure) 2013-01-23 21:05:04 +04:00
Andrey Kamaev 0773ab4d07 Merge pull request #315 from taka-no-me:java_on 2013-01-23 19:02:27 +04:00
Andrey Pavlenko e287dea91b fixing build warnings 2013-01-23 18:45:06 +04:00
Andrey Kamaev 2c32536bf4 Enable Java bindings on all platforms by default 2013-01-23 18:08:09 +04:00
Andrey Kamaev caa2c06e50 Quiet output of cv::error in Java tests
Introduced new Java API
void org.opencv.core.Core.setErrorVerbosity(boolean verbose)
used to suppress output to stderr from OpenCV's asserts
2013-01-23 18:08:09 +04:00
Andrey Kamaev 5eabcf8e4f Java tests: print summary for tests run 2013-01-23 18:08:09 +04:00
Andrey Kamaev 4668a133f0 Java API: fix build warning on OS X
Common part of all source files is extracted to special header
2013-01-23 18:08:09 +04:00
Andrey Kamaev 3889b34ec3 Add option to run java tests with run.py 2013-01-23 18:08:08 +04:00
Andrey Pavlenko 81721d0dce enabling sanity checks for warp and resize functions on Android
- add syntetic images generation function to ts
- use generated syntetic images
2013-01-23 17:25:30 +04:00
Andrey Kamaev 311d799344 Merge pull request #299 from branch 'bitwangyaoyao_ocl' into 2.4 2013-01-23 14:50:29 +04:00
yao e05112a364 some host side optimizations to ocl::GaussianBlur 2013-01-23 14:48:04 +04:00
yao 9060365f5e use format on filtering.cpp 2013-01-23 14:48:04 +04:00
yao 56c1a7fab6 make oclHaarDetectObjects running on more ocl platforms 2013-01-23 14:48:04 +04:00
yao b5bd2cde9e A few optimizations to ocl::pyrLK::sparse, make it running on more OCL platforms 2013-01-23 14:48:04 +04:00
yao 02c9e0a3e0 add default clAmdFft and clAmdBlas path 2013-01-23 14:48:04 +04:00
yao f6d82773f9 fix bug #2674 2013-01-23 14:48:04 +04:00
Andrey Kamaev 78dc44a7fd Merge pull request #295 from apavlenko:test_surf_keypoints_invariance 2013-01-23 14:40:05 +04:00
Andrey Kamaev 4d64db8be7 Merge pull request #319 from AnnaKogan8:added-surf-keypoints-cleanup 2013-01-23 10:36:02 +04:00
Anna Kogan 608fab60fd Added cleanup of keypoints vector 2013-01-22 18:05:18 +04:00
Andrey Kamaev 46c4390a2e Hardly refactored CMake script for Java wrappers 2013-01-22 17:59:01 +04:00
Andrey Kamaev c92743d124 Eliminate intermediate build target "opencv_java_api" 2013-01-22 17:59:00 +04:00
Andrey Kamaev 594f969641 Merge pull request #316 from mdim:draw_matches_fix 2013-01-22 16:09:48 +04:00
Eric Christiansen c2c2403a79 Added a desktop Java tutorial 2013-01-21 14:57:25 -08:00
mdim 93f8e7ba74 check of keypoint index range in drawMatches 2013-01-22 00:37:27 +04:00
Andrey Kamaev a45eb275e3 Merge pull request #306 from AnnaKogan8:perf_tests_timing.py-improvement 2013-01-21 18:10:08 +04:00
Andrey Kamaev abb9e08671 Merge pull request #314 from vpisarev:2.4 2013-01-21 17:52:35 +04:00
Vadim Pisarevsky f14b7af5ac changed diagnostic from "warning" to "note" in the python wrapper generator, to suppress some noise in opencv utilities 2013-01-21 15:00:32 +04:00
Andrey Kamaev 9c7a8dd584 Merge pull request #312 from taka-no-me:cheatsheet 2013-01-19 12:03:20 +04:00
Andrey Kamaev 1ed507c065 Merge pull request #310 from taka-no-me:4digit_version 2013-01-19 12:03:04 +04:00
Andrey Kamaev 55c74ebea8 Merge pull request #309 from asmorkalov:android_manager_4number_version 2013-01-19 12:02:49 +04:00
Andrey Kamaev e9301c3c4b Add opencv_cheatsheet.pdf to documentation build and silence Latex output 2013-01-18 18:27:43 +04:00
Andrey Kamaev e3474878b6 Consistently use 4-digit library version 2013-01-18 14:57:55 +04:00
Alexander Smorkalov 4feae810fa 4 digit library version numeration implemented in OpenCV Manager
Code refactoring done.
OpenCV library version type changed to int.
Some UI labels updated.
OpenCV Manager verison incremented.
2013-01-18 11:42:48 +04:00
Andrey Kamaev 101e9bd456 Merge pull request #304 from apavlenko:test_java_fix_double 2013-01-17 18:20:47 +04:00
Siegfried Hochdorfer 82a9f9a5a9 MeanshiftGrouping Bugfix (Bug #2685) 2013-01-17 11:46:24 +01:00
Andrey Pavlenko a8c0f1d962 fixing test failure on some systems 2013-01-16 18:33:35 +04:00
Andrey Kamaev 7341eaa654 Merge pull request #296 from asmorkalov:html_docs_warning_fix 2013-01-16 16:44:13 +04:00
Andrey Kamaev 28afa8d2d4 Merge pull request #297 from taka-no-me:fix_deps 2013-01-16 16:30:38 +04:00
Andrey Kamaev 0fed75a880 Merge pull request #302 from taka-no-me:fix_doc_sphinx107 2013-01-16 16:07:49 +04:00
Andrey Kamaev 069844cd4e Merge pull request #300 from taka-no-me:java_64bit 2013-01-16 14:49:46 +04:00
Andrey Kamaev b362d47d95 Fix documentation build with Sphinx 1.07 2013-01-16 12:43:12 +04:00
Eric Christiansen 6169b1dc90 Adds samples for Java and Scala 2013-01-15 12:03:55 -08:00
Andrey Kamaev bf3c2b0bbb Fix incorrect Mat address reconstruction on 64-bit platforms
This fixes random failures in Java wrappers.
2013-01-15 19:23:49 +04:00
Anna Kogan 0587bef667 Switched time from seconds to minutes 2013-01-15 15:32:22 +04:00
Anna Kogan 3cdfa654ae Added 'Num of tests' col, changed headers, added 'overall time' row 2013-01-15 15:26:43 +04:00
Andrey Kamaev 3cb84ed17c Fix dependencies inference for auto-disabled targets
Sometimes information about dependencies causing disabling were loosed and it
was not possible to correctly display these dependencies in status report
2013-01-14 18:58:24 +04:00
Andrey Pavlenko 9f0d5f60b5 fixinf warning on non-Windows systems 2013-01-14 18:15:51 +04:00
Alexander Smorkalov 8cb0343f4c Documentation build warning fixes.
Invalid links and refences fixed.
SpaeseMat class documentation updated.
2013-01-14 17:58:27 +04:00
Andrey Pavlenko 8e42ca1764 SURF keypoints rotation invariance test.
It calcs kpts for a cross and checks that 4 kpts at the edges have equal responce.
2013-01-14 14:06:00 +04:00
Andrey Kamaev c49b23d4dd Merge pull request #240 from emchristiansen:javatest2.4 2013-01-14 11:06:44 +04:00
Andrey Pavlenko b0e1cb473a more tests fixes 2013-01-11 09:13:25 +04:00
Andrey Kamaev 5e2726fb17 Merge pull request #287 from taka-no-me:fix_cvCalcOpticalFlow_2526 2013-01-10 19:56:44 +04:00
Andrey Kamaev 64d89d3546 Merge pull request #288 from taka-no-me:fix_unused_cmake_variable 2013-01-10 19:56:26 +04:00
Andrey Kamaev cf8deac2b2 Always touch variable controlling build of the module
This suppresses "unused variable" CMake warning when user explicilty disables
module unavailable in selected configuration
2013-01-10 19:05:39 +04:00
Andrey Kamaev b1384a6da8 Fix cvCalcOpticalFlow when the status parameter is NULL
issue 2526
2013-01-10 18:14:08 +04:00
Andrey Kamaev dff59ec960 Merge pull request #284 from taka-no-me:fix_equalize_hist_2678 2013-01-10 16:58:36 +04:00
Andrey Kamaev 59c6e2cc44 Merge pull request #283 from AnnaKogan8:perf_tests_timing.py-improved-console-output 2013-01-10 16:58:22 +04:00
Andrey Kamaev 6131a847a2 Fix histogram calculation in equalizeHist
issue #2678
2013-01-10 14:48:31 +04:00
Andrey Kamaev b81d1b25c7 Merge pull request #280 from vpisarev:bug_fixes_jan9 2013-01-10 13:31:04 +04:00
Anna Kogan 3271e395c8 Improved console output 2013-01-10 13:19:59 +04:00
Anna Kogan 0d7ce141aa Cleaned code 2013-01-10 13:18:26 +04:00
Anna Kogan 0334cf11cc Fixed last testsuit disregarding 2013-01-10 13:16:46 +04:00
Vadim Pisarevsky e383d39598 fixed bug #2679 2013-01-09 17:53:19 +04:00
Andrey Kamaev 399c20a928 Merge pull request #272 from 5kg:fix_haar 2013-01-09 16:53:11 +04:00
Andrey Kamaev e34aba60d9 Merge pull request #278 from taka-no-me:fix_build_jpeg9 2013-01-09 16:52:56 +04:00
Andrey Kamaev 873aefae19 Merge pull request #279 from taka-no-me:mingw_java 2013-01-09 16:52:41 +04:00
Vadim Pisarevsky 46cf2e96b5 Merge pull request #265 from taka-no-me:doc_signatures 2013-01-09 15:40:39 +04:00
Andrey Kamaev 4e1ba6f02f Fix build with libjpeg release 9 2013-01-08 19:55:29 +04:00
Andrey Kamaev da9089612a Fix build of java bindings on mingw 2012-12-30 23:24:39 +04:00
cuda-geek 47df8f4c2a Merge pull request #275 from mdim:bug_fix_cvboost 2012-12-30 00:31:03 +04:00
Andrey Kamaev dcde359181 Merge pull request #270 from wswld:2.4 2012-12-29 16:47:39 +04:00
Andrey Kamaev 7f4bcd3d72 Merge pull request #271 from 5kg:fix_cascade 2012-12-29 15:04:11 +04:00
Maria Dimashova 0e2958e888 fixed CvBoost::predict
(Sometimes sample_data became bad because the buffer with its values was deallocated early).
2012-12-29 00:30:52 +04:00
Zifei Tong 260bdc057c Changed parallel_for to parallel_for_ in haar.cpp 2012-12-28 22:56:47 +08:00
Andrey Pavlenko c49b1bc6d5 partial fix for failing tests; fix for Windows launcher script; more quiet output 2012-12-28 17:03:35 +04:00
Zifei Tong e331787645 Fix race condition for Cascade Classifier when TBB enabled. 2012-12-28 20:51:02 +08:00
Vsevolod Glumov c0411caef4 Fixed a bunch of minor issues in 'dev_with_OCV_on_Android.rst'. 2012-12-28 16:37:05 +04:00
Andrey Kamaev b401c6a0c3 Fix discrepancies between function signatures in headers and documentation 2012-12-26 18:24:50 +04:00
Andrey Kamaev aabbe11e64 Improve function arguments parsing and checking
* always use "argN" names for unnamed arguments
* honor space symbol between typename and "*", "&" symbols
* fix indent errors
2012-12-26 17:55:03 +04:00
Andrey Kamaev 5f41971305 Merge pull request #264 from kirill-kornyakov:remove-hack-from-hough-lines-perf-test 2012-12-26 12:53:50 +04:00
Kirill Kornyakov 5023afffc7 Removed hack from perf test on HoughLines, since I hope it is fixed by pr263 2012-12-26 10:33:02 +04:00
Eric Christiansen ad326cb0be adds desktop java junit tests 2012-12-19 14:28:59 -08:00
693 arquivos alterados com 60153 adições e 28637 exclusões
+35 -27
Ver Arquivo
@@ -1,27 +1,36 @@
.git* export-ignore
* text=auto
* whitespace=!indent,trail,space
* text=auto whitespace=trailing-space,space-before-tab,-indent-with-non-tab,tab-in-indent,tabwidth=4
*.py text whitespace=tab-in-indent,trail,space,fix
*.cpp text whitespace=tab-in-indent,trail,space,fix
*.hpp text whitespace=tab-in-indent,trail,space,fix
*.cxx text whitespace=tab-in-indent,trail,space,fix
*.hxx text whitespace=tab-in-indent,trail,space,fix
*.mm text whitespace=tab-in-indent,trail,space,fix
*.c text whitespace=tab-in-indent,trail,space,fix
*.h text whitespace=tab-in-indent,trail,space,fix
*.i text whitespace=tab-in-indent,trail,space,fix
*.java text whitespace=tab-in-indent,trail,space,fix
*.cu text whitespace=tab-in-indent,trail,space,fix
*.cl text whitespace=tab-in-indent,trail,space,fix
*.py text
*.cpp text
*.hpp text
*.cxx text
*.hxx text
*.mm text
*.c text
*.h text
*.i text
*.js text
*.java text
*.scala text
*.cu text
*.cl text
*.css_t text
*.qrc text
*.qss text
*.S text
*.rst text
*.tex text
*.sty text
*.cmake text whitespace=tab-in-indent,trail,space,fix
*.cmakein text whitespace=tab-in-indent,trail,space,fix
*.in text whitespace=tab-in-indent,trail,space,fix
CMakeLists.txt text whitespace=tab-in-indent,trail,space,fix
*.aidl text
*.mk text
*.rst text whitespace=tab-in-indent,trail,space,fix
*.cmake text whitespace=tabwidth=2
*.cmakein text whitespace=tabwidth=2
*.in text whitespace=tabwidth=2
CMakeLists.txt text whitespace=tabwidth=2
*.png binary
*.jepg binary
@@ -32,22 +41,21 @@ CMakeLists.txt text whitespace=tab-in-indent,trail,space,fix
*.a binary
*.so binary
*.dll binary
*.jar binary
*.pdf binary
*.pbxproj binary
*.vec binary
*.doc binary
*.css_t text
*.qrc text
*.qss text
*.S text
*.xml -text
*.yml -text
*.xml -text whitespace=cr-at-eol
*.yml -text whitespace=cr-at-eol
.project -text whitespace=cr-at-eol merge=union
.classpath -text whitespace=cr-at-eol merge=union
.cproject -text whitespace=cr-at-eol merge=union
org.eclipse.jdt.core.prefs -text whitespace=cr-at-eol merge=union
*.vcproj text eol=crlf merge=union
*.cproject text eol=crlf merge=union
*.bat text eol=crlf
*.cmd text eol=crlf
*.cmd.tmpl text eol=crlf
Arquivo binário não exibido.
Arquivo binário não exibido.
+28 -16
Ver Arquivo
@@ -1,15 +1,18 @@
#build TBB for Android from source
if(NOT ANDROID)
message(FATAL_ERROR "The script is designed for Android only!")
endif()
#Cross compile TBB from source
project(tbb)
# 4.1 update 1 - works fine
set(tbb_ver "tbb41_20121003oss")
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20121003oss_src.tgz")
set(tbb_md5 "2a684fefb855d2d0318d1ef09afa75ff")
# 4.1 update 2 - works fine
set(tbb_ver "tbb41_20130116oss")
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
set(tbb_version_file "version_string.ver")
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
# 4.1 update 1 - works fine
#set(tbb_ver "tbb41_20121003oss")
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20121003oss_src.tgz")
#set(tbb_md5 "2a684fefb855d2d0318d1ef09afa75ff")
#set(tbb_version_file "version_string.ver")
# 4.1 - works fine
#set(tbb_ver "tbb41_20120718oss")
@@ -121,9 +124,9 @@ list(APPEND lib_srcs "${tbb_src_dir}/src/rml/client/rml_tbb.cpp")
add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
-D__TBB_BUILD=1 #required
-D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk on Android ?
-DUSE_PTHREAD #required
-DTBB_USE_GCC_BUILTINS=1 #required
-D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support
-DUSE_PTHREAD #required for Unix
-DTBB_USE_GCC_BUILTINS=1 #required for ARM GCC
-DTBB_USE_DEBUG=0 #just to be sure
-DTBB_NO_LEGACY=1 #don't need backward compatibility
-DDO_ITT_NOTIFY=0 #it seems that we don't need these notifications
@@ -140,14 +143,24 @@ if(tbb_need_GENERIC_DWORD_LOAD_STORE)
set(tbb_need_GENERIC_DWORD_LOAD_STORE ON PARENT_SCOPE)
endif()
add_library(tbb STATIC ${lib_srcs} ${lib_hdrs} "${CMAKE_CURRENT_SOURCE_DIR}/android_additional.h" "${CMAKE_CURRENT_SOURCE_DIR}/${tbb_version_file}")
set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs})
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
if (NOT ANDROID)
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp")
endif()
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/android_additional.h")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include \"${CMAKE_CURRENT_SOURCE_DIR}/android_additional.h\"")
endif()
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/${tbb_version_file}")
add_library(tbb ${TBB_SOURCE_FILES})
target_link_libraries(tbb c m dl)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations)
string(REPLACE "-Werror=non-virtual-dtor" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include \"${CMAKE_CURRENT_SOURCE_DIR}/android_additional.h\"")
set_target_properties(tbb
PROPERTIES OUTPUT_NAME tbb
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
@@ -164,4 +177,3 @@ endif()
# get TBB version
ocv_parse_header("${tbb_src_dir}/include/tbb/tbb_stddef.h" TBB_VERSION_LINES TBB_VERSION_MAJOR TBB_VERSION_MINOR TBB_INTERFACE_VERSION CACHE)
+10
Ver Arquivo
@@ -0,0 +1,10 @@
#include "tbb/tbb_misc.h"
namespace tbb {
namespace internal {
void affinity_helper::protect_affinity_mask() {}
affinity_helper::~affinity_helper() {}
}
}
+90 -61
Ver Arquivo
@@ -113,11 +113,12 @@ endif()
OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (UNIX AND 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_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 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_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_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS))
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_IMAGEIO "ImageIO support for OS X" OFF IF APPLE)
@@ -136,7 +137,7 @@ OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF WIN32 )
OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) )
OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
OCV_OPTION(WITH_VIDEOINPUT "Build HighGUI with DirectShow support" ON 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) )
@@ -148,6 +149,7 @@ OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" OFF
# OpenCV build components
# ===================================================
OCV_OPTION(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" NOT (ANDROID OR IOS) )
OCV_OPTION(BUILD_opencv_apps "Build utility applications (used for example to train classifiers)" (NOT ANDROID) IF (NOT IOS) )
OCV_OPTION(BUILD_ANDROID_EXAMPLES "Build examples for Android platform" ON IF ANDROID )
OCV_OPTION(BUILD_DOCS "Create build rules for OpenCV Documentation" ON )
OCV_OPTION(BUILD_EXAMPLES "Build all examples" OFF )
@@ -156,18 +158,18 @@ OCV_OPTION(BUILD_PERF_TESTS "Build performance tests"
OCV_OPTION(BUILD_TESTS "Build accuracy & regression tests" ON IF (NOT IOS) )
OCV_OPTION(BUILD_WITH_DEBUG_INFO "Include debug info into debug libs (not MSCV only)" ON )
OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for staticaly linked OpenCV" ON IF MSVC )
OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF ANDROID AND NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(BUILD_ANDROID_SERVICE "Build OpenCV Manager for Google Play" OFF IF ANDROID AND ANDROID_SOURCE_TREE )
OCV_OPTION(BUILD_ANDROID_PACKAGE "Build platform-specific package for Google Play" OFF IF ANDROID )
# 3rd party libs
OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE )
OCV_OPTION(BUILD_TIFF "Build libtiff from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_JASPER "Build libjasper from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_OPENEXR "Build openexr from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE )
OCV_OPTION(BUILD_TIFF "Build libtiff from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_JASPER "Build libjasper from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_OPENEXR "Build openexr from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID IF CMAKE_COMPILER_IS_GNUCXX )
# OpenCV installation options
# ===================================================
@@ -182,7 +184,7 @@ OCV_OPTION(INSTALL_TO_MANGLED_PATHS "Enables mangled install paths, that help wi
OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (NOT IOS) )
OCV_OPTION(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) IF (CMAKE_VERSION VERSION_GREATER "2.8.0") )
OCV_OPTION(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON IF CMAKE_COMPILER_IS_GNUCXX AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX) )
OCV_OPTION(ENABLE_POWERPC "Enable PowerPC for GCC" ON IF (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*) )
OCV_OPTION(ENABLE_FAST_MATH "Enable -ffast-math (not recommended for GCC 4.6.x)" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
OCV_OPTION(ENABLE_SSE "Enable SSE instructions" ON IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
@@ -299,21 +301,19 @@ find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bi
mark_as_advanced(GIT_EXECUTABLE)
if(GIT_EXECUTABLE)
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
OUTPUT_VARIABLE OPENCV_GIT_HASH_SORT
OUTPUT_VARIABLE OPENCV_VCSVERSION
RESULT_VARIABLE GIT_RESULT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(GIT_RESULT EQUAL 0)
set(OPENCV_VCSVERSION "commit:${OPENCV_GIT_HASH_SORT}")
else()
set(OPENCV_VCSVERSION "exported")
if(NOT GIT_RESULT EQUAL 0)
set(OPENCV_VCSVERSION "unknown")
endif()
else()
# We don't have git:
set(OPENCV_VCSVERSION "")
set(OPENCV_VCSVERSION "unknown")
endif()
@@ -415,10 +415,10 @@ if(WITH_OPENCL)
if(OPENCL_FOUND)
set(HAVE_OPENCL 1)
endif()
if(WITH_OPENCLAMDFFT)
if(WITH_OPENCLAMDFFT AND CLAMDFFT_INCLUDE_DIR)
set(HAVE_CLAMDFFT 1)
endif()
if(WITH_OPENCLAMDBLAS)
if(WITH_OPENCLAMDBLAS AND CLAMDBLAS_INCLUDE_DIR)
set(HAVE_CLAMDBLAS 1)
endif()
endif()
@@ -452,7 +452,9 @@ add_subdirectory(doc)
add_subdirectory(data)
# extra applications
add_subdirectory(apps)
if(BUILD_opencv_apps)
add_subdirectory(apps)
endif()
# examples
if(BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES)
@@ -519,10 +521,21 @@ if(NOT CMAKE_GENERATOR MATCHES "Xcode|Visual Studio")
endif()
# ========================== C/C++ options ==========================
if(CMAKE_CXX_COMPILER_VERSION)
set(OPENCV_COMPILER_STR "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} (ver ${CMAKE_CXX_COMPILER_VERSION})")
elseif(CMAKE_COMPILER_IS_CLANGCXX)
set(OPENCV_COMPILER_STR "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} (ver ${CMAKE_CLANG_REGEX_VERSION})")
elseif(CMAKE_COMPILER_IS_GNUCXX)
set(OPENCV_COMPILER_STR "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} (ver ${CMAKE_GCC_REGEX_VERSION})")
else()
set(OPENCV_COMPILER_STR "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}")
endif()
string(STRIP "${OPENCV_COMPILER_STR}" OPENCV_COMPILER_STR)
status("")
status(" C/C++:")
status(" Built as dynamic libs?:" BUILD_SHARED_LIBS THEN YES ELSE NO)
status(" C++ Compiler:" CMAKE_COMPILER_IS_GNUCXX THEN "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} (ver ${CMAKE_GCC_REGEX_VERSION})" ELSE "${CMAKE_CXX_COMPILER}" )
status(" C++ Compiler:" ${OPENCV_COMPILER_STR})
status(" C++ flags (Release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
status(" C++ flags (Debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
status(" C Compiler:" ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
@@ -551,7 +564,11 @@ foreach(m ${OPENCV_MODULES_DISABLED_AUTO})
list(APPEND __mdeps ${d})
endif()
endforeach()
list(APPEND OPENCV_MODULES_DISABLED_AUTO_ST "${m}(deps: ${__mdeps})")
if(__mdeps)
list(APPEND OPENCV_MODULES_DISABLED_AUTO_ST "${m}(deps: ${__mdeps})")
else()
list(APPEND OPENCV_MODULES_DISABLED_AUTO_ST "${m}")
endif()
endforeach()
string(REPLACE "opencv_" "" OPENCV_MODULES_DISABLED_AUTO_ST "${OPENCV_MODULES_DISABLED_AUTO_ST}")
@@ -567,15 +584,16 @@ if(ANDROID)
status(" Android ABI:" ${ANDROID_ABI})
status(" STL type:" ${ANDROID_STL})
status(" Native API level:" android-${ANDROID_NATIVE_API_LEVEL})
status(" SDK target:" "${ANDROID_SDK_TARGET}")
android_get_compatible_target(android_sdk_target_status ${ANDROID_NATIVE_API_LEVEL} ${ANDROID_SDK_TARGET} 11)
status(" SDK target:" "${android_sdk_target_status}")
if(BUILD_WITH_ANDROID_NDK)
status(" Android NDK:" "${ANDROID_NDK} (toolchain: ${ANDROID_TOOLCHAIN_NAME})")
elseif(BUILD_WITH_STANDALONE_TOOLCHAIN)
status(" Android toolchain:" "${ANDROID_STANDALONE_TOOLCHAIN}")
endif()
status(" android tool:" ANDROID_EXECUTABLE THEN "${ANDROID_EXECUTABLE} (${ANDROID_TOOLS_Pkg_Desc})" ELSE NO)
status(" ant:" ANT_EXECUTABLE THEN "${ANT_EXECUTABLE} (ver ${ANT_VERSION})" ELSE NO)
status(" Google Play package:" BUILD_ANDROID_PACKAGE THEN YES ELSE NO)
status(" Google Play package:" BUILD_ANDROID_PACKAGE THEN YES ELSE NO)
status(" Android examples:" BUILD_ANDROID_EXAMPLES AND CAN_BUILD_ANDROID_PROJECTS THEN YES ELSE NO)
endif()
# ========================== GUI ==========================
@@ -699,7 +717,7 @@ if(DEFINED WITH_PVAPI)
endif(DEFINED WITH_PVAPI)
if(DEFINED WITH_GIGEAPI)
status(" GigEVisionSDK:" HAVE_GIGE_API THEN YES ELSE NO)
status(" GigEVisionSDK:" HAVE_GIGE_API THEN YES ELSE NO)
endif(DEFINED WITH_GIGEAPI)
if(DEFINED WITH_QUICKTIME)
@@ -720,11 +738,13 @@ if(DEFINED WITH_V4L)
endif()
if(HAVE_CAMV4L2)
set(HAVE_CAMV4L2_STR "YES")
elseif(HAVE_VIDEOIO)
set(HAVE_CAMV4L2_STR "YES(videoio)")
else()
set(HAVE_CAMV4L2_STR "NO")
endif()
status(" V4L/V4L2:" HAVE_LIBV4L THEN "Using libv4l (ver ${ALIASOF_libv4l1_VERSION})"
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
endif(DEFINED WITH_V4L)
if(DEFINED WITH_VIDEOINPUT)
@@ -743,46 +763,51 @@ endif(DEFINED WITH_XINE)
status("")
status(" Other third-party libraries:")
if(DEFINED WITH_IPP)
if(WITH_IPP AND IPP_FOUND)
status(" Use IPP:" "${IPP_LATEST_VERSION_STR} [${IPP_LATEST_VERSION_MAJOR}.${IPP_LATEST_VERSION_MINOR}.${IPP_LATEST_VERSION_BUILD}]")
status(" at:" "${IPP_ROOT_DIR}")
else()
status(" Use IPP:" WITH_IPP AND NOT IPP_FOUND THEN "IPP not found" ELSE NO)
endif()
endif(DEFINED WITH_IPP)
if(WITH_IPP AND IPP_FOUND)
status(" Use IPP:" "${IPP_LATEST_VERSION_STR} [${IPP_LATEST_VERSION_MAJOR}.${IPP_LATEST_VERSION_MINOR}.${IPP_LATEST_VERSION_BUILD}]")
status(" at:" "${IPP_ROOT_DIR}")
else()
status(" Use IPP:" WITH_IPP AND NOT IPP_FOUND THEN "IPP not found" ELSE NO)
endif()
if(DEFINED WITH_TBB)
status(" Use TBB:" HAVE_TBB THEN "YES (ver ${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR} interface ${TBB_INTERFACE_VERSION})" ELSE NO)
endif(DEFINED WITH_TBB)
if(DEFINED WITH_CSTRIPES)
status(" Use C=:" HAVE_CSTRIPES THEN YES ELSE NO)
endif(DEFINED WITH_CSTRIPES)
if(DEFINED WITH_CUDA)
status(" Use Cuda:" HAVE_CUDA THEN "YES (ver ${CUDA_VERSION_STRING})" ELSE NO)
endif(DEFINED WITH_CUDA)
status(" Use OpenCL:" HAVE_OPENCL THEN YES ELSE NO)
status(" Use Eigen:" HAVE_EIGEN THEN "YES (ver ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})" ELSE NO)
status(" Use Eigen:" HAVE_EIGEN THEN "YES (ver ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})" ELSE NO)
status(" Use TBB:" HAVE_TBB THEN "YES (ver ${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR} interface ${TBB_INTERFACE_VERSION})" ELSE NO)
status(" Use OpenMP:" HAVE_OPENMP THEN YES ELSE NO)
status(" Use GCD" HAVE_GCD THEN YES ELSE NO)
status(" Use Concurrency" HAVE_CONCURRENCY THEN YES ELSE NO)
status(" Use C=:" HAVE_CSTRIPES THEN YES ELSE NO)
status(" Use Cuda:" HAVE_CUDA THEN "YES (ver ${CUDA_VERSION_STRING})" ELSE NO)
status(" Use OpenCL:" HAVE_OPENCL THEN YES ELSE NO)
if(HAVE_CUDA)
status("")
status(" NVIDIA CUDA")
status(" Use CUFFT:" HAVE_CUFFT THEN YES ELSE NO)
status(" Use CUBLAS:" HAVE_CUBLAS THEN YES ELSE NO)
status(" Use CUFFT:" HAVE_CUFFT THEN YES ELSE NO)
status(" Use CUBLAS:" HAVE_CUBLAS THEN YES ELSE NO)
status(" USE NVCUVID:" HAVE_NVCUVID THEN YES ELSE NO)
status(" NVIDIA GPU arch:" ${OPENCV_CUDA_ARCH_BIN})
status(" NVIDIA PTX archs:" ${OPENCV_CUDA_ARCH_PTX})
status(" Use fast math:" CUDA_FAST_MATH THEN YES ELSE NO)
endif()
if(HAVE_OPENCL AND BUILD_opencv_ocl)
status("")
status(" OpenCL")
if(OPENCL_INCLUDE_DIR)
status(" Include:" ${OPENCL_INCLUDE_DIR})
endif()
if(OPENCL_LIBRARIES)
status(" libraries:" ${OPENCL_LIBRARIES})
endif()
status(" Use AMDFFT:" HAVE_CLAMDFFT THEN YES ELSE NO)
status(" Use AMDBLAS:" HAVE_CLAMDBLAS THEN YES ELSE NO)
endif()
# ========================== python ==========================
status("")
status(" Python:")
status(" Interpreter:" PYTHON_EXECUTABLE THEN "${PYTHON_EXECUTABLE} (ver ${PYTHON_VERSION_FULL})" ELSE NO)
status(" Interpreter:" PYTHON_EXECUTABLE THEN "${PYTHON_EXECUTABLE} (ver ${PYTHON_VERSION_FULL})" ELSE NO)
if(BUILD_opencv_python)
if(PYTHONLIBS_VERSION_STRING)
status(" Libraries:" HAVE_opencv_python THEN "${PYTHON_LIBRARIES} (ver ${PYTHONLIBS_VERSION_STRING})" ELSE NO)
@@ -793,6 +818,15 @@ if(BUILD_opencv_python)
status(" packages path:" PYTHON_EXECUTABLE THEN "${PYTHON_PACKAGES_PATH}" ELSE "-")
endif()
# ========================== java ==========================
status("")
status(" Java:")
status(" ant:" ANT_EXECUTABLE THEN "${ANT_EXECUTABLE} (ver ${ANT_VERSION})" ELSE NO)
if(NOT ANDROID)
status(" JNI:" JNI_INCLUDE_DIRS THEN "${JNI_INCLUDE_DIRS}" ELSE NO)
endif()
status(" Java tests:" BUILD_TESTS AND (NOT ANDROID OR CAN_BUILD_ANDROID_PROJECTS) THEN YES ELSE NO)
# ========================== documentation ==========================
if(BUILD_DOCS)
status("")
@@ -811,12 +845,7 @@ status("")
status(" Tests and samples:")
status(" Tests:" BUILD_TESTS AND HAVE_opencv_ts THEN YES ELSE NO)
status(" Performance tests:" BUILD_PERF_TESTS AND HAVE_opencv_ts THEN YES ELSE NO)
status(" Examples:" BUILD_EXAMPLES THEN YES ELSE NO)
if(ANDROID)
status(" Android tests:" BUILD_TESTS AND CAN_BUILD_ANDROID_PROJECTS THEN YES ELSE NO)
status(" Android examples:" BUILD_ANDROID_EXAMPLES AND CAN_BUILD_ANDROID_PROJECTS THEN YES ELSE NO)
endif()
status(" C/C++ Examples:" BUILD_EXAMPLES THEN YES ELSE NO)
# ========================== auxiliary ==========================
status("")
+2 -2
Ver Arquivo
@@ -6,8 +6,8 @@ const char* GetRevision(void);
const char* GetLibraryList(void);
JNIEXPORT jstring JNICALL Java_org_opencv_android_StaticHelper_getLibraryList(JNIEnv *, jclass);
#define PACKAGE_NAME "org.opencv.lib_v" CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) "_" ANDROID_PACKAGE_PLATFORM
#define PACKAGE_REVISION CVAUX_STR(CV_SUBMINOR_VERSION) "." CVAUX_STR(ANDROID_PACKAGE_RELEASE)
#define PACKAGE_NAME "org.opencv.lib_v" CVAUX_STR(CV_VERSION_EPOCH) CVAUX_STR(CV_VERSION_MAJOR) "_" ANDROID_PACKAGE_PLATFORM
#define PACKAGE_REVISION CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION) "." CVAUX_STR(ANDROID_PACKAGE_RELEASE)
const char* GetPackageName(void)
{
+2 -2
Ver Arquivo
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.opencv.lib_v@OPENCV_VERSION_MAJOR@@OPENCV_VERSION_MINOR@_@ANDROID_PACKAGE_PLATFORM@"
android:versionCode="@OPENCV_VERSION_PATCH@@ANDROID_PACKAGE_RELEASE@"
android:versionName="@OPENCV_VERSION_PATCH@.@ANDROID_PACKAGE_RELEASE@" >
android:versionCode="@OPENCV_VERSION_PATCH@@OPENCV_VERSION_TWEAK@@ANDROID_PACKAGE_RELEASE@"
android:versionName="@OPENCV_VERSION_PATCH@.@OPENCV_VERSION_TWEAK@.@ANDROID_PACKAGE_RELEASE@" >
<uses-sdk android:minSdkVersion="@ANDROID_SDK_VERSION@" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
+2 -2
Ver Arquivo
@@ -56,7 +56,7 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${ANDROID_MANIFEST_FILE}" "${PACKAGE
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/values/strings.xml" "${PACKAGE_DIR}/res/values/strings.xml" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/drawable/icon.png" "${PACKAGE_DIR}/res/drawable/icon.png" COPYONLY)
set(target_name "OpenCV_${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}_binary_pack_${ANDROID_PACKAGE_PLATFORM}")
set(target_name "OpenCV_${OPENCV_VERSION}_binary_pack_${ANDROID_PACKAGE_PLATFORM}")
get_target_property(opencv_java_location opencv_java LOCATION)
set(android_proj_target_files ${ANDROID_PROJECT_FILES})
@@ -86,7 +86,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E touch "${APK_NAME}"
WORKING_DIRECTORY "${PACKAGE_DIR}"
MAIN_DEPENDENCY "${PACKAGE_DIR}/${ANDROID_MANIFEST_FILE}"
DEPENDS "${OpenCV_BINARY_DIR}/bin/.classes.jar.dephelper" "${PACKAGE_DIR}/res/values/strings.xml" "${PACKAGE_DIR}/res/drawable/icon.png" ${camera_wrappers} opencv_java
DEPENDS "${OpenCV_BINARY_DIR}/bin/classes.jar.dephelper" "${PACKAGE_DIR}/res/values/strings.xml" "${PACKAGE_DIR}/res/drawable/icon.png" ${camera_wrappers} opencv_java
)
install(FILES "${APK_NAME}" DESTINATION "apk/" COMPONENT main)
+199 -101
Ver Arquivo
@@ -1,130 +1,228 @@
#!/usr/bin/python
from optparse import OptionParser
from shutil import rmtree
import os
import sys
ANDROID_SDK_PATH = "/opt/android-sdk-linux"
ANDROID_NDK_PATH = None
INSTALL_DIRECTORY = None
CLASS_PATH = None
TMP_HEADER_PATH="tmp_include"
HEADER_EXTS = set(['h', 'hpp'])
SYS_INCLUDES = ["platforms/android-8/arch-arm/usr/include", "sources/cxx-stl/gnu-libstdc++/include", "sources/cxx-stl/gnu-libstdc++/libs/armeabi/include"]
PROJECT_NAME = "OpenCV-branch"
TARGET_LIBS = ["libopencv_java.so"]
ARCH = "armeabi"
GCC_OPTIONS = "-fpermissive"
EXCLUDE_HEADERS = set(["hdf5.h", "eigen.hpp", "cxeigen.hpp"]);
architecture = 'armeabi'
excludedHeaders = set(['hdf5.h', 'cap_ios.h',
'eigen.hpp', 'cxeigen.hpp' #TOREMOVE
])
systemIncludes = ['sources/cxx-stl/gnu-libstdc++/4.6/include', \
'/opt/android-ndk-r8c/platforms/android-8/arch-arm', # TODO: check if this one could be passed as command line arg
'sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include']
targetLibs = ['libopencv_java.so']
preamble = ['Eigen/Core']
# TODO: get gcc_options automatically
gcc_options = ['-fexceptions', '-frtti', '-Wno-psabi', '--sysroot=/opt/android-ndk-r8c/platforms/android-8/arch-arm', '-fpic', '-D__ARM_ARCH_5__', '-D__ARM_ARCH_5T__', '-D__ARM_ARCH_5E__', '-D__ARM_ARCH_5TE__', '-fsigned-char', '-march=armv5te', '-mtune=xscale', '-msoft-float', '-fdata-sections', '-ffunction-sections', '-Wa,--noexecstack ', '-W', '-Wall', '-Werror=return-type', '-Werror=address', '-Werror=sequence-point', '-Wformat', '-Werror=format-security', '-Wmissing-declarations', '-Wundef', '-Winit-self', '-Wpointer-arith', '-Wshadow', '-Wsign-promo', '-Wno-narrowing', '-fdiagnostics-show-option', '-fomit-frame-pointer', '-mthumb', '-fomit-frame-pointer', '-O3', '-DNDEBUG ', '-DNDEBUG']
excludedOptionsPrefix = '-W'
def FindClasses(root, prefix):
classes = []
if ("" != prefix):
prefix = prefix + "."
for path in os.listdir(root):
currentPath = os.path.join(root, path)
if (os.path.isdir(currentPath)):
classes += FindClasses(currentPath, prefix + path)
else:
name = str.split(path, ".")[0]
ext = str.split(path, ".")[1]
if (ext == "class"):
#print("class: %s" % (prefix + name))
classes.append(prefix+name)
return classes
def FindHeaders(root):
def GetHeaderFiles(root):
headers = []
for path in os.listdir(root):
currentPath = os.path.join(root, path)
if (os.path.isdir(currentPath)):
headers += FindHeaders(currentPath)
else:
ext = str.split(path, ".")[-1]
#print("%s: \"%s\"" % (currentPath, ext))
if (ext in HEADER_EXTS):
#print("Added as header file")
if (path not in EXCLUDE_HEADERS):
headers.append(currentPath)
if not os.path.isdir(os.path.join(root, path)) \
and os.path.splitext(path)[1] in ['.h', '.hpp'] \
and not path in excludedHeaders:
headers.append(os.path.join(root, path))
return sorted(headers)
def GetClasses(root, prefix):
classes = []
if ('' != prefix):
prefix = prefix + '.'
for path in os.listdir(root):
currentPath = os.path.join(root, path)
if (os.path.isdir(currentPath)):
classes += GetClasses(currentPath, prefix + path)
else:
name = str.split(path, '.')[0]
ext = str.split(path, '.')[1]
if (ext == 'class'):
classes.append(prefix + name)
return classes
def GetJavaHHeaders():
print('\nGenerating JNI headers for Java API ...')
javahHeaders = os.path.join(managerDir, 'javah_generated_headers')
if os.path.exists(javahHeaders):
rmtree(javahHeaders)
os.makedirs(os.path.join(os.getcwd(), javahHeaders))
AndroidJavaDeps = os.path.join(SDK_path, 'platforms/android-11/android.jar')
classPath = os.path.join(managerDir, 'sdk/java/bin/classes')
if not os.path.exists(classPath):
print('Error: no Java classes found in \'%s\'' % classPath)
quit()
allJavaClasses = GetClasses(classPath, '')
if not allJavaClasses:
print('Error: no Java classes found')
quit()
for currentClass in allJavaClasses:
os.system('javah -d %s -classpath %s:%s %s' % (javahHeaders, classPath, \
AndroidJavaDeps, currentClass))
print('\nBuilding JNI headers list ...')
jniHeaders = GetHeaderFiles(javahHeaders)
return jniHeaders
def GetImmediateSubdirs(dir):
return [name for name in os.listdir(dir)
if os.path.isdir(os.path.join(dir, name))]
def GetOpenCVModules():
makefile = open(os.path.join(managerDir, 'sdk/native/jni/OpenCV.mk'), 'r')
makefileStr = makefile.read()
left = makefileStr.find('OPENCV_MODULES:=') + len('OPENCV_MODULES:=')
right = makefileStr[left:].find('\n')
modules = makefileStr[left:left+right].split()
modules = filter(lambda x: x != 'ts' and x != 'androidcamera', modules)
return modules
def FindHeaders():
headers = []
print('\nBuilding Native OpenCV header list ...')
cppHeadersFolder = os.path.join(managerDir, 'sdk/native/jni/include/opencv2')
modulesFolders = GetImmediateSubdirs(cppHeadersFolder)
modules = GetOpenCVModules()
cppHeaders = []
for m in modules:
for f in modulesFolders:
moduleHeaders = []
if f == m:
moduleHeaders += GetHeaderFiles(os.path.join(cppHeadersFolder, f))
if m == 'flann':
flann = os.path.join(cppHeadersFolder, f, 'flann.hpp')
moduleHeaders.remove(flann)
moduleHeaders.insert(0, flann)
cppHeaders += moduleHeaders
cppHeaders += GetHeaderFiles(cppHeadersFolder)
headers += cppHeaders
cHeaders = GetHeaderFiles(os.path.join(managerDir, \
'sdk/native/jni/include/opencv'))
headers += cHeaders
headers += GetJavaHHeaders()
return headers
if (len(sys.argv) < 3):
print("Error: Invalid command line arguments")
exit(-1)
INSTALL_DIRECTORY = sys.argv[1]
PROJECT_NAME = sys.argv[2]
CLASS_PATH = os.path.join(INSTALL_DIRECTORY, "sdk/java/bin/classes")
if (not os.path.exists(CLASS_PATH)):
print("Error: no java classes found in \"%s\"" % CLASS_PATH)
exit(-2)
def FindLibraries():
libraries = []
for lib in targetLibs:
libraries.append(os.path.join(managerDir, 'sdk/native/libs', architecture, lib))
return libraries
if (os.environ.has_key("NDK_ROOT")):
ANDROID_NDK_PATH = os.environ["NDK_ROOT"];
print("Using Android NDK from NDK_ROOT (\"%s\")" % ANDROID_NDK_PATH)
if (not ANDROID_NDK_PATH):
pipe = os.popen("which ndk-build")
tmp = str.strip(pipe.readline(), "\n")
while(not tmp):
tmp = str.strip(pipe.readline(), "\n")
pipe.close()
ANDROID_NDK_PATH = os.path.split(tmp)[0]
print("Using Android NDK from PATH (\"%s\")" % ANDROID_NDK_PATH)
print("Using Android SDK from \"%s\"" % ANDROID_SDK_PATH)
def FindIncludes():
includes = [os.path.join(managerDir, 'sdk', 'native', 'jni', 'include'),
os.path.join(managerDir, 'sdk', 'native', 'jni', 'include', 'opencv'),
os.path.join(managerDir, 'sdk', 'native', 'jni', 'include', 'opencv2')]
outputFileName = PROJECT_NAME + ".xml"
try:
outputFile = open(outputFileName, "w")
except:
print("Error: Cannot open output file \"%s\" for writing" % outputFileName)
for inc in systemIncludes:
includes.append(os.path.join(NDK_path, inc))
allJavaClasses = FindClasses(CLASS_PATH, "")
if (not allJavaClasses):
print("Error: No Java classes found :(")
exit(-1)
return includes
if (not os.path.exists(TMP_HEADER_PATH)):
os.makedirs(os.path.join(os.getcwd(), TMP_HEADER_PATH))
print("Generating JNI headers for Java API ...")
AndroidJavaDeps = os.path.join(ANDROID_SDK_PATH, "platforms/android-11/android.jar")
for currentClass in allJavaClasses:
os.system("javah -d %s -classpath %s:%s %s" % (TMP_HEADER_PATH, CLASS_PATH, AndroidJavaDeps, currentClass))
print("Building JNI headers list ...")
jniHeaders = FindHeaders(TMP_HEADER_PATH)
#print(jniHeaders)
def FilterGCCOptions():
gcc = filter(lambda x: not x.startswith(excludedOptionsPrefix), gcc_options)
return sorted(gcc)
print("Building Native OpenCV header list ...")
cHeaders = FindHeaders(os.path.join(INSTALL_DIRECTORY, "sdk/native/jni/include/opencv"))
cppHeaders = FindHeaders(os.path.join(INSTALL_DIRECTORY, "sdk/native/jni/include/opencv2"))
#print(cHeaders)
#print(cppHeaders)
print("Writing config file ...")
outputFile.write("<descriptor>\n\n<version>\n\t%s\n</version>\n\n<headers>\n" % PROJECT_NAME)
outputFile.write("\t" + "\n\t".join(cHeaders))
outputFile.write("\n\t" + "\n\t".join(cppHeaders))
outputFile.write("\n\t" + "\n\t".join(jniHeaders))
outputFile.write("\n</headers>\n\n")
includes = [os.path.join(INSTALL_DIRECTORY, "sdk", "native", "jni", "include"),
os.path.join(INSTALL_DIRECTORY, "sdk", "native", "jni", "include", "opencv"),
os.path.join(INSTALL_DIRECTORY, "sdk", "native", "jni", "include", "opencv2")]
def WriteXml(version, headers, includes, libraries):
xmlName = version + '.xml'
for inc in SYS_INCLUDES:
includes.append(os.path.join(ANDROID_NDK_PATH, inc))
print '\noutput file: ' + xmlName
try:
xml = open(xmlName, 'w')
except:
print 'Error: Cannot open output file "%s" for writing' % xmlName
quit()
outputFile.write("<include_paths>\n\t%s\n</include_paths>\n\n" % "\n\t".join(includes))
xml.write('<descriptor>')
libraries = []
for lib in TARGET_LIBS:
libraries.append(os.path.join(INSTALL_DIRECTORY, "sdk/native/libs", ARCH, lib))
xml.write('\n\n<version>')
xml.write('\n\t%s' % version)
xml.write('\n</version>')
outputFile.write("<libs>\n\t%s\n</libs>\n\n" % "\n\t".join(libraries))
outputFile.write("<gcc_options>\n\t%s\n</gcc_options>\n\n</descriptor>" % GCC_OPTIONS)
xml.write('\n\n<headers>')
xml.write('\n\t%s' % '\n\t'.join(headers))
xml.write('\n</headers>')
print("done!")
xml.write('\n\n<include_paths>')
xml.write('\n\t%s' % '\n\t'.join(includes))
xml.write('\n</include_paths>')
# TODO: uncomment when Eigen problem is solved
# xml.write('\n\n<include_preamble>')
# xml.write('\n\t%s' % '\n\t'.join(preamble))
# xml.write('\n</include_preamble>')
xml.write('\n\n<libs>')
xml.write('\n\t%s' % '\n\t'.join(libraries))
xml.write('\n</libs>')
xml.write('\n\n<gcc_options>')
xml.write('\n\t%s' % '\n\t'.join(gcc_options))
xml.write('\n</gcc_options>')
xml.write('\n\n</descriptor>')
if __name__ == '__main__':
usage = '%prog <OpenCV_Manager install directory> <OpenCV_Manager version>'
parser = OptionParser(usage = usage)
args = parser.parse_args()
if 2 != len(args):
parser.print_help()
quit()
managerDir = args[1][0]
version = args[1][1]
NDK_path = '/opt/android-ndk-r8c'
print '\nUsing Android NDK from "%s"' % NDK_path
SDK_path = '~/NVPACK/android-sdk-linux'
print '\nUsing Android SDK from "%s"' % SDK_path
headers = FindHeaders()
includes = FindIncludes()
libraries = FindLibraries()
gcc_options = FilterGCCOptions()
WriteXml(version, headers, includes, libraries)
-1
Ver Arquivo
@@ -5,4 +5,3 @@ mkdir -p build_service
cd build_service
cmake -DCMAKE_TOOLCHAIN_FILE=../android.toolchain.cmake -DANDROID_TOOLCHAIN_NAME="arm-linux-androideabi-4.4.3" -DANDROID_STL=stlport_static -DANDROID_STL_FORCE_FEATURES=OFF -DBUILD_ANDROID_SERVICE=ON -DANDROID_SOURCE_TREE=~/Projects/AndroidSource/ServiceStub/ $@ ../..
+1 -1
Ver Arquivo
@@ -48,7 +48,7 @@ See the "15-puzzle" OpenCV sample for details.
super.onResume();
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mOpenCVCallBack))
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_4, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
}
+4
Ver Arquivo
@@ -47,3 +47,7 @@ OpenCV version constants
.. data:: OPENCV_VERSION_2_4_3
OpenCV Library version 2.4.3
.. data:: OPENCV_VERSION_2_4_4
OpenCV Library version 2.4.4
+2 -2
Ver Arquivo
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.opencv.engine"
android:versionCode="24@ANDROID_PLATFORM_VERSION_CODE@"
android:versionName="2.4" >
android:versionCode="26@ANDROID_PLATFORM_VERSION_CODE@"
android:versionName="2.6" >
<uses-sdk android:minSdkVersion="@ANDROID_NATIVE_API_LEVEL@" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
+11
Ver Arquivo
@@ -62,3 +62,14 @@ set_target_properties(${engine}_jni PROPERTIES
get_target_property(engine_lib_location ${engine}_jni LOCATION)
add_custom_command(TARGET ${engine}_jni POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "${engine_lib_location}")
# native tests
add_definitions(-DGTEST_HAS_CLONE=0 -DANDROID -DGTEST_HAS_TR1_TUPLE=0)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-allow-shlib-undefined")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/jni/Tests)
file(GLOB engine_test_files "jni/Tests/*.cpp")
add_executable(opencv_test_engine ${engine_test_files} jni/Tests/gtest/gtest-all.cpp)
target_link_libraries(opencv_test_engine z binder log utils android_runtime ${engine} ${engine}_jni)
@@ -15,60 +15,44 @@ using namespace android;
const int OpenCVEngine::Platform = DetectKnownPlatforms();
const int OpenCVEngine::CpuID = GetCpuID();
const int OpenCVEngine::KnownVersions[] = {2040000, 2040100, 2040200, 2040300, 2040301, 2040302, 2040400};
std::set<std::string> OpenCVEngine::InitKnownOpenCVersions()
bool OpenCVEngine::ValidateVersion(int version)
{
std::set<std::string> result;
for (size_t i = 0; i < sizeof(KnownVersions)/sizeof(int); i++)
if (KnownVersions[i] == version)
return true;
result.insert("240");
result.insert("241");
result.insert("242");
result.insert("243");
return result;
return false;
}
const std::set<std::string> OpenCVEngine::KnownVersions = InitKnownOpenCVersions();
bool OpenCVEngine::ValidateVersionString(const std::string& version)
int OpenCVEngine::NormalizeVersionString(std::string version)
{
return (KnownVersions.find(version) != KnownVersions.end());
}
std::string OpenCVEngine::NormalizeVersionString(std::string version)
{
std::string result = "";
std::string suffix = "";
int result = 0;
if (version.empty())
{
return result;
}
if (('a' == version[version.size()-1]) || ('b' == version[version.size()-1]))
{
suffix = version[version.size()-1];
version.erase(version.size()-1);
}
std::vector<std::string> parts = SplitStringVector(version, '.');
if (parts.size() >= 2)
// Use only 4 digits of the version, i.e. 1.2.3.4.
// Other digits will be ignored.
if (parts.size() > 4)
parts.erase(parts.begin()+4, parts.end());
int multiplyer = 1000000;
for (std::vector<std::string>::const_iterator it = parts.begin(); it != parts.end(); ++it)
{
if (parts.size() >= 3)
{
result = parts[0] + parts[1] + parts[2] + suffix;
if (!ValidateVersionString(result))
result = "";
}
else
{
result = parts[0] + parts[1] + "0" + suffix;
if (!ValidateVersionString(result))
result = "";
}
int digit = atoi(it->c_str());
result += multiplyer*digit;
multiplyer /= 100;
}
if (!ValidateVersion(result))
result = 0;
return result;
}
@@ -86,19 +70,19 @@ int32_t OpenCVEngine::GetVersion()
String16 OpenCVEngine::GetLibPathByVersion(android::String16 version)
{
std::string std_version(String8(version).string());
std::string norm_version;
int norm_version;
std::string path;
LOGD("OpenCVEngine::GetLibPathByVersion(%s) impl", String8(version).string());
norm_version = NormalizeVersionString(std_version);
if (!norm_version.empty())
if (0 != norm_version)
{
path = PackageManager->GetPackagePathByVersion(norm_version, Platform, CpuID);
if (path.empty())
{
LOGI("Package OpenCV of version %s is not installed. Try to install it :)", norm_version.c_str());
LOGI("Package OpenCV of version \"%s\" (%d) is not installed. Try to install it :)", String8(version).string(), norm_version);
}
else
{
@@ -107,7 +91,7 @@ String16 OpenCVEngine::GetLibPathByVersion(android::String16 version)
}
else
{
LOGE("OpenCV version \"%s\" (%s) is not supported", String8(version).string(), norm_version.c_str());
LOGE("OpenCV version \"%s\" (%d) is not supported", String8(version).string(), norm_version);
}
return String16(path.c_str());
@@ -116,11 +100,11 @@ String16 OpenCVEngine::GetLibPathByVersion(android::String16 version)
android::String16 OpenCVEngine::GetLibraryList(android::String16 version)
{
std::string std_version = String8(version).string();
std::string norm_version;
int norm_version;
String16 result;
norm_version = NormalizeVersionString(std_version);
if (!norm_version.empty())
if (0 != norm_version)
{
std::string tmp = PackageManager->GetPackagePathByVersion(norm_version, Platform, CpuID);
if (!tmp.empty())
@@ -156,12 +140,12 @@ android::String16 OpenCVEngine::GetLibraryList(android::String16 version)
}
else
{
LOGI("Package OpenCV of version %s is not installed. Try to install it :)", norm_version.c_str());
LOGI("Package OpenCV of version \"%s\" (%d) is not installed. Try to install it :)", std_version.c_str(), norm_version);
}
}
else
{
LOGE("OpenCV version \"%s\" is not supported", norm_version.c_str());
LOGE("OpenCV version \"%s\" is not supported", std_version.c_str());
}
return result;
@@ -170,21 +154,21 @@ android::String16 OpenCVEngine::GetLibraryList(android::String16 version)
bool OpenCVEngine::InstallVersion(android::String16 version)
{
std::string std_version = String8(version).string();
std::string norm_version;
int norm_version;
bool result = false;
LOGD("OpenCVEngine::InstallVersion() begin");
norm_version = NormalizeVersionString(std_version);
if (!norm_version.empty())
if (0 != norm_version)
{
LOGD("PackageManager->InstallVersion call");
result = PackageManager->InstallVersion(norm_version, Platform, CpuID);
}
else
{
LOGE("OpenCV version \"%s\" is not supported", norm_version.c_str());
LOGE("OpenCV version \"%s\" (%d) is not supported", std_version.c_str(), norm_version);
}
LOGD("OpenCVEngine::InstallVersion() end");
@@ -23,16 +23,15 @@ public:
protected:
IPackageManager* PackageManager;
static const std::set<std::string> KnownVersions;
static const int KnownVersions[];
OpenCVEngine();
static std::set<std::string> InitKnownOpenCVersions();
bool ValidateVersionString(const std::string& version);
std::string NormalizeVersionString(std::string version);
bool ValidateVersion(int version);
int NormalizeVersionString(std::string version);
bool FixPermissions(const std::string& path);
static const int Platform;
static const int CpuID;
};
#endif
#endif
@@ -40,13 +40,16 @@ bool JavaBasedPackageManager::InstallPackage(const PackageInfo& package)
if (!jmethod)
{
LOGE("MarketConnector::GetAppFormMarket method was not found!");
jenv->DeleteLocalRef(jclazz);
return false;
}
LOGD("Calling java package manager with package name %s\n", package.GetFullName().c_str());
jobject jpkgname = jenv->NewStringUTF(package.GetFullName().c_str());
bool result = jenv->CallNonvirtualBooleanMethod(JavaPackageManager, jclazz, jmethod, jpkgname);
jenv->DeleteLocalRef(jpkgname);
jenv->DeleteLocalRef(jclazz);
if (self_attached)
{
@@ -72,7 +75,6 @@ vector<PackageInfo> JavaBasedPackageManager::GetInstalledPackages()
JavaContext->AttachCurrentThread(&jenv, NULL);
}
LOGD("GetObjectClass call");
jclass jclazz = jenv->GetObjectClass(JavaPackageManager);
if (!jclazz)
{
@@ -80,15 +82,14 @@ vector<PackageInfo> JavaBasedPackageManager::GetInstalledPackages()
return result;
}
LOGD("GetMethodID call");
jmethodID jmethod = jenv->GetMethodID(jclazz, "GetInstalledOpenCVPackages", "()[Landroid/content/pm/PackageInfo;");
if (!jmethod)
{
LOGE("MarketConnector::GetInstalledOpenCVPackages method was not found!");
jenv->DeleteLocalRef(jclazz);
return result;
}
LOGD("Java package manager call");
jobjectArray jpkgs = static_cast<jobjectArray>(jenv->CallNonvirtualObjectMethod(JavaPackageManager, jclazz, jmethod));
jsize size = jenv->GetArrayLength(jpkgs);
@@ -100,13 +101,15 @@ vector<PackageInfo> JavaBasedPackageManager::GetInstalledPackages()
{
jobject jtmp = jenv->GetObjectArrayElement(jpkgs, i);
PackageInfo tmp = ConvertPackageFromJava(jtmp, jenv);
jenv->DeleteLocalRef(jtmp);
if (tmp.IsValid())
result.push_back(tmp);
jenv->DeleteLocalRef(jtmp);
}
jenv->DeleteLocalRef(jpkgs);
jenv->DeleteLocalRef(jclazz);
if (self_attached)
{
@@ -118,10 +121,21 @@ vector<PackageInfo> JavaBasedPackageManager::GetInstalledPackages()
return result;
}
static jint GetAndroidVersion(JNIEnv* jenv)
{
jclass jclazz = jenv->FindClass("android/os/Build$VERSION");
jfieldID jfield = jenv->GetStaticFieldID(jclazz, "SDK_INT", "I");
jint api_level = jenv->GetStaticIntField(jclazz, jfield);
jenv->DeleteLocalRef(jclazz);
return api_level;
}
// IMPORTANT: This method can be called only if thread is attached to Dalvik
PackageInfo JavaBasedPackageManager::ConvertPackageFromJava(jobject package, JNIEnv* jenv)
{
jclass jclazz = jenv->GetObjectClass(package);
jfieldID jfield = jenv->GetFieldID(jclazz, "packageName", "Ljava/lang/String;");
jstring jnameobj = static_cast<jstring>(jenv->GetObjectField(package, jfield));
const char* jnamestr = jenv->GetStringUTFChars(jnameobj, NULL);
@@ -134,22 +148,27 @@ PackageInfo JavaBasedPackageManager::ConvertPackageFromJava(jobject package, JNI
string verison(jversionstr);
jenv->DeleteLocalRef(jversionobj);
jenv->DeleteLocalRef(jclazz);
static const jint api_level = GetAndroidVersion(jenv);
string path;
jclazz = jenv->FindClass("android/os/Build$VERSION");
jfield = jenv->GetStaticFieldID(jclazz, "SDK_INT", "I");
jint api_level = jenv->GetStaticIntField(jclazz, jfield);
if (api_level > 8)
{
jclazz = jenv->GetObjectClass(package);
jfield = jenv->GetFieldID(jclazz, "applicationInfo", "Landroid/content/pm/ApplicationInfo;");
jobject japp_info = jenv->GetObjectField(package, jfield);
jenv->DeleteLocalRef(jclazz);
jclazz = jenv->GetObjectClass(japp_info);
jfield = jenv->GetFieldID(jclazz, "nativeLibraryDir", "Ljava/lang/String;");
jstring jpathobj = static_cast<jstring>(jenv->GetObjectField(japp_info, jfield));
const char* jpathstr = jenv->GetStringUTFChars(jpathobj, NULL);
path = string(jpathstr);
jenv->ReleaseStringUTFChars(jpathobj, jpathstr);
jenv->DeleteLocalRef(japp_info);
jenv->DeleteLocalRef(jpathobj);
jenv->DeleteLocalRef(jclazz);
}
else
{
@@ -19,4 +19,4 @@ private:
JavaBasedPackageManager();
PackageInfo ConvertPackageFromJava(jobject package, JNIEnv* jenv);
};
};
@@ -11,22 +11,24 @@
using namespace std;
set<string> CommonPackageManager::GetInstalledVersions()
vector<int> CommonPackageManager::GetInstalledVersions()
{
set<string> result;
vector<int> result;
vector<PackageInfo> installed_packages = GetInstalledPackages();
for (vector<PackageInfo>::const_iterator it = installed_packages.begin(); it != installed_packages.end(); ++it)
result.resize(installed_packages.size());
for (size_t i = 0; i < installed_packages.size(); i++)
{
string version = it->GetVersion();
assert(!version.empty());
result.insert(version);
int version = installed_packages[i].GetVersion();
assert(version);
result[i] = version;
}
return result;
}
bool CommonPackageManager::CheckVersionInstalled(const std::string& version, int platform, int cpu_id)
bool CommonPackageManager::CheckVersionInstalled(int version, int platform, int cpu_id)
{
bool result = false;
LOGD("CommonPackageManager::CheckVersionInstalled() begin");
@@ -48,14 +50,14 @@ bool CommonPackageManager::CheckVersionInstalled(const std::string& version, int
return result;
}
bool CommonPackageManager::InstallVersion(const std::string& version, int platform, int cpu_id)
bool CommonPackageManager::InstallVersion(int version, int platform, int cpu_id)
{
LOGD("CommonPackageManager::InstallVersion() begin");
PackageInfo package(version, platform, cpu_id);
return InstallPackage(package);
}
string CommonPackageManager::GetPackagePathByVersion(const std::string& version, int platform, int cpu_id)
string CommonPackageManager::GetPackagePathByVersion(int version, int platform, int cpu_id)
{
string result;
PackageInfo target_package(version, platform, cpu_id);
@@ -64,7 +66,7 @@ string CommonPackageManager::GetPackagePathByVersion(const std::string& version,
for (vector<PackageInfo>::iterator it = all_packages.begin(); it != all_packages.end(); ++it)
{
LOGD("Check version \"%s\" compatibility with \"%s\"\n", version.c_str(), it->GetVersion().c_str());
LOGD("Check version \"%d\" compatibility with \"%d\"\n", version, it->GetVersion());
if (IsVersionCompatible(version, it->GetVersion()))
{
LOGD("Compatible");
@@ -78,17 +80,21 @@ string CommonPackageManager::GetPackagePathByVersion(const std::string& version,
if (!packages.empty())
{
int OptRating = -1;
std::string OptVersion = "";
std::vector<std::pair<int, int> >& group = CommonPackageManager::ArmRating;
int platform_group = 0;
if ((cpu_id & ARCH_X86) || (cpu_id & ARCH_X64))
group = CommonPackageManager::IntelRating;
platform_group = 1;
int HardwareRating = GetHardwareRating(platform, cpu_id, group);
LOGD("Current hardware platform rating %d for (%d,%d)", HardwareRating, platform, cpu_id);
if (cpu_id & ARCH_MIPS)
platform_group = 2;
if (-1 == HardwareRating)
int opt_rating = -1;
int opt_version = 0;
const int hardware_rating = GetHardwareRating(platform, cpu_id, ArchRatings[platform_group]);
LOGD("Current hardware platform rating %d for (%d,%d)", hardware_rating, platform, cpu_id);
if (-1 == hardware_rating)
{
LOGE("Cannot calculate rating for current hardware platform!");
}
@@ -97,26 +103,38 @@ string CommonPackageManager::GetPackagePathByVersion(const std::string& version,
vector<PackageInfo>::iterator found = packages.end();
for (vector<PackageInfo>::iterator it = packages.begin(); it != packages.end(); ++it)
{
int PackageRating = GetHardwareRating(it->GetPlatform(), it->GetCpuID(), group);
LOGD("Package \"%s\" rating %d for (%d,%d)", it->GetFullName().c_str(), PackageRating, it->GetPlatform(), it->GetCpuID());
if ((PackageRating >= 0) && (PackageRating <= HardwareRating))
int package_group = 0;
if ((it->GetCpuID() & ARCH_X86) || (it->GetCpuID() & ARCH_X64))
package_group = 1;
if (it->GetCpuID() & ARCH_MIPS)
package_group = 2;
if (package_group != platform_group)
continue;
const int package_rating = GetHardwareRating(it->GetPlatform(), it->GetCpuID(), ArchRatings[package_group]);
LOGD("Package \"%s\" rating %d for (%d,%d)", it->GetFullName().c_str(), package_rating, it->GetPlatform(), it->GetCpuID());
if ((package_rating >= 0) && (package_rating <= hardware_rating))
{
if (((it->GetVersion() >= OptVersion) && (PackageRating >= OptRating)) || (it->GetVersion() > OptVersion))
if (((it->GetVersion() >= opt_version) && (package_rating >= opt_rating)) || (it->GetVersion() > opt_version))
{
OptRating = PackageRating;
OptVersion = it->GetVersion();
opt_rating = package_rating;
opt_version = it->GetVersion();
found = it;
}
}
}
if ((-1 != OptRating) && (packages.end() != found))
if ((-1 != opt_rating) && (packages.end() != found))
{
result = found->GetInstalationPath();
}
else
{
LOGI("Found package is incompatible with current hardware platform");
LOGI("No compatible packages found!");
}
}
}
@@ -124,20 +142,13 @@ string CommonPackageManager::GetPackagePathByVersion(const std::string& version,
return result;
}
bool CommonPackageManager::IsVersionCompatible(const std::string& target_version, const std::string& package_version)
bool CommonPackageManager::IsVersionCompatible(int target_version, int package_version)
{
assert (target_version.size() == 3);
assert (package_version.size() == 3);
bool result = false;
assert(target_version);
assert(package_version);
// major version is the same and minor package version is above or the same as target.
if ((package_version[0] == target_version[0]) && (package_version[1] == target_version[1]) && (package_version[2] >= target_version[2]))
{
result = true;
}
return result;
return ( (package_version/10000 == target_version/10000) && (package_version%10000 >= target_version%10000) );
}
int CommonPackageManager::GetHardwareRating(int platform, int cpu_id, const std::vector<std::pair<int, int> >& group)
@@ -151,10 +162,13 @@ int CommonPackageManager::GetHardwareRating(int platform, int cpu_id, const std:
else
{
// Calculate rating for Arm
LOGD("!!! Calculating rating for ARM\n");
for (size_t i = 0; i < group.size(); i++)
{
LOGD("Checking (%d, %d) against (%d,%d)\n", group[i].first, group[i].second, platform, cpu_id);
if (group[i] == std::pair<int, int>(platform, cpu_id))
{
LOGD("Rating found: %d\n", i);
result = i;
break;
}
@@ -187,21 +201,27 @@ std::vector<std::pair<int, int> > CommonPackageManager::InitArmRating()
return result;
}
// Stub for Intel platforms rating initialization. Common package for all Intel based devices is used now
std::vector<std::pair<int, int> > CommonPackageManager::InitIntelRating()
{
std::vector<std::pair<int, int> > result;
result.push_back(std::pair<int, int>(PLATFORM_UNKNOWN, ARCH_X64));
result.push_back(std::pair<int, int>(PLATFORM_UNKNOWN, ARCH_X86 | FEATURES_HAS_SSSE3));
result.push_back(std::pair<int, int>(PLATFORM_UNKNOWN, ARCH_X86 | FEATURES_HAS_SSE2));
result.push_back(std::pair<int, int>(PLATFORM_UNKNOWN, ARCH_X86 | FEATURES_HAS_SSE));
result.push_back(std::pair<int, int>(PLATFORM_UNKNOWN, ARCH_X86));
return result;
}
// Stub for MIPS platforms rating initialization. Common package for all MIPS based devices is used now
std::vector<std::pair<int, int> > CommonPackageManager::InitMipsRating()
{
std::vector<std::pair<int, int> > result;
return result;
}
std::vector<std::pair<int, int> > CommonPackageManager::IntelRating = CommonPackageManager::InitIntelRating();
std::vector<std::pair<int, int> > CommonPackageManager::ArmRating = InitArmRating();
const std::vector<std::pair<int, int> > CommonPackageManager::ArchRatings[] = {
CommonPackageManager::InitArmRating(),
CommonPackageManager::InitIntelRating(),
CommonPackageManager::InitMipsRating()
};
CommonPackageManager::~CommonPackageManager()
{
@@ -3,27 +3,26 @@
#include "IPackageManager.h"
#include "PackageInfo.h"
#include <set>
#include <vector>
#include <string>
class CommonPackageManager: public IPackageManager
{
public:
std::set<std::string> GetInstalledVersions();
bool CheckVersionInstalled(const std::string& version, int platform, int cpu_id);
bool InstallVersion(const std::string& version, int platform, int cpu_id);
std::string GetPackagePathByVersion(const std::string& version, int platform, int cpu_id);
std::vector<int> GetInstalledVersions();
bool CheckVersionInstalled(int version, int platform, int cpu_id);
bool InstallVersion(int version, int platform, int cpu_id);
std::string GetPackagePathByVersion(int version, int platform, int cpu_id);
virtual ~CommonPackageManager();
protected:
static std::vector<std::pair<int, int> > ArmRating;
static std::vector<std::pair<int, int> > IntelRating;
static const std::vector<std::pair<int, int> > ArchRatings[];
static std::vector<std::pair<int, int> > InitArmRating();
static std::vector<std::pair<int, int> > InitIntelRating();
static std::vector<std::pair<int, int> > InitMipsRating();
bool IsVersionCompatible(const std::string& target_version, const std::string& package_version);
bool IsVersionCompatible(int target_version, int package_version);
int GetHardwareRating(int platform, int cpu_id, const std::vector<std::pair<int, int> >& group);
virtual bool InstallPackage(const PackageInfo& package) = 0;
@@ -31,4 +30,4 @@ protected:
};
#endif
#endif
@@ -124,14 +124,29 @@ inline int SplitIntelFeatures(const vector<string>& features)
return result;
}
inline string SplitVersion(const vector<string>& features, const string& package_version)
inline int SplitVersion(const vector<string>& features, const string& package_version)
{
string result;
int result = 0;
if ((features.size() > 1) && ('v' == features[1][0]))
{
result = features[1].substr(1);
result += SplitStringVector(package_version, '.')[0];
// Taking major and minor mart of library version from package name
string tmp1 = features[1].substr(1);
result += atoi(tmp1.substr(0,1).c_str())*1000000 + atoi(tmp1.substr(1,1).c_str())*10000;
// Taking release and build number from package revision
vector<string> tmp2 = SplitStringVector(package_version, '.');
if (tmp2.size() == 2)
{
// the 2nd digit is revision
result += atoi(tmp2[0].c_str())*100 + 00;
}
else
{
// the 2nd digit is part of library version
// the 3rd digit is revision
result += atoi(tmp2[0].c_str())*100 + atoi(tmp2[1].c_str());
}
}
else
{
@@ -186,19 +201,26 @@ inline int SplitPlatfrom(const vector<string>& features)
* Second part is version. Version starts from "v" symbol. After "v" symbol version nomber without dot symbol added.
* If platform is known third part is platform name
* If platform is unknown it is defined by hardware capabilities using pattern: <arch>_<floating point and vectorization features>_<other features>
* Example: armv7_neon, armv5_vfpv3
* Example: armv7_neon
*/
PackageInfo::PackageInfo(const string& version, int platform, int cpu_id, std::string install_path):
Version(version),
Platform(platform),
CpuID(cpu_id),
InstallPath("")
PackageInfo::PackageInfo(int version, int platform, int cpu_id, std::string install_path):
Version(version),
Platform(platform),
CpuID(cpu_id),
InstallPath("")
{
#ifndef __SUPPORT_TEGRA3
Platform = PLATFORM_UNKNOWN;
#endif
FullName = BasePackageName + "_v" + Version.substr(0, Version.size()-1);
int major_version = version/1000000;
int minor_version = version/10000 - major_version*100;
char tmp[32];
sprintf(tmp, "%d%d", major_version, minor_version);
FullName = BasePackageName + std::string("_v") + std::string(tmp);
if (PLATFORM_UNKNOWN != Platform)
{
FullName += string("_") + JoinPlatform(platform);
@@ -296,7 +318,7 @@ InstallPath("")
else
{
LOGD("PackageInfo::PackageInfo: package arch unknown");
Version.clear();
Version = 0;
CpuID = ARCH_UNKNOWN;
Platform = PLATFORM_UNKNOWN;
}
@@ -304,7 +326,7 @@ InstallPath("")
else
{
LOGD("PackageInfo::PackageInfo: package arch unknown");
Version.clear();
Version = 0;
CpuID = ARCH_UNKNOWN;
Platform = PLATFORM_UNKNOWN;
}
@@ -371,7 +393,7 @@ InstallPath(install_path)
{
LOGI("Info library not found in package");
LOGI("OpenCV Manager package does not contain any verison of OpenCV library");
Version.clear();
Version = 0;
CpuID = ARCH_UNKNOWN;
Platform = PLATFORM_UNKNOWN;
return;
@@ -383,7 +405,7 @@ InstallPath(install_path)
if (!features.empty() && (BasePackageName == features[0]))
{
Version = SplitVersion(features, package_version);
if (Version.empty())
if (0 == Version)
{
CpuID = ARCH_UNKNOWN;
Platform = PLATFORM_UNKNOWN;
@@ -410,7 +432,7 @@ InstallPath(install_path)
if (features.size() < 3)
{
LOGD("It is not OpenCV library package for this platform");
Version.clear();
Version = 0;
CpuID = ARCH_UNKNOWN;
Platform = PLATFORM_UNKNOWN;
return;
@@ -444,7 +466,7 @@ InstallPath(install_path)
else
{
LOGD("It is not OpenCV library package for this platform");
Version.clear();
Version = 0;
CpuID = ARCH_UNKNOWN;
Platform = PLATFORM_UNKNOWN;
return;
@@ -454,7 +476,7 @@ InstallPath(install_path)
else
{
LOGD("It is not OpenCV library package for this platform");
Version.clear();
Version = 0;
CpuID = ARCH_UNKNOWN;
Platform = PLATFORM_UNKNOWN;
return;
@@ -463,7 +485,7 @@ InstallPath(install_path)
bool PackageInfo::IsValid() const
{
return !(Version.empty() && (PLATFORM_UNKNOWN == Platform) && (ARCH_UNKNOWN == CpuID));
return !((0 == Version) && (PLATFORM_UNKNOWN == Platform) && (ARCH_UNKNOWN == CpuID));
}
int PackageInfo::GetPlatform() const
@@ -481,7 +503,7 @@ string PackageInfo::GetFullName() const
return FullName;
}
string PackageInfo::GetVersion() const
int PackageInfo::GetVersion() const
{
return Version;
}
@@ -494,4 +516,4 @@ string PackageInfo::GetInstalationPath() const
bool PackageInfo::operator==(const PackageInfo& package) const
{
return (package.FullName == FullName);
}
}
@@ -30,10 +30,10 @@
class PackageInfo
{
public:
PackageInfo(const std::string& version, int platform, int cpu_id, std::string install_path = "/data/data/");
PackageInfo(int version, int platform, int cpu_id, std::string install_path = "/data/data/");
PackageInfo(const std::string& fullname, const std::string& install_path, std::string package_version = "0.0");
std::string GetFullName() const;
std::string GetVersion() const;
int GetVersion() const;
int GetPlatform() const;
int GetCpuID() const;
std::string GetInstalationPath() const;
@@ -43,7 +43,7 @@ public:
protected:
static std::map<int, std::string> InitPlatformNameMap();
std::string Version;
int Version;
int Platform;
int CpuID;
std::string FullName;
@@ -51,4 +51,4 @@ protected:
static const std::string BasePackageName;
};
#endif
#endif
@@ -111,7 +111,6 @@ TEST(Split, SplitMultiElementString)
TEST(CpuCount, CheckNonZero)
{
EXPECT_TRUE(GetProcessorCount() != 0);
EXPECT_TRUE(a.find("") == a.end());
}
TEST(GetCpuInfo, GetCpuInfo)
@@ -127,7 +126,7 @@ TEST(CpuID, CheckNotEmpy)
EXPECT_NE(0, cpu_id);
}
#ifdef __i386__
#if defined(__i386__)
TEST(CpuID, CheckX86)
{
int cpu_id = GetCpuID();
@@ -139,14 +138,14 @@ TEST(CpuID, CheckSSE2)
int cpu_id = GetCpuID();
EXPECT_TRUE(cpu_id & FEATURES_HAS_SSE2);
}
#elseif __mips
#ifdef __SUPPORT_MIPS
TEST(CpuID, CheckMips)
{
#elif defined(__mips)
#ifdef __SUPPORT_MIPS
TEST(CpuID, CheckMips)
{
int cpu_id = GetCpuID();
EXPECT_TRUE(cpu_id & ARCH_MIPS);
}
#endif
}
#endif
#else
TEST(TegraDetector, Detect)
{
@@ -175,4 +174,4 @@ TEST(PlatfromDetector, CheckTegra)
{
EXPECT_NE(PLATFORM_UNKNOWN, DetectKnownPlatforms());
}
#endif
#endif
@@ -69,7 +69,7 @@ TEST(OpenCVEngineTest, GetPathForExecHWExistVersion)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("240", PLATFORM_UNKNOWN, ARCH_X86);
Starter.PackageManager->InstallVersion(2040000, PLATFORM_UNKNOWN, ARCH_X86);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
EXPECT_STREQ("/data/data/org.opencv.lib_v24_x86/lib", String8(result).string());
@@ -79,7 +79,7 @@ TEST(OpenCVEngineTest, GetPathForExecHWOldVersion)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("242", PLATFORM_UNKNOWN, ARCH_X86);
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_X86);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.1"));
EXPECT_STREQ("/data/data/org.opencv.lib_v24_x86/lib", String8(result).string());
@@ -89,7 +89,7 @@ TEST(OpenCVEngineTest, GetPathForExecHWNewVersion)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("241", PLATFORM_UNKNOWN, ARCH_X86);
Starter.PackageManager->InstallVersion(2040100, PLATFORM_UNKNOWN, ARCH_X86);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.2"));
EXPECT_EQ(0, result.size());
@@ -100,7 +100,7 @@ TEST(OpenCVEngineTest, GetPathForExecHWExistVersion)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("240", PLATFORM_UNKNOWN, ARCH_MIPS);
Starter.PackageManager->InstallVersion(2040000, PLATFORM_UNKNOWN, ARCH_MIPS);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
EXPECT_STREQ("/data/data/org.opencv.lib_v24_mips/lib", String8(result).string());
@@ -110,7 +110,7 @@ TEST(OpenCVEngineTest, GetPathForExecHWOldVersion)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("242", PLATFORM_UNKNOWN, ARCH_MIPS);
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_MIPS);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.1"));
EXPECT_STREQ("/data/data/org.opencv.lib_v24_mips/lib", String8(result).string());
@@ -120,7 +120,7 @@ TEST(OpenCVEngineTest, GetPathForExecHWNewVersion)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("241", PLATFORM_UNKNOWN, ARCH_MIPS);
Starter.PackageManager->InstallVersion(2040100, PLATFORM_UNKNOWN, ARCH_MIPS);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.2"));
EXPECT_EQ(0, result.size());
@@ -131,7 +131,7 @@ TEST(OpenCVEngineTest, GetPathForExecHWExistVersion)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("240", PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_NEON);
Starter.PackageManager->InstallVersion(2040000, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
#ifdef __SUPPORT_TEGRA3
@@ -149,7 +149,7 @@ TEST(OpenCVEngineTest, GetPathForExecHWOldVersion)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("242", PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_NEON);
Starter.PackageManager->InstallVersion(2040200, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.1"));
#ifdef __SUPPORT_TEGRA3
@@ -167,7 +167,7 @@ TEST(OpenCVEngineTest, GetPathForExecHWNewVersion)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("241", PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_NEON);
Starter.PackageManager->InstallVersion(2040100, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_NEON);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.2"));
EXPECT_EQ(0, result.size());
@@ -177,7 +177,7 @@ TEST(OpenCVEngineTest, GetPathForCompatiblePackage1)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("242", PLATFORM_UNKNOWN, ARCH_ARMv5);
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_ARMv5);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv5/lib", String8(result).string());
@@ -187,7 +187,7 @@ TEST(OpenCVEngineTest, GetPathForCompatiblePackage2)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("242", PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_NEON);
Starter.PackageManager->InstallVersion(2040200, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
#ifdef __SUPPORT_TEGRA3
@@ -218,6 +218,66 @@ TEST(OpenCVEngineTest, InstallAndGetVersion)
#endif
#endif
}
TEST(OpenCVEngineTest, GetPathFor2_4_2)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_ARMv7);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.2"));
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
}
TEST(OpenCVEngineTest, GetPathFor2_4_3)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion(2040300, PLATFORM_UNKNOWN, ARCH_ARMv7);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.3"));
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
}
TEST(OpenCVEngineTest, GetPathFor2_4_3_1)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion(2040301, PLATFORM_UNKNOWN, ARCH_ARMv7);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.3.1"));
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
}
TEST(OpenCVEngineTest, GetPathFor2_4_3_2)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion(2040302, PLATFORM_UNKNOWN, ARCH_ARMv7);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.3.2"));
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
}
TEST(OpenCVEngineTest, GetPathFor2_4_4)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion(2040400, PLATFORM_UNKNOWN, ARCH_ARMv7);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.4"));
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
}
TEST(OpenCVEngineTest, GetPathFor2_4_5)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion(2040500, PLATFORM_UNKNOWN, ARCH_ARMv7);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.5"));
EXPECT_EQ(0, result.size()); // 2.4.5 is not published yet
}
#endif
#ifndef __i386__
@@ -225,7 +285,7 @@ TEST(OpenCVEngineTest, GetPathForInCompatiblePackage1)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("242", PLATFORM_UNKNOWN, ARCH_X64);
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_X64);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
EXPECT_EQ(0, result.size());
@@ -235,7 +295,7 @@ TEST(OpenCVEngineTest, GetPathForInCompatiblePackage1)
{
sp<IOpenCVEngine> Engine = InitConnect();
Starter.PackageManager->InstalledPackages.clear();
Starter.PackageManager->InstallVersion("242", PLATFORM_UNKNOWN, ARCH_ARMv7);
Starter.PackageManager->InstallVersion(2040200, PLATFORM_UNKNOWN, ARCH_ARMv7);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4"));
EXPECT_EQ(0, result.size());
@@ -248,4 +308,4 @@ TEST(OpenCVEngineTest, GetPathForUnExistVersion)
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.5"));
EXPECT_EQ(0, result.size());
}
}
@@ -11,14 +11,14 @@ using namespace std;
TEST(PackageInfo, FullNameArmv7)
{
PackageInfo info("230", PLATFORM_UNKNOWN, ARCH_ARMv7);
PackageInfo info(2030000, PLATFORM_UNKNOWN, ARCH_ARMv7);
string name = info.GetFullName();
EXPECT_STREQ("org.opencv.lib_v23_armv7a", name.c_str());
}
TEST(PackageInfo, FullNameArmv7Neon)
{
PackageInfo info("241", PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_NEON);
PackageInfo info(2040100, PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_NEON);
string name = info.GetFullName();
#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
EXPECT_STREQ("org.opencv.lib_v24_armv7a_neon", name.c_str());
@@ -29,14 +29,14 @@ TEST(PackageInfo, FullNameArmv7Neon)
TEST(PackageInfo, FullNameArmv7VFPv3)
{
PackageInfo info("233", PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_VFPv3);
PackageInfo info(2030300, PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_VFPv3);
string name = info.GetFullName();
EXPECT_STREQ("org.opencv.lib_v23_armv7a", name.c_str());
}
TEST(PackageInfo, FullNameArmv7VFPv3Neon)
{
PackageInfo info("230", PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON);
PackageInfo info(2030000, PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON);
string name = info.GetFullName();
#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
EXPECT_STREQ("org.opencv.lib_v23_armv7a_neon", name.c_str());
@@ -47,21 +47,21 @@ TEST(PackageInfo, FullNameArmv7VFPv3Neon)
TEST(PackageInfo, FullNameArmv5)
{
PackageInfo info("230", PLATFORM_UNKNOWN, ARCH_ARMv5);
PackageInfo info(2030000, PLATFORM_UNKNOWN, ARCH_ARMv5);
string name = info.GetFullName();
EXPECT_STREQ("org.opencv.lib_v23_armv5", name.c_str());
}
TEST(PackageInfo, FullNameArmv6)
{
PackageInfo info("230", PLATFORM_UNKNOWN, ARCH_ARMv6);
PackageInfo info(2030000, PLATFORM_UNKNOWN, ARCH_ARMv6);
string name = info.GetFullName();
EXPECT_STREQ("org.opencv.lib_v23_armv5", name.c_str());
}
TEST(PackageInfo, FullNameArmv6VFPv3)
{
PackageInfo info("232", PLATFORM_UNKNOWN, ARCH_ARMv6 | FEATURES_HAS_VFPv3);
PackageInfo info(2030200, PLATFORM_UNKNOWN, ARCH_ARMv6 | FEATURES_HAS_VFPv3);
string name = info.GetFullName();
#ifdef __SUPPORT_ARMEABI_FEATURES
EXPECT_STREQ("org.opencv.lib_v23_armv5_vfpv3", name.c_str());
@@ -72,7 +72,7 @@ TEST(PackageInfo, FullNameArmv6VFPv3)
TEST(PackageInfo, FullNameTegra3)
{
PackageInfo info("230", PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_NEON);
PackageInfo info(2030000, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_NEON);
string name = info.GetFullName();
#ifdef __SUPPORT_TEGRA3
EXPECT_STREQ("org.opencv.lib_v23_tegra3", name.c_str());
@@ -87,7 +87,7 @@ TEST(PackageInfo, FullNameTegra3)
TEST(PackageInfo, FullNameX86SSE2)
{
PackageInfo info("230", PLATFORM_UNKNOWN, ARCH_X86 | FEATURES_HAS_SSE2);
PackageInfo info(2030000, PLATFORM_UNKNOWN, ARCH_X86 | FEATURES_HAS_SSE2);
string name = info.GetFullName();
#ifdef __SUPPORT_INTEL_FEATURES
EXPECT_STREQ("org.opencv.lib_v23_x86_sse2", name.c_str());
@@ -99,7 +99,7 @@ TEST(PackageInfo, FullNameX86SSE2)
#ifdef __SUPPORT_MIPS
TEST(PackageInfo, FullNameMips)
{
PackageInfo info("243", PLATFORM_UNKNOWN, ARCH_MIPS);
PackageInfo info(2040300, PLATFORM_UNKNOWN, ARCH_MIPS);
string name = info.GetFullName();
EXPECT_STREQ("org.opencv.lib_v24_mips", name.c_str());
}
@@ -108,21 +108,21 @@ TEST(PackageInfo, FullNameMips)
TEST(PackageInfo, Armv7NeonFromFullName)
{
PackageInfo info("org.opencv.lib_v23_armv7a_neon", "/data/data/org.opencv.lib_v23_armv7_neon");
EXPECT_EQ("230", info.GetVersion());
EXPECT_EQ(2030000, info.GetVersion());
EXPECT_EQ(ARCH_ARMv7 | FEATURES_HAS_NEON, info.GetCpuID());
}
TEST(PackageInfo, Armv5FromFullName)
{
PackageInfo info("org.opencv.lib_v23_armv5", "/data/data/org.opencv.lib_v23_armv5");
EXPECT_EQ("230", info.GetVersion());
EXPECT_EQ(2030000, info.GetVersion());
EXPECT_EQ(ARCH_ARMv5, info.GetCpuID());
}
TEST(PackageInfo, Armv5VFPv3FromFullName)
{
PackageInfo info("org.opencv.lib_v23_armv5_vfpv3", "/data/data/org.opencv.lib_v23_armv5_vfpv3");
EXPECT_EQ("230", info.GetVersion());
EXPECT_EQ(2030000, info.GetVersion());
EXPECT_EQ(ARCH_ARMv5 | FEATURES_HAS_VFPv3, info.GetCpuID());
}
@@ -131,20 +131,20 @@ TEST(PackageInfo, X86SSE2FromFullName)
PackageInfo info("org.opencv.lib_v24_x86_sse2", "/data/data/org.opencv.lib_v24_x86_sse2");
EXPECT_EQ(PLATFORM_UNKNOWN, info.GetPlatform());
EXPECT_EQ(ARCH_X86 | FEATURES_HAS_SSE2, info.GetCpuID());
EXPECT_EQ("240", info.GetVersion());
EXPECT_EQ(2040000, info.GetVersion());
}
TEST(PackageInfo, Tegra2FromFullName)
{
PackageInfo info("org.opencv.lib_v23_tegra2", "/data/data/org.opencv.lib_v23_tegra2");
EXPECT_EQ("230", info.GetVersion());
EXPECT_EQ(2030000, info.GetVersion());
EXPECT_EQ(PLATFORM_TEGRA2, info.GetPlatform());
}
TEST(PackageInfo, Tegra3FromFullName)
{
PackageInfo info("org.opencv.lib_v24_tegra3", "/data/data/org.opencv.lib_v24_tegra3");
EXPECT_EQ("240", info.GetVersion());
EXPECT_EQ(2040000, info.GetVersion());
EXPECT_EQ(PLATFORM_TEGRA3, info.GetPlatform());
}
@@ -152,14 +152,28 @@ TEST(PackageInfo, Tegra3FromFullName)
TEST(PackageInfo, MipsFromFullName)
{
PackageInfo info("org.opencv.lib_v24_mips", "/data/data/org.opencv.lib_v24_mips");
EXPECT_EQ("240", info.GetVersion());
EXPECT_EQ(2040000, info.GetVersion());
EXPECT_EQ(ARCH_MIPS, info.GetCpuID());
}
#endif
TEST(PackageInfo, Check2DigitRevision)
{
PackageInfo info("org.opencv.lib_v23_armv7a_neon", "/data/data/org.opencv.lib_v23_armv7_neon", "4.1");
EXPECT_EQ(2030400, info.GetVersion());
EXPECT_EQ(ARCH_ARMv7 | FEATURES_HAS_NEON, info.GetCpuID());
}
TEST(PackageInfo, Check3DigitRevision)
{
PackageInfo info("org.opencv.lib_v23_armv7a_neon", "/data/data/org.opencv.lib_v23_armv7_neon", "4.1.5");
EXPECT_EQ(2030401, info.GetVersion());
EXPECT_EQ(ARCH_ARMv7 | FEATURES_HAS_NEON, info.GetCpuID());
}
TEST(PackageInfo, Comparator1)
{
PackageInfo info1("240", PLATFORM_UNKNOWN, ARCH_X86);
PackageInfo info1(2040000, PLATFORM_UNKNOWN, ARCH_X86);
PackageInfo info2("org.opencv.lib_v24_x86", "/data/data/org.opencv.lib_v24_x86");
EXPECT_STREQ(info1.GetFullName().c_str(), info2.GetFullName().c_str());
EXPECT_EQ(info1, info2);
@@ -167,7 +181,7 @@ TEST(PackageInfo, Comparator1)
TEST(PackageInfo, Comparator2)
{
PackageInfo info1("240", PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_NEON | FEATURES_HAS_VFPv3);
PackageInfo info1(2040000, PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_NEON | FEATURES_HAS_VFPv3);
#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
PackageInfo info2("org.opencv.lib_v24_armv7a_neon", "/data/data/org.opencv.lib_v24_armv7a_neon");
#else
@@ -180,7 +194,7 @@ TEST(PackageInfo, Comparator2)
#ifdef __SUPPORT_TEGRA3
TEST(PackageInfo, Comparator3)
{
PackageInfo info1("230", PLATFORM_TEGRA3, 0);
PackageInfo info1(2030000, PLATFORM_TEGRA3, 0);
PackageInfo info2("org.opencv.lib_v23_tegra3", "/data/data/org.opencv.lib_v23_tegra3");
EXPECT_STREQ(info1.GetFullName().c_str(), info2.GetFullName().c_str());
EXPECT_EQ(info1, info2);
@@ -5,7 +5,6 @@
#include "IOpenCVEngine.h"
#include <utils/String16.h>
#include <gtest/gtest.h>
#include <set>
#include <string>
#include <vector>
@@ -14,52 +13,52 @@ using namespace std;
TEST(PackageManager, InstalledVersions)
{
PackageManagerStub pm;
PackageInfo info("230", PLATFORM_UNKNOWN, ARCH_ARMv7);
PackageInfo info(2030000, PLATFORM_UNKNOWN, ARCH_ARMv7);
pm.InstalledPackages.push_back(info);
std::set<string> versions = pm.GetInstalledVersions();
std::vector<int> versions = pm.GetInstalledVersions();
EXPECT_EQ(1, versions.size());
EXPECT_EQ("230", *versions.begin());
EXPECT_EQ(2030000, *versions.begin());
}
TEST(PackageManager, CheckVersionInstalled)
{
PackageManagerStub pm;
PackageInfo info("230", PLATFORM_UNKNOWN, ARCH_ARMv7);
PackageInfo info(2030000, PLATFORM_UNKNOWN, ARCH_ARMv7);
pm.InstalledPackages.push_back(info);
EXPECT_TRUE(pm.CheckVersionInstalled("230", PLATFORM_UNKNOWN, ARCH_ARMv7));
EXPECT_TRUE(pm.CheckVersionInstalled(2030000, PLATFORM_UNKNOWN, ARCH_ARMv7));
}
TEST(PackageManager, InstallVersion)
{
PackageManagerStub pm;
PackageInfo info("230", PLATFORM_UNKNOWN, ARCH_ARMv5);
PackageInfo info(2030000, PLATFORM_UNKNOWN, ARCH_ARMv5);
pm.InstalledPackages.push_back(info);
EXPECT_TRUE(pm.InstallVersion("240", PLATFORM_UNKNOWN, ARCH_ARMv5));
EXPECT_TRUE(pm.InstallVersion(2040000, PLATFORM_UNKNOWN, ARCH_ARMv5));
EXPECT_EQ(2, pm.InstalledPackages.size());
EXPECT_TRUE(pm.CheckVersionInstalled("240", PLATFORM_UNKNOWN, ARCH_ARMv5));
EXPECT_TRUE(pm.CheckVersionInstalled(2040000, PLATFORM_UNKNOWN, ARCH_ARMv5));
}
TEST(PackageManager, GetPackagePathForArmv5)
{
PackageManagerStub pm;
EXPECT_TRUE(pm.InstallVersion("243", PLATFORM_UNKNOWN, ARCH_ARMv5));
string path = pm.GetPackagePathByVersion("243", PLATFORM_UNKNOWN, ARCH_ARMv5);
EXPECT_TRUE(pm.InstallVersion(2040300, PLATFORM_UNKNOWN, ARCH_ARMv5));
string path = pm.GetPackagePathByVersion(2040300, PLATFORM_UNKNOWN, ARCH_ARMv5);
EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv5/lib", path.c_str());
}
TEST(PackageManager, GetPackagePathForArmv7)
{
PackageManagerStub pm;
EXPECT_TRUE(pm.InstallVersion("230", PLATFORM_UNKNOWN, ARCH_ARMv7));
string path = pm.GetPackagePathByVersion("230", PLATFORM_UNKNOWN, ARCH_ARMv7);
EXPECT_TRUE(pm.InstallVersion(2030000, PLATFORM_UNKNOWN, ARCH_ARMv7));
string path = pm.GetPackagePathByVersion(2030000, PLATFORM_UNKNOWN, ARCH_ARMv7);
EXPECT_STREQ("/data/data/org.opencv.lib_v23_armv7a/lib", path.c_str());
}
TEST(PackageManager, GetPackagePathForArmv7Neon)
{
PackageManagerStub pm;
EXPECT_TRUE(pm.InstallVersion("230", PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_NEON));
string path = pm.GetPackagePathByVersion("230", PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_NEON);
EXPECT_TRUE(pm.InstallVersion(2030000, PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_NEON));
string path = pm.GetPackagePathByVersion(2030000, PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_NEON);
#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
EXPECT_STREQ("/data/data/org.opencv.lib_v23_armv7a_neon/lib", path.c_str());
#else
@@ -70,16 +69,16 @@ TEST(PackageManager, GetPackagePathForArmv7Neon)
TEST(PackageManager, GetPackagePathForX86)
{
PackageManagerStub pm;
EXPECT_TRUE(pm.InstallVersion("230", PLATFORM_UNKNOWN, ARCH_X86));
string path = pm.GetPackagePathByVersion("230", PLATFORM_UNKNOWN, ARCH_X86);
EXPECT_TRUE(pm.InstallVersion(2030000, PLATFORM_UNKNOWN, ARCH_X86));
string path = pm.GetPackagePathByVersion(2030000, PLATFORM_UNKNOWN, ARCH_X86);
EXPECT_STREQ("/data/data/org.opencv.lib_v23_x86/lib", path.c_str());
}
TEST(PackageManager, GetPackagePathForX86SSE2)
{
PackageManagerStub pm;
EXPECT_TRUE(pm.InstallVersion("230", PLATFORM_UNKNOWN, ARCH_X86 | FEATURES_HAS_SSE2));
string path = pm.GetPackagePathByVersion("230", PLATFORM_UNKNOWN, ARCH_X86 | FEATURES_HAS_SSE2);
EXPECT_TRUE(pm.InstallVersion(2030000, PLATFORM_UNKNOWN, ARCH_X86 | FEATURES_HAS_SSE2));
string path = pm.GetPackagePathByVersion(2030000, PLATFORM_UNKNOWN, ARCH_X86 | FEATURES_HAS_SSE2);
#ifdef __SUPPORT_INTEL_FEATURES
EXPECT_STREQ("/data/data/org.opencv.lib_v23_x86_sse2/lib", path.c_str());
#else
@@ -90,8 +89,8 @@ TEST(PackageManager, GetPackagePathForX86SSE2)
TEST(PackageManager, GetPackagePathForTegra3)
{
PackageManagerStub pm;
EXPECT_TRUE(pm.InstallVersion("230", PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_NEON));
string path = pm.GetPackagePathByVersion("230", PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_NEON);
EXPECT_TRUE(pm.InstallVersion(2030000, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON));
string path = pm.GetPackagePathByVersion(2030000, PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON);
#ifdef __SUPPORT_TEGRA3
EXPECT_STREQ("/data/data/org.opencv.lib_v23_tegra3/lib", path.c_str());
#else
@@ -107,8 +106,8 @@ TEST(PackageManager, GetPackagePathForTegra3)
TEST(PackageManager, GetPackagePathForMips)
{
PackageManagerStub pm;
EXPECT_TRUE(pm.InstallVersion("243", PLATFORM_UNKNOWN, ARCH_MIPS));
string path = pm.GetPackagePathByVersion("243", PLATFORM_UNKNOWN, ARCH_MIPS);
EXPECT_TRUE(pm.InstallVersion(2040000, PLATFORM_UNKNOWN, ARCH_MIPS));
string path = pm.GetPackagePathByVersion(2040000, PLATFORM_UNKNOWN, ARCH_MIPS);
EXPECT_STREQ("/data/data/org.opencv.lib_v24_mips/lib", path.c_str());
}
#endif
@@ -1,17 +1,17 @@
#ifndef __IPACKAGE_MANAGER__
#define __IPACKAGE_MANAGER__
#include <set>
#include <vector>
#include <string>
class IPackageManager
{
public:
virtual std::set<std::string> GetInstalledVersions() = 0;
virtual bool CheckVersionInstalled(const std::string& version, int platform, int cpu_id) = 0;
virtual bool InstallVersion(const std::string&, int platform, int cpu_id) = 0;
virtual std::string GetPackagePathByVersion(const std::string&, int platform, int cpu_id) = 0;
virtual std::vector<int> GetInstalledVersions() = 0;
virtual bool CheckVersionInstalled(int version, int platform, int cpu_id) = 0;
virtual bool InstallVersion(int version, int platform, int cpu_id) = 0;
virtual std::string GetPackagePathByVersion(int version, int platform, int cpu_id) = 0;
virtual ~IPackageManager(){};
};
#endif
#endif
+1 -1
Ver Arquivo
@@ -26,7 +26,7 @@
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Version: "
android:text="Library version: "
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
+1 -1
Ver Arquivo
@@ -30,7 +30,7 @@
android:id="@+id/EngineVersionCaption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Version: "
android:text="OpenCV Manager version: "
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
@@ -299,10 +299,9 @@ public class ManagerActivity extends Activity
else
NativeLibDir = "/data/data/" + mInstalledPackageInfo[i].packageName + "/lib";
OpenCVLibraryInfo NativeInfo = new OpenCVLibraryInfo(NativeLibDir);
if (PackageName.equals("org.opencv.engine"))
{
OpenCVLibraryInfo NativeInfo = new OpenCVLibraryInfo(NativeLibDir);
if (NativeInfo.status())
{
PublicName = "Built-in OpenCV library";
@@ -348,9 +347,7 @@ public class ManagerActivity extends Activity
if (null != ActivePackagePath)
{
int start = ActivePackagePath.indexOf(mInstalledPackageInfo[i].packageName);
int stop = start + mInstalledPackageInfo[i].packageName.length();
if (start >= 0 && ActivePackagePath.charAt(stop) == '/')
if (ActivePackagePath.equals(NativeLibDir))
{
temp.put("Activity", "y");
Tags = "active";
@@ -405,13 +402,22 @@ public class ManagerActivity extends Activity
if (OpenCVersion == null || PackageVersion == null)
return "unknown";
int dot = PackageVersion.indexOf(".");
if (dot == -1 || OpenCVersion.length() == 0)
String[] revisions = PackageVersion.split("\\.");
if (revisions.length <= 1 || OpenCVersion.length() == 0)
return "unknown";
else
return OpenCVersion.substring(0, OpenCVersion.length()-1) + "." +
OpenCVersion.toCharArray()[OpenCVersion.length()-1] + "." +
PackageVersion.substring(0, dot) + " rev " + PackageVersion.substring(dot+1);
if (revisions.length == 2)
// the 2nd digit is revision
return OpenCVersion.substring(0, OpenCVersion.length()-1) + "." +
OpenCVersion.toCharArray()[OpenCVersion.length()-1] + "." +
revisions[0] + " rev " + revisions[1];
else
// the 2nd digit is part of library version
// the 3rd digit is revision
return OpenCVersion.substring(0, OpenCVersion.length()-1) + "." +
OpenCVersion.toCharArray()[OpenCVersion.length()-1] + "." +
revisions[0] + "." + revisions[1] + " rev " + revisions[2];
}
protected String ConvertPackageName(String Name, String Version)
+14 -14
Ver Arquivo
@@ -14,20 +14,20 @@ manually using adb tool:
.. code-block:: sh
adb install OpenCV-2.4.3-android-sdk/apk/OpenCV_2.4.3.2_Manager_2.4_<platform>.apk
adb install OpenCV-2.4.4-android-sdk/apk/OpenCV_2.4.4_Manager_2.6_<platform>.apk
Use the table below to determine proper OpenCV Manager package for your device:
+------------------------------+--------------+-----------------------------------------------------+
| Hardware Platform | Android ver. | Package name |
+==============================+==============+=====================================================+
| armeabi-v7a (ARMv7-A + NEON) | >= 2.3 | OpenCV_2.4.3.2_Manager_2.4_armv7a-neon.apk |
+------------------------------+--------------+-----------------------------------------------------+
| armeabi-v7a (ARMv7-A + NEON) | = 2.2 | OpenCV_2.4.3.2_Manager_2.4_armv7a-neon-android8.apk |
+------------------------------+--------------+-----------------------------------------------------+
| armeabi (ARMv5, ARMv6) | >= 2.3 | OpenCV_2.4.3.2_Manager_2.4_armeabi.apk |
+------------------------------+--------------+-----------------------------------------------------+
| Intel x86 | >= 2.3 | OpenCV_2.4.3.2_Manager_2.4_x86.apk |
+------------------------------+--------------+-----------------------------------------------------+
| MIPS | >= 2.3 | OpenCV_2.4.3.2_Manager_2.4_mips.apk |
+------------------------------+--------------+-----------------------------------------------------+
+------------------------------+--------------+---------------------------------------------------+
| Hardware Platform | Android ver. | Package name |
+==============================+==============+===================================================+
| armeabi-v7a (ARMv7-A + NEON) | >= 2.3 | OpenCV_2.4.4_Manager_2.6_armv7a-neon.apk |
+------------------------------+--------------+---------------------------------------------------+
| armeabi-v7a (ARMv7-A + NEON) | = 2.2 | OpenCV_2.4.4_Manager_2.6_armv7a-neon-android8.apk |
+------------------------------+--------------+---------------------------------------------------+
| armeabi (ARMv5, ARMv6) | >= 2.3 | OpenCV_2.4.4_Manager_2.6_armeabi.apk |
+------------------------------+--------------+---------------------------------------------------+
| Intel x86 | >= 2.3 | OpenCV_2.4.4_Manager_2.6_x86.apk |
+------------------------------+--------------+---------------------------------------------------+
| MIPS | >= 2.3 | OpenCV_2.4.4_Manager_2.6_mips.apk |
+------------------------------+--------------+---------------------------------------------------+
-4
Ver Arquivo
@@ -1,7 +1,3 @@
if(IOS OR ANDROID)
return()
endif()
SET(OPENCV_HAARTRAINING_DEPS opencv_core opencv_imgproc opencv_highgui opencv_objdetect opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy)
ocv_check_dependencies(${OPENCV_HAARTRAINING_DEPS})
-4
Ver Arquivo
@@ -1,7 +1,3 @@
if(IOS OR ANDROID)
return()
endif()
SET(OPENCV_TRAINCASCADE_DEPS opencv_core opencv_ml opencv_imgproc opencv_objdetect opencv_highgui opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy)
ocv_check_dependencies(${OPENCV_TRAINCASCADE_DEPS})
+47 -26
Ver Arquivo
@@ -360,7 +360,7 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
if (is_buf_16u)
{
unsigned short* udst_idx = (unsigned short*)(buf->data.s + root->buf_idx*buf->cols +
unsigned short* udst_idx = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
vi*sample_count + data_root->offset);
for( int i = 0; i < num_valid; i++ )
{
@@ -373,7 +373,7 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
}
else
{
int* idst_idx = buf->data.i + root->buf_idx*buf->cols +
int* idst_idx = buf->data.i + root->buf_idx*get_length_subbuf() +
vi*sample_count + root->offset;
for( int i = 0; i < num_valid; i++ )
{
@@ -390,14 +390,14 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
const int* src_lbls = get_cv_labels(data_root, (int*)(uchar*)inn_buf);
if (is_buf_16u)
{
unsigned short* udst = (unsigned short*)(buf->data.s + root->buf_idx*buf->cols +
unsigned short* udst = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
(workVarCount-1)*sample_count + root->offset);
for( int i = 0; i < count; i++ )
udst[i] = (unsigned short)src_lbls[sidx[i]];
}
else
{
int* idst = buf->data.i + root->buf_idx*buf->cols +
int* idst = buf->data.i + root->buf_idx*get_length_subbuf() +
(workVarCount-1)*sample_count + root->offset;
for( int i = 0; i < count; i++ )
idst[i] = src_lbls[sidx[i]];
@@ -407,14 +407,14 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
const int* sample_idx_src = get_sample_indices(data_root, (int*)(uchar*)inn_buf);
if (is_buf_16u)
{
unsigned short* sample_idx_dst = (unsigned short*)(buf->data.s + root->buf_idx*buf->cols +
unsigned short* sample_idx_dst = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
workVarCount*sample_count + root->offset);
for( int i = 0; i < count; i++ )
sample_idx_dst[i] = (unsigned short)sample_idx_src[sidx[i]];
}
else
{
int* sample_idx_dst = buf->data.i + root->buf_idx*buf->cols +
int* sample_idx_dst = buf->data.i + root->buf_idx*get_length_subbuf() +
workVarCount*sample_count + root->offset;
for( int i = 0; i < count; i++ )
sample_idx_dst[i] = sample_idx_src[sidx[i]];
@@ -489,6 +489,10 @@ void CvCascadeBoostTrainData::setData( const CvFeatureEvaluator* _featureEvaluat
int* idst = 0;
unsigned short* udst = 0;
uint64 effective_buf_size = 0;
int effective_buf_height = 0, effective_buf_width = 0;
clear();
shared = true;
have_labels = true;
@@ -548,13 +552,28 @@ void CvCascadeBoostTrainData::setData( const CvFeatureEvaluator* _featureEvaluat
var_type->data.i[var_count] = cat_var_count;
var_type->data.i[var_count+1] = cat_var_count+1;
work_var_count = ( cat_var_count ? 0 : numPrecalcIdx ) + 1/*cv_lables*/;
buf_size = (work_var_count + 1) * sample_count/*sample_indices*/;
buf_count = 2;
if ( is_buf_16u )
buf = cvCreateMat( buf_count, buf_size, CV_16UC1 );
buf_size = -1; // the member buf_size is obsolete
effective_buf_size = (uint64)(work_var_count + 1)*(uint64)sample_count * buf_count; // this is the total size of "CvMat buf" to be allocated
effective_buf_width = sample_count;
effective_buf_height = work_var_count+1;
if (effective_buf_width >= effective_buf_height)
effective_buf_height *= buf_count;
else
buf = cvCreateMat( buf_count, buf_size, CV_32SC1 );
effective_buf_width *= buf_count;
if ((uint64)effective_buf_width * (uint64)effective_buf_height != effective_buf_size)
{
CV_Error(CV_StsBadArg, "The memory buffer cannot be allocated since its size exceeds integer fields limit");
}
if ( is_buf_16u )
buf = cvCreateMat( effective_buf_height, effective_buf_width, CV_16UC1 );
else
buf = cvCreateMat( effective_buf_height, effective_buf_width, CV_32SC1 );
cat_count = cvCreateMat( 1, cat_var_count + 1, CV_32SC1 );
@@ -609,7 +628,7 @@ void CvCascadeBoostTrainData::setData( const CvFeatureEvaluator* _featureEvaluat
priors_mult = cvCloneMat( priors );
counts = cvCreateMat( 1, get_num_classes(), CV_32SC1 );
direction = cvCreateMat( 1, sample_count, CV_8UC1 );
split_buf = cvCreateMat( 1, sample_count, CV_32SC1 );
split_buf = cvCreateMat( 1, sample_count, CV_32SC1 );//TODO: make a pointer
}
void CvCascadeBoostTrainData::free_train_data()
@@ -652,10 +671,10 @@ void CvCascadeBoostTrainData::get_ord_var_data( CvDTreeNode* n, int vi, float* o
if ( vi < numPrecalcIdx )
{
if( !is_buf_16u )
*sortedIndices = buf->data.i + n->buf_idx*buf->cols + vi*sample_count + n->offset;
*sortedIndices = buf->data.i + n->buf_idx*get_length_subbuf() + vi*sample_count + n->offset;
else
{
const unsigned short* shortIndices = (const unsigned short*)(buf->data.s + n->buf_idx*buf->cols +
const unsigned short* shortIndices = (const unsigned short*)(buf->data.s + n->buf_idx*get_length_subbuf() +
vi*sample_count + n->offset );
for( int i = 0; i < nodeSampleCount; i++ )
sortedIndicesBuf[i] = shortIndices[i];
@@ -1027,6 +1046,7 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
int newBufIdx = data->get_child_buf_idx( node );
int workVarCount = data->get_work_var_count();
CvMat* buf = data->buf;
size_t length_buf_row = data->get_length_subbuf();
cv::AutoBuffer<uchar> inn_buf(n*(3*sizeof(int)+sizeof(float)));
int* tempBuf = (int*)(uchar*)inn_buf;
bool splitInputData;
@@ -1070,7 +1090,7 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
if (data->is_buf_16u)
{
ushort *ldst, *rdst;
ldst = (ushort*)(buf->data.s + left->buf_idx*buf->cols +
ldst = (ushort*)(buf->data.s + left->buf_idx*length_buf_row +
vi*scount + left->offset);
rdst = (ushort*)(ldst + nl);
@@ -1096,9 +1116,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
else
{
int *ldst, *rdst;
ldst = buf->data.i + left->buf_idx*buf->cols +
ldst = buf->data.i + left->buf_idx*length_buf_row +
vi*scount + left->offset;
rdst = buf->data.i + right->buf_idx*buf->cols +
rdst = buf->data.i + right->buf_idx*length_buf_row +
vi*scount + right->offset;
// split sorted
@@ -1131,9 +1151,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
if (data->is_buf_16u)
{
unsigned short *ldst = (unsigned short *)(buf->data.s + left->buf_idx*buf->cols +
unsigned short *ldst = (unsigned short *)(buf->data.s + left->buf_idx*length_buf_row +
(workVarCount-1)*scount + left->offset);
unsigned short *rdst = (unsigned short *)(buf->data.s + right->buf_idx*buf->cols +
unsigned short *rdst = (unsigned short *)(buf->data.s + right->buf_idx*length_buf_row +
(workVarCount-1)*scount + right->offset);
for( int i = 0; i < n; i++ )
@@ -1154,9 +1174,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
}
else
{
int *ldst = buf->data.i + left->buf_idx*buf->cols +
int *ldst = buf->data.i + left->buf_idx*length_buf_row +
(workVarCount-1)*scount + left->offset;
int *rdst = buf->data.i + right->buf_idx*buf->cols +
int *rdst = buf->data.i + right->buf_idx*length_buf_row +
(workVarCount-1)*scount + right->offset;
for( int i = 0; i < n; i++ )
@@ -1184,9 +1204,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
if (data->is_buf_16u)
{
unsigned short* ldst = (unsigned short*)(buf->data.s + left->buf_idx*buf->cols +
unsigned short* ldst = (unsigned short*)(buf->data.s + left->buf_idx*length_buf_row +
workVarCount*scount + left->offset);
unsigned short* rdst = (unsigned short*)(buf->data.s + right->buf_idx*buf->cols +
unsigned short* rdst = (unsigned short*)(buf->data.s + right->buf_idx*length_buf_row +
workVarCount*scount + right->offset);
for (int i = 0; i < n; i++)
{
@@ -1205,9 +1225,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
}
else
{
int* ldst = buf->data.i + left->buf_idx*buf->cols +
int* ldst = buf->data.i + left->buf_idx*length_buf_row +
workVarCount*scount + left->offset;
int* rdst = buf->data.i + right->buf_idx*buf->cols +
int* rdst = buf->data.i + right->buf_idx*length_buf_row +
workVarCount*scount + right->offset;
for (int i = 0; i < n; i++)
{
@@ -1352,6 +1372,7 @@ void CvCascadeBoost::update_weights( CvBoostTree* tree )
sampleIdx = data->get_sample_indices( data->data_root, sampleIdxBuf );
}
CvMat* buf = data->buf;
size_t length_buf_row = data->get_length_subbuf();
if( !tree ) // before training the first tree, initialize weights and other parameters
{
int* classLabelsBuf = (int*)cur_inn_buf_pos; cur_inn_buf_pos = (uchar*)(classLabelsBuf + n);
@@ -1375,7 +1396,7 @@ void CvCascadeBoost::update_weights( CvBoostTree* tree )
if (data->is_buf_16u)
{
unsigned short* labels = (unsigned short*)(buf->data.s + data->data_root->buf_idx*buf->cols +
unsigned short* labels = (unsigned short*)(buf->data.s + data->data_root->buf_idx*length_buf_row +
data->data_root->offset + (data->work_var_count-1)*data->sample_count);
for( int i = 0; i < n; i++ )
{
@@ -1393,7 +1414,7 @@ void CvCascadeBoost::update_weights( CvBoostTree* tree )
}
else
{
int* labels = buf->data.i + data->data_root->buf_idx*buf->cols +
int* labels = buf->data.i + data->data_root->buf_idx*length_buf_row +
data->data_root->offset + (data->work_var_count-1)*data->sample_count;
for( int i = 0; i < n; i++ )
+1 -1
Ver Arquivo
@@ -97,7 +97,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
endif()
# We need pthread's
if(UNIX AND NOT ANDROID)
if(UNIX AND NOT ANDROID AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX))
add_extra_compiler_option(-pthread)
endif()
+1 -1
Ver Arquivo
@@ -302,7 +302,7 @@ macro(add_android_project target path)
COMMAND ${CMAKE_COMMAND} -E touch "${android_proj_bin_dir}/bin/${target}-debug.apk" # needed because ant does not update the timestamp of updated apk
WORKING_DIRECTORY "${android_proj_bin_dir}"
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}"
DEPENDS "${OpenCV_BINARY_DIR}/bin/.classes.jar.dephelper" opencv_java # as we are part of OpenCV we can just force this dependency
DEPENDS "${OpenCV_BINARY_DIR}/bin/classes.jar.dephelper" opencv_java # as we are part of OpenCV we can just force this dependency
DEPENDS ${android_proj_file_deps} ${JNI_LIB_NAME})
endif()
+65 -22
Ver Arquivo
@@ -3,17 +3,17 @@ if(${CMAKE_VERSION} VERSION_LESS "2.8.3")
return()
endif()
if (WIN32 AND NOT MSVC)
message(STATUS "CUDA compilation is disabled (due to only Visual Studio compiler suppoted on your platform).")
if(WIN32 AND NOT MSVC)
message(STATUS "CUDA compilation is disabled (due to only Visual Studio compiler supported on your platform).")
return()
endif()
if (CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
message(STATUS "CUDA compilation is disabled (due to Clang unsuppoted on your platform).")
if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
message(STATUS "CUDA compilation is disabled (due to Clang unsupported on your platform).")
return()
endif()
find_package(CUDA 4.1)
find_package(CUDA 4.2 QUIET)
if(CUDA_FOUND)
set(HAVE_CUDA 1)
@@ -26,15 +26,55 @@ if(CUDA_FOUND)
set(HAVE_CUBLAS 1)
endif()
message(STATUS "CUDA detected: " ${CUDA_VERSION})
if(${CUDA_VERSION_STRING} VERSION_GREATER "4.1")
set(CUDA_ARCH_BIN "1.1 1.2 1.3 2.0 2.1(2.0) 3.0" CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
else()
set(CUDA_ARCH_BIN "1.1 1.2 1.3 2.0 2.1(2.0)" CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
if(WITH_NVCUVID)
find_cuda_helper_libs(nvcuvid)
set(HAVE_NVCUVID 1)
endif()
set(CUDA_ARCH_PTX "2.0" CACHE STRING "Specify 'virtual' PTX architectures to build PTX intermediate code for")
message(STATUS "CUDA detected: " ${CUDA_VERSION})
set(_generations "Fermi" "Kepler")
if(NOT CMAKE_CROSSCOMPILING)
list(APPEND _generations "Auto")
endif()
set(CUDA_GENERATION "" CACHE STRING "Build CUDA device code only for specific GPU architecture. Leave empty to build for all architectures.")
if( CMAKE_VERSION VERSION_GREATER "2.8" )
set_property( CACHE CUDA_GENERATION PROPERTY STRINGS "" ${_generations} )
endif()
if(CUDA_GENERATION)
if(NOT ";${_generations};" MATCHES ";${CUDA_GENERATION};")
string(REPLACE ";" ", " _generations "${_generations}")
message(FATAL_ERROR "ERROR: ${_generations} Generations are suppered.")
endif()
unset(CUDA_ARCH_BIN CACHE)
unset(CUDA_ARCH_PTX CACHE)
endif()
set(__cuda_arch_ptx "")
if(CUDA_GENERATION STREQUAL "Fermi")
set(__cuda_arch_bin "2.0 2.1(2.0)")
elseif(CUDA_GENERATION STREQUAL "Kepler")
set(__cuda_arch_bin "3.0")
elseif(CUDA_GENERATION STREQUAL "Auto")
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCudaArch.cu" "--run"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT _nvcc_res EQUAL 0)
message(STATUS "Automatic detection of CUDA generation failed. Going to build for all known architectures.")
else()
set(__cuda_arch_bin "${_nvcc_out}")
endif()
endif()
if(NOT DEFINED __cuda_arch_bin)
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
set(__cuda_arch_ptx "2.0 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")
set(CUDA_ARCH_PTX ${__cuda_arch_ptx} CACHE STRING "Specify 'virtual' PTX architectures to build PTX intermediate code for")
string(REGEX REPLACE "\\." "" ARCH_BIN_NO_POINTS "${CUDA_ARCH_BIN}")
string(REGEX REPLACE "\\." "" ARCH_PTX_NO_POINTS "${CUDA_ARCH_PTX}")
@@ -72,11 +112,15 @@ if(CUDA_FOUND)
# Tell NVCC to add PTX intermediate code for the specified architectures
string(REGEX MATCHALL "[0-9]+" ARCH_LIST "${ARCH_PTX_NO_POINTS}")
foreach(ARCH IN LISTS ARCH_LIST)
set(NVCC_FLAGS_EXTRA ${NVCC_FLAGS_EXTRA} -gencode arch=compute_${ARCH},code=compute_${ARCH})
set(OPENCV_CUDA_ARCH_PTX "${OPENCV_CUDA_ARCH_PTX} ${ARCH}")
set(OPENCV_CUDA_ARCH_FEATURES "${OPENCV_CUDA_ARCH_FEATURES} ${ARCH}")
endforeach()
foreach(ARCH IN LISTS ARCH_LIST)
set(NVCC_FLAGS_EXTRA ${NVCC_FLAGS_EXTRA} -gencode arch=compute_${ARCH},code=compute_${ARCH})
set(OPENCV_CUDA_ARCH_PTX "${OPENCV_CUDA_ARCH_PTX} ${ARCH}")
set(OPENCV_CUDA_ARCH_FEATURES "${OPENCV_CUDA_ARCH_FEATURES} ${ARCH}")
endforeach()
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --target-cpu-architecture=ARM")
endif()
# These vars will be processed in other scripts
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ${NVCC_FLAGS_EXTRA})
@@ -84,7 +128,7 @@ if(CUDA_FOUND)
message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}")
OCV_OPTION(CUDA_FAST_MATH "Enable --use_fast_math for CUDA compiler " OFF)
OCV_OPTION(CUDA_FAST_MATH "Enable --use_fast_math for CUDA compiler " OFF)
if(CUDA_FAST_MATH)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --use_fast_math)
@@ -92,7 +136,6 @@ if(CUDA_FOUND)
mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_VERBOSE_BUILD CUDA_SDK_ROOT_DIR)
unset(CUDA_npp_LIBRARY CACHE)
find_cuda_helper_libs(npp)
macro(ocv_cuda_compile VAR)
@@ -106,15 +149,15 @@ if(CUDA_FOUND)
string(REPLACE "-ggdb3" "" ${var} "${${var}}")
endforeach()
if (BUILD_SHARED_LIBS)
if(BUILD_SHARED_LIBS)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -DCVAPI_EXPORTS)
endif()
if(UNIX OR APPLE)
set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fPIC)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fPIC)
endif()
if(APPLE)
set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fno-finite-math-only)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fno-finite-math-only)
endif()
# disabled because of multiple warnings during building nvcc auto generated files
+26 -16
Ver Arquivo
@@ -5,15 +5,17 @@ if(CMAKE_CL_64)
set(MSVC64 1)
endif()
if(NOT APPLE)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(ENABLE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(CMAKE_COMPILER_IS_GNUCC 1)
set(ENABLE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(CMAKE_COMPILER_IS_CLANGCXX 1)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(CMAKE_COMPILER_IS_GNUCC 1)
set(CMAKE_COMPILER_IS_CLANGCC 1)
endif()
if((CMAKE_COMPILER_IS_CLANGCXX OR CMAKE_COMPILER_IS_CLANGCC) AND NOT CMAKE_GENERATOR MATCHES "Xcode")
set(ENABLE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE)
endif()
# ----------------------------------------------------------------------------
@@ -44,16 +46,24 @@ if(MSVC AND CMAKE_C_COMPILER MATCHES "icc")
set(CV_ICC __INTEL_COMPILER_FOR_WINDOWS)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR (UNIX AND CV_ICC))
set(CV_COMPILER_IS_GNU TRUE)
else()
set(CV_COMPILER_IS_GNU FALSE)
endif()
# ----------------------------------------------------------------------------
# Detect GNU version:
# ----------------------------------------------------------------------------
if(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_COMPILER_IS_CLANGCXX)
set(CMAKE_GCC_REGEX_VERSION "4.2.1")
set(CMAKE_OPENCV_GCC_VERSION_MAJOR 4)
set(CMAKE_OPENCV_GCC_VERSION_MINOR 2)
set(CMAKE_OPENCV_GCC_VERSION 42)
set(CMAKE_OPENCV_GCC_VERSION_NUM 402)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -v
ERROR_VARIABLE CMAKE_OPENCV_CLANG_VERSION_FULL
ERROR_STRIP_TRAILING_WHITESPACE)
string(REGEX MATCH "version.*$" CMAKE_OPENCV_CLANG_VERSION_FULL "${CMAKE_OPENCV_CLANG_VERSION_FULL}")
string(REGEX MATCH "[0-9]+\\.[0-9]+" CMAKE_CLANG_REGEX_VERSION "${CMAKE_OPENCV_CLANG_VERSION_FULL}")
elseif(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE CMAKE_OPENCV_GCC_VERSION_FULL
OUTPUT_STRIP_TRAILING_WHITESPACE)
+14
Ver Arquivo
@@ -0,0 +1,14 @@
#include <stdio.h>
int main()
{
int count = 0;
if (cudaSuccess != cudaGetDeviceCount(&count)){return -1;}
if (count == 0) {return -1;}
for (int device = 0; device < count; ++device)
{
cudaDeviceProp prop;
if (cudaSuccess != cudaGetDeviceProperties(&prop, device)){ continue;}
printf("%d.%d ", prop.major, prop.minor);
}
return 0;
}
+148 -72
Ver Arquivo
@@ -1,78 +1,154 @@
if(APPLE)
set(OPENCL_FOUND YES)
set(OPENCL_LIBRARIES "-framework OpenCL")
set(OPENCL_FOUND YES)
set(OPENCL_LIBRARIES "-framework OpenCL")
else()
#find_package(OpenCL QUIET)
if(WITH_OPENCLAMDFFT)
find_path(CLAMDFFT_INCLUDE_DIR
NAMES clAmdFft.h)
find_library(CLAMDFFT_LIBRARIES
NAMES clAmdFft.Runtime)
find_package(OpenCL QUIET)
if(WITH_OPENCLAMDFFT)
set(CLAMDFFT_SEARCH_PATH $ENV{CLAMDFFT_PATH})
if(NOT CLAMDFFT_SEARCH_PATH)
if(WIN32)
set( CLAMDFFT_SEARCH_PATH "C:\\Program Files (x86)\\AMD\\clAmdFft" )
endif()
endif()
if(WITH_OPENCLAMDBLAS)
find_path(CLAMDBLAS_INCLUDE_DIR
NAMES clAmdBlas.h)
find_library(CLAMDBLAS_LIBRARIES
NAMES clAmdBlas)
endif()
# Try AMD/ATI Stream SDK
if (NOT OPENCL_FOUND)
set(ENV_AMDSTREAMSDKROOT $ENV{AMDAPPSDKROOT})
set(ENV_OPENCLROOT $ENV{OPENCLROOT})
set(ENV_CUDA_PATH $ENV{CUDA_PATH})
if(ENV_AMDSTREAMSDKROOT)
set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_AMDSTREAMSDKROOT}/include)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_AMDSTREAMSDKROOT}/lib/x86)
else()
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_AMDSTREAMSDKROOT}/lib/x86_64)
endif()
elseif(ENV_CUDA_PATH AND WIN32)
set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_CUDA_PATH}/include)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_CUDA_PATH}/lib/Win32)
else()
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_CUDA_PATH}/lib/x64)
endif()
elseif(ENV_OPENCLROOT AND UNIX)
set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_OPENCLROOT}/inc)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} /usr/lib)
else()
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} /usr/lib64)
endif()
endif()
if(OPENCL_INCLUDE_SEARCH_PATH)
find_path(OPENCL_INCLUDE_DIR
NAMES CL/cl.h OpenCL/cl.h
PATHS ${OPENCL_INCLUDE_SEARCH_PATH}
NO_DEFAULT_PATH)
else()
find_path(OPENCL_INCLUDE_DIR
NAMES CL/cl.h OpenCL/cl.h)
endif()
if(OPENCL_LIB_SEARCH_PATH)
find_library(OPENCL_LIBRARY NAMES OpenCL PATHS ${OPENCL_LIB_SEARCH_PATH} NO_DEFAULT_PATH)
else()
find_library(OPENCL_LIBRARY NAMES OpenCL)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
OPENCL
DEFAULT_MSG
OPENCL_LIBRARY OPENCL_INCLUDE_DIR
)
if(OPENCL_FOUND)
set(OPENCL_LIBRARIES ${OPENCL_LIBRARY})
set(HAVE_OPENCL 1)
else()
set(OPENCL_LIBRARIES)
endif()
set( CLAMDFFT_INCLUDE_SEARCH_PATH ${CLAMDFFT_SEARCH_PATH}/include )
if(UNIX)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CLAMDFFT_LIB_SEARCH_PATH /usr/lib)
else()
set(CLAMDFFT_LIB_SEARCH_PATH /usr/lib64)
endif()
else()
set(HAVE_OPENCL 1)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CLAMDFFT_LIB_SEARCH_PATH ${CLAMDFFT_SEARCH_PATH}\\lib32\\import)
else()
set(CLAMDFFT_LIB_SEARCH_PATH ${CLAMDFFT_SEARCH_PATH}\\lib64\\import)
endif()
endif()
find_path(CLAMDFFT_INCLUDE_DIR
NAMES clAmdFft.h
PATHS ${CLAMDFFT_INCLUDE_SEARCH_PATH}
PATH_SUFFIXES clAmdFft
NO_DEFAULT_PATH)
find_library(CLAMDFFT_LIBRARY
NAMES clAmdFft.Runtime
PATHS ${CLAMDFFT_LIB_SEARCH_PATH}
NO_DEFAULT_PATH)
if(CLAMDFFT_LIBRARY)
set(CLAMDFFT_LIBRARIES ${CLAMDFFT_LIBRARY})
else()
set(CLAMDFFT_LIBRARIES "")
endif()
endif()
if(WITH_OPENCLAMDBLAS)
set(CLAMDBLAS_SEARCH_PATH $ENV{CLAMDBLAS_PATH})
if(NOT CLAMDBLAS_SEARCH_PATH)
if(WIN32)
set( CLAMDBLAS_SEARCH_PATH "C:\\Program Files (x86)\\AMD\\clAmdBlas" )
endif()
endif()
set( CLAMDBLAS_INCLUDE_SEARCH_PATH ${CLAMDBLAS_SEARCH_PATH}/include )
if(UNIX)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CLAMDBLAS_LIB_SEARCH_PATH /usr/lib)
else()
set(CLAMDBLAS_LIB_SEARCH_PATH /usr/lib64)
endif()
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CLAMDBLAS_LIB_SEARCH_PATH ${CLAMDBLAS_SEARCH_PATH}\\lib32\\import)
else()
set(CLAMDBLAS_LIB_SEARCH_PATH ${CLAMDBLAS_SEARCH_PATH}\\lib64\\import)
endif()
endif()
find_path(CLAMDBLAS_INCLUDE_DIR
NAMES clAmdBlas.h
PATHS ${CLAMDBLAS_INCLUDE_SEARCH_PATH}
PATH_SUFFIXES clAmdBlas
NO_DEFAULT_PATH)
find_library(CLAMDBLAS_LIBRARY
NAMES clAmdBlas
PATHS ${CLAMDBLAS_LIB_SEARCH_PATH}
NO_DEFAULT_PATH)
if(CLAMDBLAS_LIBRARY)
set(CLAMDBLAS_LIBRARIES ${CLAMDBLAS_LIBRARY})
else()
set(CLAMDBLAS_LIBRARIES "")
endif()
endif()
# Try AMD/ATI Stream SDK
if (NOT OPENCL_FOUND)
set(ENV_AMDSTREAMSDKROOT $ENV{AMDAPPSDKROOT})
set(ENV_AMDAPPSDKROOT $ENV{AMDAPPSDKROOT})
set(ENV_OPENCLROOT $ENV{OPENCLROOT})
set(ENV_CUDA_PATH $ENV{CUDA_PATH})
set(ENV_INTELOCLSDKROOT $ENV{INTELOCLSDKROOT})
if(ENV_AMDSTREAMSDKROOT)
set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_AMDAPPSDKROOT}/include)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_AMDAPPSDKROOT}/lib/x86)
else()
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_AMDAPPSDKROOT}/lib/x86_64)
endif()
elseif(ENV_AMDSTREAMSDKROOT)
set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_AMDSTREAMSDKROOT}/include)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_AMDSTREAMSDKROOT}/lib/x86)
else()
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_AMDSTREAMSDKROOT}/lib/x86_64)
endif()
elseif(ENV_CUDA_PATH AND WIN32)
set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_CUDA_PATH}/include)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_CUDA_PATH}/lib/Win32)
else()
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_CUDA_PATH}/lib/x64)
endif()
elseif(ENV_OPENCLROOT AND UNIX)
set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_OPENCLROOT}/inc)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} /usr/lib)
else()
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} /usr/lib64)
endif()
elseif(ENV_INTELOCLSDKROOT)
set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_INTELOCLSDKROOT}/include)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_INTELOCLSDKROOT}/lib/x86)
else()
set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_INTELOCLSDKROOT}/lib/x64)
endif()
endif()
if(OPENCL_INCLUDE_SEARCH_PATH)
find_path(OPENCL_INCLUDE_DIR
NAMES CL/cl.h OpenCL/cl.h
PATHS ${OPENCL_INCLUDE_SEARCH_PATH}
NO_DEFAULT_PATH)
else()
find_path(OPENCL_INCLUDE_DIR
NAMES CL/cl.h OpenCL/cl.h)
endif()
if(OPENCL_LIB_SEARCH_PATH)
find_library(OPENCL_LIBRARY NAMES OpenCL PATHS ${OPENCL_LIB_SEARCH_PATH} NO_DEFAULT_PATH)
else()
find_library(OPENCL_LIBRARY NAMES OpenCL)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
OPENCL
DEFAULT_MSG
OPENCL_LIBRARY OPENCL_INCLUDE_DIR
)
if(OPENCL_FOUND)
set(OPENCL_LIBRARIES ${OPENCL_LIBRARY})
set(HAVE_OPENCL 1)
else()
set(OPENCL_LIBRARIES)
endif()
else()
set(HAVE_OPENCL 1)
endif()
endif()
+10 -3
Ver Arquivo
@@ -19,18 +19,25 @@ unset(HAVE_SPHINX CACHE)
if(PYTHON_EXECUTABLE)
if(PYTHON_VERSION_STRING)
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" PYTHON_VERSION_FULL "${PYTHON_VERSION_STRING}")
set(PYTHON_VERSION_FULL "${PYTHON_VERSION_STRING}")
else()
execute_process(COMMAND ${PYTHON_EXECUTABLE} --version
ERROR_VARIABLE PYTHON_VERSION_FULL
ERROR_STRIP_TRAILING_WHITESPACE)
string(REGEX MATCH "[0-9]+.[0-9]+" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")
string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" PYTHON_VERSION_FULL "${PYTHON_VERSION_FULL}")
endif()
if("${PYTHON_VERSION_FULL}" MATCHES "[0-9]+.[0-9]+.[0-9]+")
set(PYTHON_VERSION_FULL "${CMAKE_MATCH_0}")
elseif("${PYTHON_VERSION_FULL}" MATCHES "[0-9]+.[0-9]+")
set(PYTHON_VERSION_FULL "${CMAKE_MATCH_0}")
else()
unset(PYTHON_VERSION_FULL)
endif()
if(NOT ANDROID AND NOT IOS)
if(CMAKE_VERSION VERSION_GREATER 2.8.8)
if(CMAKE_VERSION VERSION_GREATER 2.8.8 AND PYTHON_VERSION_FULL)
find_host_package(PythonLibs ${PYTHON_VERSION_FULL} EXACT)
else()
find_host_package(PythonLibs ${PYTHON_VERSION_FULL})
+2 -2
Ver Arquivo
@@ -1,4 +1,4 @@
if(ANDROID AND NOT MIPS)
if(BUILD_TBB)
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/tbb")
include_directories(SYSTEM ${TBB_INCLUDE_DIRS})
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} tbb)
@@ -22,7 +22,7 @@ endif()
if(NOT HAVE_TBB)
set(TBB_DEFAULT_INCLUDE_DIRS
"/opt/intel/tbb" "/usr/local/include" "/usr/include"
"/opt/intel/tbb/include" "/usr/local/include" "/usr/include"
"C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB"
"C:/Program Files (x86)/tbb/include"
"C:/Program Files (x86)/tbb/include"
+1 -1
Ver Arquivo
@@ -16,7 +16,7 @@ endif()
# Source package, for "make package_source"
# ----------------------------------------------------------------------------
if(BUILD_PACKAGE)
set(TARBALL_NAME "${CMAKE_PROJECT_NAME}-${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}")
set(TARBALL_NAME "${CMAKE_PROJECT_NAME}-${OPENCV_VERSION}")
if (NOT WIN32)
if(APPLE)
set(TAR_CMD gnutar)
+32 -5
Ver Arquivo
@@ -7,11 +7,6 @@ if(WITH_TBB)
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectTBB.cmake")
endif(WITH_TBB)
# --- C= ---
if(WITH_CSTRIPES)
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCStripes.cmake")
endif(WITH_CSTRIPES)
# --- IPP ---
ocv_clear_vars(IPP_FOUND)
if(WITH_IPP)
@@ -43,3 +38,35 @@ if(WITH_EIGEN)
set(HAVE_EIGEN 1)
endif()
endif(WITH_EIGEN)
# --- C= ---
if(WITH_CSTRIPES AND NOT HAVE_TBB)
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCStripes.cmake")
else()
set(HAVE_CSTRIPES 0)
endif()
# --- OpenMP ---
if(NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/omptest.cpp")
FILE(WRITE "${_fname}" "#ifndef _OPENMP\n#error\n#endif\nint main() { return 0; }\n")
TRY_COMPILE(HAVE_OPENMP "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp" "${_fname}")
else()
set(HAVE_OPENMP 0)
endif()
# --- GCD ---
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
set(HAVE_GCD 1)
else()
set(HAVE_GCD 0)
endif()
# --- Concurrency ---
if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/concurrencytest.cpp")
FILE(WRITE "${_fname}" "#if _MSC_VER < 1600\n#error\n#endif\nint main() { return 0; }\n")
TRY_COMPILE(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp" "${_fname}")
else()
set(HAVE_CONCURRENCY 0)
endif()
+2 -1
Ver Arquivo
@@ -85,11 +85,12 @@ if(WITH_XINE)
endif(WITH_XINE)
# --- V4L ---
ocv_clear_vars(HAVE_LIBV4L HAVE_CAMV4L HAVE_CAMV4L2)
ocv_clear_vars(HAVE_LIBV4L HAVE_CAMV4L HAVE_CAMV4L2 HAVE_VIDEOIO)
if(WITH_V4L)
CHECK_MODULE(libv4l1 HAVE_LIBV4L)
CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L)
CHECK_INCLUDE_FILE(linux/videodev2.h HAVE_CAMV4L2)
CHECK_INCLUDE_FILE(sys/videoio.h HAVE_VIDEOIO)
endif(WITH_V4L)
# --- OpenNI ---
+1 -1
Ver Arquivo
@@ -20,7 +20,7 @@ if(ANDROID)
endif()
# setup lists of camera libs
foreach(abi ARMEABI ARMEABI_V7A X86)
foreach(abi ARMEABI ARMEABI_V7A X86 MIPS)
ANDROID_GET_ABI_RAWNAME(${abi} ndkabi)
if(BUILD_ANDROID_CAMERA_WRAPPER)
if(ndkabi STREQUAL ANDROID_NDK_ABI_NAME)
+11 -2
Ver Arquivo
@@ -53,6 +53,10 @@ if(OpenCV_LIB_COMPONENTS)
list(REMOVE_ITEM OPENCV_MODULES_CONFIGCMAKE ${OpenCV_LIB_COMPONENTS})
endif()
if(BUILD_FAT_JAVA_LIB AND HAVE_opencv_java)
list(APPEND OPENCV_MODULES_CONFIGCMAKE opencv_java)
endif()
macro(ocv_generate_dependencies_map_configcmake suffix configuration)
set(OPENCV_DEPENDENCIES_MAP_${suffix} "")
set(OPENCV_PROCESSED_LIBS "")
@@ -126,8 +130,13 @@ configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}/opencv" "\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}\"")
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
set(OpenCV_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_LIB_INSTALL_PATH}\"")
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_3P_LIB_INSTALL_PATH}\"")
if(ANDROID)
set(OpenCV_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/sdk/native/libs/\${ANDROID_NDK_ABI_NAME}\"")
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/sdk/native/3rdparty/libs/\${ANDROID_NDK_ABI_NAME}\"")
else()
set(OpenCV_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_LIB_INSTALL_PATH}\"")
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_3P_LIB_INSTALL_PATH}\"")
endif()
if(INSTALL_TO_MANGLED_PATHS)
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "${OPENCV_3P_LIB_INSTALL_PATH}")
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE}\"")
+9 -3
Ver Arquivo
@@ -164,6 +164,9 @@ macro(ocv_module_disable module)
set(HAVE_${__modname} OFF CACHE INTERNAL "Module ${__modname} can not be built in current configuration")
set(OPENCV_MODULE_${__modname}_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Location of ${__modname} module sources")
set(OPENCV_MODULES_DISABLED_FORCE "${OPENCV_MODULES_DISABLED_FORCE}" CACHE INTERNAL "List of OpenCV modules which can not be build in current configuration")
if(BUILD_${__modname})
# touch variable controlling build of the module to suppress "unused variable" CMake warning
endif()
unset(__modname)
return() # leave the current folder
endmacro()
@@ -171,6 +174,7 @@ endmacro()
# Internal macro; partly disables OpenCV module
macro(__ocv_module_turn_off the_module)
list(REMOVE_ITEM OPENCV_MODULES_DISABLED_AUTO "${the_module}")
list(APPEND OPENCV_MODULES_DISABLED_AUTO "${the_module}")
list(REMOVE_ITEM OPENCV_MODULES_BUILD "${the_module}")
list(REMOVE_ITEM OPENCV_MODULES_PUBLIC "${the_module}")
@@ -190,7 +194,7 @@ macro(__ocv_flatten_module_required_dependencies the_module)
break()
elseif(";${OPENCV_MODULES_DISABLED_USER};${OPENCV_MODULES_DISABLED_AUTO};" MATCHES ";${__dep};")
__ocv_module_turn_off(${the_module}) # depends on disabled module
break()
list(APPEND __flattened_deps "${__dep}")
elseif(";${OPENCV_MODULES_BUILD};" MATCHES ";${__dep};")
if(";${__resolved_deps};" MATCHES ";${__dep};")
list(APPEND __flattened_deps "${__dep}") # all dependencies of this module are already resolved
@@ -259,6 +263,7 @@ macro(__ocv_flatten_module_dependencies)
foreach(m ${OPENCV_MODULES_BUILD})
set(HAVE_${m} ON CACHE INTERNAL "Module ${m} will be built in current configuration")
__ocv_flatten_module_required_dependencies(${m})
set(OPENCV_MODULE_${m}_DEPS ${OPENCV_MODULE_${m}_DEPS} CACHE INTERNAL "Flattened required dependencies of ${m} module")
endforeach()
foreach(m ${OPENCV_MODULES_BUILD})
@@ -283,7 +288,7 @@ macro(__ocv_flatten_module_dependencies)
ocv_list_unique(OPENCV_MODULES_BUILD_)
set(OPENCV_MODULES_PUBLIC ${OPENCV_MODULES_PUBLIC} CACHE INTERNAL "List of OpenCV modules marked for export")
set(OPENCV_MODULES_BUILD ${OPENCV_MODULES_BUILD_} CACHE INTERNAL "List of OpenCV modules included into the build")
set(OPENCV_MODULES_BUILD ${OPENCV_MODULES_BUILD_} CACHE INTERNAL "List of OpenCV modules included into the build")
set(OPENCV_MODULES_DISABLED_AUTO ${OPENCV_MODULES_DISABLED_AUTO} CACHE INTERNAL "List of OpenCV modules implicitly disabled due to dependencies")
endmacro()
@@ -456,6 +461,7 @@ macro(ocv_create_module)
OUTPUT_NAME "${the_module}${OPENCV_DLLVERSION}"
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
INSTALL_NAME_DIR lib
)
@@ -465,7 +471,7 @@ macro(ocv_create_module)
# Android SDK build scripts can include only .so files into final .apk
# As result we should not set version properties for Android
set_target_properties(${the_module} PROPERTIES
VERSION ${OPENCV_VERSION}
VERSION ${OPENCV_LIBVERSION}
SOVERSION ${OPENCV_SOVERSION}
)
endif()
+10 -1
Ver Arquivo
@@ -64,6 +64,13 @@ MACRO(ocv_check_compiler_flag LANG FLAG RESULT)
else()
FILE(WRITE "${_fname}" "#pragma\nint main(void) { return 0; }\n")
endif()
elseif("_${LANG}_" MATCHES "_OBJCXX_")
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.mm")
if("${CMAKE_CXX_FLAGS} ${FLAG} " MATCHES "-Werror " OR "${CMAKE_CXX_FLAGS} ${FLAG} " MATCHES "-Werror=unknown-pragmas ")
FILE(WRITE "${_fname}" "int main() { return 0; }\n")
else()
FILE(WRITE "${_fname}" "#pragma\nint main() { return 0; }\n")
endif()
else()
unset(_fname)
endif()
@@ -100,6 +107,8 @@ macro(ocv_check_flag_support lang flag varname)
set(_lang CXX)
elseif("_${lang}_" MATCHES "_C_")
set(_lang C)
elseif("_${lang}_" MATCHES "_OBJCXX_")
set(_lang OBJCXX)
else()
set(_lang ${lang})
endif()
@@ -132,7 +141,7 @@ macro(ocv_warnings_disable)
set(${var} "${${var}} ${warning}")
endforeach()
endforeach()
elseif(CV_COMPILER_IS_GNU AND _gxx_warnings AND _flag_vars)
elseif((CMAKE_COMPILER_IS_GNUCXX OR (UNIX AND CV_ICC)) AND _gxx_warnings AND _flag_vars)
foreach(var ${_flag_vars})
foreach(warning ${_gxx_warnings})
if(NOT warning MATCHES "^-Wno-")
+11 -5
Ver Arquivo
@@ -1,12 +1,18 @@
SET(OPENCV_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/modules/core/include/opencv2/core/version.hpp")
FILE(STRINGS "${OPENCV_VERSION_FILE}" OPENCV_VERSION_PARTS REGEX "#define CV_.+OR_VERSION[ ]+[0-9]+" )
FILE(STRINGS "${OPENCV_VERSION_FILE}" OPENCV_VERSION_PARTS REGEX "#define CV_VERSION_[A-Z]+[ ]+[0-9]+" )
string(REGEX REPLACE ".+CV_MAJOR_VERSION[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_MAJOR "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_MINOR_VERSION[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_MINOR "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_SUBMINOR_VERSION[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_PATCH "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_EPOCH[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_MAJOR "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_MAJOR[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_MINOR "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_MINOR[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_PATCH "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_REVISION[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_TWEAK "${OPENCV_VERSION_PARTS}")
set(OPENCV_VERSION "${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}")
if(OPENCV_VERSION_TWEAK GREATER 0)
set(OPENCV_VERSION "${OPENCV_VERSION}.${OPENCV_VERSION_TWEAK}")
endif()
set(OPENCV_VERSION "${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}.2")
set(OPENCV_SOVERSION "${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}")
set(OPENCV_LIBVERSION "${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}")
# create a dependency on version file
# we never use output of the following command but cmake will rerun automatically if the version file changes
+17 -8
Ver Arquivo
@@ -42,7 +42,7 @@ else
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
endif
ifeq ($(TARGET_ARCH_ABI),mips)
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB@
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
endif
endif
@@ -57,6 +57,9 @@ ifeq (${OPENCV_CAMERA_MODULES},on)
ifeq ($(TARGET_ARCH_ABI),x86)
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_X86_CONFIGCMAKE@
endif
ifeq ($(TARGET_ARCH_ABI),mips)
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_MIPS_CONFIGCMAKE@
endif
else
OPENCV_CAMERA_MODULES:=
endif
@@ -89,14 +92,20 @@ define add_opencv_camera_module
include $(PREBUILT_SHARED_LIBRARY)
endef
ifeq ($(OPENCV_INSTALL_MODULES),on)
$(foreach module,$(OPENCV_LIBS),$(eval $(call add_opencv_module,$(module))))
endif
$(foreach module,$(OPENCV_3RDPARTY_COMPONENTS),$(eval $(call add_opencv_3rdparty_component,$(module))))
$(foreach module,$(OPENCV_CAMERA_MODULES),$(eval $(call add_opencv_camera_module,$(module))))
ifeq ($(OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED),)
ifeq ($(OPENCV_INSTALL_MODULES),on)
$(foreach module,$(OPENCV_LIBS),$(eval $(call add_opencv_module,$(module))))
endif
ifneq ($(OPENCV_BASEDIR),)
OPENCV_LOCAL_C_INCLUDES += $(foreach mod, $(OPENCV_MODULES), $(OPENCV_BASEDIR)/modules/$(mod)/include)
$(foreach module,$(OPENCV_3RDPARTY_COMPONENTS),$(eval $(call add_opencv_3rdparty_component,$(module))))
$(foreach module,$(OPENCV_CAMERA_MODULES),$(eval $(call add_opencv_camera_module,$(module))))
ifneq ($(OPENCV_BASEDIR),)
OPENCV_LOCAL_C_INCLUDES += $(foreach mod, $(OPENCV_MODULES), $(OPENCV_BASEDIR)/modules/$(mod)/include)
endif
#turn off module installation to prevent their redefinition
OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED:=on
endif
ifeq ($(OPENCV_LOCAL_CFLAGS),)
+32 -12
Ver Arquivo
@@ -22,10 +22,11 @@
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability
# - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API
# - OpenCV_VERSION : The version of this OpenCV build. Example: "@OPENCV_VERSION@"
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION. Example: "@OPENCV_VERSION_MAJOR@"
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION. Example: "@OPENCV_VERSION_MINOR@"
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION. Example: "@OPENCV_VERSION_PATCH@"
# - OpenCV_VERSION : The version of this OpenCV build: "@OPENCV_VERSION@"
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION: "@OPENCV_VERSION_MAJOR@"
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION: "@OPENCV_VERSION_MINOR@"
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION: "@OPENCV_VERSION_PATCH@"
# - OpenCV_VERSION_TWEAK : Tweak version part of OpenCV_VERSION: "@OPENCV_VERSION_TWEAK@"
#
# Advanced variables:
# - OpenCV_SHARED
@@ -41,8 +42,9 @@
set(OpenCV_COMPUTE_CAPABILITIES @OpenCV_CUDA_CC_CONFIGCMAKE@)
set(OpenCV_CUDA_VERSION @OpenCV_CUDA_VERSION@)
set(OpenCV_USE_CUBLAS @HAVE_CUBLAS@)
set(OpenCV_USE_CUFFT @HAVE_CUFFT@)
set(OpenCV_USE_CUBLAS @HAVE_CUBLAS@)
set(OpenCV_USE_CUFFT @HAVE_CUFFT@)
set(OpenCV_USE_NVCUVID @HAVE_NVCUVID@)
# Android API level from which OpenCV has been compiled is remembered
set(OpenCV_ANDROID_NATIVE_API_LEVEL @OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE@)
@@ -99,6 +101,7 @@ SET(OpenCV_VERSION @OPENCV_VERSION@)
SET(OpenCV_VERSION_MAJOR @OPENCV_VERSION_MAJOR@)
SET(OpenCV_VERSION_MINOR @OPENCV_VERSION_MINOR@)
SET(OpenCV_VERSION_PATCH @OPENCV_VERSION_PATCH@)
SET(OpenCV_VERSION_TWEAK @OPENCV_VERSION_TWEAK@)
# ====================================================================
# Link libraries: e.g. libopencv_core.so, opencv_imgproc220d.lib, etc...
@@ -148,6 +151,7 @@ endif()
# ==============================================================
if(NOT OpenCV_FIND_COMPONENTS)
set(OpenCV_FIND_COMPONENTS ${OpenCV_LIB_COMPONENTS})
list(REMOVE_ITEM OpenCV_FIND_COMPONENTS opencv_java)
if(GTest_FOUND OR GTEST_FOUND)
list(REMOVE_ITEM OpenCV_FIND_COMPONENTS opencv_ts)
endif()
@@ -183,7 +187,7 @@ set(OpenCV_FIND_COMPONENTS ${OpenCV_FIND_COMPONENTS_})
# Resolve dependencies
# ==============================================================
if(OpenCV_USE_MANGLED_PATHS)
set(OpenCV_LIB_SUFFIX ".${OpenCV_VERSION}")
set(OpenCV_LIB_SUFFIX ".${OpenCV_VERSION_MAJOR}.${OpenCV_VERSION_MINOR}.${OpenCV_VERSION_PATCH}")
else()
set(OpenCV_LIB_SUFFIX "")
endif()
@@ -198,7 +202,7 @@ foreach(__opttype OPT DBG)
#indicate that this module is also found
string(TOUPPER "${__cvdep}" __cvdep)
set(${__cvdep}_FOUND 1)
else()
elseif(EXISTS "${OpenCV_3RDPARTY_LIB_DIR_${__opttype}}/${OpenCV_${__cvdep}_LIBNAME_${__opttype}}")
list(APPEND OpenCV_LIBS_${__opttype} "${OpenCV_3RDPARTY_LIB_DIR_${__opttype}}/${OpenCV_${__cvdep}_LIBNAME_${__opttype}}")
endif()
endforeach()
@@ -216,17 +220,18 @@ foreach(__opttype OPT DBG)
else()
#TODO: duplicates are annoying but they should not be the problem
endif()
# fix hard coded paths for CUDA libraries under Windows
if(WIN32 AND OpenCV_CUDA_VERSION AND NOT OpenCV_SHARED)
# CUDA
if(OpenCV_CUDA_VERSION AND (CMAKE_CROSSCOMPILING OR (WIN32 AND NOT OpenCV_SHARED)))
if(NOT CUDA_FOUND)
find_package(CUDA ${OpenCV_CUDA_VERSION} EXACT REQUIRED)
else()
if(NOT CUDA_VERSION_STRING VERSION_EQUAL OpenCV_CUDA_VERSION)
message(FATAL_ERROR "OpenCV static library compiled with CUDA ${OpenCV_CUDA_VERSION} support. Please, use the same version or rebuild OpenCV with CUDA ${CUDA_VERSION_STRING}")
message(FATAL_ERROR "OpenCV static library was compiled with CUDA ${OpenCV_CUDA_VERSION} support. Please, use the same version or rebuild OpenCV with CUDA ${CUDA_VERSION_STRING}")
endif()
endif()
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY} ${CUDA_nvcuvid_LIBRARY} ${CUDA_nvcuvenc_LIBRARY})
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
if(OpenCV_USE_CUBLAS)
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_CUBLAS_LIBRARIES})
@@ -236,6 +241,13 @@ foreach(__opttype OPT DBG)
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_CUFFT_LIBRARIES})
endif()
if(OpenCV_USE_NVCUVID)
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_nvcuvid_LIBRARIES})
endif()
if(WIN32)
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_nvcuvenc_LIBRARIES})
endif()
endif()
endforeach()
@@ -293,3 +305,11 @@ else()
SET(OpenCV_LIB_DIR ${OpenCV_LIB_DIR_OPT} ${OpenCV_3RDPARTY_LIB_DIR_OPT})
endif()
set(OpenCV_LIBRARIES ${OpenCV_LIBS})
if(CMAKE_CROSSCOMPILING AND OpenCV_SHARED AND (CMAKE_SYSTEM_NAME MATCHES "Linux"))
foreach(dir ${OpenCV_LIB_DIR})
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath-link,${dir}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath-link,${dir}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-rpath-link,${dir}")
endforeach()
endif()
+15 -9
Ver Arquivo
@@ -19,6 +19,9 @@
/* V4L2 capturing support */
#cmakedefine HAVE_CAMV4L2
/* V4L2 capturing support in videoio.h */
#cmakedefine HAVE_VIDEOIO
/* V4L/V4L2 capturing support via libv4l */
#cmakedefine HAVE_LIBV4L
@@ -175,21 +178,15 @@
/* NVidia Cuda Runtime API*/
#cmakedefine HAVE_CUDA
/* OpenCL Support */
#cmakedefine HAVE_OPENCL
/* AMD's OpenCL Fast Fourier Transform Library*/
#cmakedefine HAVE_CLAMDFFT
/* AMD's Basic Linear Algebra Subprograms Library*/
#cmakedefine HAVE_CLAMDBLAS
/* NVidia Cuda Fast Fourier Transform (FFT) API*/
#cmakedefine HAVE_CUFFT
/* NVidia Cuda Basic Linear Algebra Subprograms (BLAS) API*/
#cmakedefine HAVE_CUBLAS
/* NVidia Video Decoding API*/
#cmakedefine HAVE_NVCUVID
/* Compile for 'real' NVIDIA GPU architectures */
#define CUDA_ARCH_BIN "${OPENCV_CUDA_ARCH_BIN}"
@@ -202,6 +199,15 @@
/* Create PTX or BIN for 1.0 compute capability */
#cmakedefine CUDA_ARCH_BIN_OR_PTX_10
/* OpenCL Support */
#cmakedefine HAVE_OPENCL
/* AMD's OpenCL Fast Fourier Transform Library*/
#cmakedefine HAVE_CLAMDFFT
/* AMD's Basic Linear Algebra Subprograms Library*/
#cmakedefine HAVE_CLAMDBLAS
/* VideoInput library */
#cmakedefine HAVE_VIDEOINPUT
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+16 -9
Ver Arquivo
@@ -60,7 +60,7 @@ if(BUILD_DOCS AND HAVE_SPHINX)
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_UG user_guide/*.rst)
file(GLOB_RECURSE OPENCV_FILES_TUT tutorials/*.rst)
file(GLOB_RECURSE OPENCV_FILES_TUT_PICT tutorials/*.png tutorials/*.jpg)
@@ -74,14 +74,21 @@ if(BUILD_DOCS AND HAVE_SPHINX)
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
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/patch_refman_latex.py" opencv2manager.tex
COMMAND ${PDFLATEX_COMPILER} opencv2refman.tex
COMMAND ${PDFLATEX_COMPILER} opencv2refman.tex
COMMAND ${PDFLATEX_COMPILER} opencv2manager.tex
COMMAND ${PDFLATEX_COMPILER} opencv2manager.tex
COMMAND ${PDFLATEX_COMPILER} opencv_user.tex
COMMAND ${PDFLATEX_COMPILER} opencv_user.tex
COMMAND ${PDFLATEX_COMPILER} opencv_tutorials.tex
COMMAND ${PDFLATEX_COMPILER} opencv_tutorials.tex
COMMAND ${CMAKE_COMMAND} -E echo "Generating opencv2refman.pdf"
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv2refman.tex
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv2refman.tex
COMMAND ${CMAKE_COMMAND} -E echo "Generating opencv2manager.pdf"
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv2manager.tex
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv2manager.tex
COMMAND ${CMAKE_COMMAND} -E echo "Generating opencv_user.pdf"
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv_user.tex
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv_user.tex
COMMAND ${CMAKE_COMMAND} -E echo "Generating opencv_tutorials.pdf"
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv_tutorials.tex
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv_tutorials.tex
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}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating the PDF Manuals"
+4 -1
Ver Arquivo
@@ -38,7 +38,7 @@ doc_signatures_whitelist = [
"CvArr", "CvFileStorage",
# other
"InputArray", "OutputArray",
]
] + ["CvSubdiv2D", "CvQuadEdge2D", "CvSubdiv2DPoint", "cvDrawContours"]
defines = ["cvGraphEdgeIdx", "cvFree", "CV_Assert", "cvSqrt", "cvGetGraphVtx", "cvGraphVtxIdx",
"cvCaptureFromFile", "cvCaptureFromCAM", "cvCalcBackProjectPatch", "cvCalcBackProject",
@@ -116,6 +116,8 @@ def compareSignatures(f, s):
sarg = arg[1]
ftype = re.sub(r"\b(cv|std)::", "", (farg[0] or ""))
stype = re.sub(r"\b(cv|std)::", "", (sarg[0] or ""))
ftype = re.sub(r"\s+(\*|&)$", "\\1", ftype)
stype = re.sub(r"\s+(\*|&)$", "\\1", stype)
if ftype != stype:
return False, "type of argument #" + str(idx+1) + " mismatch"
fname = farg[1] or "arg" + str(idx)
@@ -151,6 +153,7 @@ def formatSignature(s):
if idx > 0:
_str += ", "
argtype = re.sub(r"\bcv::", "", arg[0])
argtype = re.sub(r"\s+(\*|&)$", "\\1", arg[0])
bidx = argtype.find('[')
if bidx < 0:
_str += argtype + " "
+9 -6
Ver Arquivo
@@ -44,21 +44,24 @@ master_doc = 'index'
# General information about the project.
project = u'OpenCV'
copyright = u'2011-2012, opencv dev team'
copyright = u'2011-2013, opencv dev team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
version_file = open("../modules/core/include/opencv2/core/version.hpp", "rt").read()
version_major = re.search("^W*#\W*define\W+CV_MAJOR_VERSION\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
version_minor = re.search("^W*#\W*define\W+CV_MINOR_VERSION\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
version_patch = re.search("^W*#\W*define\W+CV_SUBMINOR_VERSION\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
version_epoch = re.search("^W*#\W*define\W+CV_VERSION_EPOCH\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
version_major = re.search("^W*#\W*define\W+CV_VERSION_MAJOR\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
version_minor = re.search("^W*#\W*define\W+CV_VERSION_MINOR\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
version_patch = re.search("^W*#\W*define\W+CV_VERSION_REVISION\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
# The short X.Y version.
version = version_major + '.' + version_minor
version = version_epoch + '.' + version_major
# The full version, including alpha/beta/rc tags.
release = version_major + '.' + version_minor + '.' + version_patch
release = version_epoch + '.' + version_major + '.' + version_minor
if version_patch:
release = release + '.' + version_patch
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
+57 -4
Ver Arquivo
@@ -992,6 +992,11 @@ class DefinitionParser(object):
return rv
def _parse_signature(self):
if r'CvStatModel::train' in self.definition:
# hack to skip parsing of problematic definition
self.pos = self.end
return [ArgumentDefExpr("const Mat&", "train_data", None), ArgumentDefExpr(None, self.definition[self.definition.find("["):-1], None)], False, True
self.skip_ws()
if not self.skip_string('('):
self.fail('expected parentheses for function')
@@ -1075,6 +1080,17 @@ class DefinitionParser(object):
value = None
return MemberObjDefExpr(name, visibility, static, typename, value)
def parse_enum_member_object(self):
visibility, static = self._parse_visibility_static()
typename = None
name = self._parse_type()
self.skip_ws()
if self.skip_string('='):
value = self.read_rest().strip()
else:
value = None
return MemberObjDefExpr(name, visibility, static, typename, value)
def parse_function(self):
visibility, static = self._parse_visibility_static()
if self.skip_word('explicit'):
@@ -1180,6 +1196,8 @@ class OCVObject(ObjectDescription):
def add_target_and_index(self, sigobj, sig, signode):
theid = sig#obj.get_id()
theid = re.sub(r" +", " ", theid)
if self.objtype == 'emember':
theid = re.sub(r" ?=.*", "", theid)
theid = re.sub(r"=[^,()]+\([^)]*?\)[^,)]*(,|\))", "\\1", theid)
theid = re.sub(r"=\w*[^,)(]+(,|\))", "\\1", theid)
theid = theid.replace("( ", "(").replace(" )", ")")
@@ -1293,6 +1311,25 @@ class OCVTypeObject(OCVObject):
signode += nodes.Text(' ')
self.attach_name(signode, obj.name)
class OCVEnumObject(OCVObject):
def get_index_text(self, name):
if self.objtype == 'enum':
return _('%s (enum)') % name
return ''
def parse_definition(self, parser):
return parser.parse_type_object()
def describe_signature(self, signode, obj):
self.attach_modifiers(signode, obj)
signode += addnodes.desc_annotation('enum ', 'enum ')
if obj.typename is not None:
self.attach_type(signode, obj.typename)
signode += nodes.Text(' ')
self.attach_name(signode, obj.name)
class OCVMemberObject(OCVObject):
ismember = True
@@ -1309,12 +1346,20 @@ class OCVMemberObject(OCVObject):
def describe_signature(self, signode, obj):
self.attach_modifiers(signode, obj)
self.attach_type(signode, obj.typename)
signode += nodes.Text(' ')
if obj.typename:
self.attach_type(signode, obj.typename)
signode += nodes.Text(' ')
self.attach_name(signode, obj.name)
if obj.value is not None:
signode += nodes.Text(u' = ' + obj.value)
class OCVEnumMemberObject(OCVMemberObject):
def parse_definition(self, parser):
# parent_class = self.env.temp_data.get('ocv:parent')
# if parent_class is None:
# parser.fail("missing parent structure/class")
return parser.parse_enum_member_object()
class OCVFunctionObject(OCVObject):
def attach_function(self, node, func):
@@ -1448,7 +1493,9 @@ class OCVDomain(Domain):
'pyfunction': ObjType(l_('pyfunction'), 'pyfunc'),
'pyoldfunction': ObjType(l_('pyoldfunction'), 'pyoldfunc'),
'member': ObjType(l_('member'), 'member'),
'type': ObjType(l_('type'), 'type')
'emember': ObjType(l_('emember'), 'emember'),
'type': ObjType(l_('type'), 'type'),
'enum': ObjType(l_('enum'), 'enum')
}
directives = {
@@ -1460,7 +1507,9 @@ class OCVDomain(Domain):
'pyfunction': OCVPyModulelevel,
'pyoldfunction': OCVPyOldModulelevel,
'member': OCVMemberObject,
'emember': OCVEnumMemberObject,
'type': OCVTypeObject,
'enum': OCVEnumObject,
'namespace': OCVCurrentNamespace
}
roles = {
@@ -1475,7 +1524,9 @@ class OCVDomain(Domain):
'pyfunc' : OCVPyXRefRole(),
'pyoldfunc' : OCVPyXRefRole(),
'member': OCVXRefRole(),
'type': OCVXRefRole()
'emember': OCVXRefRole(),
'type': OCVXRefRole(),
'enum': OCVXRefRole()
}
initial_data = {
'objects': {}, # fullname -> docname, objtype
@@ -1563,7 +1614,9 @@ class OCVDomain(Domain):
'pyfunction': _('Python function'),
'pyoldfunction': _('Legacy Python function'),
'member': _('C++ member'),
'emember': _('enum member'),
'type': _('C/C++ type'),
'enum': _('C/C++ enum'),
'namespace': _('C++ namespace'),
}.get(type.lname, _('%s %s') % (self.label, type.lname))
+2 -1
Ver Arquivo
@@ -67,6 +67,7 @@
\usepackage[pdftex]{color,graphicx}
\usepackage[landscape]{geometry}
\usepackage{hyperref}
\usepackage[T1]{fontenc}
\hypersetup{colorlinks=true, filecolor=black, linkcolor=black, urlcolor=blue, citecolor=black}
\graphicspath{{./images/}}
@@ -214,7 +215,7 @@
\> \texttt{for(int y = 1; y < image.rows-1; y++) \{}\\
\> \> \texttt{Vec3b* prevRow = image.ptr<Vec3b>(y-1);}\\
\> \> \texttt{Vec3b* nextRow = image.ptr<Vec3b>(y+1);}\\
\> \> \texttt{for(int x = 0; y < image.cols; x++)}\\
\> \> \texttt{for(int x = 0; x < image.cols; x++)}\\
\> \> \> \texttt{for(int c = 0; c < 3; c++)}\\
\> \> \> \texttt{ dyImage.at<Vec3b>(y,x)[c] =}\\
\> \> \> \texttt{ saturate\_cast<uchar>(}\\
@@ -53,8 +53,8 @@ As usual, after the not-so-lengthy explanation, let's go to the code:
std::cout<<"* Enter alpha [0-1]: ";
std::cin>>input;
/// We use the alpha provided by the user iff it is between 0 and 1
if( alpha >= 0 && alpha <= 1 )
/// We use the alpha provided by the user if it is between 0 and 1
if( input >= 0.0 && input <= 1.0 )
{ alpha = input; }
/// Read image ( same size, same type )
@@ -6,26 +6,28 @@ Mat - The Basic Image Container
Goal
====
We have multiple ways to acquire digital images from the real world: digital cameras, scanners, computed tomography or magnetic resonance imaging to just name a few. In every case what we (humans) see are images. However, when transforming this to our digital devices what we record are numerical values for each of the points of the image.
We have multiple ways to acquire digital images from the real world: digital cameras, scanners, computed tomography, and magnetic resonance imaging to name a few. In every case what we (humans) see are images. However, when transforming this to our digital devices what we record are numerical values for each of the points of the image.
.. image:: images/MatBasicImageForComputer.jpg
:alt: A matrix of the mirror of a car
:align: center
For example in the above image you can see that the mirror of the care is nothing more than a matrix containing all the intensity values of the pixel points. Now, how we get and store the pixels values may vary according to what fits best our need, in the end all images inside a computer world may be reduced to numerical matrices and some other information's describing the matric itself. *OpenCV* is a computer vision library whose main focus is to process and manipulate these information to find out further ones. Therefore, the first thing you need to learn and get accommodated with is how OpenCV stores and handles images.
For example in the above image you can see that the mirror of the car is nothing more than a matrix containing all the intensity values of the pixel points. How we get and store the pixels values may vary according to our needs, but in the end all images inside a computer world may be reduced to numerical matrices and other information describing the matrix itself. *OpenCV* is a computer vision library whose main focus is to process and manipulate this information. Therefore, the first thing you need to be familiar with is how OpenCV stores and handles images.
*Mat*
=====
OpenCV has been around ever since 2001. In those days the library was built around a *C* interface. In those days to store the image in the memory they used a C structure entitled *IplImage*. This is the one you'll see in most of the older tutorials and educational materials. The problem with this is that it brings to the table all the minuses of the C language. The biggest issue is the manual management. It builds on the assumption that the user is responsible for taking care of memory allocation and deallocation. While this is no issue in case of smaller programs once your code base start to grove larger and larger it will be more and more a struggle to handle all this rather than focusing on actually solving your development goal.
OpenCV has been around since 2001. In those days the library was built around a *C* interface and to store the image in the memory they used a C structure called *IplImage*. This is the one you'll see in most of the older tutorials and educational materials. The problem with this is that it brings to the table all the minuses of the C language. The biggest issue is the manual memory management. It builds on the assumption that the user is responsible for taking care of memory allocation and deallocation. While this is not a problem with smaller programs, once your code base grows it will be more of a struggle to handle all this rather than focusing on solving your development goal.
Luckily C++ came around and introduced the concept of classes making possible to build another road for the user: automatic memory management (more or less). The good news is that C++ if fully compatible with C so no compatibility issues can arise from making the change. Therefore, OpenCV with its 2.0 version introduced a new C++ interface that by taking advantage of these offers a new way of doing things. A way, in which you do not need to fiddle with memory management; making your code concise (less to write, to achieve more). The only main downside of the C++ interface is that many embedded development systems at the moment support only C. Therefore, unless you are targeting this platform, there's no point on using the *old* methods (unless you're a masochist programmer and you're asking for trouble).
Luckily C++ came around and introduced the concept of classes making easier for the user through automatic memory management (more or less). The good news is that C++ is fully compatible with C so no compatibility issues can arise from making the change. Therefore, OpenCV 2.0 introduced a new C++ interface which offered a new way of doing things which means you do not need to fiddle with memory management, making your code concise (less to write, to achieve more). The main downside of the C++ interface is that many embedded development systems at the moment support only C. Therefore, unless you are targeting embedded platforms, there's no point to using the *old* methods (unless you're a masochist programmer and you're asking for trouble).
The first thing you need to know about *Mat* is that you no longer need to manually allocate its size and release it as soon as you do not need it. While doing this is still a possibility, most of the OpenCV functions will allocate its output data manually. As a nice bonus if you pass on an already existing *Mat* object, what already has allocated the required space for the matrix, this will be reused. In other words we use at all times only as much memory as much we must to perform the task.
The first thing you need to know about *Mat* is that you no longer need to manually allocate its memory and release it as soon as you do not need it. While doing this is still a possibility, most of the OpenCV functions will allocate its output data manually. As a nice bonus if you pass on an already existing *Mat* object, which has already allocated the required space for the matrix, this will be reused. In other words we use at all times only as much memory as we need to perform the task.
*Mat* is basically a class having two data parts: the matrix header (containing information such as the size of the matrix, the method used for storing, at which address is the matrix stored and so on) and a pointer to the matrix containing the pixel values (may take any dimensionality depending on the method chosen for storing) . The matrix header size is constant. However, the size of the matrix itself may vary from image to image and usually is larger by order of magnitudes. Therefore, when you're passing on images in your program and at some point you need to create a copy of the image the big price you will need to build is for the matrix itself rather than its header. OpenCV is an image processing library. It contains a large collection of image processing functions. To solve a computational challenge most of the time you will end up using multiple functions of the library. Due to this passing on images to functions is a common practice. We should not forget that we are talking about image processing algorithms, which tend to be quite computational heavy. The last thing we want to do is to further decrease the speed of your program by making unnecessary copies of potentially *large* images.
*Mat* is basically a class with two data parts: the matrix header (containing information such as the size of the matrix, the method used for storing, at which address is the matrix stored, and so on) and a pointer to the matrix containing the pixel values (taking any dimensionality depending on the method chosen for storing) . The matrix header size is constant, however the size of the matrix itself may vary from image to image and usually is larger by orders of magnitude.
To tackle this issue OpenCV uses a reference counting system. The idea is that each *Mat* object has its own header, however the matrix may be shared between two instance of them by having their matrix pointer point to the same address. Moreover, the copy operators **will only copy the headers**, and as also copy the pointer to the large matrix too, however not the matrix itself.
OpenCV is an image processing library. It contains a large collection of image processing functions. To solve a computational challenge, most of the time you will end up using multiple functions of the library. Because of this, passing images to functions is a common practice. We should not forget that we are talking about image processing algorithms, which tend to be quite computational heavy. The last thing we want to do is further decrease the speed of your program by making unnecessary copies of potentially *large* images.
To tackle this issue OpenCV uses a reference counting system. The idea is that each *Mat* object has its own header, however the matrix may be shared between two instance of them by having their matrix pointers point to the same address. Moreover, the copy operators **will only copy the headers** and the pointer to the large matrix, not the data itself.
.. code-block:: cpp
:linenos:
@@ -37,7 +39,7 @@ To tackle this issue OpenCV uses a reference counting system. The idea is that e
C = A; // Assignment operator
All the above objects, in the end point to the same single data matrix. Their headers are different, however making any modification using either one of them will affect all the other ones too. In practice the different objects just provide different access method to the same underlying data. Nevertheless, their header parts are different. The real interesting part comes that you can create headers that refer only to a subsection of the full data. For example, to create a region of interest (*ROI*) in an image you just create a new header with the new boundaries:
All the above objects, in the end, point to the same single data matrix. Their headers are different, however, and making a modification using any of them will affect all the other ones as well. In practice the different objects just provide different access method to the same underlying data. Nevertheless, their header parts are different. The real interesting part is that you can create headers which refer to only a subsection of the full data. For example, to create a region of interest (*ROI*) in an image you just create a new header with the new boundaries:
.. code-block:: cpp
:linenos:
@@ -45,7 +47,7 @@ All the above objects, in the end point to the same single data matrix. Their he
Mat D (A, Rect(10, 10, 100, 100) ); // using a rectangle
Mat E = A(Range:all(), Range(1,3)); // using row and column boundaries
Now you may ask if the matrix itself may belong to multiple *Mat* objects who will take responsibility for its cleaning when it's no longer needed. The short answer is: the last object that used it. For this a reference counting mechanism is used. Whenever somebody copies a header of a *Mat* object a counter is increased for the matrix. Whenever a header is cleaned this counter is decreased. When the counter reaches zero the matrix too is freed. Because, sometimes you will still want to copy the matrix itself too, there exists the :basicstructures:`clone() <mat-clone>` or the :basicstructures:`copyTo() <mat-copyto>` function.
Now you may ask if the matrix itself may belong to multiple *Mat* objects who takes responsibility for cleaning it up when it's no longer needed. The short answer is: the last object that used it. This is handled by using a reference counting mechanism. Whenever somebody copies a header of a *Mat* object, a counter is increased for the matrix. Whenever a header is cleaned this counter is decreased. When the counter reaches zero the matrix too is freed. Sometimes you will want to copy the matrix itself too, so OpenCV provides the :basicstructures:`clone() <mat-clone>` and :basicstructures:`copyTo() <mat-copyto>` functions.
.. code-block:: cpp
:linenos:
@@ -59,34 +61,34 @@ Now modifying *F* or *G* will not affect the matrix pointed by the *Mat* header.
.. container:: enumeratevisibleitemswithsquare
* Output image allocation for OpenCV functions is automatic (unless specified otherwise).
* No need to think about memory freeing with OpenCVs C++ interface.
* The assignment operator and the copy constructor (*ctor*)copies only the header.
* Use the :basicstructures:`clone()<mat-clone>` or the :basicstructures:`copyTo() <mat-copyto>` function to copy the underlying matrix of an image.
* You do not need to think about memory management with OpenCVs C++ interface.
* The assignment operator and the copy constructor only copies the header.
* The underlying matrix of an image may be copied using the :basicstructures:`clone()<mat-clone>` and :basicstructures:`copyTo() <mat-copyto>` functions.
*Storing* methods
=================
This is about how you store the pixel values. You can select the color space and the data type used. The color space refers to how we combine color components in order to code a given color. The simplest one is the gray scale. Here the colors at our disposal are black and white. The combination of these allows us to create many shades of gray.
This is about how you store the pixel values. You can select the color space and the data type used. The color space refers to how we combine color components in order to code a given color. The simplest one is the gray scale where the colors at our disposal are black and white. The combination of these allows us to create many shades of gray.
For *colorful* ways we have a lot more of methods to choose from. However, every one of them breaks it down to three or four basic components and the combination of this will give all others. The most popular one of this is RGB, mainly because this is also how our eye builds up colors in our eyes. Its base colors are red, green and blue. To code the transparency of a color sometimes a fourth element: alpha (A) is added.
For *colorful* ways we have a lot more methods to choose from. Each of them breaks it down to three or four basic components and we can use the combination of these to create the others. The most popular one is RGB, mainly because this is also how our eye builds up colors. Its base colors are red, green and blue. To code the transparency of a color sometimes a fourth element: alpha (A) is added.
However, they are many color systems each with their own advantages:
There are, however, many other color systems each with their own advantages:
.. container:: enumeratevisibleitemswithsquare
* RGB is the most common as our eyes use something similar, our display systems also compose colors using these.
* The HSV and HLS decompose colors into their hue, saturation and value/luminance components, which is a more natural way for us to describe colors. Using you may for example dismiss the last component, making your algorithm less sensible to light conditions of the input image.
* The HSV and HLS decompose colors into their hue, saturation and value/luminance components, which is a more natural way for us to describe colors. You might, for example, dismiss the last component, making your algorithm less sensible to the light conditions of the input image.
* YCrCb is used by the popular JPEG image format.
* CIE L*a*b* is a perceptually uniform color space, which comes handy if you need to measure the *distance* of a given color to another color.
Now each of the building components has their own valid domains. This leads to the data type used. How we store a component defines just how fine control we have over its domain. The smallest data type possible is *char*, which means one byte or 8 bits. This may be unsigned (so can store values from 0 to 255) or signed (values from -127 to +127). Although in case of three components this already gives 16 million possible colors to represent (like in case of RGB) we may acquire an even finer control by using the float (4 byte = 32 bit) or double (8 byte = 64 bit) data types for each component. Nevertheless, remember that increasing the size of a component also increases the size of the whole picture in the memory.
Each of the building components has their own valid domains. This leads to the data type used. How we store a component defines the control we have over its domain. The smallest data type possible is *char*, which means one byte or 8 bits. This may be unsigned (so can store values from 0 to 255) or signed (values from -127 to +127). Although in case of three components this already gives 16 million possible colors to represent (like in case of RGB) we may acquire an even finer control by using the float (4 byte = 32 bit) or double (8 byte = 64 bit) data types for each component. Nevertheless, remember that increasing the size of a component also increases the size of the whole picture in the memory.
Creating explicitly a *Mat* object
Creating a *Mat* object explicitly
==================================
In the :ref:`Load_Save_Image` tutorial you could already see how to write a matrix to an image file by using the :readWriteImageVideo:` imwrite() <imwrite>` function. However, for debugging purposes it's much more convenient to see the actual values. You can achieve this via the << operator of *Mat*. However, be aware that this only works for two dimensional matrices.
In the :ref:`Load_Save_Image` tutorial you have already learned how to write a matrix to an image file by using the :readWriteImageVideo:` imwrite() <imwrite>` function. However, for debugging purposes it's much more convenient to see the actual values. You can do this using the << operator of *Mat*. Be aware that this only works for two dimensional matrices.
Although *Mat* is a great class as image container it is also a general matrix class. Therefore, it is possible to create and manipulate multidimensional matrices. You can create a Mat object in multiple ways:
Although *Mat* works really well as an image container, it is also a general matrix class. Therefore, it is possible to create and manipulate multidimensional matrices. You can create a Mat object in multiple ways:
.. container:: enumeratevisibleitemswithsquare
@@ -103,13 +105,13 @@ Although *Mat* is a great class as image container it is also a general matrix c
For two dimensional and multichannel images we first define their size: row and column count wise.
Then we need to specify the data type to use for storing the elements and the number of channels per matrix point. To do this we have multiple definitions made according to the following convention:
Then we need to specify the data type to use for storing the elements and the number of channels per matrix point. To do this we have multiple definitions constructed according to the following convention:
.. code-block:: cpp
CV_[The number of bits per item][Signed or Unsigned][Type Prefix]C[The channel number]
For instance, *CV_8UC3* means we use unsigned char types that are 8 bit long and each pixel has three items of this to form the three channels. This are predefined for up to four channel numbers. The :basicstructures:`Scalar <scalar>` is four element short vector. Specify this and you can initialize all matrix points with a custom value. However if you need more you can create the type with the upper macro and putting the channel number in parenthesis as you can see below.
For instance, *CV_8UC3* means we use unsigned char types that are 8 bit long and each pixel has three of these to form the three channels. This are predefined for up to four channel numbers. The :basicstructures:`Scalar <scalar>` is four element short vector. Specify this and you can initialize all matrix points with a custom value. If you need more you can create the type with the upper macro, setting the channel number in parenthesis as you can see below.
+ Use C\\C++ arrays and initialize via constructor
@@ -118,7 +120,7 @@ Although *Mat* is a great class as image container it is also a general matrix c
:tab-width: 4
:lines: 35-36
The upper example shows how to create a matrix with more than two dimensions. Specify its dimension, then pass a pointer containing the size for each dimension and the rest remains the same.
The upper example shows how to create a matrix with more than two dimensions. Specify its dimension, then pass a pointer containing the size for each dimension and the rest remains the same.
+ Create a header for an already existing IplImage pointer:
@@ -176,7 +178,7 @@ Although *Mat* is a great class as image container it is also a general matrix c
.. note::
You can fill out a matrix with random values using the :operationsOnArrays:`randu() <randu>` function. You need to give the lower and upper value between what you want the random values:
You can fill out a matrix with random values using the :operationsOnArrays:`randu() <randu>` function. You need to give the lower and upper value for the random values:
.. literalinclude:: ../../../../samples/cpp/tutorial_code/core/mat_the_basic_image_container/mat_the_basic_image_container.cpp
:language: cpp
@@ -184,10 +186,10 @@ Although *Mat* is a great class as image container it is also a general matrix c
:lines: 57-58
Print out formatting
====================
Output formatting
=================
In the above examples you could see the default formatting option. Nevertheless, OpenCV allows you to format your matrix output format to fit the rules of:
In the above examples you could see the default formatting option. OpenCV, however, allows you to format your matrix output:
.. container:: enumeratevisibleitemswithsquare
@@ -246,10 +248,10 @@ In the above examples you could see the default formatting option. Nevertheless,
:alt: Default Output
:align: center
Print for other common items
Output of other common items
============================
OpenCV offers support for print of other common OpenCV data structures too via the << operator like:
OpenCV offers support for output of other common OpenCV data structures too via the << operator:
.. container:: enumeratevisibleitemswithsquare
@@ -298,9 +300,9 @@ OpenCV offers support for print of other common OpenCV data structures too via t
:alt: Default Output
:align: center
Most of the samples here have been included into a small console application. You can download it from :download:`here <../../../../samples/cpp/tutorial_code/core/mat_the_basic_image_container/mat_the_basic_image_container.cpp>` or in the core section of the cpp samples.
Most of the samples here have been included in a small console application. You can download it from :download:`here <../../../../samples/cpp/tutorial_code/core/mat_the_basic_image_container/mat_the_basic_image_container.cpp>` or in the core section of the cpp samples.
A quick video demonstration of this you can find on `YouTube <https://www.youtube.com/watch?v=1tibU7vGWpk>`_.
You can also find a quick video demonstration of this on `YouTube <https://www.youtube.com/watch?v=1tibU7vGWpk>`_.
.. raw:: html
+3 -1
Ver Arquivo
@@ -8,4 +8,6 @@
.. |Author_FernandoI| unicode:: Fernando U+0020 Iglesias U+0020 Garc U+00ED a
.. |Author_EduardF| unicode:: Eduard U+0020 Feicho
.. |Author_AlexB| unicode:: Alexandre U+0020 Benoit
.. |Author_EricCh| unicode:: Eric U+0020 Christiansen
.. |Author_AndreyP| unicode:: Andrey U+0020 Pavlenko
.. |Author_AlexS| unicode:: Alexander U+0020 Smorkalov
@@ -32,6 +32,7 @@ This tutorial code's is shown lines below. You can also download it from `here <
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/features2d.hpp"
using namespace cv;
@@ -22,127 +22,8 @@ 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>`_
.. code-block:: cpp
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
/// Global variables
Mat src, src_gray;
Mat myHarris_dst; Mat myHarris_copy; Mat Mc;
Mat myShiTomasi_dst; Mat myShiTomasi_copy;
int myShiTomasi_qualityLevel = 50;
int myHarris_qualityLevel = 50;
int max_qualityLevel = 100;
double myHarris_minVal; double myHarris_maxVal;
double myShiTomasi_minVal; double myShiTomasi_maxVal;
RNG rng(12345);
char* myHarris_window = "My Harris corner detector";
char* myShiTomasi_window = "My Shi Tomasi corner detector";
/// Function headers
void myShiTomasi_function( int, void* );
void myHarris_function( int, void* );
/** @function main */
int main( int argc, char** argv )
{
/// Load source image and convert it to gray
src = imread( argv[1], 1 );
cvtColor( src, src_gray, CV_BGR2GRAY );
/// Set some parameters
int blockSize = 3; int apertureSize = 3;
/// My Harris matrix -- Using cornerEigenValsAndVecs
myHarris_dst = Mat::zeros( src_gray.size(), CV_32FC(6) );
Mc = Mat::zeros( src_gray.size(), CV_32FC1 );
cornerEigenValsAndVecs( src_gray, myHarris_dst, blockSize, apertureSize, BORDER_DEFAULT );
/* calculate Mc */
for( int j = 0; j < src_gray.rows; j++ )
{ for( int i = 0; i < src_gray.cols; i++ )
{
float lambda_1 = myHarris_dst.at<float>( j, i, 0 );
float lambda_2 = myHarris_dst.at<float>( j, i, 1 );
Mc.at<float>(j,i) = lambda_1*lambda_2 - 0.04*pow( ( lambda_1 + lambda_2 ), 2 );
}
}
minMaxLoc( Mc, &myHarris_minVal, &myHarris_maxVal, 0, 0, Mat() );
/* Create Window and Trackbar */
namedWindow( myHarris_window, CV_WINDOW_AUTOSIZE );
createTrackbar( " Quality Level:", myHarris_window, &myHarris_qualityLevel, max_qualityLevel,
myHarris_function );
myHarris_function( 0, 0 );
/// My Shi-Tomasi -- Using cornerMinEigenVal
myShiTomasi_dst = Mat::zeros( src_gray.size(), CV_32FC1 );
cornerMinEigenVal( src_gray, myShiTomasi_dst, blockSize, apertureSize, BORDER_DEFAULT );
minMaxLoc( myShiTomasi_dst, &myShiTomasi_minVal, &myShiTomasi_maxVal, 0, 0, Mat() );
/* Create Window and Trackbar */
namedWindow( myShiTomasi_window, CV_WINDOW_AUTOSIZE );
createTrackbar( " Quality Level:", myShiTomasi_window, &myShiTomasi_qualityLevel, max_qualityLevel,
myShiTomasi_function );
myShiTomasi_function( 0, 0 );
waitKey(0);
return(0);
}
/** @function myShiTomasi_function */
void myShiTomasi_function( int, void* )
{
myShiTomasi_copy = src.clone();
if( myShiTomasi_qualityLevel < 1 ) { myShiTomasi_qualityLevel = 1; }
for( int j = 0; j < src_gray.rows; j++ )
{ for( int i = 0; i < src_gray.cols; i++ )
{
if( myShiTomasi_dst.at<float>(j,i) > myShiTomasi_minVal + ( myShiTomasi_maxVal -
myShiTomasi_minVal )*myShiTomasi_qualityLevel/max_qualityLevel )
{ circle( myShiTomasi_copy, Point(i,j), 4, Scalar( rng.uniform(0,255),
rng.uniform(0,255), rng.uniform(0,255) ), -1, 8, 0 ); }
}
}
imshow( myShiTomasi_window, myShiTomasi_copy );
}
/** @function myHarris_function */
void myHarris_function( int, void* )
{
myHarris_copy = src.clone();
if( myHarris_qualityLevel < 1 ) { myHarris_qualityLevel = 1; }
for( int j = 0; j < src_gray.rows; j++ )
{ for( int i = 0; i < src_gray.cols; i++ )
{
if( Mc.at<float>(j,i) > myHarris_minVal + ( myHarris_maxVal - myHarris_minVal )
*myHarris_qualityLevel/max_qualityLevel )
{ circle( myHarris_copy, Point(i,j), 4, Scalar( rng.uniform(0,255), rng.uniform(0,255),
rng.uniform(0,255) ), -1, 8, 0 ); }
}
}
imshow( myHarris_window, myHarris_copy );
}
.. literalinclude:: ../../../../../samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp
:language: cpp
Explanation
============
@@ -16,7 +16,7 @@ Today it is common to have a digital video recording system at your disposal. Th
The source code
===============
As a test case where to show off these using OpenCV I've created a small program that reads in two video files and performs a similarity check between them. This is something you could use to check just how well a new video compressing algorithms works. Let there be a reference (original) video like :download:`this small Megamind clip <../../../../samples/cpp/tutorial_code/highgui/video-input-psnr-ssim/video/Megamind.avi>` and :download:`a compressed version of it <../../../../samples/cpp/tutorial_code/highgui/video-input-psnr-ssim/video/Megamind_bugy.avi>`. You may also find the source code and these video file in the :file:`samples/cpp/tutorial_code/highgui/video-input-psnr-ssim/` folder of the OpenCV source library.
As a test case where to show off these using OpenCV I've created a small program that reads in two video files and performs a similarity check between them. This is something you could use to check just how well a new video compressing algorithms works. Let there be a reference (original) video like :download:`this small Megamind clip <../../../../samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/video/Megamind.avi>` and :download:`a compressed version of it <../../../../samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/video/Megamind_bugy.avi>`. You may also find the source code and these video file in the :file:`samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/` folder of the OpenCV source library.
.. literalinclude:: ../../../../samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/video-input-psnr-ssim.cpp
:language: cpp
@@ -36,7 +36,6 @@ You may also find the source code and these video file in the :file:`samples/cpp
:language: cpp
:linenos:
:tab-width: 4
:lines: 1-8, 21-22, 24-97
The structure of a video
========================
@@ -48,10 +48,10 @@ The structure of package contents looks as follows:
::
OpenCV-2.4.3-android-sdk
OpenCV-2.4.4-android-sdk
|_ apk
| |_ OpenCV_2.4.3_binary_pack_armv7a.apk
| |_ OpenCV_2.4.3_Manager_2.0_XXX.apk
| |_ OpenCV_2.4.4_binary_pack_armv7a.apk
| |_ OpenCV_2.4.4_Manager_2.6_XXX.apk
|
|_ doc
|_ samples
@@ -157,10 +157,10 @@ Get the OpenCV4Android SDK
.. code-block:: bash
unzip ~/Downloads/OpenCV-2.4.3-android-sdk.zip
unzip ~/Downloads/OpenCV-2.4.4-android-sdk.zip
.. |opencv_android_bin_pack| replace:: OpenCV-2.4.3.2-android-sdk.zip
.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.3/OpenCV-2.4.3.2-android-sdk.zip/download
.. |opencv_android_bin_pack| replace:: :file:`OpenCV-2.4.4-android-sdk.zip`
.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.4/OpenCV-2.4.4-android-sdk.zip/download
.. |opencv_android_bin_pack_url| replace:: |opencv_android_bin_pack|
.. |seven_zip| replace:: 7-Zip
.. _seven_zip: http://www.7-zip.org/
@@ -184,7 +184,7 @@ Import OpenCV library and samples to the Eclipse
You can simply reference it in your projects.
Each sample included into the |opencv_android_bin_pack| is a regular Android project that already
references OpenCV library.Follow the steps below to import OpenCV and samples into the workspace:
references OpenCV library. Follow the steps below to import OpenCV and samples into the workspace:
.. note:: OpenCV samples are indeed **dependent** on OpenCV library project so don't forget to import it to your workspace as well.
@@ -246,8 +246,8 @@ Running OpenCV Samples
----------------------
At this point you should be able to build and run the samples. Keep in mind, that
``face-detection``, ``Tutorial 3` and ``Tutorial 4`` include some native code and
require Android NDK and CDT plugin for Eclipse to build working applications. If you haven't
``face-detection`` and ``Tutorial 2 - Mixed Processing`` include some native code and
require Android NDK and NDK/CDT plugin for Eclipse to build working applications. If you haven't
installed these tools, see the corresponding section of :ref:`Android_Dev_Intro`.
.. warning:: Please consider that some samples use Android Java Camera API, which is accessible
@@ -295,7 +295,7 @@ Well, running samples from Eclipse is very simple:
.. code-block:: sh
:linenos:
<Android SDK path>/platform-tools/adb install <OpenCV4Android SDK path>/apk/OpenCV_2.4.3_Manager_armv7a-neon.apk
<Android SDK path>/platform-tools/adb install <OpenCV4Android SDK path>/apk/OpenCV_2.4.4_Manager_2.6_armv7a-neon.apk
.. note:: ``armeabi``, ``armv7a-neon``, ``arm7a-neon-android8``, ``mips`` and ``x86`` stand for
platform targets:
@@ -326,15 +326,16 @@ Well, running samples from Eclipse is very simple:
When done, you will be able to run OpenCV samples on your device/emulator seamlessly.
* Here is ``Tutorial 2 - Use OpenCV Camera`` sample, running on top of stock camera-preview of the emulator.
* Here is ``Sample - image-manipulations`` sample, running on top of stock camera-preview of the emulator.
.. image:: images/emulator_canny.png
:height: 600px
:alt: Tutorial 1 Basic - 1. Add OpenCV - running Canny
:alt: 'Sample - image-manipulations' running Canny
:align: center
What's next
===========
Now, when you have your instance of OpenCV4Adroid SDK set up and configured, you may want to proceed to using OpenCV in your own application. You can learn how to do that in a separate :ref:`dev_with_OCV_on_Android` tutorial.
Now, when you have your instance of OpenCV4Adroid SDK set up and configured,
you may want to proceed to using OpenCV in your own application.
You can learn how to do that in a separate :ref:`dev_with_OCV_on_Android` tutorial.
@@ -103,8 +103,8 @@ You need the following software to be installed in order to develop for Android
Here is Google's `install guide <http://developer.android.com/sdk/installing.html>`_ for the SDK.
.. note:: You can choose downloading ``ADT Bundle package`` that in addition to Android SDK Tools includes
Eclipse + ADT + CDT plugins, Android Platform-tools, the latest Android platform and the latest
.. note:: You can choose downloading **ADT Bundle package** that in addition to Android SDK Tools includes
Eclipse + ADT + NDK/CDT plugins, Android Platform-tools, the latest Android platform and the latest
Android system image for the emulator - this is the best choice for those who is setting up Android
development environment the first time!
@@ -112,15 +112,15 @@ You need the following software to be installed in order to develop for Android
for use on amd64 and ia64 systems to be installed. You can install them with the
following command:
.. code-block:: bash
.. code-block:: bash
sudo apt-get install ia32-libs
sudo apt-get install ia32-libs
For Red Hat based systems the following command might be helpful:
For Red Hat based systems the following command might be helpful:
.. code-block:: bash
.. code-block:: bash
sudo yum install libXtst.i386
sudo yum install libXtst.i386
#. **Android SDK components**
@@ -148,7 +148,7 @@ You need the following software to be installed in order to develop for Android
Check the `Android SDK System Requirements <http://developer.android.com/sdk/requirements.html>`_
document for a list of Eclipse versions that are compatible with the Android SDK.
For OpenCV 2.4.x we recommend **Eclipse 3.7 (Indigo)** or later versions. They work well for
For OpenCV 2.4.x we recommend **Eclipse 3.7 (Indigo)** or **Eclipse 4.2 (Juno)**. They work well for
OpenCV under both Windows and Linux.
If you have no Eclipse installed, you can get it from the `official site <http://www.eclipse.org/downloads/>`_.
@@ -210,9 +210,9 @@ You need the following software to be installed in order to develop for Android
.. note:: Before start you can read official Android NDK documentation which is in the Android
NDK archive, in the folder :file:`docs/`.
The main article about using Android NDK build system is in the :file:`ANDROID-MK.html` file.
Some additional information you can find in the :file:`APPLICATION-MK.html`,
:file:`NDK-BUILD.html` files, and :file:`CPU-ARM-NEON.html`, :file:`CPLUSPLUS-SUPPORT.html`,
:file:`PREBUILTS.html`.
Some additional information you can find in
the :file:`APPLICATION-MK.html`, :file:`NDK-BUILD.html` files,
and :file:`CPU-ARM-NEON.html`, :file:`CPLUSPLUS-SUPPORT.html`, :file:`PREBUILTS.html`.
#. **CDT plugin for Eclipse**
@@ -1,13 +1,13 @@
.. _dev_with_OCV_on_Android:
Android development with OpenCV
Android Development with OpenCV
*******************************
This tutorial is created to help you use OpenCV library within your Android project.
This tutorial has been created to help you use OpenCV library within your Android project.
This guide was written with Windows 7 in mind, though it should work with any other OS supported by OpenCV4Android SDK.
This guide was written with Windows 7 in mind, though it should work with any other OS supported by
OpenCV4Android SDK.
This tutorial assumes you have the following installed and configured:
@@ -23,109 +23,132 @@ This tutorial assumes you have the following installed and configured:
If you need help with anything of the above, you may refer to our :ref:`android_dev_intro` guide.
This tutorial also assumes you have OpenCV4Android SDK already installed on your development machine and OpenCV Manager on your testing device correspondingly. If you need help with any of these, you may consult our :ref:`O4A_SDK` tutorial.
This tutorial also assumes you have OpenCV4Android SDK already installed on your development
machine and OpenCV Manager on your testing device correspondingly. If you need help with any of
these, you may consult our :ref:`O4A_SDK` tutorial.
If you encounter any error after thoroughly following these steps, feel free to contact us via `OpenCV4Android <https://groups.google.com/group/android-opencv/>`_ discussion group or OpenCV `Q&A forum <http://answers.opencv.org>`_ . We'll do our best to help you out.
If you encounter any error after thoroughly following these steps, feel free to contact us via
`OpenCV4Android <https://groups.google.com/group/android-opencv/>`_ discussion group or OpenCV
`Q&A forum <http://answers.opencv.org>`_ . We'll do our best to help you out.
Using OpenCV library within your Android project
Using OpenCV Library Within Your Android Project
================================================
In this section we will explain how to make some existing project to use OpenCV.
Starting with 2.4.2 release for Android, *OpenCV Manager* is used to provide apps with the best available version of OpenCV.
You can get more information here: :ref:`Android_OpenCV_Manager` and in these `slides <https://docs.google.com/a/itseez.com/presentation/d/1EO_1kijgBg_BsjNp2ymk-aarg-0K279_1VZRcPplSuk/present#slide=id.p>`_.
In this section we will explain how to make some existing project to use OpenCV.
Starting with 2.4.2 release for Android, *OpenCV Manager* is used to provide apps with the best
available version of OpenCV.
You can get more information here: :ref:`Android_OpenCV_Manager` and in these
`slides <https://docs.google.com/a/itseez.com/presentation/d/1EO_1kijgBg_BsjNp2ymk-aarg-0K279_1VZRcPplSuk/present#slide=id.p>`_.
Java
----
Application development with async initialization
Application Development with Async Initialization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using async initialization is a **recommended** way for application development. It uses the OpenCV Manager to access OpenCV libraries externally installed in the target system.
Using async initialization is a **recommended** way for application development. It uses the OpenCV
Manager to access OpenCV libraries externally installed in the target system.
#. Add OpenCV library project to your workspace. Use menu :guilabel:`File -> Import -> Existing project in your workspace`,
press :guilabel:`Browse` button and locate OpenCV4Android SDK (:file:`OpenCV-2.4.3-android-sdk/sdk`).
#. Add OpenCV library project to your workspace. Use menu
:guilabel:`File -> Import -> Existing project in your workspace`.
Press :guilabel:`Browse` button and locate OpenCV4Android SDK
(:file:`OpenCV-2.4.4-android-sdk/sdk`).
.. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library
:align: center
#. In application project add a reference to the OpenCV Java SDK in :guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.3``.
#. In application project add a reference to the OpenCV Java SDK in
:guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.4``.
.. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library
:align: center
In most cases OpenCV Manager may be installed automatically from Google Play. For such case, when Google Play is not available, i.e. emulator, developer board, etc, you can
install it manually using adb tool. See :ref:`manager_selection` for details.
In most cases OpenCV Manager may be installed automatically from Google Play. For the case, when
Google Play is not available, i.e. emulator, developer board, etc, you can install it manually
using adb tool. See :ref:`manager_selection` for details.
There is a very base code snippet implementing the async initialization. It shows basic principles. See the "15-puzzle" OpenCV sample for details.
There is a very base code snippet implementing the async initialization. It shows basic principles.
See the "15-puzzle" OpenCV sample for details.
.. code-block:: java
:linenos:
public class MyActivity extends Activity implements HelperCallbackInterface
{
private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
{
Log.i(TAG, "OpenCV loaded successfully");
// Create and set View
mView = new puzzle15View(mAppContext);
setContentView(mView);
} break;
default:
{
super.onManagerConnected(status);
} break;
}
}
};
public class Sample1Java extends Activity implements CvCameraViewListener {
/** Call on every application resume **/
@Override
protected void onResume()
{
Log.i(TAG, "called onResume");
super.onResume();
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
{
Log.i(TAG, "OpenCV loaded successfully");
mOpenCvCameraView.enableView();
} break;
default:
{
super.onManagerConnected(status);
} break;
}
}
};
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))
@Override
public void onResume()
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
super.onResume();
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback);
}
...
}
It this case application works with OpenCV Manager in asynchronous fashion. ``OnManagerConnected`` callback will be called in UI thread, when initialization finishes.
Please note, that it is not allowed to use OpenCV calls or load OpenCV-dependent native libs before invoking this callback.
Load your own native libraries that depend on OpenCV after the successful OpenCV initialization.
Default BaseLoaderCallback implementation treat application context as Activity and calls Activity.finish() method to exit in case of initialization failure.
To override this behavior you need to override finish() method of BaseLoaderCallback class and implement your own finalization method.
It this case application works with OpenCV Manager in asynchronous fashion. ``OnManagerConnected``
callback will be called in UI thread, when initialization finishes. Please note, that it is not
allowed to use OpenCV calls or load OpenCV-dependent native libs before invoking this callback.
Load your own native libraries that depend on OpenCV after the successful OpenCV initialization.
Default ``BaseLoaderCallback`` implementation treat application context as Activity and calls
``Activity.finish()`` method to exit in case of initialization failure. To override this behavior
you need to override ``finish()`` method of ``BaseLoaderCallback`` class and implement your own
finalization method.
Application development with static initialization
Application Development with Static Initialization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
According to this approach all OpenCV binaries are included into your application package. It is designed mostly for development purposes.
This approach is deprecated for the production code, release package is recommended to communicate with OpenCV Manager via the async initialization described above.
According to this approach all OpenCV binaries are included into your application package. It is
designed mostly for development purposes. This approach is deprecated for the production code,
release package is recommended to communicate with OpenCV Manager via the async initialization
described above.
#. Add the OpenCV library project to your workspace the same way as for the async initialization above.
Use menu :guilabel:`File -> Import -> Existing project in your workspace`, push :guilabel:`Browse` button and select OpenCV SDK path (:file:`OpenCV-2.4.3-android-sdk/sdk`).
#. Add the OpenCV library project to your workspace the same way as for the async initialization
above. Use menu :guilabel:`File -> Import -> Existing project in your workspace`,
press :guilabel:`Browse` button and select OpenCV SDK path
(:file:`OpenCV-2.4.4-android-sdk/sdk`).
.. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library
:align: center
#. In the application project add a reference to the OpenCV4Android SDK in :guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.3``;
#. In the application project add a reference to the OpenCV4Android SDK in
:guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.4``;
.. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library
:align: center
#. If your application project **doesn't have a JNI part**, just copy the corresponding OpenCV native libs from :file:`<OpenCV-2.4.3-android-sdk>/sdk/native/libs/<target_arch>` to your project directory to folder :file:`libs/<target_arch>`.
#. If your application project **doesn't have a JNI part**, just copy the corresponding OpenCV
native libs from :file:`<OpenCV-2.4.4-android-sdk>/sdk/native/libs/<target_arch>` to your
project directory to folder :file:`libs/<target_arch>`.
In case of the application project **with a JNI part**, instead of manual libraries copying you need to modify your ``Android.mk`` file:
add the following two code lines after the ``"include $(CLEAR_VARS)"`` and before ``"include path_to_OpenCV-2.4.3-android-sdk/sdk/native/jni/OpenCV.mk"``
In case of the application project **with a JNI part**, instead of manual libraries copying you
need to modify your ``Android.mk`` file:
add the following two code lines after the ``"include $(CLEAR_VARS)"`` and before
``"include path_to_OpenCV-2.4.4-android-sdk/sdk/native/jni/OpenCV.mk"``
.. code-block:: make
:linenos:
@@ -145,12 +168,14 @@ This approach is deprecated for the production code, release package is recommen
OPENCV_INSTALL_MODULES:=on
include ../../sdk/native/jni/OpenCV.mk
After that the OpenCV libraries will be copied to your application :file:`libs` folder during the JNI part build.
After that the OpenCV libraries will be copied to your application :file:`libs` folder during
the JNI build.v
Eclipse will automatically include all the libraries from the :file:`libs` folder to the application package (APK).
Eclipse will automatically include all the libraries from the :file:`libs` folder to the
application package (APK).
#. The last step of enabling OpenCV in your application is Java initialization code before call to OpenCV API.
It can be done, for example, in the static section of the ``Activity`` class:
#. The last step of enabling OpenCV in your application is Java initialization code before calling
OpenCV API. It can be done, for example, in the static section of the ``Activity`` class:
.. code-block:: java
:linenos:
@@ -161,7 +186,8 @@ This approach is deprecated for the production code, release package is recommen
}
}
If you application includes other OpenCV-dependent native libraries you should load them **after** OpenCV initialization:
If you application includes other OpenCV-dependent native libraries you should load them
**after** OpenCV initialization:
.. code-block:: java
:linenos:
@@ -175,39 +201,45 @@ This approach is deprecated for the production code, release package is recommen
}
}
Native/C++
----------
To build your own Android application, which uses OpenCV from native part, the following steps should be done:
To build your own Android application, using OpenCV as native part, the following steps should be
taken:
#. You can use an environment variable to specify the location of OpenCV package or just hardcode absolute or relative path in the :file:`jni/Android.mk` of your projects.
#. You can use an environment variable to specify the location of OpenCV package or just hardcode
absolute or relative path in the :file:`jni/Android.mk` of your projects.
#. The file :file:`jni/Android.mk` should be written for the current application using the common rules for this file.
#. The file :file:`jni/Android.mk` should be written for the current application using the common
rules for this file.
For detailed information see the Android NDK documentation from the Android NDK archive, in the file
:file:`<path_where_NDK_is_placed>/docs/ANDROID-MK.html`
For detailed information see the Android NDK documentation from the Android NDK archive, in the
file :file:`<path_where_NDK_is_placed>/docs/ANDROID-MK.html`.
#. The line
#. The following line:
.. code-block:: make
include C:\Work\OpenCV4Android\OpenCV-2.4.3-android-sdk\sdk\native\jni\OpenCV.mk
include C:\Work\OpenCV4Android\OpenCV-2.4.4-android-sdk\sdk\native\jni\OpenCV.mk
should be inserted into the :file:`jni/Android.mk` file **after** the line
Should be inserted into the :file:`jni/Android.mk` file **after** this line:
.. code-block:: make
include $(CLEAR_VARS)
#. Several variables can be used to customize OpenCV stuff, but you **don't need** to use them when your application uses the `async initialization` via the `OpenCV Manager` API.
#. Several variables can be used to customize OpenCV stuff, but you **don't need** to use them when
your application uses the `async initialization` via the `OpenCV Manager` API.
Note: these variables should be set **before** the ``"include .../OpenCV.mk"`` line:
.. note:: These variables should be set **before** the ``"include .../OpenCV.mk"`` line:
.. code-block:: make
.. code-block:: make
OPENCV_INSTALL_MODULES:=on
OPENCV_INSTALL_MODULES:=on
Copies necessary OpenCV dynamic libs to the project ``libs`` folder in order to include them into the APK.
Copies necessary OpenCV dynamic libs to the project ``libs`` folder in order to include them
into the APK.
.. code-block:: make
@@ -219,7 +251,8 @@ To build your own Android application, which uses OpenCV from native part, the f
OPENCV_LIB_TYPE:=STATIC
Perform static link with OpenCV. By default dynamic link is used and the project JNI lib depends on ``libopencv_java.so``.
Perform static linking with OpenCV. By default dynamic link is used and the project JNI lib
depends on ``libopencv_java.so``.
#. The file :file:`Application.mk` should exist and should contain lines:
@@ -228,145 +261,46 @@ To build your own Android application, which uses OpenCV from native part, the f
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
Also the line like this one:
Also, the line like this one:
.. code-block:: make
APP_ABI := armeabi-v7a
should specify the application target platforms.
Should specify the application target platforms.
In some cases a linkage error (like ``"In function 'cv::toUtf16(std::basic_string<...>... undefined reference to 'mbstowcs'"``) happens
when building an application JNI library depending on OpenCV.
The following line in the :file:`Application.mk` usually fixes it:
In some cases a linkage error (like ``"In function 'cv::toUtf16(std::basic_string<...>...
undefined reference to 'mbstowcs'"``) happens when building an application JNI library,
depending on OpenCV. The following line in the :file:`Application.mk` usually fixes it:
.. code-block:: make
APP_PLATFORM := android-9
#. Either use :ref:`manual <NDK_build_cli>` ``ndk-build`` invocation or :ref:`setup Eclipse CDT Builder <CDT_Builder>` to build native JNI lib before Java part [re]build and APK creation.
#. Either use :ref:`manual <NDK_build_cli>` ``ndk-build`` invocation or
:ref:`setup Eclipse CDT Builder <CDT_Builder>` to build native JNI lib before (re)building the Java
part and creating an APK.
Hello OpenCV Sample
===================
Here are basic steps to guide you trough the process of creating a simple OpenCV-centric application.
It will be capable of accessing camera output, processing it and displaying the result.
Here are basic steps to guide you trough the process of creating a simple OpenCV-centric
application. It will be capable of accessing camera output, processing it and displaying the
result.
#. Open Eclipse IDE, create a new clean workspace, create a new Android project (*File -> New -> Android Project*).
#. Open Eclipse IDE, create a new clean workspace, create a new Android project
:menuselection:`File --> New --> Android Project`
#. Set name, target, package and minSDKVersion accordingly.
#. Set name, target, package and ``minSDKVersion`` accordingly. The minimal SDK version for build
with OpenCV4Android SDK is 11. Minimal device API Level (for application manifest) is 8.
#. Create a new class (*File -> New -> Class*). Name it for example: *HelloOpenCVView*.
#. Allow Eclipse to create default activity. Lets name the activity ``HelloOpenCvActivity``.
.. image:: images/dev_OCV_new_class.png
:alt: Add a new class.
:align: center
#. Choose Blank Activity with full screen layout. Lets name the layout ``HelloOpenCvLayout``.
* It should extend *SurfaceView* class.
* It also should implement *SurfaceHolder.Callback*, *Runnable*.
#. Edit *HelloOpenCVView* class.
* Add an *import* line for *android.content.context*.
* Modify autogenerated stubs: *HelloOpenCVView*, *surfaceCreated*, *surfaceDestroyed* and *surfaceChanged*.
.. code-block:: java
:linenos:
package com.hello.opencv.test;
import android.content.Context;
public class HelloOpenCVView extends SurfaceView implements Callback, Runnable {
public HelloOpenCVView(Context context) {
super(context);
getHolder().addCallback(this);
}
public void surfaceCreated(SurfaceHolder holder) {
(new Thread(this)).start();
}
public void surfaceDestroyed(SurfaceHolder holder) {
cameraRelease();
}
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
cameraSetup(width, height);
}
//...
* Add *cameraOpen*, *cameraRelease* and *cameraSetup* voids as shown below.
* Also, don't forget to add the public void *run()* as follows:
.. code-block:: java
:linenos:
public void run() {
// TODO: loop { getFrame(), processFrame(), drawFrame() }
}
public boolean cameraOpen() {
return false; //TODO: open camera
}
private void cameraRelease() {
// TODO release camera
}
private void cameraSetup(int width, int height) {
// TODO setup camera
}
#. Create a new *Activity* (*New -> Other -> Android -> Android Activity*) and name it, for example: *HelloOpenCVActivity*. For this activity define *onCreate*, *onResume* and *onPause* voids.
.. code-block:: java
:linenos:
public void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mView = new HelloOpenCVView(this);
setContentView (mView);
}
protected void onPause() {
super.onPause();
mView.cameraRelease();
}
protected void onResume() {
super.onResume();
if( !mView.cameraOpen() ) {
// MessageBox and exit app
AlertDialog ad = new AlertDialog.Builder(this).create();
ad.setCancelable(false); // This blocks the "BACK" button
ad.setMessage("Fatal error: can't open camera!");
ad.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
}
});
ad.show();
}
}
#. Add the following permissions to the AndroidManifest.xml file:
.. code-block:: xml
:linenos:
</application>
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
#. Import OpenCV library project to your workspace.
#. Reference OpenCV library within your project properties.
@@ -374,98 +308,153 @@ It will be capable of accessing camera output, processing it and displaying the
:alt: Reference OpenCV library.
:align: center
#. We now need some code to handle the camera. Update the *HelloOpenCVView* class as follows:
#. Edit your layout file as xml file and pass the following layout there:
.. code-block:: xml
:linenos:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:opencv="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<org.opencv.android.JavaCameraView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
android:id="@+id/HelloOpenCvView"
opencv:show_fps="true"
opencv:camera_id="any" />
</LinearLayout>
#. Add the following permissions to the :file:`AndroidManifest.xml` file:
.. code-block:: xml
:linenos:
</application>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front.autofocus" android:required="false"/>
#. Set application theme in AndroidManifest.xml to hide title and system buttons.
.. code-block:: xml
:linenos:
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
#. Add OpenCV library initialization to your activity. Fix errors by adding requited imports.
.. code-block:: java
:linenos:
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
{
Log.i(TAG, "OpenCV loaded successfully");
mOpenCvCameraView.enableView();
} break;
default:
{
super.onManagerConnected(status);
} break;
}
}
};
@Override
public void onResume()
{
super.onResume();
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback);
}
#. Defines that your activity implements ``CvViewFrameListener2`` interface and fix activity related
errors by defining missed methods. For this activity define ``onCreate``, ``onDestroy`` and
``onPause`` and implement them according code snippet bellow. Fix errors by adding requited
imports.
.. code-block:: java
:linenos:
private VideoCapture mCamera;
private CameraBridgeViewBase mOpenCvCameraView;
public boolean cameraOpen() {
synchronized (this) {
cameraRelease();
mCamera = new VideoCapture(Highgui.CV_CAP_ANDROID);
if (!mCamera.isOpened()) {
mCamera.release();
mCamera = null;
Log.e("HelloOpenCVView", "Failed to open native camera");
return false;
}
}
return true;
}
@Override
public void onCreate(Bundle savedInstanceState) {
Log.i(TAG, "called onCreate");
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.HelloOpenCvLayout);
mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.HelloOpenCvView);
mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);
mOpenCvCameraView.setCvCameraViewListener(this);
}
public void cameraRelease() {
synchronized(this) {
if (mCamera != null) {
mCamera.release();
mCamera = null;
}
}
}
@Override
public void onPause()
{
super.onPause();
if (mOpenCvCameraView != null)
mOpenCvCameraView.disableView();
}
private void cameraSetup(int width, int height) {
synchronized (this) {
if (mCamera != null && mCamera.isOpened()) {
List<Size> sizes = mCamera.getSupportedPreviewSizes();
int mFrameWidth = width;
int mFrameHeight = height;
{ // selecting optimal camera preview size
double minDiff = Double.MAX_VALUE;
for (Size size : sizes) {
if (Math.abs(size.height - height) < minDiff) {
mFrameWidth = (int) size.width;
mFrameHeight = (int) size.height;
minDiff = Math.abs(size.height - height);
}
}
}
mCamera.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, mFrameWidth);
mCamera.set(Highgui.CV_CAP_PROP_FRAME_HEIGHT, mFrameHeight);
}
}
}
public void onDestroy() {
super.onDestroy();
if (mOpenCvCameraView != null)
mOpenCvCameraView.disableView();
}
#. The last step would be to update the *run()* void in *HelloOpenCVView* class as follows:
public void onCameraViewStarted(int width, int height) {
}
.. code-block:: java
:linenos:
public void onCameraViewStopped() {
}
public void run() {
while (true) {
Bitmap bmp = null;
synchronized (this) {
if (mCamera == null)
break;
if (!mCamera.grab())
break;
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
return inputFrame.rgba();
}
bmp = processFrame(mCamera);
}
if (bmp != null) {
Canvas canvas = getHolder().lockCanvas();
if (canvas != null) {
canvas.drawBitmap(bmp, (canvas.getWidth() - bmp.getWidth()) / 2,
(canvas.getHeight() - bmp.getHeight()) / 2, null);
getHolder().unlockCanvasAndPost(canvas);
#. Run your application on device or emulator.
}
bmp.recycle();
}
}
}
Lets discuss some most important steps. Every Android application with UI must implement Activity
and View. By the first steps we create blank activity and default view layout. The simplest
OpenCV-centric application must implement OpenCV initialization, create its own view to show
preview from camera and implements ``CvViewFrameListener2`` interface to get frames from camera and
process it.
protected Bitmap processFrame(VideoCapture capture) {
Mat mRgba = new Mat();
capture.retrieve(mRgba, Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA);
//process mRgba
Bitmap bmp = Bitmap.createBitmap(mRgba.cols(), mRgba.rows(), Bitmap.Config.ARGB_8888);
try {
Utils.matToBitmap(mRgba, bmp);
} catch(Exception e) {
Log.e("processFrame", "Utils.matToBitmap() throws an exception: " + e.getMessage());
bmp.recycle();
bmp = null;
}
return bmp;
}
First of all we create our application view using xml layout. Our layout consists of the only
one full screen component of class ``org.opencv.android.JavaCameraView``. This class is
implemented inside OpenCV library. It is inherited from ``CameraBridgeViewBase``, that extends
``SurfaceView`` and uses standard Android camera API. Alternatively you can use
``org.opencv.android.NativeCameraView`` class, that implements the same interface, but uses
``VideoCapture`` class as camera access back-end. ``opencv:show_fps="true"`` and
``opencv:camera_id="any"`` options enable FPS message and allow to use any camera on device.
Application tries to use back camera first.
After creating layout we need to implement ``Activity`` class. OpenCV initialization process has
been already discussed above. In this sample we use asynchronous initialization. Implementation of
``CvCameraViewListener`` interface allows you to add processing steps after frame grabbing from
camera and before its rendering on screen. The most important function is ``onCameraFrame``. It is
callback function and it is called on retrieving frame from camera. The callback input is object
of ``CvCameraViewFrame`` class that represents frame from camera.
.. note::
Do not save or use ``CvCameraViewFrame`` object out of ``onCameraFrame`` callback. This object
does not have its own state and its behavior out of callback is unpredictable!
It has ``rgba()`` and ``gray()`` methods that allows to get frame as RGBA and one channel gray scale
``Mat`` respectively. It expects that ``onCameraFrame`` function returns RGBA frame that will be
drawn on the screen.
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 49 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 46 KiB

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 28 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 40 KiB

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 50 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 51 KiB

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 27 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 25 KiB

@@ -0,0 +1,115 @@
.. _ARM-Linux-cross-compile:
Cross compilation for ARM based Linux systems
*********************************************
This steps are tested on Ubuntu Linux 12.04, but should work for other Linux distributions.
I case of other distributions package names and names of cross compilation tools may differ.
There are several popular EABI versions that are used on ARM platform. This tutorial is
written for *gnueabi* and *gnueabihf*, but other variants should work with minimal changes.
Prerequisites
=============
* Host computer with Linux;
* Git;
* CMake 2.6 or higher;
* Cross compilation tools for ARM: gcc, libstc++, etc. Depending on target platform you need
to choose *gnueabi* or *gnueabihf* tools.
Install command for *gnueabi*:
.. code-block:: bash
sudo apt-get install gcc-arm-linux-gnueabi
Install command for *gnueabihf*:
.. code-block:: bash
sudo apt-get install gcc-arm-linux-gnueabihf
* pkgconfig;
* Python 2.6 for host system;
* [optional] ffmpeg or libav development packages for armeabi(hf): libavcodec-dev, libavformat-dev, libswscale-dev;
* [optional] GTK+2.x or higher, including headers (libgtk2.0-dev) for armeabi(hf);
* [optional] libdc1394 2.x;
* [optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev for armeabi(hf).
Getting OpenCV Source Code
==========================
You can use the latest stable OpenCV version available in *sourceforge* or you can grab the latest
snapshot from our `Git repository <https://github.com/Itseez/opencv.git>`_.
Getting the Latest Stable OpenCV Version
----------------------------------------
* Go to our `page on Sourceforge <http://sourceforge.net/projects/opencvlibrary>`_;
* Download the source tarball and unpack it.
Getting the Cutting-edge OpenCV from the Git Repository
-------------------------------------------------------
Launch Git client and clone `OpenCV repository <http://github.com/itseez/opencv>`_
In Linux it can be achieved with the following command in Terminal:
.. code-block:: bash
cd ~/<my_working _directory>
git clone https://github.com/Itseez/opencv.git
Building OpenCV
===============
#. Create a build directory, make it current and run the following command:
.. code-block:: bash
cmake [<some optional parameters>] -DCMAKE_TOOLCHAIN_FILE=<path to the OpenCV source directory>/platforms/linux/arm-gnueabi.toolchain.cmake <path to the OpenCV source directory>
Toolchain uses *gnueabihf* EABI convention by default. Add ``-DSOFTFP=ON`` cmake argument to switch on softfp compiler.
.. code-block:: bash
cmake [<some optional parameters>] -DSOFTFP=ON -DCMAKE_TOOLCHAIN_FILE=<path to the OpenCV source directory>/platforms/linux/arm-gnueabi.toolchain.cmake <path to the OpenCV source directory>
For example:
.. code-block:: bash
cd ~/opencv/platforms/linux
mkdir -p build_hardfp
cd build_hardfp
cmake -DCMAKE_TOOLCHAIN_FILE=../arm-gnueabi.toolchain.cmake ../../..
#. Run make in build (<cmake_binary_dir>) directory:
.. code-block:: bash
make
.. note::
Optionally you can strip symbols info from the created library via install/strip make target.
This option produces smaller binary (~ twice smaller) but makes further debugging harder.
Enable hardware optimizations
-----------------------------
Depending on target platfrom architecture different instruction sets can be used. By default
compiler generates code for armv5l without VFPv3 and NEON extensions. Add ``-DUSE_VFPV3=ON``
to cmake command line to enable code generation for VFPv3 and ``-DUSE_NEON=ON`` for using
NEON SIMD extensions.
TBB is supported on multi core ARM SoCs also.
Add ``-DWITH_TBB=ON`` and ``-DBUILD_TBB=ON`` to enable it. Cmake scripts download TBB sources
from official project site `<http://threadingbuildingblocks.org/>`_ and build it.
Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 41 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 23 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 15 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 42 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 12 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 74 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 42 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 25 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 25 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 32 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 14 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 34 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 38 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 25 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 500 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 606 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 248 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 195 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 258 KiB

@@ -0,0 +1,540 @@
.. _Java_Dev_Intro:
Introduction to Java Development
********************************
Last updated: 28 February, 2013.
As of OpenCV 2.4.4, OpenCV supports desktop Java development using nearly the same interface as for
Android development. This guide will help you to create your first Java (or Scala) application using OpenCV.
We will use either `Eclipse <http://eclipse.org/>`_, `Apache Ant <http://ant.apache.org/>`_ or the
`Simple Build Tool (SBT) <http://www.scala-sbt.org/>`_ to build the application.
For further reading after this guide, look at the :ref:`Android_Dev_Intro` tutorials.
What we'll do in this guide
***************************
In this guide, we will:
* Get OpenCV with desktop Java support
* Create an ``Ant``, ``Eclipse`` or ``SBT`` project
* Write a simple OpenCV application in Java or Scala
The same process was used to create the samples in the :file:`samples/java` folder of the OpenCV repository,
so consult those files if you get lost.
Get proper OpenCV
*****************
Starting from version 2.4.4 OpenCV includes desktop Java bindings.
Download
########
The most simple way to get it is downloading the appropriate package of **version 2.4.4 or higher** from the
`OpenCV SourceForge repository <http://sourceforge.net/projects/opencvlibrary/files/>`_.
.. note:: Windows users can find the prebuilt files needed for Java development in
the :file:`opencv/build/java/` folder inside the package.
For other OSes it's required to build OpenCV from sources.
Another option to get OpenCV sources is to clone `OpenCV git repository
<https://github.com/Itseez/opencv/>`_.
In order to build OpenCV with Java bindings you need :abbr:`JDK (Java Development Kit)`
(we recommend `Oracle/Sun JDK 6 or 7 <http://www.oracle.com/technetwork/java/javase/downloads/>`_),
`Apache Ant <http://ant.apache.org/>`_ and `Python` v2.6 or higher to be installed.
Build
#####
Let's build OpenCV:
.. code-block:: bash
git clone git://github.com/Itseez/opencv.git
cd opencv
git checkout 2.4
mkdir build
cd build
Generate a Makefile or a MS Visual Studio* solution, or whatever you use for
building executables in your system:
.. code-block:: bash
cmake -DBUILD_SHARED_LIBS=OFF ..
or
.. code-block:: bat
cmake -DBUILD_SHARED_LIBS=OFF -G "Visual Studio 10" ..
.. note:: When OpenCV is built as a set of **static** libraries (``-DBUILD_SHARED_LIBS=OFF`` option)
the Java bindings dynamic library is all-sufficient,
i.e. doesn't depend on other OpenCV libs, but includes all the OpenCV code inside.
Examine the output of CMake and ensure ``java`` is one of the modules "To be built".
If not, it's likely you're missing a dependency. You should troubleshoot by looking
through the CMake output for any Java-related tools that aren't found and installing them.
.. image:: images/cmake_output.png
:alt: CMake output
:align: center
.. note:: If ``CMake`` can't find Java in your system set the ``JAVA_HOME``
environment variable with the path to installed JDK
before running it. E.g.:
.. code-block:: bash
export JAVA_HOME=/usr/lib/jvm/java-6-oracle
cmake -DBUILD_SHARED_LIBS=OFF ..
Now start the build:
.. code-block:: bash
make -j8
or
.. code-block:: bat
msbuild /m OpenCV.sln /t:Build /p:Configuration=Release /v:m
Besides all this will create a ``jar`` containing the Java interface (:file:`bin/opencv-244.jar`)
and a native dynamic library containing Java bindings and all the OpenCV stuff
(:file:`bin/Release/opencv_java244.dll` or :file:`lib/libopencv_java244.so` respectively).
We'll use these files later.
Java sample with Ant
********************
.. note::
The described sample is provided with OpenCV library in the :file:`opencv/samples/java/ant` folder.
* Create a folder where you'll develop this sample application.
* In this folder create the :file:`build.xml` file with the following content using any text editor:
.. code-block:: xml
:linenos:
<project name="SimpleSample" basedir="." default="rebuild-run">
<property name="src.dir" value="src"/>
<property name="lib.dir" value="${ocvJarDir}"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="main-class" value="${ant.project.name}"/>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath"/>
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java fork="true" classname="${main-class}">
<sysproperty key="java.library.path" path="${ocvLibDir}"/>
<classpath>
<path refid="classpath"/>
<path location="${jar.dir}/${ant.project.name}.jar"/>
</classpath>
</java>
</target>
<target name="rebuild" depends="clean,jar"/>
<target name="rebuild-run" depends="clean,run"/>
</project>
.. note::
This XML file can be reused for building other Java applications.
It describes a common folder structure in the lines 3 - 12 and common targets
for compiling and running the application.
When reusing this XML don't forget to modify the project name in the line 1,
that is also the name of the `main` class (line 14).
The paths to OpenCV `jar` and `jni lib` are expected as parameters
(``"${ocvJarDir}"`` in line 5 and ``"${ocvLibDir}"`` in line 37), but
you can hardcode these paths for your convenience.
See `Ant documentation <http://ant.apache.org/manual/>`_ for detailed description
of its build file format.
* Create an :file:`src` folder next to the :file:`build.xml` file and a :file:`SimpleSample.java` file in it.
* Put the following Java code into the :file:`SimpleSample.java` file:
.. code-block:: java
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.CvType;
import org.opencv.core.Scalar;
class SimpleSample {
static{ System.loadLibrary(Core.NATIVE_LIBRARY_NAME); }
public static void main(String[] args) {
System.out.println("Welcome to OpenCV " + Core.VERSION);
Mat m = new Mat(5, 10, CvType.CV_8UC1, new Scalar(0));
System.out.println("OpenCV Mat: " + m);
Mat mr1 = m.row(1);
mr1.setTo(new Scalar(1));
Mat mc5 = m.col(5);
mc5.setTo(new Scalar(5));
System.out.println("OpenCV Mat data:\n" + m.dump());
}
}
* Run the following command in console in the folder containing :file:`build.xml`:
.. code-block:: bash
ant -DocvJarDir=path/to/dir/containing/opencv-244.jar -DocvLibDir=path/to/dir/containing/opencv_java244/native/library
For example:
.. code-block:: bat
ant -DocvJarDir=X:\opencv-2.4.4\bin -DocvLibDir=X:\opencv-2.4.4\bin\Release
The command should initiate [re]building and running the sample.
You should see on the screen something like this:
.. image:: images/ant_output.png
:alt: run app with Ant
:align: center
Java project in Eclipse
***********************
Now let's look at the possiblity of using OpenCV in Java when developing in Eclipse IDE.
* Create a new Eclipse workspace
* Create a new Java project via :guilabel:`File --> New --> Java Project`
.. image:: images/eclipse_new_java_prj.png
:alt: Eclipse: new Java project
:align: center
Call it say "HelloCV".
* Open :guilabel:`Java Build Path` tab on :guilabel:`Project Properties` dialog
and configure additional library (OpenCV) reference (jar and native library location):
.. image:: images/eclipse_user_lib.png
:alt: Eclipse: external JAR
:align: center
` `
.. image:: images/eclipse_user_lib2.png
:alt: Eclipse: external JAR
:align: center
` `
.. image:: images/eclipse_user_lib3.png
:alt: Eclipse: external JAR
:align: center
` `
.. image:: images/eclipse_user_lib4.png
:alt: Eclipse: external JAR
:align: center
` `
.. image:: images/eclipse_user_lib5.png
:alt: Eclipse: external JAR
:align: center
` `
.. image:: images/eclipse_user_lib6.png
:alt: Eclipse: external JAR
:align: center
` `
.. image:: images/eclipse_user_lib7.png
:alt: Eclipse: external JAR
:align: center
` `
.. image:: images/eclipse_user_lib8.png
:alt: Eclipse: external JAR
:align: center
` `
* Add a new Java class (say ``Main``) containing the application entry:
.. image:: images/eclipse_main_class.png
:alt: Eclipse: Main class
:align: center
* Put some simple OpenCV calls there, e.g.:
.. code-block:: java
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
public class Main {
public static void main(String[] args) {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
Mat m = Mat.eye(3, 3, CvType.CV_8UC1);
System.out.println("m = " + m.dump());
}
}
* Press :guilabel:`Run` button and find the identity matrix content in the Eclipse ``Console`` window.
.. image:: images/eclipse_run.png
:alt: Eclipse: run
:align: center
SBT project for Java and Scala
******************************
Now we'll create a simple Java application using SBT. This serves as a brief introduction to
those unfamiliar with this build tool. We're using SBT because it is particularly easy and powerful.
First, download and install `SBT <http://www.scala-sbt.org/>`_ using the instructions on its `web site <http://www.scala-sbt.org/>`_.
Next, navigate to a new directory where you'd like the application source to live (outside :file:`opencv` dir).
Let's call it "JavaSample" and create a directory for it:
.. code-block:: bash
cd <somewhere outside opencv>
mkdir JavaSample
Now we will create the necessary folders and an SBT project:
.. code-block:: bash
cd JavaSample
mkdir -p src/main/java # This is where SBT expects to find Java sources
mkdir project # This is where the build definitions live
Now open :file:`project/build.scala` in your favorite editor and paste the following.
It defines your project:
.. code-block:: scala
import sbt._
import Keys._
object JavaSampleBuild extends Build {
def scalaSettings = Seq(
scalaVersion := "2.10.0",
scalacOptions ++= Seq(
"-optimize",
"-unchecked",
"-deprecation"
)
)
def buildSettings =
Project.defaultSettings ++
scalaSettings
lazy val root = {
val settings = buildSettings ++ Seq(name := "JavaSample")
Project(id = "JavaSample", base = file("."), settings = settings)
}
}
Now edit :file:`project/plugins.sbt` and paste the following.
This will enable auto-generation of an Eclipse project:
.. code-block:: scala
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")
Now run ``sbt`` from the :file:`JavaSample` root and from within SBT run ``eclipse`` to generate an eclipse project:
.. code-block:: bash
sbt # Starts the sbt console
> eclipse # Running "eclipse" from within the sbt console
You should see something like this:
.. image:: images/sbt_eclipse.png
:alt: SBT output
:align: center
You can now import the SBT project to Eclipse using :guilabel:`Import ... -> Existing projects into workspace`.
Whether you actually do this is optional for the guide;
we'll be using SBT to build the project, so if you choose to use Eclipse it will just serve as a text editor.
To test that everything is working, create a simple "Hello OpenCV" application.
Do this by creating a file :file:`src/main/java/HelloOpenCV.java` with the following contents:
.. code-block:: java
public class HelloOpenCV {
public static void main(String[] args) {
System.out.println("Hello, OpenCV");
}
}
Now execute ``run`` from the sbt console, or more concisely, run ``sbt run`` from the command line:
.. code-block:: bash
sbt run
You should see something like this:
.. image:: images/sbt_run.png
:alt: SBT run
:align: center
Running SBT samples
###################
Now we'll create a simple face detection application using OpenCV.
First, create a :file:`lib/` folder and copy the OpenCV jar into it.
By default, SBT adds jars in the lib folder to the Java library search path.
You can optionally rerun ``sbt eclipse`` to update your Eclipse project.
.. code-block:: bash
mkdir lib
cp <opencv_dir>/build/bin/opencv_<version>.jar lib/
sbt eclipse
Next, create the directory :file:`src/main/resources` and download this Lena image into it:
.. image:: images/lena.png
:alt: Lena
:align: center
Make sure it's called :file:`"lena.png"`.
Items in the resources directory are available to the Java application at runtime.
Next, copy :file:`lbpcascade_frontalface.xml` from :file:`opencv/data/lbpcascades/` into the :file:`resources`
directory:
.. code-block:: bash
cp <opencv_dir>/data/lbpcascades/lbpcascade_frontalface.xml src/main/resources/
Now modify src/main/java/HelloOpenCV.java so it contains the following Java code:
.. code-block:: java
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import org.opencv.objdetect.CascadeClassifier;
//
// Detects faces in an image, draws boxes around them, and writes the results
// to "faceDetection.png".
//
class DetectFaceDemo {
public void run() {
System.out.println("\nRunning DetectFaceDemo");
// Create a face detector from the cascade file in the resources
// directory.
CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("/lbpcascade_frontalface.xml").getPath());
Mat image = Highgui.imread(getClass().getResource("/lena.png").getPath());
// Detect faces in the image.
// MatOfRect is a special container class for Rect.
MatOfRect faceDetections = new MatOfRect();
faceDetector.detectMultiScale(image, faceDetections);
System.out.println(String.format("Detected %s faces", faceDetections.toArray().length));
// Draw a bounding box around each face.
for (Rect rect : faceDetections.toArray()) {
Core.rectangle(image, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height), new Scalar(0, 255, 0));
}
// Save the visualized detection.
String filename = "faceDetection.png";
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, image);
}
}
public class HelloOpenCV {
public static void main(String[] args) {
System.out.println("Hello, OpenCV");
// Load the native library.
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
new DetectFaceDemo().run();
}
}
Note the call to ``System.loadLibrary(Core.NATIVE_LIBRARY_NAME)``.
This command must be executed exactly once per Java process prior to using any native OpenCV methods.
If you don't call it, you will get ``UnsatisfiedLink errors``.
You will also get errors if you try to load OpenCV when it has already been loaded.
Now run the face detection app using ``sbt run``:
.. code-block:: bash
sbt run
You should see something like this:
.. image:: images/sbt_run_face.png
:alt: SBT run
:align: center
It should also write the following image to :file:`faceDetection.png`:
.. image:: images/faceDetection.png
:alt: Detected face
:align: center
You're done!
Now you have a sample Java application working with OpenCV, so you can start the work on your own.
We wish you good luck and many years of joyful life!
@@ -25,8 +25,8 @@ Let's use a simple program such as DisplayImage.cpp shown below.
.. code-block:: cpp
#include <cv.h>
#include <highgui.h>
#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
@@ -55,9 +55,10 @@ Now you have to create your CMakeLists.txt file. It should look like this:
.. code-block:: cmake
cmake_minimum_required(VERSION 2.8)
project( DisplayImage )
find_package( OpenCV REQUIRED )
add_executable( DisplayImage DisplayImage )
add_executable( DisplayImage DisplayImage.cpp )
target_link_libraries( DisplayImage ${OpenCV_LIBS} )
Generate the executable
@@ -15,7 +15,7 @@ In this tutorial you will learn how to:
.. container:: enumeratevisibleitemswithsquare
* Load an image using :imread:`imread <>`
* Transform an image from RGB to Grayscale format by using :cvt_color:`cvtColor <>`
* Transform an image from BGR to Grayscale format by using :cvt_color:`cvtColor <>`
* Save your transformed image in a file on disk (using :imwrite:`imwrite <>`)
Code
@@ -45,7 +45,7 @@ Here it is:
}
Mat gray_image;
cvtColor( image, gray_image, CV_RGB2GRAY );
cvtColor( image, gray_image, CV_BGR2GRAY );
imwrite( "../../images/Gray_Image.jpg", gray_image );
@@ -68,11 +68,11 @@ Explanation
* Creating a Mat object to store the image information
* Load an image using :imread:`imread <>`, located in the path given by *imageName*. Fort this example, assume you are loading a RGB image.
#. Now we are going to convert our image from RGB to Grayscale format. OpenCV has a really nice function to do this kind of transformations:
#. Now we are going to convert our image from BGR to Grayscale format. OpenCV has a really nice function to do this kind of transformations:
.. code-block:: cpp
cvtColor( image, gray_image, CV_RGB2GRAY );
cvtColor( image, gray_image, CV_BGR2GRAY );
As you can see, :cvt_color:`cvtColor <>` takes as arguments:
@@ -80,7 +80,7 @@ Explanation
* a source image (*image*)
* a destination image (*gray_image*), in which we will save the converted image.
* an additional parameter that indicates what kind of transformation will be performed. In this case we use **CV_RGB2GRAY** (self-explanatory).
* an additional parameter that indicates what kind of transformation will be performed. In this case we use **CV_BGR2GRAY** (because of :imread:`imread <>` has BGR default channel order in case of color images).
#. So now we have our new *gray_image* and want to save it on disk (otherwise it will get lost after the program ends). To save it, we will use a function analagous to :imread:`imread <>`: :imwrite:`imwrite <>`
Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 41 KiB

@@ -3,7 +3,9 @@
Introduction to OpenCV
-----------------------------------------------------------
Here you can read tutorials about how to set up your computer to work with the OpenCV library. Additionaly you can find a few very basic sample source code that will let introduce you to the world of the OpenCV.
Here you can read tutorials about how to set up your computer to work with the OpenCV library.
Additionally you can find a few very basic sample source code that will let introduce you to the
world of the OpenCV.
.. include:: ../../definitions/tocDefinitions.rst
@@ -101,6 +103,26 @@ Here you can read tutorials about how to set up your computer to work with the O
:height: 90pt
:width: 90pt
* **Desktop Java**
.. tabularcolumns:: m{100pt} m{300pt}
.. cssclass:: toctableopencv
================ =================================================
|JavaLogo| **Title:** :ref:`Java_Dev_Intro`
*Compatibility:* > OpenCV 2.4.4
*Authors:* |Author_EricCh| and |Author_AndreyP|
Explains how to build and run a simple desktop Java application using Eclipse, Ant or the Simple Build Tool (SBT).
================ =================================================
.. |JavaLogo| image:: images/Java_logo.png
:height: 90pt
:width: 90pt
* **Android**
.. tabularcolumns:: m{100pt} m{300pt}
@@ -137,7 +159,7 @@ Here you can read tutorials about how to set up your computer to work with the O
================ =================================================
|AndroidLogo| **Title:** :ref:`dev_with_OCV_on_Android`
*Compatibility:* > OpenCV 2.4.2
*Compatibility:* > OpenCV 2.4.3
*Author:* |Author_VsevolodG|
@@ -169,6 +191,24 @@ Here you can read tutorials about how to set up your computer to work with the O
.. |Install_iOS| image:: images/opencv_ios.png
:width: 90pt
* **Embedded Linux**
.. tabularcolumns:: m{100pt} m{300pt}
.. cssclass:: toctableopencv
=========== ======================================================
|Usage_1| **Title:** :ref:`ARM-Linux-cross-compile`
*Compatibility:* > OpenCV 2.4.4
*Author:* |Author_AlexS|
We will learn how to setup OpenCV cross compilation environment for ARM Linux.
=========== ======================================================
* **Common**
.. tabularcolumns:: m{100pt} m{300pt}
.. cssclass:: toctableopencv
@@ -229,7 +269,7 @@ Here you can read tutorials about how to set up your computer to work with the O
\pagebreak
.. We use a custom table of content format and as the table of content only imforms Sphinx about the hierarchy of the files, no need to show it.
.. We use a custom table of content format and as the table of content only informs Sphinx about the hierarchy of the files, no need to show it.
.. toctree::
:hidden:
@@ -238,10 +278,12 @@ Here you can read tutorials about how to set up your computer to work with the O
../linux_eclipse/linux_eclipse
../windows_install/windows_install
../windows_visual_studio_Opencv/windows_visual_studio_Opencv
../desktop_java/java_dev_intro
../android_binary_package/android_dev_intro
../android_binary_package/O4A_SDK
../android_binary_package/dev_with_OCV_on_Android
../ios_install/ios_install
../crosscompilation/arm_crosscompile_with_cmake
../display_image/display_image
../load_save_image/load_save_image
../how_to_write_a_tutorial/how_to_write_a_tutorial
../how_to_write_a_tutorial/how_to_write_a_tutorial
@@ -20,11 +20,7 @@ Installation by Using the Pre-built Libraries
.. If you downloaded the source files present here see :ref:`CppTutWindowsMakeOwn`.
#. Make sure you have admin rights. Start the setup and follow the wizard.
#. While adding the OpenCV library to the system path is a good decision for a better control, we will do it manually for the sake of this tutorial. Make sure you do not set this option.
#. Most of the time it is a good idea to install the source files too, as this will allow for you to debug into the OpenCV library, if it is necessary. Follow the default settings of the wizard and finish the installation.
#. Make sure you have admin rights. Unpack the self-extracting archive.
#. You can check the installation at the chosen path as you can see below.
@@ -294,15 +290,7 @@ Building the library
:alt: The Install Project
:align: center
This will create an *install* directory inside the *Build* one collecting all the built binaries into a single place. Use this only after you built both the *Release* and *Debug* versions.
.. note::
To create an installer you need to install `NSIS <http://nsis.sourceforge.net/Download>`_. Then just build the *Package* project to build the installer into the :file:`Build/_CPack_Packages/{win32}/NSIS` folder. You can then use this to distribute OpenCV with your build settings on other systems.
.. image:: images/WindowsOpenCVInstaller.png
:alt: The Installer directory
:align: center
This will create an *Install* directory inside the *Build* one collecting all the built binaries into a single place. Use this only after you built both the *Release* and *Debug* versions.
To test your build just go into the :file:`Build/bin/Debug` or :file:`Build/bin/Release` directory and start a couple of applications like the *contours.exe*. If they run, you are done. Otherwise, something definitely went awfully wrong. In this case you should contact us via our :opencv_group:`user group <>`.
If everything is okay the *contours.exe* output should resemble the following image (if built with Qt support):
@@ -320,15 +308,15 @@ Building the library
Set the OpenCV enviroment variable and add it to the systems path
=================================================================
First we set an enviroment variable to make easier our work. This will hold the install directory of our OpenCV library that we use in our projects. Start up a command window and enter:
First we set an enviroment variable to make easier our work. This will hold the build directory of our OpenCV library that we use in our projects. Start up a command window and enter:
::
setx -m OPENCV_DIR D:\OpenCV\Build\Install
setx -m OPENCV_DIR D:\OpenCV\Build\x86\vc10
Here the directory is where you have your OpenCV binaries (*installed* or *built*). Inside this you should have folders like *bin* and *include*. The -m should be added if you wish to make the settings computer wise, instead of user wise.
Here the directory is where you have your OpenCV binaries (*extracted* or *built*). You can have different platform (e.g. x64 instead of x86) or compiler type, so substitute appropriate value. Inside this you should have folders like *bin* and *include*. The -m should be added if you wish to make the settings computer wise, instead of user wise.
If you built static libraries then you are done. Otherwise, you need to add the *bin* folders path to the systems path.This is cause you will use the OpenCV library in form of *\"Dynamic-link libraries\"* (also known as **DLL**). Inside these are stored all the algorithms and information the OpenCV library contains. The operating system will load them only on demand, during runtime. However, to do this he needs to know where they are. The systems **PATH** contains a list of folders where DLLs can be found. Add the OpenCV library path to this and the OS will know where to look if he ever needs the OpenCV binaries. Otherwise, you will need to copy the used DLLs right beside the applications executable file (*exe*) for the OS to find it, which is highly unpleasent if you work on many projects. To do this start up again the |PathEditor|_ and add the following new entry (right click in the application to bring up the menu):
If you built static libraries then you are done. Otherwise, you need to add the *bin* folders path to the systems path. This is cause you will use the OpenCV library in form of *\"Dynamic-link libraries\"* (also known as **DLL**). Inside these are stored all the algorithms and information the OpenCV library contains. The operating system will load them only on demand, during runtime. However, to do this he needs to know where they are. The systems **PATH** contains a list of folders where DLLs can be found. Add the OpenCV library path to this and the OS will know where to look if he ever needs the OpenCV binaries. Otherwise, you will need to copy the used DLLs right beside the applications executable file (*exe*) for the OS to find it, which is highly unpleasent if you work on many projects. To do this start up again the |PathEditor|_ and add the following new entry (right click in the application to bring up the menu):
::
@@ -342,6 +330,6 @@ If you built static libraries then you are done. Otherwise, you need to add the
:alt: Add the entry.
:align: center
Save it to the registry and you are done. If you ever change the location of your install directories or want to try out your applicaton with a different build all you will need to do is to update the OPENCV_DIR variable via the *setx* command inside a command window.
Save it to the registry and you are done. If you ever change the location of your build directories or want to try out your applicaton with a different build all you will need to do is to update the OPENCV_DIR variable via the *setx* command inside a command window.
Now you can continue reading the tutorials with the :ref:`Windows_Visual_Studio_How_To` section. There you will find out how to use the OpenCV library in your own projects with the help of the Microsoft Visual Studio IDE.

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