mirror of
https://github.com/opencv/opencv.git
synced 2026-07-21 19:33:03 +04:00
Compare commits
583 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f5fd865aa | |||
| 9a3dccab20 | |||
| ac6ca660f4 | |||
| 6f47c26acf | |||
| 945663bc9b | |||
| 0263b49298 | |||
| c2f59a0f73 | |||
| 9eda260495 | |||
| 3ed54b9008 | |||
| 6b954cd24e | |||
| 42ba5c7d16 | |||
| 72ddeea479 | |||
| 869dda4117 | |||
| 07de67c32f | |||
| c467d0d553 | |||
| 0906744788 | |||
| 67158b12cd | |||
| 9e50cf5375 | |||
| 4bf82e50d0 | |||
| 2e86d46cf2 | |||
| 707d10f115 | |||
| 83a4ad5f51 | |||
| e7b82a8561 | |||
| 546e68dc65 | |||
| b7c2a46830 | |||
| 719099ad6d | |||
| 2e9004813e | |||
| 50842b9036 | |||
| 3d6413cfc6 | |||
| 799622affd | |||
| 57ab0d4d17 | |||
| 02f8b85dd9 | |||
| 1fbdca0c9b | |||
| 9eaac6105f | |||
| 83ace8d580 | |||
| 851ce27240 | |||
| 70f8d807c8 | |||
| daa21a4385 | |||
| 13cef0cdfc | |||
| 083aced3b4 | |||
| 72ec9c159e | |||
| 5b00d9da49 | |||
| 74bb0beeb0 | |||
| 08714c510f | |||
| acfbed8654 | |||
| 6212084046 | |||
| d89b6226a3 | |||
| 11d1909e6b | |||
| 3c6fe75149 | |||
| ede4943d7e | |||
| 9d148c76ca | |||
| 21d8b588a2 | |||
| 5d66b1130b | |||
| 0550b2c1fe | |||
| d58d277707 | |||
| 95eed59f2d | |||
| 62bc647731 | |||
| 7f63776395 | |||
| b9792fdc14 | |||
| 0410fe6978 | |||
| 242e64c08d | |||
| cc94b393c5 | |||
| 58dd70e8dc | |||
| 53ff537f1c | |||
| a5814871d9 | |||
| 1aa03cecf1 | |||
| f10537cdd6 | |||
| 9d294cbcf5 | |||
| f1bec940b1 | |||
| dd93d48be4 | |||
| ad3123adfd | |||
| f939d80f4c | |||
| ee316758ca | |||
| 6d7a61cbdc | |||
| b44b1ab47b | |||
| 2e47a1a61b | |||
| 72685cf01c | |||
| 612888c066 | |||
| e7b55f4982 | |||
| 3004f5fa30 | |||
| 9682d2afff | |||
| 87d655325c | |||
| db25e44a17 | |||
| b7a9e672c5 | |||
| 8e49ab1d3b | |||
| 00c36e88ef | |||
| cde697dd14 | |||
| bb44316028 | |||
| 0b2cfcfda2 | |||
| 9c02caf392 | |||
| d87c30dc84 | |||
| 63d6cc5ca6 | |||
| 9682430a69 | |||
| b69ffe6376 | |||
| 1f72815637 | |||
| 90c3d7d361 | |||
| f4eebc46b2 | |||
| 2b1103c1d3 | |||
| 007a3ef8b6 | |||
| 83eb1d3608 | |||
| 5c12c92243 | |||
| 9e29762838 | |||
| da229cce9a | |||
| 36af97d00c | |||
| d705c651f2 | |||
| 08848c56b7 | |||
| ebe979090e | |||
| 901d4995e3 | |||
| aad95c7d8c | |||
| d9b7b300b4 | |||
| 044de4105e | |||
| 7a5aa06b9e | |||
| a21fb63c28 | |||
| eaa9b78121 | |||
| fd4df0f67d | |||
| 6decc2596d | |||
| 41b920344d | |||
| 82668e06d4 | |||
| a81374c1d7 | |||
| 66fc6126d2 | |||
| 8b58b59df4 | |||
| f0595b8254 | |||
| 1e01441767 | |||
| c797746b6e | |||
| 1bf4427a5c | |||
| ac3ec0d96d | |||
| 5c6c537044 | |||
| f8c82fc214 | |||
| 40b762bceb | |||
| 89e3c508d8 | |||
| cbdddb473c | |||
| b4c2891ef3 | |||
| 1325213303 | |||
| fb15bdfb21 | |||
| 9d2d173485 | |||
| 26e3bcb9de | |||
| 960dee8ab8 | |||
| 847976de4e | |||
| ceec0eb33a | |||
| 4840c4ae6f | |||
| 02e29fc99c | |||
| 7ce116695d | |||
| c879b1ab09 | |||
| de8d8720a2 | |||
| a855d230ec | |||
| 6a6619ec1e | |||
| 8c2bde2af4 | |||
| d22516872c | |||
| 17608f7ade | |||
| 81ebe28c24 | |||
| f7792f0be2 | |||
| 27302c367c | |||
| a153948a19 | |||
| 4273534c92 | |||
| 7274e2ff1a | |||
| 0e8bfff386 | |||
| 8c55d7be5e | |||
| f6de017171 | |||
| cc63452f65 | |||
| eeae81e903 | |||
| e30139edc3 | |||
| f01b2413c3 | |||
| 772fcf4088 | |||
| b8c00854fe | |||
| ba0a8dc723 | |||
| 100c2dd91c | |||
| 58c9135626 | |||
| 6e121b2e29 | |||
| e6619cf580 | |||
| 122b9f8e17 | |||
| d948b2a235 | |||
| ebd7d08408 | |||
| 140051b18c | |||
| b7276359e9 | |||
| 83d6d70a56 | |||
| a9d4e05346 | |||
| e5e6367223 | |||
| 5678ba1227 | |||
| b01f067614 | |||
| 65b0ecfec5 | |||
| d1902a1276 | |||
| 56cae1b293 | |||
| 7c740b6a31 | |||
| d430664791 | |||
| d057828ee3 | |||
| c9bb18b9f7 | |||
| 297e2b6f1a | |||
| 3853a18e0e | |||
| 226b4e3ed5 | |||
| 756c1a22d9 | |||
| a7bf1d53d8 | |||
| 7711cd284b | |||
| 8755ffbf31 | |||
| 69344f175b | |||
| d14a1de947 | |||
| 514b3b520c | |||
| 4a6b1805e0 | |||
| 4ab525c880 | |||
| 7d665a4754 | |||
| f7d52c774e | |||
| 8efdfd9dfc | |||
| cd42e38013 | |||
| 339e6aa782 | |||
| 309eb3c122 | |||
| 2594e5e384 | |||
| 3a7ea37090 | |||
| 9f0cd9ee10 | |||
| 13694c8ae8 | |||
| dde7c22fad | |||
| 29e7eb7719 | |||
| 3419c704a9 | |||
| cdbb661eab | |||
| afdf319f36 | |||
| 488babf3b3 | |||
| 2c57717ca2 | |||
| e9b4813bb2 | |||
| 9185b62a1d | |||
| ac8045b9c6 | |||
| 417f1e51a4 | |||
| b595812bd0 | |||
| 0172bd6beb | |||
| e02d6e2c8f | |||
| 7458dfc082 | |||
| bed8cb42be | |||
| c849492dfa | |||
| 4f5d30a865 | |||
| 2c0ef660bf | |||
| 21bbed7baf | |||
| 1e95c964f3 | |||
| 2c9547e314 | |||
| f73a97b53b | |||
| 387a0f26fb | |||
| c147ab1e85 | |||
| a5b293b412 | |||
| 7d4cbbd7aa | |||
| b7be49426d | |||
| 96d7bcc2a9 | |||
| 2d2ecbf3ee | |||
| e03136e951 | |||
| 1c6e9fdfae | |||
| d56dd0e091 | |||
| baabd95f30 | |||
| 877058aaed | |||
| 42b1c6440c | |||
| 35a89b1541 | |||
| 8ae6402799 | |||
| 720fd144ef | |||
| 0832b47d21 | |||
| dcc569ee5c | |||
| 0cbe2f2eab | |||
| 3df13ff564 | |||
| c2944dbc0c | |||
| c059f7ddcd | |||
| cf54e3b97e | |||
| 6d52ea8984 | |||
| b8c60234c3 | |||
| 2136c3f3c8 | |||
| a46166d30f | |||
| 85fd599939 | |||
| f3210b58a1 | |||
| d34a52042e | |||
| 99ae48f0b4 | |||
| 96e5300fdd | |||
| 4f621de849 | |||
| 3649a1a179 | |||
| 352485fc54 | |||
| c1e3ca170e | |||
| 9665e08bac | |||
| 65e4df751c | |||
| 4e8aac5308 | |||
| a649aea82a | |||
| 4fcfcfd002 | |||
| 4ce31c7c1a | |||
| 49bc100e51 | |||
| f5a14e5594 | |||
| dc21a0a6b5 | |||
| d218f28070 | |||
| e8a7394009 | |||
| 6a3a6416d7 | |||
| 9e3a826263 | |||
| 8714219dab | |||
| 6c4b3c1efe | |||
| 49fe496914 | |||
| 77578d415f | |||
| ff4c42d182 | |||
| 3d46c1f960 | |||
| 0387f8ad56 | |||
| 9a62173a5b | |||
| 682fdcfc9b | |||
| b9a6edfe3d | |||
| 606a646435 | |||
| 94d14c637f | |||
| cd1ca7b08b | |||
| 98f9a013d1 | |||
| c60fa84027 | |||
| 50eb661df8 | |||
| a87ccb9ac0 | |||
| 8e1b1a845b | |||
| 5253265342 | |||
| 2b303f38a8 | |||
| e6ac64008b | |||
| 7bb8c50080 | |||
| 8c68f1f626 | |||
| 98a157f589 | |||
| a1cc9380e5 | |||
| e938563de5 | |||
| 0ab4bbf771 | |||
| ab40630ff4 | |||
| 8548a8430e | |||
| 06b97b7b67 | |||
| cf852972d1 | |||
| 1f47c22371 | |||
| 602b034a03 | |||
| 8764b17ffc | |||
| ddc1b965b6 | |||
| be6b847675 | |||
| 9206ec30a2 | |||
| a7e9760316 | |||
| 7e1068919b | |||
| 30d46313ec | |||
| c1252a1089 | |||
| a86dc747b3 | |||
| c481e06e87 | |||
| 3bfe4f711d | |||
| 5245c7454c | |||
| 2fabe56bbe | |||
| 2ca39c910d | |||
| cf5a7b9679 | |||
| 9a6a046caf | |||
| c29c52a216 | |||
| 07c9a88d9c | |||
| f3439de480 | |||
| 28dd3aae79 | |||
| 0a5b200da2 | |||
| 9e9327e2f8 | |||
| 9fb0f5ac51 | |||
| 911be68a41 | |||
| 72d90ba8d2 | |||
| d277a1ba75 | |||
| 396f7e1a17 | |||
| 12a3eb776d | |||
| 6628714fc6 | |||
| 187befd665 | |||
| 1292fdf71a | |||
| 3425c90b66 | |||
| b0c5f49170 | |||
| 9cadc1e530 | |||
| c0d76ef984 | |||
| 72063bf136 | |||
| 36c1dce264 | |||
| 964d5a20e9 | |||
| 177478a8ad | |||
| a1c5740044 | |||
| 042ff210d5 | |||
| 091c7a3821 | |||
| c778011f14 | |||
| 4e9cb475da | |||
| e02418e904 | |||
| 840088e021 | |||
| e23ba9215d | |||
| ad71efb2cb | |||
| 8acd4c3ff4 | |||
| 0f263e125b | |||
| 82bd82e2f8 | |||
| c0a8d4e1ef | |||
| a5969aec96 | |||
| b01cdf28ca | |||
| ba84eb58f2 | |||
| d00f36ec75 | |||
| 7ec6d8a336 | |||
| c105b72945 | |||
| 1ed22204c8 | |||
| 034ff3ce13 | |||
| 1386489f41 | |||
| 08da247a87 | |||
| 63bc4d4b7f | |||
| cc024d3ef2 | |||
| 20d957d212 | |||
| 03df7831ab | |||
| 2425dac9a1 | |||
| 9071598a65 | |||
| 16ce114e0c | |||
| 183454a723 | |||
| ba612fc9bd | |||
| 91e21847e2 | |||
| 241991c677 | |||
| 4ef03ccbe1 | |||
| 73d1ea9a52 | |||
| db9a0cfbc0 | |||
| ff7ea605ef | |||
| 6cc5959356 | |||
| ce81433aff | |||
| 63c49be487 | |||
| 4f82b3588a | |||
| 3481c1caec | |||
| 35f96d6da7 | |||
| 2bda7aaf61 | |||
| 3212dd5465 | |||
| 7efc917ee0 | |||
| ec57a938c0 | |||
| c5b6c0456d | |||
| 1b73530b75 | |||
| 7512b5fdde | |||
| eeb997261d | |||
| 3dd1afe4ec | |||
| f151b1d277 | |||
| 047b1ca457 | |||
| 8ebd474c0e | |||
| 9086d6a230 | |||
| d9164bdd4c | |||
| 42b1bd56cc | |||
| eedde323ce | |||
| da6a38f9f6 | |||
| 92e08c9863 | |||
| 773e621190 | |||
| d2f19a3a0d | |||
| a3f05474c9 | |||
| 2d8673197c | |||
| d8ca61b01b | |||
| ec335b7398 | |||
| 7d8e5f623a | |||
| 2b8229f716 | |||
| b80a3a91a8 | |||
| 13d67b6ae7 | |||
| e05a0bc6c5 | |||
| 3da1144cef | |||
| b476bf2a00 | |||
| 23b28a6700 | |||
| eceada586b | |||
| a28cde9c3b | |||
| 529af7a90e | |||
| 8bf58937a9 | |||
| 7dce2d0b8f | |||
| 2e393ab833 | |||
| 0c3722be82 | |||
| 09fb7512ed | |||
| b59aaae2dc | |||
| d77088b19b | |||
| b5a6df4966 | |||
| 67e50b4415 | |||
| 0cf170587f | |||
| 0c2ccd3bae | |||
| 1692801fc5 | |||
| 84f33d0578 | |||
| 5c07e0b6d3 | |||
| e0827069c1 | |||
| 9b55c09999 | |||
| 6bb6039ebb | |||
| ba7c92b0e8 | |||
| 4f8a1213bd | |||
| edf54ac3a9 | |||
| f44c29ad7d | |||
| 0c57dc2e00 | |||
| 07bd58a0e8 | |||
| 7bff337828 | |||
| 24580e348a | |||
| cfdcf9f2d2 | |||
| 63ac69cadf | |||
| 263621aed8 | |||
| 40efd17be4 | |||
| 0f2b7fbc45 | |||
| 1ce31dcd62 | |||
| f55c1cc0fb | |||
| 81c0537b0c | |||
| 32f978ff4b | |||
| 8f3b876ee6 | |||
| 6b0cd392f0 | |||
| ea50be0529 | |||
| b11b08b478 | |||
| a5e89bf724 | |||
| 0d196529f7 | |||
| 77b57459c4 | |||
| 5dde172452 | |||
| d83372a8dc | |||
| 5a797ae7de | |||
| ff8e32453b | |||
| fb2012def2 | |||
| d7ba03a9cb | |||
| 1e744bf5b1 | |||
| 8364ea3954 | |||
| c24e6f7ae9 | |||
| ed2fb773cd | |||
| afb164cc15 | |||
| 474897ff01 | |||
| 29fb2b6e47 | |||
| af72e6b8f4 | |||
| 38bb0db9db | |||
| 2ad8c6dbd0 | |||
| 5c96021172 | |||
| 4b1bb702ce | |||
| a77a2f357c | |||
| 7e78b5d06e | |||
| 11c81067dc | |||
| de6edcc48a | |||
| e9f7c4aeba | |||
| e929dd4d98 | |||
| 10a2c51c52 | |||
| 4664a339ae | |||
| fb81e4df1c | |||
| cb1e9adc63 | |||
| 562796e41b | |||
| bb93c53948 | |||
| 00575b346d | |||
| 7316676c41 | |||
| 77585bf8af | |||
| c821cb1489 | |||
| 86c1babd03 | |||
| 2205b2f5bc | |||
| 975e40f1c0 | |||
| 628b23acc8 | |||
| f8758da289 | |||
| ca9c52ac97 | |||
| b2790973a3 | |||
| e650d87e47 | |||
| feb74b125d | |||
| 3c0b0b0f94 | |||
| 942401de16 | |||
| f9ff9c5618 | |||
| b4845d8c9f | |||
| ea51396731 | |||
| aa82f921cc | |||
| 2da7eae2c4 | |||
| 25159d8e81 | |||
| f40ffe4763 | |||
| 116311b7b4 | |||
| f1ef3a4865 | |||
| 9997aa8187 | |||
| f15b42018c | |||
| f9e9ae85bd | |||
| a49beb7c73 | |||
| 51dff5b9e8 | |||
| 826fc00374 | |||
| c10692deff | |||
| daa7b9ce5f | |||
| 1ab02631b0 | |||
| 3e755b2290 | |||
| f15a167df4 | |||
| f6367a2ea5 | |||
| 5f88e2b496 | |||
| 2c7cf52e3b | |||
| b7c5083a87 | |||
| d5d88efd5d | |||
| 6cb7a7be18 | |||
| cdea6b532f | |||
| d01e3529a6 | |||
| 7c13d3277c | |||
| 345b3b0bdd | |||
| a65d7d4dd3 | |||
| 5e986f3347 | |||
| 27a8bb471b | |||
| 7868733002 | |||
| 469aef2e5e | |||
| 5e00fc6afe | |||
| 5170f0b5da | |||
| dc2dbb4173 | |||
| 79e4f7eb78 | |||
| cc73c7000f | |||
| 8bb26fa5de | |||
| 48612d7c58 | |||
| 8ba84f4b47 | |||
| bc653add74 | |||
| 215f78eee2 | |||
| 4425dac7f4 | |||
| 4f79b9de48 | |||
| 397ac5e68f | |||
| 43c75c64b5 | |||
| c319625a07 | |||
| a7d0448faa | |||
| ca10e5e8ae | |||
| 32414afe72 | |||
| ed10f50d25 | |||
| 48d9be70d5 | |||
| c6b31481b6 | |||
| 514b714cc2 | |||
| 7fec87d3f6 | |||
| 00d555f051 | |||
| 6cf7d6ef4e | |||
| 3ebdcafdd3 | |||
| a348f3eeaa | |||
| 33f423de04 | |||
| d6ba52c3f9 | |||
| e9638d0997 | |||
| 5cb0084547 |
@@ -0,0 +1 @@
|
||||
ippicv
|
||||
Vendored
+2
@@ -3,9 +3,11 @@ set(HAVE_FFMPEG_CODEC 1)
|
||||
set(HAVE_FFMPEG_FORMAT 1)
|
||||
set(HAVE_FFMPEG_UTIL 1)
|
||||
set(HAVE_FFMPEG_SWSCALE 1)
|
||||
set(HAVE_FFMPEG_RESAMPLE 0)
|
||||
set(HAVE_GENTOO_FFMPEG 1)
|
||||
|
||||
set(ALIASOF_libavcodec_VERSION 55.18.102)
|
||||
set(ALIASOF_libavformat_VERSION 55.12.100)
|
||||
set(ALIASOF_libavutil_VERSION 52.38.100)
|
||||
set(ALIASOF_libswscale_VERSION 2.3.100)
|
||||
set(ALIASOF_libavresample_VERSION 1.0.1)
|
||||
Vendored
+1
-1
@@ -14,7 +14,7 @@ ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" ${ZLIB_INCLUDE_DIR})
|
||||
file(GLOB lib_srcs *.c)
|
||||
file(GLOB lib_hdrs *.h)
|
||||
|
||||
if(NEON)
|
||||
if(ARM AND NEON)
|
||||
list(APPEND lib_srcs arm/filter_neon.S)
|
||||
add_definitions(-DPNG_ARM_NEON)
|
||||
endif()
|
||||
|
||||
Vendored
+23
-17
@@ -5,21 +5,26 @@ if (WIN32 AND NOT ARM)
|
||||
message(FATAL_ERROR "BUILD_TBB option supports Windows on ARM only!\nUse regular official TBB build instead of the BUILD_TBB option!")
|
||||
endif()
|
||||
|
||||
if (WIN32 AND ARM)
|
||||
# 4.1 update 4 - The first release that supports Windows RT. Hangs on some Android devices
|
||||
set(tbb_ver "tbb41_20130613oss")
|
||||
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
|
||||
set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
|
||||
set(tbb_version_file "version_string.ver")
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
||||
else()
|
||||
# 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)
|
||||
endif()
|
||||
set(tbb_ver "tbb43_20141204oss")
|
||||
set(tbb_url "http://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb43_20141204oss_src.tgz")
|
||||
set(tbb_md5 "e903dd92d9433701f097fa7ca29a3c1f")
|
||||
set(tbb_version_file "version_string.ver")
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
|
||||
|
||||
# 4.1 update 4 - The first release that supports Windows RT. Hangs on some Android devices
|
||||
#set(tbb_ver "tbb41_20130613oss")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
|
||||
#set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
|
||||
#set(tbb_version_file "version_string.ver")
|
||||
#ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
||||
|
||||
# 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 3 dev - Hangs on some Android devices
|
||||
#set(tbb_ver "tbb41_20130401oss")
|
||||
@@ -113,7 +118,7 @@ if(NOT EXISTS "${tbb_tarball}")
|
||||
message(STATUS "Downloading ${tbb_ver}_src.tgz")
|
||||
file(DOWNLOAD "${tbb_url}" "${tbb_tarball}" TIMEOUT 600 STATUS __statvar)
|
||||
if(NOT __statvar EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to download TBB sources: ${tbb_url}")
|
||||
message(FATAL_ERROR "Failed to download TBB sources (${__statvar}): ${tbb_url}")
|
||||
endif()
|
||||
getMD5("${tbb_tarball}" tbb_local_md5)
|
||||
if(NOT tbb_local_md5 STREQUAL tbb_md5)
|
||||
@@ -169,6 +174,7 @@ if (WIN32)
|
||||
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} /APPCONTAINER")
|
||||
else()
|
||||
add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
|
||||
-D__TBB_WEAK_SYMBOLS_PRESENT=0 #required for 4.3
|
||||
-D__TBB_BUILD=1 #required
|
||||
-D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support
|
||||
-DTBB_USE_DEBUG=0 #just to be sure
|
||||
@@ -198,7 +204,7 @@ endif()
|
||||
|
||||
set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs})
|
||||
|
||||
if (ARM AND NOT WIN32)
|
||||
if ((ARM OR AARCH64) AND NOT WIN32)
|
||||
if (NOT ANDROID)
|
||||
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp")
|
||||
endif()
|
||||
|
||||
Vendored
+1
-1
@@ -82,7 +82,7 @@ if(UNIX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wshorten-64-to-32 -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations)
|
||||
|
||||
set_target_properties(${ZLIB_LIBRARY} PROPERTIES
|
||||
OUTPUT_NAME ${ZLIB_LIBRARY}
|
||||
|
||||
+42
-16
@@ -47,12 +47,24 @@ if(POLICY CMP0022)
|
||||
cmake_policy(SET CMP0022 OLD)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0026)
|
||||
# silence cmake 3.0+ warnings about reading LOCATION attribute
|
||||
cmake_policy(SET CMP0026 OLD)
|
||||
endif()
|
||||
|
||||
if (POLICY CMP0042)
|
||||
# silence cmake 3.0+ warnings about MACOSX_RPATH
|
||||
cmake_policy(SET CMP0042 OLD)
|
||||
endif()
|
||||
|
||||
# must go before the project command
|
||||
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
|
||||
if(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8")
|
||||
set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
|
||||
endif()
|
||||
|
||||
enable_testing()
|
||||
|
||||
project(OpenCV CXX C)
|
||||
|
||||
if(MSVC)
|
||||
@@ -135,7 +147,7 @@ OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support"
|
||||
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
|
||||
OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF WIN32 )
|
||||
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_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF )
|
||||
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_IMAGEIO "ImageIO support for OS X" OFF IF APPLE )
|
||||
@@ -182,6 +194,7 @@ OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for sta
|
||||
OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX )
|
||||
OCV_OPTION(BUILD_ANDROID_SERVICE "Build OpenCV Manager for Google Play" OFF IF ANDROID AND ANDROID_SOURCE_TREE )
|
||||
OCV_OPTION(BUILD_ANDROID_PACKAGE "Build platform-specific package for Google Play" OFF IF ANDROID )
|
||||
OCV_OPTION(BUILD_TINY_GPU_MODULE "Build tiny gpu module with limited image format support" OFF )
|
||||
|
||||
# 3rd party libs
|
||||
OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE )
|
||||
@@ -219,8 +232,8 @@ OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions"
|
||||
OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_AVX "Enable AVX instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_AVX2 "Enable AVX2 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_NEON "Enable NEON instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND ARM )
|
||||
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND ARM )
|
||||
OCV_OPTION(ENABLE_NEON "Enable NEON instructions" AARCH64 IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64))
|
||||
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" AARCH64 IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64))
|
||||
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
|
||||
OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
|
||||
OCV_OPTION(ENABLE_WINRT_MODE "Build with Windows Runtime support" OFF IF WIN32 )
|
||||
@@ -440,6 +453,8 @@ if(UNIX)
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|DragonFly")
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m pthread)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m)
|
||||
else()
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
|
||||
endif()
|
||||
@@ -478,8 +493,13 @@ include(cmake/OpenCVFindLibsPerf.cmake)
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# --- LATEX for pdf documentation ---
|
||||
unset(HAVE_DOXYGEN CACHE)
|
||||
if(BUILD_DOCS)
|
||||
include(cmake/OpenCVFindLATEX.cmake)
|
||||
find_host_program(DOXYGEN_BUILD doxygen)
|
||||
if (DOXYGEN_BUILD)
|
||||
set(HAVE_DOXYGEN 1)
|
||||
endif (DOXYGEN_BUILD)
|
||||
endif(BUILD_DOCS)
|
||||
|
||||
# --- Python Support ---
|
||||
@@ -599,28 +619,31 @@ include(cmake/OpenCVGenConfig.cmake)
|
||||
include(cmake/OpenCVGenInfoPlist.cmake)
|
||||
|
||||
# Generate environment setup file
|
||||
if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH AND UNIX)
|
||||
if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
|
||||
if(ANDROID)
|
||||
get_filename_component(TEST_PATH ${OPENCV_TEST_INSTALL_PATH} DIRECTORY)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_android.sh.in"
|
||||
"${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
|
||||
install(PROGRAMS "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT tests)
|
||||
else()
|
||||
DESTINATION . COMPONENT tests)
|
||||
elseif(WIN32 OR UNIX)
|
||||
set(OPENCV_PYTHON_TESTS_LIST "")
|
||||
if(BUILD_opencv_python)
|
||||
file(GLOB py_tests modules/python/test/*.py)
|
||||
install(PROGRAMS ${py_tests} DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
|
||||
set(OPENCV_PYTHON_TESTS_LIST "test2.py")
|
||||
endif()
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_testing.sh.in"
|
||||
"${CMAKE_BINARY_DIR}/unix-install/opencv_testing.sh" @ONLY)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/unix-install/opencv_testing.sh"
|
||||
DESTINATION /etc/profile.d/ COMPONENT tests)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_unix.sh.in"
|
||||
"${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
|
||||
install(PROGRAMS "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
|
||||
DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
|
||||
if(WIN32)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_windows.cmd.in"
|
||||
"${CMAKE_BINARY_DIR}/win-install/opencv_run_all_tests.cmd" @ONLY)
|
||||
install(PROGRAMS "${CMAKE_BINARY_DIR}/win-install/opencv_run_all_tests.cmd"
|
||||
DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
|
||||
else()
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_unix.sh.in"
|
||||
"${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
|
||||
install(PROGRAMS "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
|
||||
DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -638,11 +661,11 @@ endif()
|
||||
if(ANDROID OR NOT UNIX)
|
||||
install(FILES ${OPENCV_LICENSE_FILE}
|
||||
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT libs)
|
||||
DESTINATION . COMPONENT libs)
|
||||
if(OPENCV_README_FILE)
|
||||
install(FILES ${OPENCV_README_FILE}
|
||||
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT libs)
|
||||
DESTINATION . COMPONENT libs)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -866,6 +889,7 @@ if(DEFINED WITH_FFMPEG)
|
||||
status(" format:" HAVE_FFMPEG_FORMAT THEN "YES (ver ${ALIASOF_libavformat_VERSION})" ELSE NO)
|
||||
status(" util:" HAVE_FFMPEG_UTIL THEN "YES (ver ${ALIASOF_libavutil_VERSION})" ELSE NO)
|
||||
status(" swscale:" HAVE_FFMPEG_SWSCALE THEN "YES (ver ${ALIASOF_libswscale_VERSION})" ELSE NO)
|
||||
status(" resample:" HAVE_FFMPEG_RESAMPLE THEN "YES (ver ${ALIASOF_libavresample_VERSION})" ELSE NO)
|
||||
status(" gentoo-style:" HAVE_GENTOO_FFMPEG THEN YES ELSE NO)
|
||||
endif(DEFINED WITH_FFMPEG)
|
||||
|
||||
@@ -974,6 +998,7 @@ if(HAVE_CUDA)
|
||||
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)
|
||||
status(" Tiny gpu module:" BUILD_TINY_GPU_MODULE THEN YES ELSE NO)
|
||||
endif()
|
||||
|
||||
if(HAVE_OPENCL)
|
||||
@@ -1042,6 +1067,7 @@ if(BUILD_DOCS)
|
||||
endif()
|
||||
status(" Sphinx:" HAVE_SPHINX THEN "${SPHINX_BUILD} (ver ${SPHINX_VERSION})" ELSE NO)
|
||||
status(" PdfLaTeX compiler:" PDFLATEX_COMPILER THEN "${PDFLATEX_COMPILER}" ELSE NO)
|
||||
status(" Doxygen:" HAVE_DOXYGEN THEN "YES (${DOXYGEN_BUILD})" ELSE NO)
|
||||
endif()
|
||||
|
||||
# ========================== samples and tests ==========================
|
||||
|
||||
@@ -2,3 +2,4 @@ link_libraries(${OPENCV_LINKER_LIBS})
|
||||
|
||||
add_subdirectory(haartraining)
|
||||
add_subdirectory(traincascade)
|
||||
add_subdirectory(annotation)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
SET(OPENCV_ANNOTATION_DEPS opencv_core opencv_highgui opencv_imgproc)
|
||||
ocv_check_dependencies(${OPENCV_ANNOTATION_DEPS})
|
||||
|
||||
if(NOT OCV_DEPENDENCIES_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(annotation)
|
||||
|
||||
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
|
||||
ocv_include_modules(${OPENCV_ANNOTATION_DEPS})
|
||||
|
||||
set(annotation_files opencv_annotation.cpp)
|
||||
set(the_target opencv_annotation)
|
||||
|
||||
add_executable(${the_target} ${annotation_files})
|
||||
target_link_libraries(${the_target} ${OPENCV_ANNOTATION_DEPS})
|
||||
|
||||
set_target_properties(${the_target} PROPERTIES
|
||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
||||
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
||||
INSTALL_NAME_DIR lib
|
||||
OUTPUT_NAME "opencv_annotation")
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${the_target} PROPERTIES FOLDER "applications")
|
||||
endif()
|
||||
|
||||
if(INSTALL_CREATE_DISTRIB)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
|
||||
endif()
|
||||
else()
|
||||
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
@@ -0,0 +1,205 @@
|
||||
/*****************************************************************************************************
|
||||
USAGE:
|
||||
./opencv_annotation -images <folder location> -annotations <ouput file>
|
||||
|
||||
Created by: Puttemans Steven
|
||||
*****************************************************************************************************/
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
// Function prototypes
|
||||
void on_mouse(int, int, int, int, void*);
|
||||
string int2string(int);
|
||||
void get_annotations(Mat, stringstream*);
|
||||
|
||||
// Public parameters
|
||||
Mat image;
|
||||
int roi_x0 = 0, roi_y0 = 0, roi_x1 = 0, roi_y1 = 0, num_of_rec = 0;
|
||||
bool start_draw = false;
|
||||
|
||||
// Window name for visualisation purposes
|
||||
const string window_name="OpenCV Based Annotation Tool";
|
||||
|
||||
// FUNCTION : Mouse response for selecting objects in images
|
||||
// If left button is clicked, start drawing a rectangle as long as mouse moves
|
||||
// Stop drawing once a new left click is detected by the on_mouse function
|
||||
void on_mouse(int event, int x, int y, int , void * )
|
||||
{
|
||||
// Action when left button is clicked
|
||||
if(event == CV_EVENT_LBUTTONDOWN)
|
||||
{
|
||||
if(!start_draw)
|
||||
{
|
||||
roi_x0 = x;
|
||||
roi_y0 = y;
|
||||
start_draw = true;
|
||||
} else {
|
||||
roi_x1 = x;
|
||||
roi_y1 = y;
|
||||
start_draw = false;
|
||||
}
|
||||
}
|
||||
// Action when mouse is moving
|
||||
if((event == CV_EVENT_MOUSEMOVE) && start_draw)
|
||||
{
|
||||
// Redraw bounding box for annotation
|
||||
Mat current_view;
|
||||
image.copyTo(current_view);
|
||||
rectangle(current_view, Point(roi_x0,roi_y0), Point(x,y), Scalar(0,0,255));
|
||||
imshow(window_name, current_view);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION : snippet to convert an integer value to a string using a clean function
|
||||
// instead of creating a stringstream each time inside the main code
|
||||
string int2string(int num)
|
||||
{
|
||||
stringstream temp_stream;
|
||||
temp_stream << num;
|
||||
return temp_stream.str();
|
||||
}
|
||||
|
||||
// FUNCTION : given an image containing positive object instances, add all the object
|
||||
// annotations to a known stringstream
|
||||
void get_annotations(Mat input_image, stringstream* output_stream)
|
||||
{
|
||||
// Make it possible to exit the annotation
|
||||
bool stop = false;
|
||||
|
||||
// Reset the num_of_rec element at each iteration
|
||||
// Make sure the global image is set to the current image
|
||||
num_of_rec = 0;
|
||||
image = input_image;
|
||||
|
||||
// Init window interface and couple mouse actions
|
||||
namedWindow(window_name, WINDOW_AUTOSIZE);
|
||||
setMouseCallback(window_name, on_mouse);
|
||||
|
||||
imshow(window_name, image);
|
||||
stringstream temp_stream;
|
||||
int key_pressed = 0;
|
||||
|
||||
do
|
||||
{
|
||||
// Keys for processing
|
||||
// You need to select one for confirming a selection and one to continue to the next image
|
||||
// Based on the universal ASCII code of the keystroke: http://www.asciitable.com/
|
||||
// c = 99 add rectangle to current image
|
||||
// n = 110 save added rectangles and show next image
|
||||
// <ESC> = 27 exit program
|
||||
key_pressed = 0xFF & waitKey(0);
|
||||
switch( key_pressed )
|
||||
{
|
||||
case 27:
|
||||
destroyWindow(window_name);
|
||||
stop = true;
|
||||
case 99:
|
||||
// Add a rectangle to the list
|
||||
num_of_rec++;
|
||||
// Draw initiated from top left corner
|
||||
if(roi_x0<roi_x1 && roi_y0<roi_y1)
|
||||
{
|
||||
temp_stream << " " << int2string(roi_x0) << " " << int2string(roi_y0) << " " << int2string(roi_x1-roi_x0) << " " << int2string(roi_y1-roi_y0);
|
||||
}
|
||||
// Draw initiated from bottom right corner
|
||||
if(roi_x0>roi_x1 && roi_y0>roi_y1)
|
||||
{
|
||||
temp_stream << " " << int2string(roi_x1) << " " << int2string(roi_y1) << " " << int2string(roi_x0-roi_x1) << " " << int2string(roi_y0-roi_y1);
|
||||
}
|
||||
// Draw initiated from top right corner
|
||||
if(roi_x0>roi_x1 && roi_y0<roi_y1)
|
||||
{
|
||||
temp_stream << " " << int2string(roi_x1) << " " << int2string(roi_y0) << " " << int2string(roi_x0-roi_x1) << " " << int2string(roi_y1-roi_y0);
|
||||
}
|
||||
// Draw initiated from bottom left corner
|
||||
if(roi_x0<roi_x1 && roi_y0>roi_y1)
|
||||
{
|
||||
temp_stream << " " << int2string(roi_x0) << " " << int2string(roi_y1) << " " << int2string(roi_x1-roi_x0) << " " << int2string(roi_y0-roi_y1);
|
||||
}
|
||||
|
||||
rectangle(input_image, Point(roi_x0,roi_y0), Point(roi_x1,roi_y1), Scalar(0,255,0), 1);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Check if escape has been pressed
|
||||
if(stop)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Continue as long as the next image key has not been pressed
|
||||
while(key_pressed != 110);
|
||||
|
||||
// If there are annotations AND the next image key is pressed
|
||||
// Write the image annotations to the file
|
||||
if(num_of_rec>0 && key_pressed==110)
|
||||
{
|
||||
*output_stream << " " << num_of_rec << temp_stream.str() << endl;
|
||||
}
|
||||
|
||||
// Close down the window
|
||||
destroyWindow(window_name);
|
||||
}
|
||||
|
||||
int main( int argc, const char** argv )
|
||||
{
|
||||
// If no arguments are given, then supply some information on how this tool works
|
||||
if( argc == 1 ){
|
||||
cout << "Usage: " << argv[0] << endl;
|
||||
cout << " -images <folder_location> [example - /data/testimages/]" << endl;
|
||||
cout << " -annotations <ouput_file> [example - /data/annotations.txt]" << endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Read in the input arguments
|
||||
string image_folder;
|
||||
string annotations;
|
||||
for(int i = 1; i < argc; ++i )
|
||||
{
|
||||
if( !strcmp( argv[i], "-images" ) )
|
||||
{
|
||||
image_folder = argv[++i];
|
||||
}
|
||||
else if( !strcmp( argv[i], "-annotations" ) )
|
||||
{
|
||||
annotations = argv[++i];
|
||||
}
|
||||
}
|
||||
|
||||
// Create the outputfilestream
|
||||
ofstream output(annotations.c_str());
|
||||
|
||||
// Return the image filenames inside the image folder
|
||||
vector<String> filenames;
|
||||
String folder(image_folder);
|
||||
glob(folder, filenames);
|
||||
|
||||
// Loop through each image stored in the images folder
|
||||
// Create and temporarily store the annotations
|
||||
// At the end write everything to the annotations file
|
||||
for (size_t i = 0; i < filenames.size(); i++){
|
||||
// Read in an image
|
||||
Mat current_image = imread(filenames[i]);
|
||||
|
||||
// Perform annotations & generate corresponding output
|
||||
stringstream output_stream;
|
||||
get_annotations(current_image, &output_stream);
|
||||
|
||||
// Store the annotations, write to the output file
|
||||
if (output_stream.str() != ""){
|
||||
output << filenames[i] << output_stream.str();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
+28
-28
@@ -374,7 +374,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*get_length_subbuf() +
|
||||
vi*sample_count + data_root->offset);
|
||||
(size_t)vi*sample_count + data_root->offset);
|
||||
for( int i = 0; i < num_valid; i++ )
|
||||
{
|
||||
idx = src_idx[i];
|
||||
@@ -387,7 +387,7 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
|
||||
else
|
||||
{
|
||||
int* idst_idx = buf->data.i + root->buf_idx*get_length_subbuf() +
|
||||
vi*sample_count + root->offset;
|
||||
(size_t)vi*sample_count + root->offset;
|
||||
for( int i = 0; i < num_valid; i++ )
|
||||
{
|
||||
idx = src_idx[i];
|
||||
@@ -404,14 +404,14 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
|
||||
if (is_buf_16u)
|
||||
{
|
||||
unsigned short* udst = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
|
||||
(workVarCount-1)*sample_count + root->offset);
|
||||
(size_t)(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*get_length_subbuf() +
|
||||
(workVarCount-1)*sample_count + root->offset;
|
||||
(size_t)(workVarCount-1)*sample_count + root->offset;
|
||||
for( int i = 0; i < count; i++ )
|
||||
idst[i] = src_lbls[sidx[i]];
|
||||
}
|
||||
@@ -421,14 +421,14 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
|
||||
if (is_buf_16u)
|
||||
{
|
||||
unsigned short* sample_idx_dst = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
|
||||
workVarCount*sample_count + root->offset);
|
||||
(size_t)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*get_length_subbuf() +
|
||||
workVarCount*sample_count + root->offset;
|
||||
(size_t)workVarCount*sample_count + root->offset;
|
||||
for( int i = 0; i < count; i++ )
|
||||
sample_idx_dst[i] = sample_idx_src[sidx[i]];
|
||||
}
|
||||
@@ -614,9 +614,9 @@ void CvCascadeBoostTrainData::setData( const CvFeatureEvaluator* _featureEvaluat
|
||||
|
||||
// set sample labels
|
||||
if (is_buf_16u)
|
||||
udst = (unsigned short*)(buf->data.s + work_var_count*sample_count);
|
||||
udst = (unsigned short*)(buf->data.s + (size_t)work_var_count*sample_count);
|
||||
else
|
||||
idst = buf->data.i + work_var_count*sample_count;
|
||||
idst = buf->data.i + (size_t)work_var_count*sample_count;
|
||||
|
||||
for (int si = 0; si < sample_count; si++)
|
||||
{
|
||||
@@ -684,11 +684,11 @@ 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*get_length_subbuf() + vi*sample_count + n->offset;
|
||||
*sortedIndices = buf->data.i + n->buf_idx*get_length_subbuf() + (size_t)vi*sample_count + n->offset;
|
||||
else
|
||||
{
|
||||
const unsigned short* shortIndices = (const unsigned short*)(buf->data.s + n->buf_idx*get_length_subbuf() +
|
||||
vi*sample_count + n->offset );
|
||||
(size_t)vi*sample_count + n->offset );
|
||||
for( int i = 0; i < nodeSampleCount; i++ )
|
||||
sortedIndicesBuf[i] = shortIndices[i];
|
||||
|
||||
@@ -799,14 +799,14 @@ struct FeatureIdxOnlyPrecalc : ParallelLoopBody
|
||||
{
|
||||
valCachePtr[si] = (*featureEvaluator)( fi, si );
|
||||
if ( is_buf_16u )
|
||||
*(udst + fi*sample_count + si) = (unsigned short)si;
|
||||
*(udst + (size_t)fi*sample_count + si) = (unsigned short)si;
|
||||
else
|
||||
*(idst + fi*sample_count + si) = si;
|
||||
*(idst + (size_t)fi*sample_count + si) = si;
|
||||
}
|
||||
if ( is_buf_16u )
|
||||
icvSortUShAux( udst + fi*sample_count, sample_count, valCachePtr );
|
||||
icvSortUShAux( udst + (size_t)fi*sample_count, sample_count, valCachePtr );
|
||||
else
|
||||
icvSortIntAux( idst + fi*sample_count, sample_count, valCachePtr );
|
||||
icvSortIntAux( idst + (size_t)fi*sample_count, sample_count, valCachePtr );
|
||||
}
|
||||
}
|
||||
const CvFeatureEvaluator* featureEvaluator;
|
||||
@@ -835,14 +835,14 @@ struct FeatureValAndIdxPrecalc : ParallelLoopBody
|
||||
{
|
||||
valCache->at<float>(fi,si) = (*featureEvaluator)( fi, si );
|
||||
if ( is_buf_16u )
|
||||
*(udst + fi*sample_count + si) = (unsigned short)si;
|
||||
*(udst + (size_t)fi*sample_count + si) = (unsigned short)si;
|
||||
else
|
||||
*(idst + fi*sample_count + si) = si;
|
||||
*(idst + (size_t)fi*sample_count + si) = si;
|
||||
}
|
||||
if ( is_buf_16u )
|
||||
icvSortUShAux( udst + fi*sample_count, sample_count, valCache->ptr<float>(fi) );
|
||||
icvSortUShAux( udst + (size_t)fi*sample_count, sample_count, valCache->ptr<float>(fi) );
|
||||
else
|
||||
icvSortIntAux( idst + fi*sample_count, sample_count, valCache->ptr<float>(fi) );
|
||||
icvSortIntAux( idst + (size_t)fi*sample_count, sample_count, valCache->ptr<float>(fi) );
|
||||
}
|
||||
}
|
||||
const CvFeatureEvaluator* featureEvaluator;
|
||||
@@ -1165,9 +1165,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
|
||||
if (data->is_buf_16u)
|
||||
{
|
||||
unsigned short *ldst = (unsigned short *)(buf->data.s + left->buf_idx*length_buf_row +
|
||||
(workVarCount-1)*scount + left->offset);
|
||||
(size_t)(workVarCount-1)*scount + left->offset);
|
||||
unsigned short *rdst = (unsigned short *)(buf->data.s + right->buf_idx*length_buf_row +
|
||||
(workVarCount-1)*scount + right->offset);
|
||||
(size_t)(workVarCount-1)*scount + right->offset);
|
||||
|
||||
for( int i = 0; i < n; i++ )
|
||||
{
|
||||
@@ -1188,9 +1188,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
|
||||
else
|
||||
{
|
||||
int *ldst = buf->data.i + left->buf_idx*length_buf_row +
|
||||
(workVarCount-1)*scount + left->offset;
|
||||
(size_t)(workVarCount-1)*scount + left->offset;
|
||||
int *rdst = buf->data.i + right->buf_idx*length_buf_row +
|
||||
(workVarCount-1)*scount + right->offset;
|
||||
(size_t)(workVarCount-1)*scount + right->offset;
|
||||
|
||||
for( int i = 0; i < n; i++ )
|
||||
{
|
||||
@@ -1218,9 +1218,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
|
||||
if (data->is_buf_16u)
|
||||
{
|
||||
unsigned short* ldst = (unsigned short*)(buf->data.s + left->buf_idx*length_buf_row +
|
||||
workVarCount*scount + left->offset);
|
||||
(size_t)workVarCount*scount + left->offset);
|
||||
unsigned short* rdst = (unsigned short*)(buf->data.s + right->buf_idx*length_buf_row +
|
||||
workVarCount*scount + right->offset);
|
||||
(size_t)workVarCount*scount + right->offset);
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
unsigned short idx = (unsigned short)tempBuf[i];
|
||||
@@ -1239,9 +1239,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
|
||||
else
|
||||
{
|
||||
int* ldst = buf->data.i + left->buf_idx*length_buf_row +
|
||||
workVarCount*scount + left->offset;
|
||||
(size_t)workVarCount*scount + left->offset;
|
||||
int* rdst = buf->data.i + right->buf_idx*length_buf_row +
|
||||
workVarCount*scount + right->offset;
|
||||
(size_t)workVarCount*scount + right->offset;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
int idx = tempBuf[i];
|
||||
@@ -1410,7 +1410,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*length_buf_row +
|
||||
data->data_root->offset + (data->work_var_count-1)*data->sample_count);
|
||||
data->data_root->offset + (size_t)(data->work_var_count-1)*data->sample_count);
|
||||
for( int i = 0; i < n; i++ )
|
||||
{
|
||||
// save original categorical responses {0,1}, convert them to {-1,1}
|
||||
@@ -1428,7 +1428,7 @@ void CvCascadeBoost::update_weights( CvBoostTree* tree )
|
||||
else
|
||||
{
|
||||
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;
|
||||
data->data_root->offset + (size_t)(data->work_var_count-1)*data->sample_count;
|
||||
|
||||
for( int i = 0; i < n; i++ )
|
||||
{
|
||||
|
||||
@@ -136,7 +136,8 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
||||
const CvCascadeParams& _cascadeParams,
|
||||
const CvFeatureParams& _featureParams,
|
||||
const CvCascadeBoostParams& _stageParams,
|
||||
bool baseFormatSave )
|
||||
bool baseFormatSave,
|
||||
double acceptanceRatioBreakValue)
|
||||
{
|
||||
// Start recording clock ticks for training time output
|
||||
const clock_t begin_time = clock();
|
||||
@@ -169,6 +170,13 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
||||
featureEvaluator = CvFeatureEvaluator::create(cascadeParams.featureType);
|
||||
featureEvaluator->init( (CvFeatureParams*)featureParams, numPos + numNeg, cascadeParams.winSize );
|
||||
stageClassifiers.reserve( numStages );
|
||||
}else{
|
||||
// Make sure that if model parameters are preloaded, that people are aware of this,
|
||||
// even when passing other parameters to the training command
|
||||
cout << "---------------------------------------------------------------------------------" << endl;
|
||||
cout << "Training parameters are pre-loaded from the parameter file in data folder!" << endl;
|
||||
cout << "Please empty this folder if you want to use a NEW set of training parameters." << endl;
|
||||
cout << "---------------------------------------------------------------------------------" << endl;
|
||||
}
|
||||
cout << "PARAMETERS:" << endl;
|
||||
cout << "cascadeDirName: " << _cascadeDirName << endl;
|
||||
@@ -179,6 +187,7 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
||||
cout << "numStages: " << numStages << endl;
|
||||
cout << "precalcValBufSize[Mb] : " << _precalcValBufSize << endl;
|
||||
cout << "precalcIdxBufSize[Mb] : " << _precalcIdxBufSize << endl;
|
||||
cout << "acceptanceRatioBreakValue : " << acceptanceRatioBreakValue << endl;
|
||||
cascadeParams.printAttrs();
|
||||
stageParams->printAttrs();
|
||||
featureParams->printAttrs();
|
||||
@@ -201,15 +210,20 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
||||
if ( !updateTrainingSet( requiredLeafFARate, tempLeafFARate ) )
|
||||
{
|
||||
cout << "Train dataset for temp stage can not be filled. "
|
||||
"Branch training terminated." << endl;
|
||||
"Branch training terminated." << endl;
|
||||
break;
|
||||
}
|
||||
if( tempLeafFARate <= requiredLeafFARate )
|
||||
{
|
||||
cout << "Required leaf false alarm rate achieved. "
|
||||
"Branch training terminated." << endl;
|
||||
"Branch training terminated." << endl;
|
||||
break;
|
||||
}
|
||||
if( (tempLeafFARate <= acceptanceRatioBreakValue) && (acceptanceRatioBreakValue >= 0) ){
|
||||
cout << "The required acceptanceRatio for the model has been reached to avoid overfitting of trainingdata. "
|
||||
"Branch training terminated." << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
CvCascadeBoost* tempStage = new CvCascadeBoost;
|
||||
bool isStageTrained = tempStage->train( (CvFeatureEvaluator*)featureEvaluator,
|
||||
@@ -509,8 +523,6 @@ void CvCascadeClassifier::save( const string filename, bool baseFormat )
|
||||
|
||||
bool CvCascadeClassifier::load( const string cascadeDirName )
|
||||
{
|
||||
cout << "Training parameters are loaded from the parameter file in data folder!" << endl;
|
||||
cout << "Please empty the data folder if you want to use your own set of parameters." << endl;
|
||||
FileStorage fs( cascadeDirName + CC_PARAMS_FILENAME, FileStorage::READ );
|
||||
if ( !fs.isOpened() )
|
||||
return false;
|
||||
|
||||
@@ -96,7 +96,8 @@ public:
|
||||
const CvCascadeParams& _cascadeParams,
|
||||
const CvFeatureParams& _featureParams,
|
||||
const CvCascadeBoostParams& _stageParams,
|
||||
bool baseFormatSave = false );
|
||||
bool baseFormatSave = false,
|
||||
double acceptanceRatioBreakValue = -1.0 );
|
||||
private:
|
||||
int predict( int sampleIdx );
|
||||
void save( const std::string cascadeDirName, bool baseFormat = false );
|
||||
|
||||
@@ -32,20 +32,12 @@ bool CvCascadeImageReader::NegReader::create( const string _filename, Size _winS
|
||||
if ( !file.is_open() )
|
||||
return false;
|
||||
|
||||
size_t pos = _filename.rfind('\\');
|
||||
char dlmrt = '\\';
|
||||
if (pos == string::npos)
|
||||
{
|
||||
pos = _filename.rfind('/');
|
||||
dlmrt = '/';
|
||||
}
|
||||
dirname = pos == string::npos ? "" : _filename.substr(0, pos) + dlmrt;
|
||||
while( !file.eof() )
|
||||
{
|
||||
std::getline(file, str);
|
||||
if (str.empty()) break;
|
||||
if (str.at(0) == '#' ) continue; /* comment */
|
||||
imgFilenames.push_back(dirname + str);
|
||||
imgFilenames.push_back(str);
|
||||
}
|
||||
file.close();
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#ifndef _OPENCV_IMAGESTORAGE_H_
|
||||
#define _OPENCV_IMAGESTORAGE_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "highgui.h"
|
||||
|
||||
|
||||
|
||||
class CvCascadeImageReader
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -14,9 +14,10 @@ int main( int argc, char* argv[] )
|
||||
int numPos = 2000;
|
||||
int numNeg = 1000;
|
||||
int numStages = 20;
|
||||
int precalcValBufSize = 256,
|
||||
precalcIdxBufSize = 256;
|
||||
int precalcValBufSize = 1024,
|
||||
precalcIdxBufSize = 1024;
|
||||
bool baseFormatSave = false;
|
||||
double acceptanceRatioBreakValue = -1.0;
|
||||
|
||||
CvCascadeParams cascadeParams;
|
||||
CvCascadeBoostParams stageParams;
|
||||
@@ -37,6 +38,7 @@ int main( int argc, char* argv[] )
|
||||
cout << " [-precalcValBufSize <precalculated_vals_buffer_size_in_Mb = " << precalcValBufSize << ">]" << endl;
|
||||
cout << " [-precalcIdxBufSize <precalculated_idxs_buffer_size_in_Mb = " << precalcIdxBufSize << ">]" << endl;
|
||||
cout << " [-baseFormatSave]" << endl;
|
||||
cout << " [-acceptanceRatioBreakValue <value> = " << acceptanceRatioBreakValue << ">]" << endl;
|
||||
cascadeParams.printDefaults();
|
||||
stageParams.printDefaults();
|
||||
for( int fi = 0; fi < fc; fi++ )
|
||||
@@ -83,6 +85,10 @@ int main( int argc, char* argv[] )
|
||||
{
|
||||
baseFormatSave = true;
|
||||
}
|
||||
else if( !strcmp( argv[i], "-acceptanceRatioBreakValue" ) )
|
||||
{
|
||||
acceptanceRatioBreakValue = atof(argv[++i]);
|
||||
}
|
||||
else if ( cascadeParams.scanAttr( argv[i], argv[i+1] ) ) { i++; }
|
||||
else if ( stageParams.scanAttr( argv[i], argv[i+1] ) ) { i++; }
|
||||
else if ( !set )
|
||||
@@ -108,6 +114,7 @@ int main( int argc, char* argv[] )
|
||||
cascadeParams,
|
||||
*featureParams[cascadeParams.featureType],
|
||||
stageParams,
|
||||
baseFormatSave );
|
||||
baseFormatSave,
|
||||
acceptanceRatioBreakValue );
|
||||
return 0;
|
||||
}
|
||||
|
||||
+160
-241
@@ -31,10 +31,8 @@
|
||||
# The following variables affect the behavior of the macros in the
|
||||
# script (in alphebetical order). Note that any of these flags can be
|
||||
# changed multiple times in the same directory before calling
|
||||
# CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY, CUDA_COMPILE, CUDA_COMPILE_PTX
|
||||
# or CUDA_WRAP_SRCS.
|
||||
#
|
||||
# ::
|
||||
# CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY, CUDA_COMPILE, CUDA_COMPILE_PTX,
|
||||
# CUDA_COMPILE_FATBIN, CUDA_COMPILE_CUBIN or CUDA_WRAP_SRCS::
|
||||
#
|
||||
# CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
|
||||
# -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code.
|
||||
@@ -43,19 +41,11 @@
|
||||
# nvcc in the generated source. If you compile to PTX and then load the
|
||||
# file yourself, you can mix bit sizes between device and host.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
|
||||
# -- Set to ON if you want the custom build rule to be attached to the source
|
||||
# file in Visual Studio. Turn OFF if you add the same cuda file to multiple
|
||||
# targets.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# This allows the user to build the target from the CUDA file; however, bad
|
||||
# things can happen if the CUDA source file is added to multiple targets.
|
||||
# When performing parallel builds it is possible for the custom build
|
||||
@@ -68,44 +58,24 @@
|
||||
# this script could detect the reuse of source files across multiple targets
|
||||
# and turn the option off for the user, but no good solution could be found.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_BUILD_CUBIN (Default OFF)
|
||||
# -- Set to ON to enable and extra compilation pass with the -cubin option in
|
||||
# Device mode. The output is parsed and register, shared memory usage is
|
||||
# printed during build.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_BUILD_EMULATION (Default OFF for device mode)
|
||||
# -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
|
||||
# when CUDA_BUILD_EMULATION is TRUE.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
|
||||
# -- Set to the path you wish to have the generated files placed. If it is
|
||||
# blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
|
||||
# Intermediate files will always be placed in
|
||||
# CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_HOST_COMPILATION_CPP (Default ON)
|
||||
# -- Set to OFF for C compilation of host code.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER, $(VCInstallDir)/bin for VS)
|
||||
# -- Set the host compiler to be used by nvcc. Ignored if -ccbin or
|
||||
# --compiler-bindir is already present in the CUDA_NVCC_FLAGS or
|
||||
@@ -113,19 +83,11 @@
|
||||
# $(VCInstallDir)/bin is a special value that expands out to the path when
|
||||
# the command is run from withing VS.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_NVCC_FLAGS
|
||||
# CUDA_NVCC_FLAGS_<CONFIG>
|
||||
# -- Additional NVCC command line arguments. NOTE: multiple arguments must be
|
||||
# semi-colon delimited (e.g. --compiler-options;-Wall)
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_PROPAGATE_HOST_FLAGS (Default ON)
|
||||
# -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
|
||||
# dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
|
||||
@@ -137,10 +99,6 @@
|
||||
# CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for
|
||||
# shared library compilation are not affected by this flag.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_SEPARABLE_COMPILATION (Default OFF)
|
||||
# -- If set this will enable separable compilation for all CUDA runtime object
|
||||
# files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY
|
||||
@@ -148,38 +106,22 @@
|
||||
# CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
|
||||
# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_VERBOSE_BUILD (Default OFF)
|
||||
# -- Set to ON to see all the commands used when building the CUDA file. When
|
||||
# using a Makefile generator the value defaults to VERBOSE (run make
|
||||
# VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
|
||||
# always print the output.
|
||||
#
|
||||
#
|
||||
#
|
||||
# The script creates the following macros (in alphebetical order):
|
||||
#
|
||||
# ::
|
||||
# The script creates the following macros (in alphebetical order)::
|
||||
#
|
||||
# CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
|
||||
# -- Adds the cufft library to the target (can be any target). Handles whether
|
||||
# you are in emulation mode or not.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
|
||||
# -- Adds the cublas library to the target (can be any target). Handles
|
||||
# whether you are in emulation mode or not.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
|
||||
# [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
|
||||
# -- Creates an executable "cuda_target" which is made up of the files
|
||||
@@ -193,42 +135,28 @@
|
||||
# nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
|
||||
# CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
|
||||
# [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
|
||||
# -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_BUILD_CLEAN_TARGET()
|
||||
# -- Creates a convience target that deletes all the dependency files
|
||||
# generated. You should make clean after running this target to ensure the
|
||||
# dependency files get regenerated.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
|
||||
# [OPTIONS ...] )
|
||||
# -- Returns a list of generated files from the input source files to be used
|
||||
# with ADD_LIBRARY or ADD_EXECUTABLE.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
|
||||
# -- Returns a list of PTX files generated from the input source files.
|
||||
#
|
||||
# CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] )
|
||||
# -- Returns a list of FATBIN files generated from the input source files.
|
||||
#
|
||||
#
|
||||
# ::
|
||||
# CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] )
|
||||
# -- Returns a list of CUBIN files generated from the input source files.
|
||||
#
|
||||
# CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var
|
||||
# cuda_target
|
||||
@@ -242,10 +170,6 @@
|
||||
# automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that
|
||||
# this is a function and not a macro.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
|
||||
# -- Sets the directories that should be passed to nvcc
|
||||
# (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu
|
||||
@@ -253,17 +177,9 @@
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target
|
||||
# nvcc_flags object_files)
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# -- Generates the link object required by separable compilation from the given
|
||||
# object files. This is called automatically for CUDA_ADD_EXECUTABLE and
|
||||
# CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS
|
||||
@@ -273,91 +189,51 @@
|
||||
# specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function
|
||||
# instead of a macro.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
|
||||
# [STATIC | SHARED | MODULE] [OPTIONS ...] )
|
||||
# -- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
|
||||
# CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
|
||||
# function under the hood.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# Given the list of files (file0 file1 ... fileN) this macro generates
|
||||
# custom commands that generate either PTX or linkable objects (use "PTX" or
|
||||
# "OBJ" for the format argument to switch). Files that don't end with .cu
|
||||
# or have the HEADER_FILE_ONLY property are ignored.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# The arguments passed in after OPTIONS are extra command line options to
|
||||
# give to nvcc. You can also specify per configuration options by
|
||||
# specifying the name of the configuration followed by the options. General
|
||||
# options must preceed configuration specific options. Not all
|
||||
# configurations need to be specified, only the ones provided will be used.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
|
||||
# DEBUG -g
|
||||
# RELEASE --use_fast_math
|
||||
# RELWITHDEBINFO --use_fast_math;-g
|
||||
# MINSIZEREL --use_fast_math
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# For certain configurations (namely VS generating object files with
|
||||
# CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
|
||||
# be produced for the given cuda file. This is because when you add the
|
||||
# cuda file to Visual Studio it knows that this file produces an object file
|
||||
# and will link in the resulting object file automatically.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# This script will also generate a separate cmake script that is used at
|
||||
# build time to invoke nvcc. This is for several reasons.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# 1. nvcc can return negative numbers as return values which confuses
|
||||
# Visual Studio into thinking that the command succeeded. The script now
|
||||
# checks the error codes and produces errors when there was a problem.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# 2. nvcc has been known to not delete incomplete results when it
|
||||
# encounters problems. This confuses build systems into thinking the
|
||||
# target was generated when in fact an unusable file exists. The script
|
||||
# now deletes the output files if there was an error.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# 3. By putting all the options that affect the build into a file and then
|
||||
# make the build rule dependent on the file, the output files will be
|
||||
# regenerated when the options change.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# This script also looks at optional arguments STATIC, SHARED, or MODULE to
|
||||
# determine when to target the object compilation for a shared library.
|
||||
# BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
|
||||
@@ -366,27 +242,17 @@
|
||||
# <target_name>_EXPORTS is defined when a shared library compilation is
|
||||
# detected.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# Flags passed into add_definitions with -D or /D are passed along to nvcc.
|
||||
#
|
||||
#
|
||||
#
|
||||
# The script defines the following variables:
|
||||
#
|
||||
# ::
|
||||
# The script defines the following variables::
|
||||
#
|
||||
# CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc.
|
||||
# CUDA_VERSION_MINOR -- The minor version.
|
||||
# CUDA_VERSION
|
||||
# CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
|
||||
# CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the
|
||||
# SDK. This script will not directly support finding
|
||||
@@ -412,13 +278,13 @@
|
||||
# Only available for CUDA version 3.2+.
|
||||
# CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
|
||||
# Only available for CUDA version 3.2+.
|
||||
# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives library.
|
||||
# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib.
|
||||
# Only available for CUDA version 4.0+.
|
||||
# CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives library (core).
|
||||
# CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core).
|
||||
# Only available for CUDA version 5.5+.
|
||||
# CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives library (image processing).
|
||||
# CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
|
||||
# Only available for CUDA version 5.5+.
|
||||
# CUDA_npps_LIBRARY -- NVIDIA Performance Primitives library (signal processing).
|
||||
# CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing).
|
||||
# Only available for CUDA version 5.5+.
|
||||
# CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
|
||||
# Only available for CUDA version 3.2+.
|
||||
@@ -427,32 +293,15 @@
|
||||
# Only available for CUDA version 3.2+.
|
||||
# Windows only.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
|
||||
# James Bigler, NVIDIA Corp (nvidia.com - jbigler)
|
||||
# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# Copyright (c) 2007-2009
|
||||
# Scientific Computing and Imaging Institute, University of Utah
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# This code is licensed under the MIT License. See the FindCUDA.cmake script
|
||||
# for the text of the license.
|
||||
|
||||
@@ -481,11 +330,6 @@
|
||||
|
||||
# FindCUDA.cmake
|
||||
|
||||
# We need to have at least this version to support the VERSION_LESS argument to 'if' (2.6.2) and unset (2.6.3)
|
||||
cmake_policy(PUSH)
|
||||
cmake_minimum_required(VERSION 2.6.3)
|
||||
cmake_policy(POP)
|
||||
|
||||
# This macro helps us find the location of helper files we will need the full path to
|
||||
macro(CUDA_FIND_HELPER_FILE _name _extension)
|
||||
set(_full_name "${_name}.${_extension}")
|
||||
@@ -608,7 +452,17 @@ set(CUDA_NVCC_FLAGS "" CACHE STRING "Semi-colon delimit multiple arguments.")
|
||||
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
set(CUDA_HOST_COMPILER "$(VCInstallDir)bin" CACHE FILEPATH "Host side compiler used by NVCC")
|
||||
else()
|
||||
set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC")
|
||||
# Using cc which is symlink to clang may let NVCC think it is GCC and issue
|
||||
# unhandled -dumpspecs option to clang. Also in case neither
|
||||
# CMAKE_C_COMPILER is defined (project does not use C language) nor
|
||||
# CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let
|
||||
# nvcc use its own default C compiler.
|
||||
if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER)
|
||||
get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH)
|
||||
else()
|
||||
set(c_compiler_realpath "")
|
||||
endif()
|
||||
set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC")
|
||||
endif()
|
||||
|
||||
# Propagate the host flags to the host compiler via -Xcompiler
|
||||
@@ -675,14 +529,16 @@ endmacro()
|
||||
|
||||
# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed,
|
||||
# if they have then clear the cache variables, so that will be detected again.
|
||||
if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}")
|
||||
if(DEFINED CUDA_TOOLKIT_ROOT_DIR_INTERNAL AND (NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}"))
|
||||
unset(CUDA_TARGET_TRIPLET CACHE)
|
||||
unset(CUDA_TOOLKIT_TARGET_DIR CACHE)
|
||||
unset(CUDA_NVCC_EXECUTABLE CACHE)
|
||||
unset(CUDA_VERSION CACHE)
|
||||
cuda_unset_include_and_libraries()
|
||||
endif()
|
||||
|
||||
if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}")
|
||||
if(DEFINED CUDA_TARGET_TRIPLET_INTERNAL AND (NOT "${CUDA_TARGET_TRIPLET}" STREQUAL "${CUDA_TARGET_TRIPLET_INTERNAL}") OR
|
||||
(DEFINED CUDA_TOOLKIT_TARGET_DIR AND DEFINED CUDA_TOOLKIT_TARGET_DIR_INTERNAL AND NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}"))
|
||||
cuda_unset_include_and_libraries()
|
||||
endif()
|
||||
|
||||
@@ -758,27 +614,54 @@ endif()
|
||||
# Always set this convenience variable
|
||||
set(CUDA_VERSION_STRING "${CUDA_VERSION}")
|
||||
|
||||
# Support for arm cross compilation with CUDA 5.5
|
||||
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}")
|
||||
if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
|
||||
if(ANDROID AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-androideabi")
|
||||
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-androideabi")
|
||||
elseif(EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
|
||||
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
|
||||
endif()
|
||||
endif()
|
||||
set(CUDA_TOOLKIT_TARGET_DIR "${__cuda_toolkit_target_dir_initial}" CACHE PATH "Toolkit target location.")
|
||||
mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR)
|
||||
|
||||
# Target CPU architecture
|
||||
if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
|
||||
if(DEFINED CUDA_TARGET_CPU_ARCH)
|
||||
set(_cuda_target_cpu_arch_initial "${CUDA_TARGET_CPU_ARCH}")
|
||||
elseif(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|ARM)")
|
||||
set(_cuda_target_cpu_arch_initial "ARM")
|
||||
elseif(CUDA_VERSION VERSION_GREATER "6.5" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|AARCH64)")
|
||||
set(_cuda_target_cpu_arch_initial "AARCH64")
|
||||
else()
|
||||
set(_cuda_target_cpu_arch_initial "")
|
||||
endif()
|
||||
set(CUDA_TARGET_CPU_ARCH ${_cuda_target_cpu_arch_initial} CACHE STRING "Specify the name of the class of CPU architecture for which the input files must be compiled.")
|
||||
set(CUDA_TARGET_CPU_ARCH "${_cuda_target_cpu_arch_initial}" CACHE STRING "Specify the name of the class of CPU architecture for which the input files must be compiled.")
|
||||
mark_as_advanced(CUDA_TARGET_CPU_ARCH)
|
||||
|
||||
# Target OS variant
|
||||
if(DEFINED CUDA_TARGET_OS_VARIANT)
|
||||
set(_cuda_target_os_variant_initial "${CUDA_TARGET_OS_VARIANT}")
|
||||
else()
|
||||
set(_cuda_target_os_variant_initial "")
|
||||
endif()
|
||||
set(CUDA_TARGET_OS_VARIANT "${_cuda_target_os_variant_initial}" CACHE STRING "Specify the name of the class of OS for which the input files must be compiled.")
|
||||
mark_as_advanced(CUDA_TARGET_OS_VARIANT)
|
||||
|
||||
# Target triplet
|
||||
if(DEFINED CUDA_TARGET_TRIPLET)
|
||||
set(_cuda_target_triplet_initial "${CUDA_TARGET_TRIPLET}")
|
||||
elseif(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND "${CUDA_TARGET_CPU_ARCH}" STREQUAL "ARM")
|
||||
if("${CUDA_TARGET_OS_VARIANT}" STREQUAL "Android" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-androideabi")
|
||||
set(_cuda_target_triplet_initial "armv7-linux-androideabi")
|
||||
elseif(EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
|
||||
set(_cuda_target_triplet_initial "armv7-linux-gnueabihf")
|
||||
endif()
|
||||
elseif(CUDA_VERSION VERSION_GREATER "6.5" AND CMAKE_CROSSCOMPILING AND "${CUDA_TARGET_CPU_ARCH}" STREQUAL "AARCH64")
|
||||
if("${CUDA_TARGET_OS_VARIANT}" STREQUAL "Android" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/aarch64-linux-androideabi")
|
||||
set(_cuda_target_triplet_initial "aarch64-linux-androideabi")
|
||||
elseif(EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/aarch64-linux-gnueabihf")
|
||||
set(_cuda_target_triplet_initial "aarch64-linux-gnueabihf")
|
||||
endif()
|
||||
endif()
|
||||
set(CUDA_TARGET_TRIPLET "${_cuda_target_triplet_initial}" CACHE STRING "Specify the target triplet for which the input files must be compiled.")
|
||||
file(GLOB __cuda_available_target_tiplets RELATIVE "${CUDA_TOOLKIT_ROOT_DIR}/targets" "${CUDA_TOOLKIT_ROOT_DIR}/targets/*" )
|
||||
set_property(CACHE CUDA_TARGET_TRIPLET PROPERTY STRINGS ${__cuda_available_target_tiplets})
|
||||
mark_as_advanced(CUDA_TARGET_TRIPLET)
|
||||
|
||||
# Target directory
|
||||
if(NOT DEFINED CUDA_TOOLKIT_TARGET_DIR AND CUDA_TARGET_TRIPLET AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/${CUDA_TARGET_TRIPLET}")
|
||||
set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/${CUDA_TARGET_TRIPLET}")
|
||||
endif()
|
||||
|
||||
# CUDA_TOOLKIT_INCLUDE
|
||||
find_path(CUDA_TOOLKIT_INCLUDE
|
||||
device_functions.h # Header included in toolkit
|
||||
@@ -802,10 +685,16 @@ macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext )
|
||||
# and old paths.
|
||||
set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" )
|
||||
endif()
|
||||
if(CUDA_VERSION VERSION_GREATER "6.0")
|
||||
set(_cuda_static_lib_names "")
|
||||
foreach(name ${_names})
|
||||
list(APPEND _cuda_static_lib_names "${name}_static")
|
||||
endforeach()
|
||||
endif()
|
||||
# CUDA 3.2+ on Windows moved the library directories, so we need to new
|
||||
# (lib/Win32) and the old path (lib).
|
||||
find_library(${_var}
|
||||
NAMES ${_names}
|
||||
NAMES ${_names} ${_cuda_static_lib_names}
|
||||
PATHS "${CUDA_TOOLKIT_TARGET_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}"
|
||||
ENV CUDA_PATH
|
||||
ENV CUDA_LIB_PATH
|
||||
@@ -815,7 +704,7 @@ macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext )
|
||||
)
|
||||
# Search default search paths, after we search our own set of paths.
|
||||
find_library(${_var}
|
||||
NAMES ${_names}
|
||||
NAMES ${_names} ${_cuda_static_lib_names}
|
||||
PATHS "/usr/lib/nvidia-current"
|
||||
DOC ${_doc}
|
||||
)
|
||||
@@ -853,18 +742,6 @@ if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
|
||||
else()
|
||||
set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
|
||||
endif()
|
||||
if(APPLE)
|
||||
# We need to add the path to cudart to the linker using rpath, since the
|
||||
# library name for the cuda libraries is prepended with @rpath.
|
||||
if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
|
||||
get_filename_component(_cuda_path_to_cudart "${CUDA_CUDARTEMU_LIBRARY}" PATH)
|
||||
else()
|
||||
get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH)
|
||||
endif()
|
||||
if(_cuda_path_to_cudart)
|
||||
list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# 1.1 toolkit on linux doesn't appear to have a separate library on
|
||||
# some platforms.
|
||||
@@ -997,6 +874,8 @@ set(CUDA_FOUND TRUE)
|
||||
|
||||
set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL
|
||||
"This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE)
|
||||
set(CUDA_TARGET_TRIPLET_INTERNAL "${CUDA_TARGET_TRIPLET}" CACHE INTERNAL
|
||||
"This is the value of the last time CUDA_TARGET_TRIPLET was set successfully." FORCE)
|
||||
set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL
|
||||
"This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE)
|
||||
set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL
|
||||
@@ -1044,15 +923,15 @@ macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options)
|
||||
set( ${_options} )
|
||||
set( _found_options FALSE )
|
||||
foreach(arg ${ARGN})
|
||||
if(arg STREQUAL "OPTIONS")
|
||||
if("x${arg}" STREQUAL "xOPTIONS")
|
||||
set( _found_options TRUE )
|
||||
elseif(
|
||||
arg STREQUAL "WIN32" OR
|
||||
arg STREQUAL "MACOSX_BUNDLE" OR
|
||||
arg STREQUAL "EXCLUDE_FROM_ALL" OR
|
||||
arg STREQUAL "STATIC" OR
|
||||
arg STREQUAL "SHARED" OR
|
||||
arg STREQUAL "MODULE"
|
||||
"x${arg}" STREQUAL "xWIN32" OR
|
||||
"x${arg}" STREQUAL "xMACOSX_BUNDLE" OR
|
||||
"x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR
|
||||
"x${arg}" STREQUAL "xSTATIC" OR
|
||||
"x${arg}" STREQUAL "xSHARED" OR
|
||||
"x${arg}" STREQUAL "xMODULE"
|
||||
)
|
||||
list(APPEND ${_cmake_options} ${arg})
|
||||
else()
|
||||
@@ -1148,7 +1027,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# This recipie is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
|
||||
# This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
|
||||
# CMake source.
|
||||
|
||||
# Remove leading /
|
||||
@@ -1177,7 +1056,7 @@ endfunction()
|
||||
# a .cpp or .ptx file.
|
||||
# INPUT:
|
||||
# cuda_target - Target name
|
||||
# format - PTX or OBJ
|
||||
# format - PTX, CUBIN, FATBIN or OBJ
|
||||
# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped.
|
||||
# OPTIONS - Extra options to NVCC
|
||||
# OUTPUT:
|
||||
@@ -1223,8 +1102,14 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||
set(nvcc_flags ${nvcc_flags} -m32)
|
||||
endif()
|
||||
|
||||
if(CUDA_TARGET_CPU_ARCH)
|
||||
set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}")
|
||||
if(CUDA_TARGET_CPU_ARCH AND CUDA_VERSION VERSION_LESS "7.0")
|
||||
# CPU architecture is either ARM or X86. Patch AARCH64 to be ARM
|
||||
string(REPLACE "AARCH64" "ARM" CUDA_TARGET_CPU_ARCH_patched ${CUDA_TARGET_CPU_ARCH})
|
||||
set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH_patched}")
|
||||
endif()
|
||||
|
||||
if(CUDA_TARGET_OS_VARIANT AND CUDA_VERSION VERSION_LESS "7.0")
|
||||
set(nvcc_flags ${nvcc_flags} "-target-os-variant=${CUDA_TARGET_OS_VARIANT}")
|
||||
endif()
|
||||
|
||||
# This needs to be passed in at this stage, because VS needs to fill out the
|
||||
@@ -1355,7 +1240,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||
foreach(file ${ARGN})
|
||||
# Ignore any file marked as a HEADER_FILE_ONLY
|
||||
get_source_file_property(_is_header ${file} HEADER_FILE_ONLY)
|
||||
if(${file} MATCHES ".*\\.cu$" AND NOT _is_header)
|
||||
if(${file} MATCHES "\\.cu$" AND NOT _is_header)
|
||||
|
||||
# Allow per source file overrides of the format.
|
||||
get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT)
|
||||
@@ -1363,16 +1248,22 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||
set(_cuda_source_format ${format})
|
||||
endif()
|
||||
|
||||
if( ${_cuda_source_format} MATCHES "PTX" )
|
||||
set( compile_to_ptx ON )
|
||||
elseif( ${_cuda_source_format} MATCHES "OBJ")
|
||||
set( compile_to_ptx OFF )
|
||||
if( ${_cuda_source_format} MATCHES "OBJ")
|
||||
set( cuda_compile_to_external_module OFF )
|
||||
else()
|
||||
message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS for file '${file}': '${_cuda_source_format}'. Use OBJ or PTX.")
|
||||
set( cuda_compile_to_external_module ON )
|
||||
if( ${_cuda_source_format} MATCHES "PTX" )
|
||||
set( cuda_compile_to_external_module_type "ptx" )
|
||||
elseif( ${_cuda_source_format} MATCHES "CUBIN")
|
||||
set( cuda_compile_to_external_module_type "cubin" )
|
||||
elseif( ${_cuda_source_format} MATCHES "FATBIN")
|
||||
set( cuda_compile_to_external_module_type "fatbin" )
|
||||
else()
|
||||
message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
if(compile_to_ptx)
|
||||
if(cuda_compile_to_external_module)
|
||||
# Don't use any of the host compilation flags for PTX targets.
|
||||
set(CUDA_HOST_FLAGS)
|
||||
set(CUDA_NVCC_FLAGS_CONFIG)
|
||||
@@ -1387,7 +1278,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||
if(CUDA_GENERATED_OUTPUT_DIR)
|
||||
set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}")
|
||||
else()
|
||||
if ( compile_to_ptx )
|
||||
if ( cuda_compile_to_external_module )
|
||||
set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
else()
|
||||
set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}")
|
||||
@@ -1397,10 +1288,10 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||
# Add a custom target to generate a c or ptx file. ######################
|
||||
|
||||
get_filename_component( basename ${file} NAME )
|
||||
if( compile_to_ptx )
|
||||
if( cuda_compile_to_external_module )
|
||||
set(generated_file_path "${cuda_compile_output_dir}")
|
||||
set(generated_file_basename "${cuda_target}_generated_${basename}.ptx")
|
||||
set(format_flag "-ptx")
|
||||
set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}")
|
||||
set(format_flag "-${cuda_compile_to_external_module_type}")
|
||||
file(MAKE_DIRECTORY "${cuda_compile_output_dir}")
|
||||
else()
|
||||
set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}")
|
||||
@@ -1423,7 +1314,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||
set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake")
|
||||
|
||||
# Setup properties for obj files:
|
||||
if( NOT compile_to_ptx )
|
||||
if( NOT cuda_compile_to_external_module )
|
||||
set_source_files_properties("${generated_file}"
|
||||
PROPERTIES
|
||||
EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked.
|
||||
@@ -1438,7 +1329,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||
set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
|
||||
endif()
|
||||
|
||||
if( NOT compile_to_ptx AND CUDA_SEPARABLE_COMPILATION)
|
||||
if( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION)
|
||||
list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}")
|
||||
endif()
|
||||
|
||||
@@ -1455,7 +1346,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||
# Build the NVCC made dependency file ###################################
|
||||
set(build_cubin OFF)
|
||||
if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
|
||||
if ( NOT compile_to_ptx )
|
||||
if ( NOT cuda_compile_to_external_module )
|
||||
set ( build_cubin ON )
|
||||
endif()
|
||||
endif()
|
||||
@@ -1482,8 +1373,8 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||
|
||||
# Create up the comment string
|
||||
file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}")
|
||||
if(compile_to_ptx)
|
||||
set(cuda_build_comment_string "Building NVCC ptx file ${generated_file_relative_path}")
|
||||
if(cuda_compile_to_external_module)
|
||||
set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}")
|
||||
else()
|
||||
set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}")
|
||||
endif()
|
||||
@@ -1576,18 +1467,27 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
|
||||
# If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here.
|
||||
list( FIND nvcc_flags "-ccbin" ccbin_found0 )
|
||||
list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 )
|
||||
if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 )
|
||||
if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
|
||||
list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
|
||||
endif()
|
||||
# Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG}
|
||||
set(config_specific_flags)
|
||||
set(flags)
|
||||
foreach(config ${CUDA_configuration_types})
|
||||
string(TOUPPER ${config} config_upper)
|
||||
# Add config specific flags
|
||||
foreach(f ${CUDA_NVCC_FLAGS_${config_upper}})
|
||||
list(APPEND config_specific_flags $<$<CONFIG:${config}>:${f}>)
|
||||
endforeach()
|
||||
set(important_host_flags)
|
||||
_cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}})
|
||||
foreach(f ${important_host_flags})
|
||||
list(APPEND flags $<$<CONFIG:${config}>:-Xcompiler> $<$<CONFIG:${config}>:${f}>)
|
||||
endforeach()
|
||||
endforeach()
|
||||
# Add our general CUDA_NVCC_FLAGS with the configuration specifig flags
|
||||
set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags})
|
||||
|
||||
file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}")
|
||||
|
||||
# Some generators don't handle the multiple levels of custom command
|
||||
@@ -1713,21 +1613,29 @@ endmacro()
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# CUDA COMPILE
|
||||
# (Internal) helper for manually added cuda source files with specific targets
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
macro(CUDA_COMPILE generated_files)
|
||||
macro(cuda_compile_base cuda_target format generated_files)
|
||||
|
||||
# Separate the sources from the options
|
||||
CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN})
|
||||
# Create custom commands and targets for each file.
|
||||
CUDA_WRAP_SRCS( cuda_compile OBJ _generated_files ${_sources} ${_cmake_options}
|
||||
CUDA_WRAP_SRCS( ${cuda_target} ${format} _generated_files ${_sources} ${_cmake_options}
|
||||
OPTIONS ${_options} )
|
||||
|
||||
set( ${generated_files} ${_generated_files})
|
||||
|
||||
endmacro()
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# CUDA COMPILE
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
macro(CUDA_COMPILE generated_files)
|
||||
cuda_compile_base(cuda_compile OBJ ${generated_files} ${ARGN})
|
||||
endmacro()
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
@@ -1735,17 +1643,28 @@ endmacro()
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
macro(CUDA_COMPILE_PTX generated_files)
|
||||
|
||||
# Separate the sources from the options
|
||||
CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN})
|
||||
# Create custom commands and targets for each file.
|
||||
CUDA_WRAP_SRCS( cuda_compile_ptx PTX _generated_files ${_sources} ${_cmake_options}
|
||||
OPTIONS ${_options} )
|
||||
|
||||
set( ${generated_files} ${_generated_files})
|
||||
|
||||
cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN})
|
||||
endmacro()
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# CUDA COMPILE FATBIN
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
macro(CUDA_COMPILE_FATBIN generated_files)
|
||||
cuda_compile_base(cuda_compile_fatbin FATBIN ${generated_files} ${ARGN})
|
||||
endmacro()
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# CUDA COMPILE CUBIN
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
macro(CUDA_COMPILE_CUBIN generated_files)
|
||||
cuda_compile_base(cuda_compile_cubin CUBIN ${generated_files} ${ARGN})
|
||||
endmacro()
|
||||
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# CUDA ADD CUFFT TO TARGET
|
||||
|
||||
@@ -37,12 +37,11 @@
|
||||
|
||||
file(READ ${input_file} depend_text)
|
||||
|
||||
if (${depend_text} MATCHES ".+")
|
||||
if (NOT "${depend_text}" STREQUAL "")
|
||||
|
||||
# message("FOUND DEPENDS")
|
||||
|
||||
# Remember, four backslashes is escaped to one backslash in the string.
|
||||
string(REGEX REPLACE "\\\\ " " " depend_text ${depend_text})
|
||||
string(REPLACE "\\ " " " depend_text ${depend_text})
|
||||
|
||||
# This works for the nvcc -M generated dependency files.
|
||||
string(REGEX REPLACE "^.* : " "" depend_text ${depend_text})
|
||||
|
||||
@@ -37,11 +37,10 @@
|
||||
|
||||
file(READ ${input_file} file_text)
|
||||
|
||||
if (${file_text} MATCHES ".+")
|
||||
if (NOT "${file_text}" STREQUAL "")
|
||||
|
||||
# Remember, four backslashes is escaped to one backslash in the string.
|
||||
string(REGEX REPLACE ";" "\\\\;" file_text ${file_text})
|
||||
string(REGEX REPLACE "\ncode" ";code" file_text ${file_text})
|
||||
string(REPLACE ";" "\\;" file_text ${file_text})
|
||||
string(REPLACE "\ncode" ";code" file_text ${file_text})
|
||||
|
||||
list(LENGTH file_text len)
|
||||
|
||||
@@ -57,7 +56,7 @@ if (${file_text} MATCHES ".+")
|
||||
|
||||
# Extract kernel names.
|
||||
if (${entry} MATCHES "[^g]name = ([^ ]+)")
|
||||
string(REGEX REPLACE ".* = ([^ ]+)" "\\1" entry ${entry})
|
||||
set(entry "${CMAKE_MATCH_1}")
|
||||
|
||||
# Check to see if the kernel name starts with "_"
|
||||
set(skip FALSE)
|
||||
@@ -76,19 +75,19 @@ if (${file_text} MATCHES ".+")
|
||||
|
||||
# Registers
|
||||
if (${entry} MATCHES "reg([ ]+)=([ ]+)([^ ]+)")
|
||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
||||
set(entry "${CMAKE_MATCH_3}")
|
||||
message("Registers: ${entry}")
|
||||
endif()
|
||||
|
||||
# Local memory
|
||||
if (${entry} MATCHES "lmem([ ]+)=([ ]+)([^ ]+)")
|
||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
||||
set(entry "${CMAKE_MATCH_3}")
|
||||
message("Local: ${entry}")
|
||||
endif()
|
||||
|
||||
# Shared memory
|
||||
if (${entry} MATCHES "smem([ ]+)=([ ]+)([^ ]+)")
|
||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
||||
set(entry "${CMAKE_MATCH_3}")
|
||||
message("Shared: ${entry}")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ set(cmake_dependency_file "@cmake_dependency_file@") # path
|
||||
set(CUDA_make2cmake "@CUDA_make2cmake@") # path
|
||||
set(CUDA_parse_cubin "@CUDA_parse_cubin@") # path
|
||||
set(build_cubin @build_cubin@) # bool
|
||||
set(CUDA_HOST_COMPILER "@CUDA_HOST_COMPILER@") # bool
|
||||
set(CUDA_HOST_COMPILER "@CUDA_HOST_COMPILER@") # path
|
||||
# We won't actually use these variables for now, but we need to set this, in
|
||||
# order to force this file to be run again if it changes.
|
||||
set(generated_file_path "@generated_file_path@") # path
|
||||
@@ -106,7 +106,7 @@ list(APPEND CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS_${build_configuration}})
|
||||
# Any -ccbin existing in CUDA_NVCC_FLAGS gets highest priority
|
||||
list( FIND CUDA_NVCC_FLAGS "-ccbin" ccbin_found0 )
|
||||
list( FIND CUDA_NVCC_FLAGS "--compiler-bindir" ccbin_found1 )
|
||||
if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 )
|
||||
if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
|
||||
if (CUDA_HOST_COMPILER STREQUAL "$(VCInstallDir)bin" AND DEFINED CCBIN)
|
||||
set(CCBIN -ccbin "${CCBIN}")
|
||||
else()
|
||||
@@ -126,7 +126,7 @@ endif()
|
||||
# and other return variables are present after executing the process.
|
||||
macro(cuda_execute_process status command)
|
||||
set(_command ${command})
|
||||
if(NOT _command STREQUAL "COMMAND")
|
||||
if(NOT "x${_command}" STREQUAL "xCOMMAND")
|
||||
message(FATAL_ERROR "Malformed call to cuda_execute_process. Missing COMMAND as second argument. (command = ${command})")
|
||||
endif()
|
||||
if(verbose)
|
||||
|
||||
@@ -63,6 +63,10 @@ if(OPENCV_CAN_BREAK_BINARY_COMPATIBILITY)
|
||||
add_definitions(-DOPENCV_CAN_BREAK_BINARY_COMPATIBILITY)
|
||||
endif()
|
||||
|
||||
if(BUILD_TINY_GPU_MODULE)
|
||||
add_definitions(-DOPENCV_TINY_GPU_MODULE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# High level of warnings.
|
||||
add_extra_compiler_option(-W)
|
||||
@@ -91,6 +95,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_extra_compiler_option(-Wno-narrowing)
|
||||
add_extra_compiler_option(-Wno-delete-non-virtual-dtor)
|
||||
add_extra_compiler_option(-Wno-unnamed-type-template-args)
|
||||
add_extra_compiler_option(-Wno-array-bounds)
|
||||
add_extra_compiler_option(-Wno-aggressive-loop-optimizations)
|
||||
endif()
|
||||
add_extra_compiler_option(-fdiagnostics-show-option)
|
||||
|
||||
@@ -112,6 +118,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_extra_compiler_option(-march=i686)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
add_extra_compiler_option(-Wno-semicolon-before-method-body)
|
||||
endif()
|
||||
|
||||
# Other optimizations
|
||||
if(ENABLE_OMIT_FRAME_POINTER)
|
||||
add_extra_compiler_option(-fomit-frame-pointer)
|
||||
@@ -140,11 +150,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# SSE3 and further should be disabled under MingW because it generates compiler errors
|
||||
if(NOT MINGW)
|
||||
if(ENABLE_AVX)
|
||||
ocv_check_flag_support(CXX "-mavx" _varname)
|
||||
add_extra_compiler_option("-mavx")
|
||||
endif()
|
||||
|
||||
if(ENABLE_AVX2)
|
||||
ocv_check_flag_support(CXX "-mavx2" _varname)
|
||||
add_extra_compiler_option("-mavx2")
|
||||
endif()
|
||||
|
||||
# GCC depresses SSEx instructions when -mavx is used. Instead, it generates new AVX instructions or AVX equivalence for all SSEx instructions when needed.
|
||||
@@ -253,8 +263,13 @@ if(MSVC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC12 AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /FS")
|
||||
set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} /FS")
|
||||
endif()
|
||||
|
||||
# Extra link libs if the user selects building static libs:
|
||||
if(NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID)
|
||||
if(NOT BUILD_SHARED_LIBS AND ((CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID) OR QNX))
|
||||
# Android does not need these settings because they are already set by toolchain file
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} stdc++)
|
||||
set(OPENCV_EXTRA_FLAGS "-fPIC ${OPENCV_EXTRA_FLAGS}")
|
||||
|
||||
@@ -79,6 +79,8 @@ if(MSVC)
|
||||
set(OpenCV_RUNTIME vc11)
|
||||
elseif(MSVC_VERSION EQUAL 1800)
|
||||
set(OpenCV_RUNTIME vc12)
|
||||
elseif(MSVC_VERSION EQUAL 1900)
|
||||
set(OpenCV_RUNTIME vc14)
|
||||
endif()
|
||||
elseif(MINGW)
|
||||
set(OpenCV_RUNTIME mingw)
|
||||
@@ -86,7 +88,7 @@ elseif(MINGW)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
|
||||
OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64")
|
||||
if(OPENCV_GCC_TARGET_MACHINE MATCHES "amd64|x86_64|AMD64")
|
||||
set(MINGW64 1)
|
||||
set(OpenCV_ARCH x64)
|
||||
else()
|
||||
|
||||
@@ -15,19 +15,10 @@ endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH "${OpenCV_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
||||
|
||||
foreach(var INCLUDE LIBRARY PROGRAM)
|
||||
set(__old_frpm_${var} "${CMAKE_FIND_ROOT_PATH_MODE_${var}}")
|
||||
endforeach()
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
|
||||
|
||||
find_package(CUDA 4.2 QUIET)
|
||||
|
||||
foreach(var INCLUDE LIBRARY PROGRAM)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_${var} "${__old_frpm_${var}}")
|
||||
endforeach()
|
||||
if(ANDROID AND "${CUDA_VERSION}" VERSION_LESS "7.0")
|
||||
set(CUDA_TARGET_OS_VARIANT "Android")
|
||||
endif()
|
||||
find_host_package(CUDA 4.2 QUIET)
|
||||
|
||||
list(REMOVE_AT CMAKE_MODULE_PATH 0)
|
||||
|
||||
@@ -91,11 +82,18 @@ if(CUDA_FOUND)
|
||||
|
||||
if(NOT DEFINED __cuda_arch_bin)
|
||||
if(ANDROID)
|
||||
set(__cuda_arch_bin "3.2")
|
||||
set(__cuda_arch_ptx "")
|
||||
if (ARM)
|
||||
set(__cuda_arch_bin "3.2")
|
||||
set(__cuda_arch_ptx "")
|
||||
elseif(AARCH64)
|
||||
set(__cuda_arch_bin "5.3")
|
||||
set(__cuda_arch_ptx "")
|
||||
endif()
|
||||
else()
|
||||
if(${CUDA_VERSION} VERSION_LESS "5.0")
|
||||
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
|
||||
elseif(${CUDA_VERSION} VERSION_GREATER "6.5")
|
||||
set(__cuda_arch_bin "2.0 2.1(2.0) 3.0 3.5")
|
||||
else()
|
||||
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
|
||||
endif()
|
||||
@@ -154,7 +152,6 @@ if(CUDA_FOUND)
|
||||
|
||||
if(ANDROID)
|
||||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xptxas;-dlcm=ca")
|
||||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-target-os-variant=Android")
|
||||
endif()
|
||||
|
||||
message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}")
|
||||
@@ -221,40 +218,18 @@ else()
|
||||
endif()
|
||||
|
||||
if(HAVE_CUDA)
|
||||
set(CUDA_LIBS_PATH "")
|
||||
foreach(p ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
||||
get_filename_component(_tmp ${p} PATH)
|
||||
list(APPEND CUDA_LIBS_PATH ${_tmp})
|
||||
endforeach()
|
||||
|
||||
if(HAVE_CUBLAS)
|
||||
foreach(p ${CUDA_cublas_LIBRARY})
|
||||
get_filename_component(_tmp ${p} PATH)
|
||||
list(APPEND CUDA_LIBS_PATH ${_tmp})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(HAVE_CUFFT)
|
||||
foreach(p ${CUDA_cufft_LIBRARY})
|
||||
get_filename_component(_tmp ${p} PATH)
|
||||
list(APPEND CUDA_LIBS_PATH ${_tmp})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
list(REMOVE_DUPLICATES CUDA_LIBS_PATH)
|
||||
link_directories(${CUDA_LIBS_PATH})
|
||||
|
||||
set(CUDA_LIBRARIES_ABS ${CUDA_LIBRARIES})
|
||||
ocv_convert_to_lib_name(CUDA_LIBRARIES ${CUDA_LIBRARIES})
|
||||
ocv_create_imported_targets(CUDA_LIBRARIES ${CUDA_LIBRARIES})
|
||||
set(CUDA_npp_LIBRARY_ABS ${CUDA_npp_LIBRARY})
|
||||
ocv_convert_to_lib_name(CUDA_npp_LIBRARY ${CUDA_npp_LIBRARY})
|
||||
ocv_create_imported_targets(CUDA_npp_LIBRARY ${CUDA_npp_LIBRARY})
|
||||
|
||||
if(HAVE_CUBLAS)
|
||||
set(CUDA_cublas_LIBRARY_ABS ${CUDA_cublas_LIBRARY})
|
||||
ocv_convert_to_lib_name(CUDA_cublas_LIBRARY ${CUDA_cublas_LIBRARY})
|
||||
ocv_create_imported_targets(CUDA_cublas_LIBRARY ${CUDA_cublas_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(HAVE_CUFFT)
|
||||
set(CUDA_cufft_LIBRARY_ABS ${CUDA_cufft_LIBRARY})
|
||||
ocv_convert_to_lib_name(CUDA_cufft_LIBRARY ${CUDA_cufft_LIBRARY})
|
||||
ocv_create_imported_targets(CUDA_cufft_LIBRARY ${CUDA_cufft_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -91,9 +91,9 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
if(WIN32)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
|
||||
OUTPUT_VARIABLE CMAKE_OPENCV_GCC_TARGET_MACHINE
|
||||
OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "amd64|x86_64|AMD64")
|
||||
if(OPENCV_GCC_TARGET_MACHINE MATCHES "amd64|x86_64|AMD64")
|
||||
set(MINGW64 1)
|
||||
endif()
|
||||
endif()
|
||||
@@ -109,10 +109,12 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*")
|
||||
set(X86 1)
|
||||
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|ARM.*")
|
||||
set(ARM 1)
|
||||
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64.*|AARCH64.*")
|
||||
set(AARCH64 1)
|
||||
endif()
|
||||
|
||||
|
||||
# Similar code is existed in OpenCVConfig.cmake
|
||||
# Similar code exists in OpenCVConfig.cmake
|
||||
if(NOT DEFINED OpenCV_STATIC)
|
||||
# look for global setting
|
||||
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
|
||||
@@ -138,15 +140,13 @@ if(MSVC)
|
||||
set(OpenCV_RUNTIME vc11)
|
||||
elseif(MSVC_VERSION EQUAL 1800)
|
||||
set(OpenCV_RUNTIME vc12)
|
||||
elseif(MSVC_VERSION EQUAL 1900)
|
||||
set(OpenCV_RUNTIME vc14)
|
||||
endif()
|
||||
elseif(MINGW)
|
||||
set(OpenCV_RUNTIME mingw)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
|
||||
OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64")
|
||||
set(MINGW64 1)
|
||||
if(MINGW64)
|
||||
set(OpenCV_ARCH x64)
|
||||
else()
|
||||
set(OpenCV_ARCH x86)
|
||||
|
||||
@@ -39,11 +39,11 @@ if(PYTHON_EXECUTABLE)
|
||||
if(NOT ANDROID AND NOT IOS)
|
||||
ocv_check_environment_variables(PYTHON_LIBRARY PYTHON_INCLUDE_DIR)
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
find_host_package(PythonLibs ${PYTHON_VERSION_MAJOR_MINOR})
|
||||
find_package(PythonLibs ${PYTHON_VERSION_MAJOR_MINOR})
|
||||
elseif(CMAKE_VERSION VERSION_GREATER 2.8.8 AND PYTHON_VERSION_FULL)
|
||||
find_host_package(PythonLibs ${PYTHON_VERSION_FULL} EXACT)
|
||||
find_package(PythonLibs ${PYTHON_VERSION_FULL} EXACT)
|
||||
else()
|
||||
find_host_package(PythonLibs ${PYTHON_VERSION_FULL})
|
||||
find_package(PythonLibs ${PYTHON_VERSION_FULL})
|
||||
endif()
|
||||
# cmake 2.4 (at least on Ubuntu 8.04 (hardy)) don't define PYTHONLIBS_FOUND
|
||||
if(NOT PYTHONLIBS_FOUND AND PYTHON_INCLUDE_PATH)
|
||||
|
||||
@@ -63,6 +63,8 @@ if(NOT HAVE_TBB)
|
||||
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc10")
|
||||
elseif(MSVC11)
|
||||
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc11")
|
||||
elseif(MSVC12)
|
||||
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc12")
|
||||
endif()
|
||||
set(TBB_LIB_DIR "${_TBB_LIB_PATH}" CACHE PATH "Full path of TBB library directory")
|
||||
link_directories("${TBB_LIB_DIR}")
|
||||
|
||||
@@ -46,25 +46,15 @@ else()
|
||||
set(HAVE_CSTRIPES 0)
|
||||
endif()
|
||||
|
||||
# --- OpenMP ---
|
||||
if(WITH_OPENMP AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
find_package(OpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
endif()
|
||||
set(HAVE_OPENMP "${OPENMP_FOUND}")
|
||||
endif()
|
||||
|
||||
# --- GCD ---
|
||||
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
|
||||
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
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)
|
||||
if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
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}" "${_fname}")
|
||||
@@ -72,3 +62,13 @@ if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
|
||||
else()
|
||||
set(HAVE_CONCURRENCY 0)
|
||||
endif()
|
||||
|
||||
# --- OpenMP ---
|
||||
if(WITH_OPENMP)
|
||||
find_package(OpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
endif()
|
||||
set(HAVE_OPENMP "${OPENMP_FOUND}")
|
||||
endif()
|
||||
|
||||
@@ -13,7 +13,7 @@ endif(WITH_VFW)
|
||||
# --- GStreamer ---
|
||||
ocv_clear_vars(HAVE_GSTREAMER)
|
||||
# try to find gstreamer 1.x first
|
||||
if(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10)
|
||||
if(WITH_GSTREAMER)
|
||||
CHECK_MODULE(gstreamer-base-1.0 HAVE_GSTREAMER_BASE)
|
||||
CHECK_MODULE(gstreamer-video-1.0 HAVE_GSTREAMER_VIDEO)
|
||||
CHECK_MODULE(gstreamer-app-1.0 HAVE_GSTREAMER_APP)
|
||||
@@ -29,10 +29,18 @@ if(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10)
|
||||
set(GSTREAMER_PBUTILS_VERSION ${ALIASOF_gstreamer-pbutils-1.0_VERSION})
|
||||
endif()
|
||||
|
||||
endif(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10)
|
||||
endif(WITH_GSTREAMER)
|
||||
|
||||
# if gstreamer 1.x was not found, or we specified we wanted 0.10, try to find it
|
||||
if(WITH_GSTREAMER_0_10 OR NOT HAVE_GSTREAMER)
|
||||
# gstreamer support was requested but could not find gstreamer 1.x,
|
||||
# so fallback/try to find gstreamer 0.10
|
||||
if(WITH_GSTREAMER AND NOT HAVE_GSTREAMER)
|
||||
set(WITH_GSTREAMER_0_10 ON)
|
||||
endif()
|
||||
|
||||
# if gstreamer 1.x was not found (fallback on gstreamer 0.10), or we specified
|
||||
# we wanted gstreamer 0.10 support,
|
||||
# then try to find it if not gstreamer support has not been found so far.
|
||||
if(WITH_GSTREAMER_0_10 AND NOT HAVE_GSTREAMER)
|
||||
CHECK_MODULE(gstreamer-base-0.10 HAVE_GSTREAMER_BASE)
|
||||
CHECK_MODULE(gstreamer-video-0.10 HAVE_GSTREAMER_VIDEO)
|
||||
CHECK_MODULE(gstreamer-app-0.10 HAVE_GSTREAMER_APP)
|
||||
@@ -47,7 +55,7 @@ if(WITH_GSTREAMER_0_10 OR NOT HAVE_GSTREAMER)
|
||||
set(GSTREAMER_RIFF_VERSION ${ALIASOF_gstreamer-riff-0.10_VERSION})
|
||||
set(GSTREAMER_PBUTILS_VERSION ${ALIASOF_gstreamer-pbutils-0.10_VERSION})
|
||||
endif()
|
||||
endif(WITH_GSTREAMER_0_10 OR NOT HAVE_GSTREAMER)
|
||||
endif(WITH_GSTREAMER_0_10 AND NOT HAVE_GSTREAMER)
|
||||
|
||||
# --- unicap ---
|
||||
ocv_clear_vars(HAVE_UNICAP)
|
||||
@@ -182,7 +190,7 @@ if(WITH_XIMEA)
|
||||
endif(WITH_XIMEA)
|
||||
|
||||
# --- FFMPEG ---
|
||||
ocv_clear_vars(HAVE_FFMPEG HAVE_FFMPEG_CODEC HAVE_FFMPEG_FORMAT HAVE_FFMPEG_UTIL HAVE_FFMPEG_SWSCALE HAVE_GENTOO_FFMPEG HAVE_FFMPEG_FFMPEG)
|
||||
ocv_clear_vars(HAVE_FFMPEG HAVE_FFMPEG_CODEC HAVE_FFMPEG_FORMAT HAVE_FFMPEG_UTIL HAVE_FFMPEG_SWSCALE HAVE_FFMPEG_RESAMPLE HAVE_GENTOO_FFMPEG HAVE_FFMPEG_FFMPEG)
|
||||
if(WITH_FFMPEG)
|
||||
if(WIN32 AND NOT ARM)
|
||||
include("${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/ffmpeg_version.cmake")
|
||||
@@ -191,6 +199,7 @@ if(WITH_FFMPEG)
|
||||
CHECK_MODULE(libavformat HAVE_FFMPEG_FORMAT)
|
||||
CHECK_MODULE(libavutil HAVE_FFMPEG_UTIL)
|
||||
CHECK_MODULE(libswscale HAVE_FFMPEG_SWSCALE)
|
||||
CHECK_MODULE(libavresample HAVE_FFMPEG_RESAMPLE)
|
||||
|
||||
CHECK_INCLUDE_FILE(libavformat/avformat.h HAVE_GENTOO_FFMPEG)
|
||||
CHECK_INCLUDE_FILE(ffmpeg/avformat.h HAVE_FFMPEG_FFMPEG)
|
||||
@@ -210,42 +219,35 @@ if(WITH_FFMPEG)
|
||||
# Do an other trial
|
||||
FIND_FILE(BZIP2_LIBRARIES NAMES libbz2.so.1 PATHS /lib)
|
||||
endif()
|
||||
endif(HAVE_FFMPEG)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
find_path(FFMPEG_INCLUDE_DIR "libavformat/avformat.h"
|
||||
PATHS /usr/local /usr /opt
|
||||
PATH_SUFFIXES include
|
||||
DOC "The path to FFMPEG headers")
|
||||
if(FFMPEG_INCLUDE_DIR)
|
||||
set(HAVE_GENTOO_FFMPEG TRUE)
|
||||
set(FFMPEG_LIB_DIR "${FFMPEG_INCLUDE_DIR}/../lib" CACHE PATH "Full path of FFMPEG library directory")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavcodec.a")
|
||||
set(HAVE_FFMPEG_CODEC 1)
|
||||
set(ALIASOF_libavcodec_VERSION "Unknown")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavformat.a")
|
||||
set(HAVE_FFMPEG_FORMAT 1)
|
||||
else()
|
||||
find_path(FFMPEG_INCLUDE_DIR "libavformat/avformat.h"
|
||||
PATHS /usr/local /usr /opt
|
||||
PATH_SUFFIXES include
|
||||
DOC "The path to FFMPEG headers")
|
||||
if(FFMPEG_INCLUDE_DIR)
|
||||
set(HAVE_GENTOO_FFMPEG TRUE)
|
||||
set(FFMPEG_LIB_DIR "${FFMPEG_INCLUDE_DIR}/../lib" CACHE PATH "Full path of FFMPEG library directory")
|
||||
find_library(FFMPEG_CODEC_LIB "avcodec" HINTS "${FFMPEG_LIB_DIR}")
|
||||
find_library(FFMPEG_FORMAT_LIB "avformat" HINTS "${FFMPEG_LIB_DIR}")
|
||||
find_library(FFMPEG_UTIL_LIB "avutil" HINTS "${FFMPEG_LIB_DIR}")
|
||||
find_library(FFMPEG_SWSCALE_LIB "swscale" HINTS "${FFMPEG_LIB_DIR}")
|
||||
if(FFMPEG_CODEC_LIB AND FFMPEG_FORMAT_LIB AND
|
||||
FFMPEG_UTIL_LIB AND FFMPEG_SWSCALE_LIB)
|
||||
set(ALIASOF_libavcodec_VERSION "Unknown")
|
||||
set(ALIASOF_libavformat_VERSION "Unknown")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavutil.a")
|
||||
set(HAVE_FFMPEG_UTIL 1)
|
||||
set(ALIASOF_libavutil_VERSION "Unknown")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libswscale.a")
|
||||
set(HAVE_FFMPEG_SWSCALE 1)
|
||||
set(ALIASOF_libswscale_VERSION "Unknown")
|
||||
set(HAVE_FFMPEG 1)
|
||||
endif()
|
||||
endif()
|
||||
set(ALIASOF_libavutil_VERSION "Unknown")
|
||||
set(ALIASOF_libswscale_VERSION "Unknown")
|
||||
set(HAVE_FFMPEG 1)
|
||||
endif()
|
||||
endif()
|
||||
endif(FFMPEG_INCLUDE_DIR)
|
||||
if(HAVE_FFMPEG)
|
||||
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
|
||||
"${FFMPEG_LIB_DIR}/libavformat.a" "${FFMPEG_LIB_DIR}/libavutil.a"
|
||||
"${FFMPEG_LIB_DIR}/libswscale.a")
|
||||
ocv_include_directories(${FFMPEG_INCLUDE_DIR})
|
||||
endif(FFMPEG_INCLUDE_DIR)
|
||||
if(HAVE_FFMPEG)
|
||||
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES}
|
||||
${FFMPEG_CODEC_LIB} ${FFMPEG_FORMAT_LIB}
|
||||
${FFMPEG_UTIL_LIB} ${FFMPEG_SWSCALE_LIB})
|
||||
ocv_include_directories(${FFMPEG_INCLUDE_DIR})
|
||||
endif(HAVE_FFMPEG)
|
||||
endif()
|
||||
endif(APPLE)
|
||||
endif()
|
||||
endif(WITH_FFMPEG)
|
||||
|
||||
# --- VideoInput/DirectShow ---
|
||||
|
||||
@@ -19,8 +19,26 @@ if(ANDROID)
|
||||
set(OPENCV_STATIC_LIBTYPE_CONFIGMAKE ${OPENCV_LIBTYPE_CONFIGMAKE})
|
||||
endif()
|
||||
|
||||
if (NOT COMMAND ANDROID_GET_ABI_RAWNAME)
|
||||
macro( ANDROID_GET_ABI_RAWNAME TOOLCHAIN_FLAG VAR )
|
||||
if( " ${TOOLCHAIN_FLAG}" STREQUAL " ARMEABI" )
|
||||
set( ${VAR} "armeabi" )
|
||||
elseif( " ${TOOLCHAIN_FLAG}" STREQUAL " ARMEABI_V7A" )
|
||||
set( ${VAR} "armeabi-v7a" )
|
||||
elseif( " ${TOOLCHAIN_FLAG}" STREQUAL " ARM64_V8A" )
|
||||
set( ${VAR} "arm64-v8a" )
|
||||
elseif( " ${TOOLCHAIN_FLAG}" STREQUAL " X86" )
|
||||
set( ${VAR} "x86" )
|
||||
elseif( " ${TOOLCHAIN_FLAG}" STREQUAL " MIPS" )
|
||||
set( ${VAR} "mips" )
|
||||
else()
|
||||
set( ${VAR} "unknown" )
|
||||
endif()
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
# setup lists of camera libs
|
||||
foreach(abi ARMEABI ARMEABI_V7A X86 MIPS)
|
||||
foreach(abi ARMEABI ARMEABI_V7A ARM64_V8A X86 MIPS)
|
||||
ANDROID_GET_ABI_RAWNAME(${abi} ndkabi)
|
||||
if(BUILD_ANDROID_CAMERA_WRAPPER)
|
||||
if(ndkabi STREQUAL ANDROID_NDK_ABI_NAME)
|
||||
@@ -30,6 +48,7 @@ if(ANDROID)
|
||||
endif()
|
||||
elseif(HAVE_opencv_androidcamera)
|
||||
set(OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE "")
|
||||
# TODO: add prebuild camera libs for arm64-v8a
|
||||
file(GLOB OPENCV_CAMERA_LIBS "${OpenCV_SOURCE_DIR}/3rdparty/lib/${ndkabi}/libnative_camera_r*.so")
|
||||
if(OPENCV_CAMERA_LIBS)
|
||||
list(SORT OPENCV_CAMERA_LIBS)
|
||||
|
||||
@@ -140,6 +140,6 @@ if(WIN32)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" COMPONENT dev)
|
||||
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
||||
endif()
|
||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT dev)
|
||||
install(FILES "${OpenCV_SOURCE_DIR}/cmake/OpenCVConfig.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/" COMPONENT dev)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION "." COMPONENT dev)
|
||||
install(FILES "${OpenCV_SOURCE_DIR}/cmake/OpenCVConfig.cmake" DESTINATION "." COMPONENT dev)
|
||||
endif()
|
||||
|
||||
@@ -8,10 +8,6 @@
|
||||
#
|
||||
# ${BIN_DIR}/unix-install/opencv.pc -> For use *with* "make install"
|
||||
# -------------------------------------------------------------------------------------------
|
||||
set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(exec_prefix "\${prefix}")
|
||||
set(libdir "") #TODO: need link paths for OpenCV_EXTRA_COMPONENTS
|
||||
set(includedir "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
set(ocv_optkind OPT)
|
||||
@@ -35,42 +31,67 @@ ocv_list_reverse(OpenCV_LIB_COMPONENTS)
|
||||
ocv_list_reverse(OpenCV_EXTRA_COMPONENTS)
|
||||
|
||||
#build the list of components
|
||||
set(OpenCV_LIB_COMPONENTS_ "")
|
||||
|
||||
# Note:
|
||||
# when linking against static libraries, if libfoo depends on libbar, then
|
||||
# libfoo must come first in the linker flags.
|
||||
|
||||
# world is a special target whose library should come first, especially for
|
||||
# static link.
|
||||
if(OpenCV_LIB_COMPONENTS MATCHES "opencv_world")
|
||||
list(REMOVE_ITEM OpenCV_LIB_COMPONENTS "opencv_world")
|
||||
list(INSERT OpenCV_LIB_COMPONENTS 0 "opencv_world")
|
||||
endif()
|
||||
|
||||
set(OpenCV_LIB_COMPONENTS_)
|
||||
foreach(CVLib ${OpenCV_LIB_COMPONENTS})
|
||||
get_target_property(libpath ${CVLib} LOCATION_${CMAKE_BUILD_TYPE})
|
||||
get_filename_component(libname "${libpath}" NAME)
|
||||
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
set(libname "${libname}.${OPENCV_VERSION}")
|
||||
endif()
|
||||
|
||||
#need better solution....
|
||||
if(libpath MATCHES "3rdparty")
|
||||
set(installDir "share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}")
|
||||
get_target_property(libloc ${CVLib} LOCATION_${CMAKE_BUILD_TYPE})
|
||||
if(libloc MATCHES "3rdparty")
|
||||
set(libpath "\${exec_prefix}/share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}")
|
||||
else()
|
||||
set(installDir "${OPENCV_LIB_INSTALL_PATH}")
|
||||
set(libpath "\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}")
|
||||
endif()
|
||||
list(APPEND OpenCV_LIB_COMPONENTS_ "-L${libpath}")
|
||||
|
||||
get_filename_component(libname ${CVLib} NAME_WE)
|
||||
string(REGEX REPLACE "^lib" "" libname "${libname}")
|
||||
list(APPEND OpenCV_LIB_COMPONENTS_ "-l${libname}")
|
||||
|
||||
set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} \${exec_prefix}/${installDir}/${libname}")
|
||||
endforeach()
|
||||
|
||||
# add extra dependencies required for OpenCV
|
||||
set(OpenCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS_})
|
||||
if(OpenCV_EXTRA_COMPONENTS)
|
||||
foreach(extra_component ${OpenCV_EXTRA_COMPONENTS})
|
||||
|
||||
if(extra_component MATCHES "^-[lL]" OR extra_component MATCHES "[\\/]")
|
||||
set(maybe_l_prefix "")
|
||||
else()
|
||||
set(maybe_l_prefix "-l")
|
||||
if(TARGET "${extra_component}")
|
||||
get_target_property(extra_component_is_imported "${extra_component}" IMPORTED)
|
||||
if(extra_component_is_imported)
|
||||
get_target_property(extra_component "${extra_component}" LOCATION)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${maybe_l_prefix}${extra_component}")
|
||||
|
||||
if(extra_component MATCHES "^-l")
|
||||
list(APPEND OpenCV_LIB_COMPONENTS_ "${extra_component}")
|
||||
elseif(extra_component MATCHES "[\\/]")
|
||||
get_filename_component(libdir "${extra_component}" PATH)
|
||||
get_filename_component(libname "${extra_component}" NAME_WE)
|
||||
string(REGEX REPLACE "^lib" "" libname "${libname}")
|
||||
list(APPEND OpenCV_LIB_COMPONENTS_ "-L${libdir}" "-l${libname}")
|
||||
else()
|
||||
list(APPEND OpenCV_LIB_COMPONENTS_ "-l${extra_component}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
list(REMOVE_DUPLICATES OpenCV_LIB_COMPONENTS_)
|
||||
string(REPLACE ";" " " OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS_}")
|
||||
|
||||
#generate the .pc file
|
||||
set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(exec_prefix "\${prefix}")
|
||||
set(libdir "\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}")
|
||||
set(includedir "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")
|
||||
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
set(OPENCV_PC_FILE_NAME "opencv-${OPENCV_VERSION}.pc")
|
||||
else()
|
||||
|
||||
+57
-21
@@ -106,7 +106,6 @@ endmacro()
|
||||
# ocv_add_module(yaom INTERNAL opencv_core opencv_highgui opencv_flann OPTIONAL opencv_gpu)
|
||||
macro(ocv_add_module _name)
|
||||
string(TOLOWER "${_name}" name)
|
||||
string(REGEX REPLACE "^opencv_" "" ${name} "${name}")
|
||||
set(the_module opencv_${name})
|
||||
|
||||
# the first pass - collect modules info, the second pass - create targets
|
||||
@@ -617,9 +616,14 @@ macro(ocv_create_module)
|
||||
|
||||
ocv_install_target(${the_module} EXPORT OpenCVModules
|
||||
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs
|
||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs
|
||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs NAMELINK_SKIP
|
||||
ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT dev
|
||||
)
|
||||
get_target_property(_target_type ${the_module} TYPE)
|
||||
if("${_target_type}" STREQUAL "SHARED_LIBRARY")
|
||||
install(TARGETS ${the_module}
|
||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT dev NAMELINK_ONLY)
|
||||
endif()
|
||||
|
||||
# only "public" headers need to be installed
|
||||
if(OPENCV_MODULE_${the_module}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${the_module};")
|
||||
@@ -702,7 +706,7 @@ macro(__ocv_parse_test_sources tests_type)
|
||||
set(__file_group_sources "")
|
||||
elseif(arg STREQUAL "DEPENDS_ON")
|
||||
set(__currentvar "OPENCV_TEST_${the_module}_DEPS")
|
||||
elseif("${__currentvar}" STREQUAL "__file_group_sources" AND NOT __file_group_name)
|
||||
elseif(" ${__currentvar}" STREQUAL " __file_group_sources" AND NOT __file_group_name) # spaces to avoid CMP0054
|
||||
set(__file_group_name "${arg}")
|
||||
else()
|
||||
list(APPEND ${__currentvar} "${arg}")
|
||||
@@ -756,6 +760,22 @@ function(ocv_add_perf_tests)
|
||||
|
||||
ocv_add_precompiled_headers(${the_target})
|
||||
|
||||
if(CMAKE_VERSION VERSION_GREATER "2.8" AND OPENCV_TEST_DATA_PATH)
|
||||
add_test(NAME ${the_target} COMMAND ${the_target} --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity)
|
||||
|
||||
get_filename_component(cur_modules_loc "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
|
||||
get_filename_component(default_modules_loc "${CMAKE_SOURCE_DIR}/modules" ABSOLUTE)
|
||||
if("${cur_modules_loc}" STREQUAL "${default_modules_loc}")
|
||||
set(test_category "Public")
|
||||
else()
|
||||
set(test_category "Extra")
|
||||
endif()
|
||||
|
||||
set_tests_properties(${the_target} PROPERTIES
|
||||
LABELS "${test_category};Sanity"
|
||||
ENVIRONMENT "OPENCV_TEST_DATA_PATH=${OPENCV_TEST_DATA_PATH}")
|
||||
endif()
|
||||
|
||||
else(OCV_DEPENDENCIES_FOUND)
|
||||
# TODO: warn about unsatisfied dependencies
|
||||
endif(OCV_DEPENDENCIES_FOUND)
|
||||
@@ -807,11 +827,24 @@ function(ocv_add_accuracy_tests)
|
||||
set_target_properties(${the_target} PROPERTIES FOLDER "tests accuracy")
|
||||
endif()
|
||||
|
||||
enable_testing()
|
||||
get_target_property(LOC ${the_target} LOCATION)
|
||||
add_test(${the_target} "${LOC}")
|
||||
|
||||
ocv_add_precompiled_headers(${the_target})
|
||||
|
||||
if(CMAKE_VERSION VERSION_GREATER "2.8" AND OPENCV_TEST_DATA_PATH AND NOT "${the_target}" MATCHES "opencv_test_viz")
|
||||
add_test(NAME ${the_target} COMMAND ${the_target})
|
||||
|
||||
get_filename_component(cur_modules_loc "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
|
||||
get_filename_component(default_modules_loc "${CMAKE_SOURCE_DIR}/modules" ABSOLUTE)
|
||||
if("${cur_modules_loc}" STREQUAL "${default_modules_loc}")
|
||||
set(test_category "Public")
|
||||
else()
|
||||
set(test_category "Extra")
|
||||
endif()
|
||||
|
||||
set_tests_properties(${the_target} PROPERTIES
|
||||
LABELS "${test_category};Accuracy"
|
||||
ENVIRONMENT "OPENCV_TEST_DATA_PATH=${OPENCV_TEST_DATA_PATH}")
|
||||
endif()
|
||||
|
||||
else(OCV_DEPENDENCIES_FOUND)
|
||||
# TODO: warn about unsatisfied dependencies
|
||||
endif(OCV_DEPENDENCIES_FOUND)
|
||||
@@ -860,7 +893,7 @@ function(ocv_add_samples)
|
||||
file(GLOB sample_files "${samples_path}/*")
|
||||
install(FILES ${sample_files}
|
||||
DESTINATION ${OPENCV_SAMPLES_SRC_INSTALL_PATH}/${module_id}
|
||||
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@@ -886,25 +919,28 @@ macro(__ocv_track_module_link_dependencies the_module optkind)
|
||||
list(REMOVE_AT __mod_depends 0)
|
||||
if(__dep STREQUAL the_module)
|
||||
set(__has_cycle TRUE)
|
||||
else()#if("${OPENCV_MODULES_BUILD}" MATCHES "(^|;)${__dep}(;|$)")
|
||||
else()
|
||||
ocv_regex_escape(__rdep "${__dep}")
|
||||
if(__resolved_deps MATCHES "(^|;)${__rdep}(;|$)")
|
||||
#all dependencies of this module are already resolved
|
||||
list(APPEND ${the_module}_MODULE_DEPS_${optkind} "${__dep}")
|
||||
else()
|
||||
get_target_property(__module_type ${__dep} TYPE)
|
||||
if(__module_type STREQUAL "STATIC_LIBRARY")
|
||||
if(NOT DEFINED ${__dep}_LIB_DEPENDS_${optkind})
|
||||
ocv_split_libs_list(${__dep}_LIB_DEPENDS ${__dep}_LIB_DEPENDS_DBG ${__dep}_LIB_DEPENDS_OPT)
|
||||
elseif(TARGET ${__dep})
|
||||
get_target_property(__dep_imported ${__dep} IMPORTED)
|
||||
if(__dep_imported)
|
||||
list(APPEND ${the_module}_EXTRA_DEPS_${optkind} "${__dep}")
|
||||
else()
|
||||
get_target_property(__module_type ${__dep} TYPE)
|
||||
if(__module_type STREQUAL "STATIC_LIBRARY")
|
||||
if(NOT DEFINED ${__dep}_LIB_DEPENDS_${optkind})
|
||||
ocv_split_libs_list(${__dep}_LIB_DEPENDS ${__dep}_LIB_DEPENDS_DBG ${__dep}_LIB_DEPENDS_OPT)
|
||||
endif()
|
||||
list(INSERT __mod_depends 0 ${${__dep}_LIB_DEPENDS_${optkind}} ${__dep})
|
||||
list(APPEND __resolved_deps "${__dep}")
|
||||
endif()
|
||||
list(INSERT __mod_depends 0 ${${__dep}_LIB_DEPENDS_${optkind}} ${__dep})
|
||||
list(APPEND __resolved_deps "${__dep}")
|
||||
elseif(NOT __module_type)
|
||||
list(APPEND ${the_module}_EXTRA_DEPS_${optkind} "${__dep}")
|
||||
endif()
|
||||
else()
|
||||
list(APPEND ${the_module}_EXTRA_DEPS_${optkind} "${__dep}")
|
||||
endif()
|
||||
#else()
|
||||
# get_target_property(__dep_location "${__dep}" LOCATION)
|
||||
endif()
|
||||
endwhile()
|
||||
|
||||
@@ -918,7 +954,7 @@ macro(__ocv_track_module_link_dependencies the_module optkind)
|
||||
list(APPEND ${the_module}_MODULE_DEPS_${optkind} "${the_module}")
|
||||
endif()
|
||||
|
||||
unset(__dep_location)
|
||||
unset(__dep_imported)
|
||||
unset(__mod_depends)
|
||||
unset(__resolved_deps)
|
||||
unset(__has_cycle)
|
||||
|
||||
@@ -41,16 +41,15 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
|
||||
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
|
||||
SET(${_out_compile_flags} ${${_flags_var_name}} )
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
|
||||
IF(${_targetType} STREQUAL SHARED_LIBRARY AND NOT WIN32)
|
||||
LIST(APPEND ${_out_compile_flags} "-fPIC")
|
||||
ENDIF()
|
||||
|
||||
ELSE()
|
||||
## TODO ... ? or does it work out of the box
|
||||
ENDIF()
|
||||
GET_TARGET_PROPERTY(_targetPIC ${_PCH_current_target} POSITION_INDEPENDENT_CODE)
|
||||
if (_targetPIC AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
|
||||
LIST(APPEND ${_out_compile_flags} "${CMAKE_CXX_COMPILE_OPTIONS_PIC}")
|
||||
elseif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
|
||||
IF(${_targetType} STREQUAL SHARED_LIBRARY AND NOT WIN32)
|
||||
LIST(APPEND ${_out_compile_flags} "-fPIC")
|
||||
ENDIF()
|
||||
endif()
|
||||
|
||||
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES )
|
||||
FOREACH(item ${DIRINC})
|
||||
@@ -147,9 +146,9 @@ MACRO(_PCH_GET_TARGET_COMPILE_FLAGS _cflags _header_name _pch_path _dowarn )
|
||||
# if you have different versions of the headers for different build types
|
||||
# you may set _pch_dowarn
|
||||
IF (_dowarn)
|
||||
SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include \"${CMAKE_CURRENT_BINARY_DIR}/${_header_name}\" -Winvalid-pch " )
|
||||
set(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -Winvalid-pch")
|
||||
ELSE (_dowarn)
|
||||
SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include \"${CMAKE_CURRENT_BINARY_DIR}/${_header_name}\" " )
|
||||
set(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS}")
|
||||
ENDIF (_dowarn)
|
||||
|
||||
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
+122
-54
@@ -14,7 +14,7 @@ machine perception in the commercial products. Being a BSD-licensed product,
|
||||
OpenCV makes it easy for businesses to utilize and modify the code.")
|
||||
set(CPACK_PACKAGE_VENDOR "OpenCV Foundation")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_PACKAGE_CONTACT "admin@opencv.org")
|
||||
set(CPACK_PACKAGE_CONTACT "OpenCV Developers <admin@opencv.org>")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "${OPENCV_VERSION_MAJOR}")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "${OPENCV_VERSION_MINOR}")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "${OPENCV_VERSION_PATCH}")
|
||||
@@ -25,21 +25,24 @@ set(CPACK_STRIP_FILES 1)
|
||||
|
||||
#arch
|
||||
if(X86)
|
||||
set(CPACK_DEBIAN_ARCHITECTURE "i386")
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
|
||||
set(CPACK_RPM_PACKAGE_ARCHITECTURE "i686")
|
||||
elseif(X86_64)
|
||||
set(CPACK_DEBIAN_ARCHITECTURE "amd64")
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
|
||||
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
|
||||
elseif(ARM)
|
||||
set(CPACK_DEBIAN_ARCHITECTURE "armhf")
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf")
|
||||
set(CPACK_RPM_PACKAGE_ARCHITECTURE "armhf")
|
||||
elseif(AARCH64)
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
|
||||
set(CPACK_RPM_PACKAGE_ARCHITECTURE "aarch64")
|
||||
else()
|
||||
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||
set(CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||
endif()
|
||||
|
||||
if(CPACK_GENERATOR STREQUAL "DEB")
|
||||
set(OPENCV_PACKAGE_ARCH_SUFFIX ${CPACK_DEBIAN_ARCHITECTURE})
|
||||
set(OPENCV_PACKAGE_ARCH_SUFFIX ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
|
||||
elseif(CPACK_GENERATOR STREQUAL "RPM")
|
||||
set(OPENCV_PACKAGE_ARCH_SUFFIX ${CPACK_RPM_PACKAGE_ARCHITECTURE})
|
||||
else()
|
||||
@@ -62,79 +65,144 @@ set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "libs")
|
||||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://opencv.org")
|
||||
|
||||
#display names
|
||||
set(CPACK_COMPONENT_DEV_DISPLAY_NAME "Development files")
|
||||
set(CPACK_COMPONENT_DOCS_DISPLAY_NAME "Documentation")
|
||||
set(CPACK_COMPONENT_JAVA_DISPLAY_NAME "Java bindings")
|
||||
set(CPACK_COMPONENT_LIBS_DISPLAY_NAME "Libraries and data")
|
||||
set(CPACK_COMPONENT_PYTHON_DISPLAY_NAME "Python bindings")
|
||||
set(CPACK_COMPONENT_SAMPLES_DISPLAY_NAME "Samples")
|
||||
set(CPACK_COMPONENT_TESTS_DISPLAY_NAME "Tests")
|
||||
|
||||
#depencencies
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
|
||||
set(CPACK_COMPONENT_samples_DEPENDS libs)
|
||||
set(CPACK_COMPONENT_dev_DEPENDS libs)
|
||||
set(CPACK_COMPONENT_docs_DEPENDS libs)
|
||||
set(CPACK_COMPONENT_java_DEPENDS libs)
|
||||
set(CPACK_COMPONENT_python_DEPENDS libs)
|
||||
set(CPACK_DEB_python_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}")
|
||||
set(CPACK_COMPONENT_tests_DEPENDS libs)
|
||||
set(CPACK_COMPONENT_LIBS_REQUIRED TRUE)
|
||||
set(CPACK_COMPONENT_SAMPLES_DEPENDS libs dev)
|
||||
set(CPACK_COMPONENT_DEV_DEPENDS libs)
|
||||
set(CPACK_COMPONENT_DOCS_DEPENDS libs)
|
||||
set(CPACK_COMPONENT_JAVA_DEPENDS libs)
|
||||
set(CPACK_COMPONENT_PYTHON_DEPENDS libs)
|
||||
set(CPACK_DEB_PYTHON_PACKAGE_DEPENDS "python-numpy (>=${PYTHON_NUMPY_VERSION}), python${PYTHON_VERSION_MAJOR_MINOR}")
|
||||
set(CPACK_COMPONENT_TESTS_DEPENDS libs)
|
||||
if (HAVE_opencv_python)
|
||||
set(CPACK_DEB_tests_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}, python-py | python-pytest")
|
||||
set(CPACK_DEB_TESTS_PACKAGE_DEPENDS "python-numpy (>=${PYTHON_NUMPY_VERSION}), python${PYTHON_VERSION_MAJOR_MINOR}, python-py | python-pytest")
|
||||
endif()
|
||||
|
||||
if(HAVE_CUDA)
|
||||
string(REPLACE "." "-" cuda_version_suffix ${CUDA_VERSION})
|
||||
if(CUDA_VERSION VERSION_LESS "6.5")
|
||||
set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_DEV_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
|
||||
else()
|
||||
set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-cudart-${cuda_version_suffix}, cuda-npp-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-cudart-dev-${cuda_version_suffix}, cuda-npp-dev-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "cuda-cudart-${cuda_version_suffix}, cuda-npp-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_DEV_PACKAGE_DEPENDS "cuda-cudart-dev-${cuda_version_suffix}, cuda-npp-dev-${cuda_version_suffix}")
|
||||
if(HAVE_CUFFT)
|
||||
set(CPACK_DEB_libs_PACKAGE_DEPENDS "${CPACK_DEB_libs_PACKAGE_DEPENDS}, cuda-cufft-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_dev_PACKAGE_DEPENDS "${CPACK_DEB_dev_PACKAGE_DEPENDS}, cuda-cufft-dev-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "${CPACK_DEB_LIBS_PACKAGE_DEPENDS}, cuda-cufft-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_DEV_PACKAGE_DEPENDS "${CPACK_DEB_DEV_PACKAGE_DEPENDS}, cuda-cufft-dev-${cuda_version_suffix}")
|
||||
endif()
|
||||
if(HAVE_HAVE_CUBLAS)
|
||||
set(CPACK_DEB_libs_PACKAGE_DEPENDS "${CPACK_DEB_libs_PACKAGE_DEPENDS}, cuda-cublas-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_dev_PACKAGE_DEPENDS "${CPACK_DEB_dev_PACKAGE_DEPENDS}, cuda-cublas-dev-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "${CPACK_DEB_LIBS_PACKAGE_DEPENDS}, cuda-cublas-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_DEV_PACKAGE_DEPENDS "${CPACK_DEB_DEV_PACKAGE_DEPENDS}, cuda-cublas-dev-${cuda_version_suffix}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CPACK_COMPONENT_dev_DEPENDS libs)
|
||||
endif()
|
||||
|
||||
if(HAVE_TBB AND NOT BUILD_TBB)
|
||||
if(CPACK_DEB_DEV_PACKAGE_DEPENDS)
|
||||
set(CPACK_DEB_DEV_PACKAGE_DEPENDS "${CPACK_DEB_DEV_PACKAGE_DEPENDS}, libtbb-dev")
|
||||
else()
|
||||
set(CPACK_DEB_DEV_PACKAGE_DEPENDS "libtbb-dev")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(STD_OPENCV_LIBS opencv-data libopencv-calib3d2.4 libopencv-contrib2.4 libopencv-core2.4
|
||||
libopencv-features2d2.4 libopencv-flann2.4 libopencv-gpu2.4 libopencv-imgproc2.4
|
||||
libopencv-ml2.4 libopencv-ocl2.4 libopencv-stitching2.4 libopencv-ts2.4 libopencv-videostab2.4)
|
||||
|
||||
set(STD_OPENCV_DEV libopencv-calib3d-dev libopencv-contrib-dev libopencv-core-dev
|
||||
libopencv-dev libopencv-features2d-dev libopencv-flann-dev libopencv-gpu-dev
|
||||
libopencv-highgui-dev libopencv-imgproc-dev libopencv-legacy-dev libopencv-ml-dev
|
||||
libopencv-objdetect-dev libopencv-ocl-dev libopencv-photo-dev libopencv-stitching-dev
|
||||
libopencv-superres-dev libopencv-ts-dev libopencv-video-dev libopencv-videostab-dev)
|
||||
|
||||
string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_CONFLICTS "${STD_OPENCV_LIBS}")
|
||||
string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_PROVIDES "${STD_OPENCV_LIBS}")
|
||||
string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_REPLACES "${STD_OPENCV_LIBS}")
|
||||
|
||||
string(REPLACE ";" ", " CPACK_COMPONENT_DEV_CONFLICTS "${STD_OPENCV_DEV}")
|
||||
string(REPLACE ";" ", " CPACK_COMPONENT_DEV_PROVIDES "${STD_OPENCV_DEV}")
|
||||
string(REPLACE ";" ", " CPACK_COMPONENT_DEV_REPLACES "${STD_OPENCV_DEV}")
|
||||
|
||||
set(CPACK_COMPONENT_PYTHON_CONFLICTS python-opencv)
|
||||
set(CPACK_COMPONENT_PYTHON_PROVIDES python-opencv)
|
||||
set(CPACK_COMPONENT_PYTHON_REPLACES python-opencv)
|
||||
|
||||
set(CPACK_COMPONENT_JAVA_CONFLICTS "libopencv2.4-java, libopencv2.4-jni")
|
||||
set(CPACK_COMPONENT_JAVA_PROVIDES "libopencv2.4-java, libopencv2.4-jni")
|
||||
set(CPACK_COMPONENT_JAVA_REPLACES "libopencv2.4-java, libopencv2.4-jni")
|
||||
|
||||
set(CPACK_COMPONENT_DOCS_CONFLICTS opencv-doc)
|
||||
set(CPACK_COMPONENT_SAMPLES_CONFLICTS opencv-doc)
|
||||
|
||||
if(NOT OPENCV_CUSTOM_PACKAGE_INFO)
|
||||
set(CPACK_COMPONENT_libs_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}")
|
||||
set(CPACK_COMPONENT_libs_DESCRIPTION "Open Computer Vision Library")
|
||||
set(CPACK_COMPONENT_libs_SECTION "libs")
|
||||
set(CPACK_COMPONENT_LIBS_DESCRIPTION "Open Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_LIBS_NAME "libopencv")
|
||||
set(CPACK_DEBIAN_COMPONENT_LIBS_SECTION "libs")
|
||||
|
||||
set(CPACK_COMPONENT_python_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-python")
|
||||
set(CPACK_COMPONENT_python_DESCRIPTION "Python bindings for Open Source Computer Vision Library")
|
||||
set(CPACK_COMPONENT_python_SECTION "python")
|
||||
set(CPACK_COMPONENT_PYTHON_DESCRIPTION "Python bindings for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_PYTHON_NAME "libopencv-python")
|
||||
set(CPACK_DEBIAN_COMPONENT_PYTHON_SECTION "python")
|
||||
|
||||
set(CPACK_COMPONENT_java_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-java")
|
||||
set(CPACK_COMPONENT_java_DESCRIPTION "Java bindings for Open Source Computer Vision Library")
|
||||
set(CPACK_COMPONENT_java_SECTION "java")
|
||||
set(CPACK_COMPONENT_JAVA_DESCRIPTION "Java bindings for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_JAVA_NAME "libopencv-java")
|
||||
set(CPACK_DEBIAN_COMPONENT_JAVA_SECTION "java")
|
||||
|
||||
set(CPACK_COMPONENT_dev_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-dev")
|
||||
set(CPACK_COMPONENT_dev_DESCRIPTION "Development files for Open Source Computer Vision Library")
|
||||
set(CPACK_COMPONENT_dev_SECTION "libdevel")
|
||||
set(CPACK_COMPONENT_DEV_DESCRIPTION "Development files for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_DEV_NAME "libopencv-dev")
|
||||
set(CPACK_DEBIAN_COMPONENT_DEV_SECTION "libdevel")
|
||||
|
||||
set(CPACK_COMPONENT_docs_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-docs")
|
||||
set(CPACK_COMPONENT_docs_DESCRIPTION "Documentation for Open Source Computer Vision Library")
|
||||
set(CPACK_COMPONENT_docs_SECTION "doc")
|
||||
set(CPACK_COMPONENT_DOCS_DESCRIPTION "Documentation for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_DOCS_NAME "libopencv-docs")
|
||||
set(CPACK_DEBIAN_COMPONENT_DOCS_SECTION "doc")
|
||||
|
||||
set(CPACK_COMPONENT_samples_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-samples")
|
||||
set(CPACK_COMPONENT_samples_DESCRIPTION "Samples for Open Source Computer Vision Library")
|
||||
set(CPACK_COMPONENT_samples_SECTION "devel")
|
||||
set(CPACK_COMPONENT_SAMPLES_DESCRIPTION "Samples for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_SAMPLES_NAME "libopencv-samples")
|
||||
set(CPACK_DEBIAN_COMPONENT_SAMPLES_SECTION "devel")
|
||||
|
||||
set(CPACK_COMPONENT_tests_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-tests")
|
||||
set(CPACK_COMPONENT_tests_DESCRIPTION "Accuracy and performance tests for Open Source Computer Vision Library")
|
||||
set(CPACK_COMPONENT_tests_SECTION "misc")
|
||||
set(CPACK_COMPONENT_TESTS_DESCRIPTION "Accuracy and performance tests for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_TESTS_NAME "libopencv-tests")
|
||||
set(CPACK_DEBIAN_COMPONENT_TESTS_SECTION "misc")
|
||||
endif(NOT OPENCV_CUSTOM_PACKAGE_INFO)
|
||||
|
||||
if(NOT OPENCV_CUSTOM_PACKAGE_LAYOUT)
|
||||
set(CPACK_libs_COMPONENT_INSTALL TRUE)
|
||||
set(CPACK_dev_COMPONENT_INSTALL TRUE)
|
||||
set(CPACK_docs_COMPONENT_INSTALL TRUE)
|
||||
set(CPACK_python_COMPONENT_INSTALL TRUE)
|
||||
set(CPACK_java_COMPONENT_INSTALL TRUE)
|
||||
set(CPACK_samples_COMPONENT_INSTALL TRUE)
|
||||
endif(NOT OPENCV_CUSTOM_PACKAGE_LAYOUT)
|
||||
if(CPACK_GENERATOR STREQUAL "DEB")
|
||||
find_program(GZIP_TOOL NAMES "gzip" PATHS "/bin" "/usr/bin" "/usr/local/bin")
|
||||
if(NOT GZIP_TOOL)
|
||||
message(FATAL_ERROR "Unable to find 'gzip' program")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND "date" "-R"
|
||||
OUTPUT_VARIABLE CHANGELOG_PACKAGE_DATE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
set(CHANGELOG_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
|
||||
set(ALL_COMPONENTS "libs" "dev" "docs" "python" "java" "samples" "tests")
|
||||
foreach (comp ${ALL_COMPONENTS})
|
||||
string(TOUPPER "${comp}" comp_upcase)
|
||||
set(DEBIAN_CHANGELOG_OUT_FILE "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.Debian")
|
||||
set(DEBIAN_CHANGELOG_OUT_FILE_GZ "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.Debian.gz")
|
||||
set(CHANGELOG_PACKAGE_NAME "${CPACK_DEBIAN_COMPONENT_${comp_upcase}_NAME}")
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/changelog.Debian.in" "${DEBIAN_CHANGELOG_OUT_FILE}" @ONLY)
|
||||
|
||||
execute_process(COMMAND "${GZIP_TOOL}" "-cf9" "${DEBIAN_CHANGELOG_OUT_FILE}"
|
||||
OUTPUT_FILE "${DEBIAN_CHANGELOG_OUT_FILE_GZ}"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||
|
||||
install(FILES "${DEBIAN_CHANGELOG_OUT_FILE_GZ}"
|
||||
DESTINATION "share/doc/${CPACK_DEBIAN_COMPONENT_${comp_upcase}_NAME}"
|
||||
COMPONENT "${comp}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
|
||||
ENDif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
ENDif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
|
||||
+22
-11
@@ -200,12 +200,12 @@ macro(OCV_OPTION variable description value)
|
||||
endif()
|
||||
endforeach()
|
||||
unset(__varname)
|
||||
if("${__condition}" STREQUAL "")
|
||||
if(__condition STREQUAL "")
|
||||
set(__condition 2 GREATER 1)
|
||||
endif()
|
||||
|
||||
if(${__condition})
|
||||
if("${__value}" MATCHES ";")
|
||||
if(__value MATCHES ";")
|
||||
if(${__value})
|
||||
option(${variable} "${description}" ON)
|
||||
else()
|
||||
@@ -449,18 +449,29 @@ endmacro()
|
||||
|
||||
|
||||
# convert list of paths to libraries names without lib prefix
|
||||
macro(ocv_convert_to_lib_name var)
|
||||
set(__tmp "")
|
||||
function(ocv_convert_to_lib_name var)
|
||||
set(tmp "")
|
||||
foreach(path ${ARGN})
|
||||
get_filename_component(__tmp_name "${path}" NAME_WE)
|
||||
string(REGEX REPLACE "^lib" "" __tmp_name ${__tmp_name})
|
||||
list(APPEND __tmp "${__tmp_name}")
|
||||
get_filename_component(tmp_name "${path}" NAME_WE)
|
||||
string(REGEX REPLACE "^lib" "" tmp_name "${tmp_name}")
|
||||
list(APPEND tmp "${tmp_name}")
|
||||
endforeach()
|
||||
set(${var} ${__tmp})
|
||||
unset(__tmp)
|
||||
unset(__tmp_name)
|
||||
endmacro()
|
||||
set(${var} ${tmp} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# create imported targets for a list of external libraries
|
||||
function(ocv_create_imported_targets var)
|
||||
set(target_list "")
|
||||
|
||||
foreach(library ${ARGN})
|
||||
ocv_convert_to_lib_name(libname "${library}")
|
||||
add_library("opencv_dep_${libname}" UNKNOWN IMPORTED)
|
||||
set_target_properties("opencv_dep_${libname}" PROPERTIES IMPORTED_LOCATION "${library}")
|
||||
list(APPEND target_list "opencv_dep_${libname}")
|
||||
endforeach()
|
||||
|
||||
set("${var}" "${target_list}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# add install command
|
||||
function(ocv_install_target)
|
||||
|
||||
@@ -31,7 +31,16 @@ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||
endif
|
||||
OPENCV_DYNAMICUDA_MODULE:=@OPENCV_DYNAMICUDA_MODULE_CONFIGMAKE@
|
||||
else
|
||||
OPENCV_DYNAMICUDA_MODULE:=
|
||||
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||
ifeq ($(OPENCV_HAVE_GPU_MODULE),on)
|
||||
ifneq ($(CUDA_TOOLKIT_DIR),)
|
||||
OPENCV_USE_GPU_MODULE:=on
|
||||
endif
|
||||
endif
|
||||
OPENCV_DYNAMICUDA_MODULE:=@OPENCV_DYNAMICUDA_MODULE_CONFIGMAKE@
|
||||
else
|
||||
OPENCV_DYNAMICUDA_MODULE:=
|
||||
endif
|
||||
endif
|
||||
|
||||
CUDA_RUNTIME_LIBS:=@CUDA_RUNTIME_LIBS_CONFIGMAKE@
|
||||
@@ -56,6 +65,10 @@ else
|
||||
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
||||
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
||||
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
||||
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
||||
@@ -77,6 +90,9 @@ ifeq ($(OPENCV_CAMERA_MODULES),on)
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_V7A_CONFIGCMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARM64_V8A_CONFIGCMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_X86_CONFIGCMAKE@
|
||||
endif
|
||||
@@ -101,10 +117,18 @@ define add_opencv_module
|
||||
include $(PREBUILT_$(OPENCV_LIB_TYPE)_LIBRARY)
|
||||
endef
|
||||
|
||||
ifndef CUDA_LIBS_DIR
|
||||
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||
CUDA_LIBS_DIR := $(CUDA_TOOLKIT_DIR)/targets/aarch64-linux-androideabi/lib
|
||||
else
|
||||
CUDA_LIBS_DIR := $(CUDA_TOOLKIT_DIR)/targets/armv7-linux-androideabi/lib
|
||||
endif
|
||||
endif
|
||||
|
||||
define add_cuda_module
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE:=$1
|
||||
LOCAL_SRC_FILES:=$(CUDA_TOOLKIT_DIR)/targets/armv7-linux-androideabi/lib/lib$1.so
|
||||
LOCAL_SRC_FILES:=$(CUDA_LIBS_DIR)/lib$(1:opencv_dep_%=%).so
|
||||
include $(PREBUILT_SHARED_LIBRARY)
|
||||
endef
|
||||
|
||||
@@ -202,7 +226,8 @@ ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
||||
ifeq ($(INSTALL_CUDA_LIBRARIES),on)
|
||||
LOCAL_SHARED_LIBRARIES += $(foreach mod, $(CUDA_RUNTIME_LIBS), $(mod))
|
||||
else
|
||||
LOCAL_LDLIBS += -L$(CUDA_TOOLKIT_DIR)/targets/armv7-linux-androideabi/lib $(foreach lib, $(CUDA_RUNTIME_LIBS), -l$(lib))
|
||||
LOCAL_LDLIBS += -L$(CUDA_LIBS_DIR) \
|
||||
$(foreach lib, $(CUDA_RUNTIME_LIBS), -l$(lib:opencv_dep_%=%))
|
||||
endif
|
||||
LOCAL_STATIC_LIBRARIES+=libopencv_gpu
|
||||
endif
|
||||
|
||||
@@ -37,6 +37,21 @@
|
||||
#
|
||||
# ===================================================================================
|
||||
|
||||
# Search packages for host system instead of packages for target system.
|
||||
# in case of cross compilation thess macro should be defined by toolchain file
|
||||
|
||||
if(NOT COMMAND find_host_package)
|
||||
macro(find_host_package)
|
||||
find_package(${ARGN})
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
if(NOT COMMAND find_host_program)
|
||||
macro(find_host_program)
|
||||
find_program(${ARGN})
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED OpenCV_MODULES_SUFFIX)
|
||||
if(ANDROID)
|
||||
string(REPLACE - _ OpenCV_MODULES_SUFFIX "_${ANDROID_NDK_ABI_NAME}")
|
||||
@@ -46,6 +61,13 @@ if(NOT DEFINED OpenCV_MODULES_SUFFIX)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET opencv_core)
|
||||
# Extract directory name from full path of the file currently being processed.
|
||||
# Note that CMake 2.8.3 introduced CMAKE_CURRENT_LIST_DIR. We reimplement it
|
||||
# for older versions of CMake to support these as well.
|
||||
if(CMAKE_VERSION VERSION_LESS "2.8.3")
|
||||
get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
endif()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${OpenCV_MODULES_SUFFIX}.cmake)
|
||||
endif()
|
||||
|
||||
@@ -212,55 +234,55 @@ endif()
|
||||
foreach(__opttype OPT DBG)
|
||||
SET(OpenCV_LIBS_${__opttype} "${OpenCV_LIBS}")
|
||||
SET(OpenCV_EXTRA_LIBS_${__opttype} "")
|
||||
|
||||
# CUDA
|
||||
if(OpenCV_CUDA_VERSION)
|
||||
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 was compiled with CUDA ${OpenCV_CUDA_VERSION} support. Please, use the same version or rebuild OpenCV with CUDA ${CUDA_VERSION_STRING}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(OpenCV_CUDA_LIBS_ABSPATH ${CUDA_LIBRARIES})
|
||||
|
||||
if(${CUDA_VERSION} VERSION_LESS "5.5")
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_npp_LIBRARY})
|
||||
else()
|
||||
find_cuda_helper_libs(nppc)
|
||||
find_cuda_helper_libs(nppi)
|
||||
find_cuda_helper_libs(npps)
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nppc_LIBRARY} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(OpenCV_USE_CUBLAS)
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUBLAS_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(OpenCV_USE_CUFFT)
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUFFT_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(OpenCV_USE_NVCUVID)
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvid_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvenc_LIBRARIES})
|
||||
endif()
|
||||
|
||||
set(OpenCV_CUDA_LIBS_RELPATH "")
|
||||
foreach(l ${OpenCV_CUDA_LIBS_ABSPATH})
|
||||
get_filename_component(_tmp ${l} PATH)
|
||||
list(APPEND OpenCV_CUDA_LIBS_RELPATH ${_tmp})
|
||||
endforeach()
|
||||
|
||||
list(REMOVE_DUPLICATES OpenCV_CUDA_LIBS_RELPATH)
|
||||
link_directories(${OpenCV_CUDA_LIBS_RELPATH})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Configure CUDA targets
|
||||
if(OpenCV_CUDA_VERSION)
|
||||
if(NOT CUDA_FOUND)
|
||||
find_host_package(CUDA ${OpenCV_CUDA_VERSION} EXACT REQUIRED)
|
||||
else()
|
||||
if(NOT CUDA_VERSION_STRING VERSION_EQUAL OpenCV_CUDA_VERSION)
|
||||
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()
|
||||
|
||||
set(OpenCV_CUDA_LIBS_ABSPATH ${CUDA_LIBRARIES})
|
||||
|
||||
if(${CUDA_VERSION} VERSION_LESS "5.5")
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_npp_LIBRARY})
|
||||
else()
|
||||
find_cuda_helper_libs(nppc)
|
||||
find_cuda_helper_libs(nppi)
|
||||
find_cuda_helper_libs(npps)
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nppc_LIBRARY} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(OpenCV_USE_CUBLAS)
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUBLAS_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(OpenCV_USE_CUFFT)
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUFFT_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(OpenCV_USE_NVCUVID)
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvid_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvenc_LIBRARIES})
|
||||
endif()
|
||||
|
||||
foreach(l ${OpenCV_CUDA_LIBS_ABSPATH})
|
||||
get_filename_component(_tmp "${l}" NAME_WE)
|
||||
string(REGEX REPLACE "^lib" "" _tmp "${_tmp}")
|
||||
if(NOT TARGET "opencv_dep_${_tmp}") # protect against repeated inclusions
|
||||
add_library("opencv_dep_${_tmp}" UNKNOWN IMPORTED)
|
||||
set_target_properties("opencv_dep_${_tmp}" PROPERTIES IMPORTED_LOCATION "${l}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# ==============================================================
|
||||
# Android camera helper macro
|
||||
# ==============================================================
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
@CHANGELOG_PACKAGE_NAME@ (@CPACK_PACKAGE_VERSION@) unstable; urgency=low
|
||||
* Debian changelog stub. See upstream changelog or release notes in user
|
||||
documentation for more details.
|
||||
-- @CPACK_PACKAGE_CONTACT@ @CHANGELOG_PACKAGE_DATE@
|
||||
@@ -1,36 +1,149 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# Usage info
|
||||
|
||||
usage()
|
||||
{
|
||||
cat << EOF
|
||||
usage: $0 [options]
|
||||
|
||||
This script runs the OpenCV tests on linux device.
|
||||
|
||||
OPTIONS:
|
||||
-h Show this message
|
||||
-c Color output
|
||||
EOF
|
||||
}
|
||||
|
||||
# Parse options
|
||||
|
||||
COLOR_OUTPUT=0
|
||||
while getopts “hc” OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
c)
|
||||
COLOR_OUTPUT=1
|
||||
;;
|
||||
?)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Text style
|
||||
|
||||
if [ $COLOR_OUTPUT -eq 1 ]; then
|
||||
TEXT_RED="$(tput setaf 1)"
|
||||
TEXT_GREEN="$(tput setaf 2)"
|
||||
TEXT_CYAN="$(tput setaf 6)"
|
||||
TEXT_RESET="$(tput sgr0)"
|
||||
else
|
||||
TEXT_RED=""
|
||||
TEXT_GREEN=""
|
||||
TEXT_CYAN=""
|
||||
TEXT_RESET=""
|
||||
fi
|
||||
|
||||
# Test binaries and data paths
|
||||
|
||||
OPENCV_TEST_PATH=@CMAKE_INSTALL_PREFIX@/@OPENCV_TEST_INSTALL_PATH@
|
||||
OPENCV_PYTHON_TESTS=@OPENCV_PYTHON_TESTS_LIST@
|
||||
export OPENCV_TEST_DATA_PATH=@CMAKE_INSTALL_PREFIX@/share/OpenCV/testdata
|
||||
|
||||
CUR_DIR=`pwd`
|
||||
if [ -d "$CUR_DIR" -a -w "$CUR_DIR" ]; then
|
||||
echo "${TEXT_CYAN}CUR_DIR : $CUR_DIR${TEXT_RESET}"
|
||||
else
|
||||
echo "${TEXT_RED}Error: Do not have permissions to write to $CUR_DIR${TEXT_RESET}"
|
||||
echo "${TEXT_RED}Please run the script from directory with write access${TEXT_RESET}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run tests
|
||||
|
||||
SUMMARY_STATUS=0
|
||||
FAILED_TESTS=""
|
||||
PASSED_TESTS=""
|
||||
|
||||
for t in "$OPENCV_TEST_PATH/"opencv_test_* "$OPENCV_TEST_PATH/"opencv_perf_*;
|
||||
do
|
||||
report="`basename "$t"`-`date --rfc-3339=date`.xml"
|
||||
"$t" --perf_min_samples=1 --perf_force_samples=1 --gtest_output=xml:"$report"
|
||||
TEST_STATUS=$?
|
||||
if [ $TEST_STATUS -ne 0 ]; then
|
||||
SUMMARY_STATUS=$TEST_STATUS
|
||||
fi
|
||||
test_name=`basename "$t"`
|
||||
|
||||
cmd="$t --perf_min_samples=1 --perf_force_samples=1 --gtest_output=xml:$test_name.xml"
|
||||
|
||||
seg_reg="s/^/${TEXT_CYAN}[$test_name]${TEXT_RESET} /" # append test name
|
||||
if [ $COLOR_OUTPUT -eq 1 ]; then
|
||||
seg_reg="${seg_reg};s/\[==========\]/${TEXT_GREEN}&${TEXT_RESET}/g" # green for [==========]
|
||||
seg_reg="${seg_reg};s/\[----------\]/${TEXT_GREEN}&${TEXT_RESET}/g" # green for [----------]
|
||||
seg_reg="${seg_reg};s/\[ RUN \]/${TEXT_GREEN}&${TEXT_RESET}/g" # green for [ RUN ]
|
||||
seg_reg="${seg_reg};s/\[ OK \]/${TEXT_GREEN}&${TEXT_RESET}/g" # green for [ OK ]
|
||||
seg_reg="${seg_reg};s/\[ FAILED \]/${TEXT_RED}&${TEXT_RESET}/g" # red for [ FAILED ]
|
||||
seg_reg="${seg_reg};s/\[ PASSED \]/${TEXT_GREEN}&${TEXT_RESET}/g" # green for [ PASSED ]
|
||||
fi
|
||||
|
||||
echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RUN : $cmd"
|
||||
eval "$cmd" | tee "$test_name.log" | sed -r "$seg_reg"
|
||||
ret=${PIPESTATUS[0]}
|
||||
echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RETURN_CODE : $ret"
|
||||
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} ${TEXT_RED}FAILED${TEXT_RESET}"
|
||||
SUMMARY_STATUS=1
|
||||
FAILED_TESTS="$FAILED_TESTS $test_name"
|
||||
else
|
||||
echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} ${TEXT_GREEN}OK${TEXT_RESET}"
|
||||
PASSED_TESTS="$PASSED_TESTS $test_name"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
done
|
||||
|
||||
for t in $OPENCV_PYTHON_TESTS;
|
||||
do
|
||||
report="`basename "$t"`-`date --rfc-3339=date`.xml"
|
||||
py.test --junitxml $report "$OPENCV_TEST_PATH"/$t
|
||||
TEST_STATUS=$?
|
||||
if [ $TEST_STATUS -ne 0 ]; then
|
||||
SUMMARY_STATUS=$TEST_STATUS
|
||||
fi
|
||||
test_name=`basename "$t"`
|
||||
|
||||
cmd="py.test --junitxml $test_name.xml \"$OPENCV_TEST_PATH\"/$t"
|
||||
|
||||
seg_reg="s/^/${TEXT_CYAN}[$test_name]${TEXT_RESET} /" # append test name
|
||||
|
||||
echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RUN : $cmd"
|
||||
eval "$cmd" | tee "$test_name.log" | sed -r "$seg_reg"
|
||||
|
||||
ret=${PIPESTATUS[0]}
|
||||
echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RETURN_CODE : $ret"
|
||||
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} ${TEXT_RED}FAILED${TEXT_RESET}"
|
||||
SUMMARY_STATUS=1
|
||||
FAILED_TESTS="$FAILED_TESTS $test_name"
|
||||
else
|
||||
echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} ${TEXT_GREEN}OK${TEXT_RESET}"
|
||||
PASSED_TESTS="$PASSED_TESTS $test_name"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
done
|
||||
|
||||
# Remove temporary test files
|
||||
|
||||
rm -f /tmp/__opencv_temp.*
|
||||
|
||||
# Report final status
|
||||
|
||||
echo "${TEXT_CYAN}===============================================================${TEXT_RESET}"
|
||||
echo "${TEXT_CYAN}PASSED TESTS : $PASSED_TESTS${TEXT_RESET}"
|
||||
echo "${TEXT_CYAN}FAILED TESTS : $FAILED_TESTS${TEXT_RESET}"
|
||||
if [ $SUMMARY_STATUS -eq 0 ]; then
|
||||
echo "All OpenCV tests finished successfully"
|
||||
echo "${TEXT_GREEN}STATUS : OK${TEXT_RESET}"
|
||||
echo "${TEXT_GREEN}STATUS : All OpenCV tests finished successfully${TEXT_RESET}"
|
||||
else
|
||||
echo "OpenCV tests finished with status $SUMMARY_STATUS"
|
||||
echo "${TEXT_RED}STATUS : FAIL${TEXT_RESET}"
|
||||
echo "${TEXT_RED}STATUS : OpenCV tests finished with status $SUMMARY_STATUS${TEXT_RESET}"
|
||||
fi
|
||||
|
||||
return $SUMMARY_STATUS
|
||||
exit $SUMMARY_STATUS
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
@echo OFF
|
||||
setlocal ENABLEDELAYEDEXPANSION
|
||||
|
||||
rem Process command line
|
||||
|
||||
rem This script is designed to allow situations when the tests are installed in
|
||||
rem a different directory from the library.
|
||||
|
||||
set OPENCV_DIR=%~1
|
||||
|
||||
if "%OPENCV_DIR%" == "" (
|
||||
echo>&2 This script runs the OpenCV tests on Windows.
|
||||
echo>&2
|
||||
echo>&2 usage: %0 ^<OpenCV install directory^>
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
if NOT EXIST "%OPENCV_DIR%" (
|
||||
echo>&2 error: "%OPENCV_DIR%" doesn't exist
|
||||
)
|
||||
|
||||
rem Set up paths
|
||||
|
||||
set PATH=%OPENCV_DIR%\@OPENCV_BIN_INSTALL_PATH@;%PATH%
|
||||
set OPENCV_TEST_PATH=%~dp0
|
||||
set OPENCV_TEST_DATA_PATH=%OPENCV_TEST_PATH%\..\testdata
|
||||
|
||||
rem Run tests
|
||||
|
||||
set SUMMARY_STATUS=0
|
||||
set FAILED_TESTS=
|
||||
set PASSED_TESTS=
|
||||
|
||||
for %%t IN ("%OPENCV_TEST_PATH%\opencv_test_*.exe" "%OPENCV_TEST_PATH%\opencv_perf_*.exe") DO (
|
||||
set test_name=%%~nt
|
||||
set report=!test_name!.xml
|
||||
|
||||
set cmd="%%t" --perf_min_samples=1 --perf_force_samples=1 "--gtest_output=xml:!report!"
|
||||
|
||||
echo [!test_name!] RUN : !cmd!
|
||||
!cmd!
|
||||
set ret=!errorlevel!
|
||||
echo [!test_name!] RETURN_CODE : !ret!
|
||||
|
||||
if !ret! EQU 0 (
|
||||
echo [!test_name!] OK
|
||||
set PASSED_TESTS=!PASSED_TESTS! !test_name!
|
||||
) ELSE (
|
||||
echo [!test_name!] FAILED
|
||||
set SUMMARY_STATUS=1
|
||||
set FAILED_TESTS=!FAILED_TESTS! !test_name!
|
||||
)
|
||||
|
||||
echo.
|
||||
)
|
||||
|
||||
rem Remove temporary test files
|
||||
|
||||
del /F /Q "%TMP%\ocv*.tmp*"
|
||||
|
||||
rem Report final status
|
||||
|
||||
echo ===============================================================
|
||||
echo PASSED TESTS : %PASSED_TESTS%
|
||||
echo FAILED TESTS : %FAILED_TESTS%
|
||||
if %SUMMARY_STATUS% EQU 0 (
|
||||
echo STATUS : OK
|
||||
echo STATUS : All OpenCV tests finished successfully
|
||||
) ELSE (
|
||||
echo STATUS : FAIL
|
||||
echo STATUS : OpenCV tests finished with status %SUMMARY_STATUS%
|
||||
)
|
||||
|
||||
exit /B %SUMMARY_STATUS%
|
||||
@@ -1,2 +0,0 @@
|
||||
# Environment setup for OpenCV testing
|
||||
export OPENCV_TEST_DATA_PATH=@CMAKE_INSTALL_PREFIX@/share/OpenCV/testdata
|
||||
+2
-2
@@ -4,7 +4,7 @@ file(GLOB LBP_CASCADES lbpcascades/*.xml)
|
||||
if(ANDROID)
|
||||
install(FILES ${HAAR_CASCADES} DESTINATION sdk/etc/haarcascades COMPONENT libs)
|
||||
install(FILES ${LBP_CASCADES} DESTINATION sdk/etc/lbpcascades COMPONENT libs)
|
||||
elseif(NOT WIN32)
|
||||
else()
|
||||
install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT libs)
|
||||
install(FILES ${LBP_CASCADES} DESTINATION share/OpenCV/lbpcascades COMPONENT libs)
|
||||
endif()
|
||||
@@ -12,7 +12,7 @@ endif()
|
||||
if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
|
||||
if(ANDROID)
|
||||
install(DIRECTORY ${OPENCV_TEST_DATA_PATH} DESTINATION sdk/etc/testdata COMPONENT tests)
|
||||
elseif(NOT WIN32)
|
||||
else()
|
||||
# CPack does not set correct permissions by default, so we do it explicitly.
|
||||
install(DIRECTORY ${OPENCV_TEST_DATA_PATH}
|
||||
DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE
|
||||
|
||||
+11464
-14703
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+23968
-25779
File diff suppressed because it is too large
Load Diff
+20283
-23114
File diff suppressed because it is too large
Load Diff
+96063
-103072
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+16183
-17271
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+13281
-14310
File diff suppressed because it is too large
Load Diff
+29356
-31596
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+6729
-8353
File diff suppressed because it is too large
Load Diff
+27453
-29086
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+65
-29
@@ -1,25 +1,15 @@
|
||||
#
|
||||
#-----------------------
|
||||
# CMake file for OpenCV docs
|
||||
#
|
||||
#-----------------------
|
||||
|
||||
if(BUILD_DOCS AND HAVE_SPHINX)
|
||||
if(BUILD_DOCS AND (HAVE_SPHINX OR HAVE_DOXYGEN))
|
||||
set(HAVE_DOC_GENERATOR TRUE)
|
||||
else()
|
||||
set(HAVE_DOC_GENERATOR FALSE)
|
||||
endif()
|
||||
|
||||
if(HAVE_DOC_GENERATOR)
|
||||
project(opencv_docs)
|
||||
|
||||
set(DOC_LIST
|
||||
"${OpenCV_SOURCE_DIR}/doc/opencv-logo.png"
|
||||
"${OpenCV_SOURCE_DIR}/doc/opencv-logo2.png"
|
||||
"${OpenCV_SOURCE_DIR}/doc/opencv-logo-white.png"
|
||||
"${OpenCV_SOURCE_DIR}/doc/opencv.ico"
|
||||
"${OpenCV_SOURCE_DIR}/doc/pattern.png"
|
||||
"${OpenCV_SOURCE_DIR}/doc/acircles_pattern.png")
|
||||
if(NOT INSTALL_CREATE_DISTRIB)
|
||||
list(APPEND DOC_LIST "${OpenCV_SOURCE_DIR}/doc/haartraining.htm")
|
||||
endif()
|
||||
|
||||
set(OPTIONAL_DOC_LIST "")
|
||||
|
||||
|
||||
# build lists of modules to be documented
|
||||
set(BASE_MODULES "")
|
||||
set(EXTRA_MODULES "")
|
||||
@@ -32,18 +22,29 @@ if(BUILD_DOCS AND HAVE_SPHINX)
|
||||
list(APPEND EXTRA_MODULES ${mod})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(FIXED_ORDER_MODULES core imgproc highgui video calib3d features2d objdetect ml flann gpu photo stitching nonfree contrib legacy)
|
||||
|
||||
list(REMOVE_ITEM BASE_MODULES ${FIXED_ORDER_MODULES})
|
||||
|
||||
ocv_list_sort(BASE_MODULES)
|
||||
ocv_list_sort(EXTRA_MODULES)
|
||||
|
||||
set(FIXED_ORDER_MODULES core imgproc highgui video calib3d features2d objdetect ml flann gpu photo stitching nonfree contrib legacy)
|
||||
list(REMOVE_ITEM BASE_MODULES ${FIXED_ORDER_MODULES})
|
||||
set(BASE_MODULES ${FIXED_ORDER_MODULES} ${BASE_MODULES})
|
||||
|
||||
# build lists of documentation files and generate table of contents for reference manual
|
||||
set(DOC_LIST
|
||||
"${OpenCV_SOURCE_DIR}/doc/opencv-logo.png"
|
||||
"${OpenCV_SOURCE_DIR}/doc/opencv-logo2.png"
|
||||
"${OpenCV_SOURCE_DIR}/doc/opencv-logo-white.png"
|
||||
"${OpenCV_SOURCE_DIR}/doc/opencv.ico"
|
||||
"${OpenCV_SOURCE_DIR}/doc/pattern.png"
|
||||
"${OpenCV_SOURCE_DIR}/doc/acircles_pattern.png")
|
||||
set(OPTIONAL_DOC_LIST "")
|
||||
endif(HAVE_DOC_GENERATOR)
|
||||
|
||||
# ========= Sphinx docs =========
|
||||
if(BUILD_DOCS AND HAVE_SPHINX)
|
||||
if(NOT INSTALL_CREATE_DISTRIB)
|
||||
list(APPEND DOC_LIST "${OpenCV_SOURCE_DIR}/doc/haartraining.htm")
|
||||
endif()
|
||||
|
||||
# build lists of documentation files and generate table of contents for reference manual
|
||||
set(DOC_FAKE_ROOT "${CMAKE_CURRENT_BINARY_DIR}/fake-root")
|
||||
set(DOC_FAKE_ROOT_FILES "")
|
||||
|
||||
@@ -98,7 +99,6 @@ if(BUILD_DOCS AND HAVE_SPHINX)
|
||||
if(PDFLATEX_COMPILER)
|
||||
add_custom_target(docs
|
||||
COMMAND ${SPHINX_BUILD} -b latex -c "${CMAKE_CURRENT_SOURCE_DIR}" "${DOC_FAKE_ROOT}" .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/pics ${CMAKE_CURRENT_BINARY_DIR}/doc/opencv1/pics
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/patch_refman_latex.py" opencv2refman.tex
|
||||
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/patch_refman_latex.py" opencv2manager.tex
|
||||
@@ -142,12 +142,48 @@ if(BUILD_DOCS AND HAVE_SPHINX)
|
||||
set_target_properties(html_docs PROPERTIES FOLDER "documentation")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# ========= Doxygen docs =========
|
||||
if(BUILD_DOCS AND HAVE_DOXYGEN)
|
||||
set(candidates)
|
||||
set(all_headers)
|
||||
set(all_images)
|
||||
list(APPEND candidates ${BASE_MODULES} ${EXTRA_MODULES})
|
||||
# blacklisted modules
|
||||
ocv_list_filterout(candidates "^ts$")
|
||||
# gathering headers
|
||||
foreach(m ${candidates})
|
||||
set(all_headers ${all_headers} "${OPENCV_MODULE_opencv_${m}_HEADERS}")
|
||||
set(docs_dir "${OPENCV_MODULE_opencv_${m}_LOCATION}/doc")
|
||||
if(EXISTS ${docs_dir})
|
||||
set(all_images ${all_images} ${docs_dir})
|
||||
set(all_headers ${all_headers} ${docs_dir})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# additional config
|
||||
string(REGEX REPLACE ";" " \\\\\\n" CMAKE_DOXYGEN_INPUT_LIST "${all_headers}")
|
||||
string(REGEX REPLACE ";" " \\\\\\n" CMAKE_DOXYGEN_IMAGE_PATH "${all_images}")
|
||||
set(CMAKE_DOXYGEN_INDEX_MD "${CMAKE_SOURCE_DIR}/README.md")
|
||||
set(CMAKE_DOXYGEN_LAYOUT "${CMAKE_CURRENT_SOURCE_DIR}/DoxygenLayout.xml")
|
||||
set(CMAKE_DOXYGEN_OUTPUT_PATH "doxygen")
|
||||
|
||||
# writing file
|
||||
set(doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
|
||||
configure_file(Doxyfile.in ${doxyfile} @ONLY)
|
||||
|
||||
add_custom_target(doxygen
|
||||
COMMAND ${DOXYGEN_BUILD} ${doxyfile}
|
||||
DEPENDS ${doxyfile} ${all_headers} ${all_images})
|
||||
endif()
|
||||
|
||||
if(HAVE_DOC_GENERATOR)
|
||||
# installation
|
||||
foreach(f ${DOC_LIST})
|
||||
install(FILES "${f}" DESTINATION "${OPENCV_DOC_INSTALL_PATH}" COMPONENT docs)
|
||||
endforeach()
|
||||
|
||||
foreach(f ${OPTIONAL_DOC_LIST})
|
||||
install(FILES "${f}" DESTINATION "${OPENCV_DOC_INSTALL_PATH}" OPTIONAL COMPONENT docs)
|
||||
endforeach()
|
||||
|
||||
endif()
|
||||
endif(HAVE_DOC_GENERATOR)
|
||||
|
||||
+218
-70
@@ -1,124 +1,272 @@
|
||||
# Doxyfile 1.3.9.1
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = opencv
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = OpenCV
|
||||
PROJECT_NUMBER = @OPENCV_VERSION@
|
||||
OUTPUT_DIRECTORY = .
|
||||
CREATE_SUBDIRS = NO
|
||||
PROJECT_BRIEF = "Open Source Computer Vision"
|
||||
PROJECT_LOGO = @CMAKE_CURRENT_SOURCE_DIR@/opencv-logo-small.png
|
||||
OUTPUT_DIRECTORY = @CMAKE_DOXYGEN_OUTPUT_PATH@
|
||||
CREATE_SUBDIRS = YES
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
SORT_BRIEF_DOCS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = NO
|
||||
STRIP_FROM_PATH =
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
QT_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 4
|
||||
ALIASES =
|
||||
TCL_SUBST =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
OPTIMIZE_FOR_FORTRAN = NO
|
||||
OPTIMIZE_OUTPUT_VHDL = NO
|
||||
EXTENSION_MAPPING =
|
||||
MARKDOWN_SUPPORT = YES
|
||||
AUTOLINK_SUPPORT = NO
|
||||
BUILTIN_STL_SUPPORT = YES
|
||||
CPP_CLI_SUPPORT = NO
|
||||
SIP_SUPPORT = NO
|
||||
IDL_PROPERTY_SUPPORT = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
INLINE_GROUPED_CLASSES = NO
|
||||
INLINE_SIMPLE_STRUCTS = NO
|
||||
TYPEDEF_HIDES_STRUCT = YES
|
||||
LOOKUP_CACHE_SIZE = 0
|
||||
EXTRACT_ALL = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_PACKAGE = NO
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
EXTRACT_ANON_NSPACES = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
SHOW_GROUPED_MEMB_INC = NO
|
||||
FORCE_LOCAL_INCLUDES = NO
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_MEMBERS_CTORS_1ST = NO
|
||||
SORT_GROUP_NAMES = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
STRICT_PROTO_MATCHING = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_FILES = YES
|
||||
SHOW_NAMESPACES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
LAYOUT_FILE = @CMAKE_DOXYGEN_LAYOUT@
|
||||
CITE_BIB_FILES =
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = @CMAKE_DOXYGEN_INPUT_LIST@
|
||||
FILE_PATTERNS = *.cpp *.h*
|
||||
RECURSIVE = NO
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS =
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXCLUDE_SYMBOLS = CV_WRAP \
|
||||
CV_EXPORTS \
|
||||
CV_EXPORTS_W \
|
||||
CV_WRAP_AS
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH = @CMAKE_DOXYGEN_IMAGE_PATH@
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = YES
|
||||
FILTER_SOURCE_PATTERNS =
|
||||
USE_MDFILE_AS_MAINPAGE = @CMAKE_DOXYGEN_INDEX_MD@
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
SOURCE_TOOLTIPS = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = NO
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_EXTRA_STYLESHEET =
|
||||
HTML_EXTRA_FILES =
|
||||
HTML_COLORSTYLE_HUE = 220
|
||||
HTML_COLORSTYLE_SAT = 100
|
||||
HTML_COLORSTYLE_GAMMA = 80
|
||||
HTML_TIMESTAMP = YES
|
||||
HTML_DYNAMIC_SECTIONS = NO
|
||||
HTML_INDEX_NUM_ENTRIES = 100
|
||||
GENERATE_DOCSET = NO
|
||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
||||
DOCSET_BUNDLE_ID = org.doxygen.Project
|
||||
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
|
||||
DOCSET_PUBLISHER_NAME = Publisher
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
CHM_INDEX_ENCODING =
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
GENERATE_QHP = NO
|
||||
QCH_FILE =
|
||||
QHP_NAMESPACE = org.doxygen.Project
|
||||
QHP_VIRTUAL_FOLDER = doc
|
||||
QHP_CUST_FILTER_NAME =
|
||||
QHP_CUST_FILTER_ATTRS =
|
||||
QHP_SECT_FILTER_ATTRS =
|
||||
QHG_LOCATION =
|
||||
GENERATE_ECLIPSEHELP = NO
|
||||
ECLIPSE_DOC_ID = org.doxygen.Project
|
||||
DISABLE_INDEX = YES
|
||||
GENERATE_TREEVIEW = YES
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
TREEVIEW_WIDTH = 250
|
||||
EXT_LINKS_IN_WINDOW = YES
|
||||
FORMULA_FONTSIZE = 10
|
||||
FORMULA_TRANSPARENT = YES
|
||||
USE_MATHJAX = NO
|
||||
MATHJAX_FORMAT = HTML-CSS
|
||||
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
|
||||
MATHJAX_EXTENSIONS =
|
||||
MATHJAX_CODEFILE =
|
||||
SEARCHENGINE = YES
|
||||
SERVER_BASED_SEARCH = NO
|
||||
EXTERNAL_SEARCH = NO
|
||||
SEARCHENGINE_URL =
|
||||
SEARCHDATA_FILE = searchdata.xml
|
||||
EXTERNAL_SEARCH_ID =
|
||||
EXTRA_SEARCH_MAPPINGS =
|
||||
GENERATE_LATEX = YES
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
LATEX_FOOTER =
|
||||
LATEX_EXTRA_FILES =
|
||||
PDF_HYPERLINKS = YES
|
||||
USE_PDFLATEX = YES
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
LATEX_SOURCE_CODE = NO
|
||||
LATEX_BIB_STYLE = plain
|
||||
GENERATE_RTF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
GENERATE_MAN = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
GENERATE_XML = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
XML_OUTPUT = xml
|
||||
XML_PROGRAMLISTING = YES
|
||||
GENERATE_DOCBOOK = NO
|
||||
DOCBOOK_OUTPUT = docbook
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = YES
|
||||
PREDEFINED = CV_EXPORTS= CVAPI(x)=x __cplusplus=1
|
||||
SEARCH_INCLUDES = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = CV_WRAP= \
|
||||
CV_WRAP_AS(x)= \
|
||||
__cplusplus=1 \
|
||||
CVAPI(x)=x \
|
||||
CV_PROP_RW= \
|
||||
CV_EXPORTS= \
|
||||
CV_EXPORTS_W=
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
EXTERNAL_PAGES = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
MSCGEN_PATH =
|
||||
DIA_PATH =
|
||||
HIDE_UNDOC_RELATIONS = NO
|
||||
HAVE_DOT = NO
|
||||
DOT_NUM_THREADS = 0
|
||||
DOT_FONTNAME = Helvetica
|
||||
DOT_FONTSIZE = 10
|
||||
DOT_FONTPATH =
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
UML_LOOK = NO
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = YES
|
||||
UML_LIMIT_NUM_FIELDS = 10
|
||||
TEMPLATE_RELATIONS = YES
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
CALL_GRAPH = YES
|
||||
CALLER_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = svg
|
||||
INTERACTIVE_SVG = YES
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
MSCFILE_DIRS =
|
||||
DIAFILE_DIRS =
|
||||
DOT_GRAPH_MAX_NODES = 50
|
||||
MAX_DOT_GRAPH_DEPTH = 0
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = YES
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
<doxygenlayout version="1.0">
|
||||
<!-- Generated by doxygen 1.8.6 -->
|
||||
<!-- Navigation index tabs for HTML output -->
|
||||
<navindex>
|
||||
<tab type="mainpage" visible="yes" title=""/>
|
||||
<tab type="pages" visible="yes" title="" intro=""/>
|
||||
<tab type="modules" visible="yes" title="" intro=""/>
|
||||
<tab type="namespaces" visible="yes" title="">
|
||||
<tab type="namespacelist" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="classes" visible="yes" title="">
|
||||
<tab type="classlist" visible="yes" title="" intro=""/>
|
||||
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
|
||||
</tab>
|
||||
<tab type="files" visible="yes" title="">
|
||||
<tab type="filelist" visible="yes" title="Files index" intro=""/>
|
||||
<tab type="globals" visible="yes" title="Global objects" intro=""/>
|
||||
</tab>
|
||||
<tab type="examples" visible="yes" title="" intro=""/>
|
||||
</navindex>
|
||||
|
||||
<!-- Layout definition for a class page -->
|
||||
<class>
|
||||
<briefdescription visible="yes"/>
|
||||
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||
<inheritancegraph visible="$CLASS_GRAPH"/>
|
||||
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
|
||||
<memberdecl>
|
||||
<nestedclasses visible="yes" title=""/>
|
||||
<publictypes title=""/>
|
||||
<services title=""/>
|
||||
<interfaces title=""/>
|
||||
<publicslots title=""/>
|
||||
<signals title=""/>
|
||||
<publicmethods title=""/>
|
||||
<publicstaticmethods title=""/>
|
||||
<publicattributes title=""/>
|
||||
<publicstaticattributes title=""/>
|
||||
<protectedtypes title=""/>
|
||||
<protectedslots title=""/>
|
||||
<protectedmethods title=""/>
|
||||
<protectedstaticmethods title=""/>
|
||||
<protectedattributes title=""/>
|
||||
<protectedstaticattributes title=""/>
|
||||
<packagetypes title=""/>
|
||||
<packagemethods title=""/>
|
||||
<packagestaticmethods title=""/>
|
||||
<packageattributes title=""/>
|
||||
<packagestaticattributes title=""/>
|
||||
<properties title=""/>
|
||||
<events title=""/>
|
||||
<privatetypes title=""/>
|
||||
<privateslots title=""/>
|
||||
<privatemethods title=""/>
|
||||
<privatestaticmethods title=""/>
|
||||
<privateattributes title=""/>
|
||||
<privatestaticattributes title=""/>
|
||||
<friends title=""/>
|
||||
<related title="" subtitle=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<services title=""/>
|
||||
<interfaces title=""/>
|
||||
<constructors title=""/>
|
||||
<functions title=""/>
|
||||
<related title=""/>
|
||||
<variables title=""/>
|
||||
<properties title=""/>
|
||||
<events title=""/>
|
||||
</memberdef>
|
||||
<allmemberslink visible="yes"/>
|
||||
<usedfiles visible="$SHOW_USED_FILES"/>
|
||||
<authorsection visible="yes"/>
|
||||
</class>
|
||||
|
||||
<!-- Layout definition for a namespace page -->
|
||||
<namespace>
|
||||
<briefdescription visible="yes"/>
|
||||
<memberdecl>
|
||||
<nestednamespaces visible="yes" title=""/>
|
||||
<constantgroups visible="yes" title=""/>
|
||||
<classes visible="yes" title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection visible="yes"/>
|
||||
</namespace>
|
||||
|
||||
<!-- Layout definition for a file page -->
|
||||
<file>
|
||||
<briefdescription visible="yes"/>
|
||||
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||
<includegraph visible="$INCLUDE_GRAPH"/>
|
||||
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
|
||||
<sourcelink visible="yes"/>
|
||||
<memberdecl>
|
||||
<classes visible="yes" title=""/>
|
||||
<namespaces visible="yes" title=""/>
|
||||
<constantgroups visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection/>
|
||||
</file>
|
||||
|
||||
<!-- Layout definition for a group page -->
|
||||
<group>
|
||||
<briefdescription visible="yes"/>
|
||||
<groupgraph visible="$GROUP_GRAPHS"/>
|
||||
<memberdecl>
|
||||
<nestedgroups visible="yes" title=""/>
|
||||
<dirs visible="yes" title=""/>
|
||||
<files visible="yes" title=""/>
|
||||
<namespaces visible="yes" title=""/>
|
||||
<classes visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<signals title=""/>
|
||||
<publicslots title=""/>
|
||||
<protectedslots title=""/>
|
||||
<privateslots title=""/>
|
||||
<events title=""/>
|
||||
<properties title=""/>
|
||||
<friends title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<pagedocs/>
|
||||
<inlineclasses title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<signals title=""/>
|
||||
<publicslots title=""/>
|
||||
<protectedslots title=""/>
|
||||
<privateslots title=""/>
|
||||
<events title=""/>
|
||||
<properties title=""/>
|
||||
<friends title=""/>
|
||||
</memberdef>
|
||||
<authorsection visible="yes"/>
|
||||
</group>
|
||||
|
||||
<!-- Layout definition for a directory page -->
|
||||
<directory>
|
||||
<briefdescription visible="yes"/>
|
||||
<directorygraph visible="yes"/>
|
||||
<memberdecl>
|
||||
<dirs visible="yes"/>
|
||||
<files visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
</directory>
|
||||
</doxygenlayout>
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
function insertIframe (elementId, iframeSrc)
|
||||
{
|
||||
var iframe;
|
||||
if (document.createElement && (iframe = document.createElement('iframe')))
|
||||
{
|
||||
iframe.src = unescape(iframeSrc);
|
||||
iframe.width = "100%";
|
||||
iframe.height = "511px";
|
||||
var element = document.getElementById(elementId);
|
||||
element.parentNode.replaceChild(iframe, element);
|
||||
}
|
||||
}
|
||||
Vendored
-1
@@ -11,7 +11,6 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
{%- endblock %}
|
||||
{% set script_files = script_files + [pathto("_static/insertIframe.js", 1)] %}
|
||||
{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %}
|
||||
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
|
||||
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
|
||||
|
||||
+1
-1
@@ -132,7 +132,7 @@ html_logo = 'opencv-logo-white.png'
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
#html_static_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -1,13 +1,19 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""gen_pattern.py
|
||||
To run:
|
||||
-c 10 -r 12 -o out.svg
|
||||
-T type of pattern, circles, acircles, checkerboard
|
||||
-s --square_size size of squares in pattern
|
||||
-u --units mm, inches, px, m
|
||||
-w page width in units
|
||||
-h page height in units
|
||||
Usage example:
|
||||
python gen_pattern.py -o out.svg -r 11 -c 8 -T circles -s 20.0 -R 5.0 -u mm -w 216 -h 279
|
||||
|
||||
-o, --output - output file (default out.svg)
|
||||
-r, --rows - pattern rows (default 11)
|
||||
-c, --columns - pattern columns (default 8)
|
||||
-T, --type - type of pattern, circles, acircles, checkerboard (default circles)
|
||||
-s, --square_size - size of squares in pattern (default 20.0)
|
||||
-R, --radius_rate - circles_radius = square_size/radius_rate (default 5.0)
|
||||
-u, --units - mm, inches, px, m (default mm)
|
||||
-w, --page_width - page width in units (default 216)
|
||||
-h, --page_height - page height in units (default 279)
|
||||
-H, --help - show help
|
||||
"""
|
||||
|
||||
from svgfig import *
|
||||
@@ -16,18 +22,20 @@ import sys
|
||||
import getopt
|
||||
|
||||
class PatternMaker:
|
||||
def __init__(self, cols,rows,output,units,square_size,page_width,page_height):
|
||||
def __init__(self, cols,rows,output,units,square_size,radius_rate,page_width,page_height):
|
||||
self.cols = cols
|
||||
self.rows = rows
|
||||
self.output = output
|
||||
self.units = units
|
||||
self.square_size = square_size
|
||||
self.radius_rate = radius_rate
|
||||
self.width = page_width
|
||||
self.height = page_height
|
||||
self.g = SVG("g") # the svg group container
|
||||
|
||||
def makeCirclesPattern(self):
|
||||
spacing = self.square_size
|
||||
r = spacing / 5.0 #radius is a 5th of the spacing TODO parameterize
|
||||
r = spacing / self.radius_rate
|
||||
for x in range(1,self.cols+1):
|
||||
for y in range(1,self.rows+1):
|
||||
dot = SVG("circle", cx=x * spacing, cy=y * spacing, r=r, fill="black")
|
||||
@@ -35,7 +43,7 @@ class PatternMaker:
|
||||
|
||||
def makeACirclesPattern(self):
|
||||
spacing = self.square_size
|
||||
r = spacing / 5.0
|
||||
r = spacing / self.radius_rate
|
||||
for i in range(0,self.rows):
|
||||
for j in range(0,self.cols):
|
||||
dot = SVG("circle", cx= ((j*2 + i%2)*spacing) + spacing, cy=self.height - (i * spacing + spacing), r=r, fill="black")
|
||||
@@ -43,37 +51,23 @@ class PatternMaker:
|
||||
|
||||
def makeCheckerboardPattern(self):
|
||||
spacing = self.square_size
|
||||
r = spacing / 5.0
|
||||
for x in range(1,self.cols+1):
|
||||
for y in range(1,self.rows+1):
|
||||
#TODO make a checkerboard pattern
|
||||
dot = SVG("circle", cx=x * spacing, cy=y * spacing, r=r, fill="black")
|
||||
self.g.append(dot)
|
||||
if x%2 == y%2:
|
||||
dot = SVG("rect", x=x * spacing, y=y * spacing, width=spacing, height=spacing, stroke_width="0", fill="black")
|
||||
self.g.append(dot)
|
||||
|
||||
def save(self):
|
||||
c = canvas(self.g,width="%d%s"%(self.width,self.units),height="%d%s"%(self.height,self.units),viewBox="0 0 %d %d"%(self.width,self.height))
|
||||
c.inkview(self.output)
|
||||
|
||||
def makePattern(cols,rows,output,p_type,units,square_size,page_width,page_height):
|
||||
width = page_width
|
||||
spacing = square_size
|
||||
height = page_height
|
||||
r = spacing / 5.0
|
||||
g = SVG("g") # the svg group container
|
||||
for x in range(1,cols+1):
|
||||
for y in range(1,rows+1):
|
||||
if "circle" in p_type:
|
||||
dot = SVG("circle", cx=x * spacing, cy=y * spacing, r=r, fill="black")
|
||||
g.append(dot)
|
||||
c = canvas(g,width="%d%s"%(width,units),height="%d%s"%(height,units),viewBox="0 0 %d %d"%(width,height))
|
||||
c.inkview(output)
|
||||
|
||||
|
||||
def main():
|
||||
# parse command line options, TODO use argparse for better doc
|
||||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], "ho:c:r:T:u:s:w:h:", ["help","output","columns","rows",
|
||||
"type","units","square_size","page_width",
|
||||
"page_height"])
|
||||
opts, args = getopt.getopt(sys.argv[1:], "Ho:c:r:T:u:s:R:w:h:", ["help","output=","columns=","rows=",
|
||||
"type=","units=","square_size=","radius_rate=",
|
||||
"page_width=","page_height="])
|
||||
except getopt.error, msg:
|
||||
print msg
|
||||
print "for help use --help"
|
||||
@@ -84,11 +78,12 @@ def main():
|
||||
p_type = "circles"
|
||||
units = "mm"
|
||||
square_size = 20.0
|
||||
radius_rate = 5.0
|
||||
page_width = 216 #8.5 inches
|
||||
page_height = 279 #11 inches
|
||||
# process options
|
||||
for o, a in opts:
|
||||
if o in ("-h", "--help"):
|
||||
if o in ("-H", "--help"):
|
||||
print __doc__
|
||||
sys.exit(0)
|
||||
elif o in ("-r", "--rows"):
|
||||
@@ -103,11 +98,13 @@ def main():
|
||||
units = a
|
||||
elif o in ("-s", "--square_size"):
|
||||
square_size = float(a)
|
||||
elif o in ("-R", "--radius_rate"):
|
||||
radius_rate = float(a)
|
||||
elif o in ("-w", "--page_width"):
|
||||
page_width = float(a)
|
||||
elif o in ("-h", "--page_height"):
|
||||
page_height = float(a)
|
||||
pm = PatternMaker(columns,rows,output,units,square_size,page_width,page_height)
|
||||
pm = PatternMaker(columns,rows,output,units,square_size,radius_rate,page_width,page_height)
|
||||
#dict for easy lookup of pattern type
|
||||
mp = {"circles":pm.makeCirclesPattern,"acircles":pm.makeACirclesPattern,"checkerboard":pm.makeCheckerboardPattern}
|
||||
mp[p_type]()
|
||||
|
||||
@@ -193,7 +193,7 @@ In the main program, before processing, first check input command parameters. He
|
||||
{
|
||||
std::cout<<"RetinaDemo: processing image "<<argv[2]<<std::endl;
|
||||
// image processing case
|
||||
inputFrame = cv::imread(std::string(argv[2]), 1); // load image in RGB mode
|
||||
inputFrame = cv::imread(std::string(argv[2]), 1); // load image in BGR color mode
|
||||
}else
|
||||
if (!strcmp(inputMediaType.c_str(), "-video"))
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ From our previous tutorial, we know already a bit of *Pixel operators*. An inter
|
||||
|
||||
g(x) = (1 - \alpha)f_{0}(x) + \alpha f_{1}(x)
|
||||
|
||||
By varying :math:`\alpha` from :math:`0 \rightarrow 1` this operator can be used to perform a temporal *cross-disolve* between two images or videos, as seen in slide shows and film productions (cool, eh?)
|
||||
By varying :math:`\alpha` from :math:`0 \rightarrow 1` this operator can be used to perform a temporal *cross-dissolve* between two images or videos, as seen in slide shows and film productions (cool, eh?)
|
||||
|
||||
Code
|
||||
=====
|
||||
|
||||
@@ -44,14 +44,14 @@ or
|
||||
Scalar
|
||||
-------
|
||||
* Represents a 4-element vector. The type Scalar is widely used in OpenCV for passing pixel values.
|
||||
* In this tutorial, we will use it extensively to represent RGB color values (3 parameters). It is not necessary to define the last argument if it is not going to be used.
|
||||
* In this tutorial, we will use it extensively to represent BGR color values (3 parameters). It is not necessary to define the last argument if it is not going to be used.
|
||||
* Let's see an example, if we are asked for a color argument and we give:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
Scalar( a, b, c )
|
||||
|
||||
We would be defining a RGB color such as: *Red = c*, *Green = b* and *Blue = a*
|
||||
We would be defining a BGR color such as: *Blue = a*, *Green = b* and *Red = c*
|
||||
|
||||
|
||||
Code
|
||||
@@ -135,7 +135,7 @@ Explanation
|
||||
|
||||
* Draw a line from Point **start** to Point **end**
|
||||
* The line is displayed in the image **img**
|
||||
* The line color is defined by **Scalar( 0, 0, 0)** which is the RGB value correspondent to **Black**
|
||||
* The line color is defined by **Scalar( 0, 0, 0)** which is the BGR value correspondent to **Black**
|
||||
* The line thickness is set to **thickness** (in this case 2)
|
||||
* The line is a 8-connected one (**lineType** = 8)
|
||||
|
||||
@@ -167,7 +167,7 @@ Explanation
|
||||
* The ellipse center is located in the point **(w/2.0, w/2.0)** and is enclosed in a box of size **(w/4.0, w/16.0)**
|
||||
* The ellipse is rotated **angle** degrees
|
||||
* The ellipse extends an arc between **0** and **360** degrees
|
||||
* The color of the figure will be **Scalar( 255, 255, 0)** which means blue in RGB value.
|
||||
* The color of the figure will be **Scalar( 255, 0, 0)** which means blue in BGR value.
|
||||
* The ellipse's **thickness** is 2.
|
||||
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ Explanation
|
||||
|
||||
We observe that :mat_zeros:`Mat::zeros <>` returns a Matlab-style zero initializer based on *image.size()* and *image.type()*
|
||||
|
||||
#. Now, to perform the operation :math:`g(i,j) = \alpha \cdot f(i,j) + \beta` we will access to each pixel in image. Since we are operating with RGB images, we will have three values per pixel (R, G and B), so we will also access them separately. Here is the piece of code:
|
||||
#. Now, to perform the operation :math:`g(i,j) = \alpha \cdot f(i,j) + \beta` we will access to each pixel in image. Since we are operating with BGR images, we will have three values per pixel (B, G and R), so we will also access them separately. Here is the piece of code:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ You can download the full source code :download:`here <../../../../samples/cpp/t
|
||||
|
||||
how_to_scan_images imageName.jpg intValueToReduce [G]
|
||||
|
||||
The final argument is optional. If given the image will be loaded in gray scale format, otherwise the RGB color way is used. The first thing is to calculate the lookup table.
|
||||
The final argument is optional. If given the image will be loaded in gray scale format, otherwise the BGR color way is used. The first thing is to calculate the lookup table.
|
||||
|
||||
.. literalinclude:: ../../../../samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp
|
||||
:language: cpp
|
||||
@@ -76,7 +76,7 @@ As you could already read in my :ref:`matTheBasicImageContainer` tutorial the si
|
||||
Row n & \tabItG{n,0} & \tabItG{n,1} & \tabItG{n,...} & \tabItG{n, m} \\
|
||||
\end{tabular}
|
||||
|
||||
For multichannel images the columns contain as many sub columns as the number of channels. For example in case of an RGB color system:
|
||||
For multichannel images the columns contain as many sub columns as the number of channels. For example in case of an BGR color system:
|
||||
|
||||
.. math::
|
||||
|
||||
@@ -89,7 +89,7 @@ For multichannel images the columns contain as many sub columns as the number of
|
||||
Row n & \tabIt{n,0} & \tabIt{n,1} & \tabIt{n,...} & \tabIt{n, m} \\
|
||||
\end{tabular}
|
||||
|
||||
Note that the order of the channels is inverse: BGR instead of RGB. Because in many cases the memory is large enough to store the rows in a successive fashion the rows may follow one after another, creating a single long row. Because everything is in a single place following one after another this may help to speed up the scanning process. We can use the :basicstructures:`isContinuous() <mat-iscontinuous>` function to *ask* the matrix if this is the case. Continue on to the next section to find an example.
|
||||
Because in many cases the memory is large enough to store the rows in a successive fashion the rows may follow one after another, creating a single long row. Because everything is in a single place following one after another this may help to speed up the scanning process. We can use the :basicstructures:`isContinuous() <mat-iscontinuous>` function to *ask* the matrix if this is the case. Continue on to the next section to find an example.
|
||||
|
||||
The efficient way
|
||||
=================
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ Here you can observe that with the new structure we have no pointer problems, al
|
||||
:tab-width: 4
|
||||
:lines: 46-51
|
||||
|
||||
Because, we want to mess around with the images luma component we first convert from the default RGB to the YUV color space and then split the result up into separate planes. Here the program splits: in the first example it processes each plane using one of the three major image scanning algorithms in OpenCV (C [] operator, iterator, individual element access). In a second variant we add to the image some Gaussian noise and then mix together the channels according to some formula.
|
||||
Because, we want to mess around with the images luma component we first convert from the default BGR to the YUV color space and then split the result up into separate planes. Here the program splits: in the first example it processes each plane using one of the three major image scanning algorithms in OpenCV (C [] operator, iterator, individual element access). In a second variant we add to the image some Gaussian noise and then mix together the channels according to some formula.
|
||||
|
||||
The scanning version looks like:
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ The first thing you need to know about *Mat* is that you no longer need to manua
|
||||
|
||||
*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.
|
||||
|
||||
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.
|
||||
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 computationally 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.
|
||||
|
||||
@@ -76,12 +76,12 @@ 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. You might, for example, dismiss the last component, making your algorithm less sensible to the light conditions of the input image.
|
||||
* RGB is the most common as our eyes use something similar, but keep in mind that the OpenCV display system uses BGR colors.
|
||||
* 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 value component, making your algorithm less sensitive 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.
|
||||
|
||||
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.
|
||||
Each of the color components has its own valid domains. This brings us 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 the case of three components (such as BGR) this already gives 16 million representable colors. 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 a *Mat* object explicitly
|
||||
==================================
|
||||
@@ -111,7 +111,7 @@ Although *Mat* works really well as an image container, it is also a general mat
|
||||
|
||||
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 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.
|
||||
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. These are predefined for up to four channel numbers. The :basicstructures:`Scalar <scalar>` is a 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 parentheses as shown below.
|
||||
|
||||
+ Use C/C++ arrays and initialize via constructor
|
||||
|
||||
@@ -120,7 +120,7 @@ Although *Mat* works really well as an image container, it is also a general mat
|
||||
: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 above example shows how to create a matrix with more than two dimensions. Specify the number of dimensions, 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:
|
||||
@@ -143,7 +143,7 @@ Although *Mat* works really well as an image container, it is also a general mat
|
||||
|
||||
You cannot initialize the matrix values with this construction. It will only reallocate its matrix data memory if the new size will not fit into the old one.
|
||||
|
||||
+ MATLAB style initializer: :basicstructures:`zeros() <mat-zeros>`, :basicstructures:`ones() <mat-ones>`, :basicstructures:`eye() <mat-eye>`. Specify size and data type to use:
|
||||
+ MATLAB style initializers: :basicstructures:`zeros() <mat-zeros>`, :basicstructures:`ones() <mat-ones>`, :basicstructures:`eye() <mat-eye>`. Specify the size and data type to use:
|
||||
|
||||
.. literalinclude:: ../../../../samples/cpp/tutorial_code/core/mat_the_basic_image_container/mat_the_basic_image_container.cpp
|
||||
:language: cpp
|
||||
@@ -189,7 +189,7 @@ Although *Mat* works really well as an image container, it is also a general mat
|
||||
Output formatting
|
||||
=================
|
||||
|
||||
In the above examples you could see the default formatting option. OpenCV, however, allows you to format your matrix output:
|
||||
In the previous examples you saw the default formatting option. OpenCV, however, allows you to format your matrix output:
|
||||
|
||||
.. container:: enumeratevisibleitemswithsquare
|
||||
|
||||
@@ -251,7 +251,7 @@ In the above examples you could see the default formatting option. OpenCV, howev
|
||||
Output of other common items
|
||||
============================
|
||||
|
||||
OpenCV offers support for output of other common OpenCV data structures too via the << operator:
|
||||
Other common OpenCV data structures can also be output via the << operator:
|
||||
|
||||
.. container:: enumeratevisibleitemswithsquare
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ Explanation
|
||||
pt1.x = rng.uniform( x_1, x_2 );
|
||||
pt1.y = rng.uniform( y_1, y_2 );
|
||||
|
||||
* We know that **rng** is a *Random number generator* object. In the code above we are calling **rng.uniform(a,b)**. This generates a radombly uniformed distribution between the values **a** and **b** (inclusive in **a**, exclusive in **b**).
|
||||
* We know that **rng** is a *Random number generator* object. In the code above we are calling **rng.uniform(a,b)**. This generates a randomly uniformed distribution between the values **a** and **b** (inclusive in **a**, exclusive in **b**).
|
||||
|
||||
* From the explanation above, we deduce that the extremes *pt1* and *pt2* will be random values, so the lines positions will be quite impredictable, giving a nice visual effect (check out the Result section below).
|
||||
|
||||
@@ -138,7 +138,7 @@ Explanation
|
||||
|
||||
As we can see, the return value is an *Scalar* with 3 randomly initialized values, which are used as the *R*, *G* and *B* parameters for the line color. Hence, the color of the lines will be random too!
|
||||
|
||||
#. The explanation above applies for the other functions generating circles, ellipses, polygones, etc. The parameters such as *center* and *vertices* are also generated randomly.
|
||||
#. The explanation above applies for the other functions generating circles, ellipses, polygons, etc. The parameters such as *center* and *vertices* are also generated randomly.
|
||||
|
||||
#. Before finishing, we also should take a look at the functions *Display_Random_Text* and *Displaying_Big_End*, since they both have a few interesting features:
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
|
||||
.. note::
|
||||
Unfortunetly we have no tutorials into this section. And you can help us with that, since OpenCV is a community effort. If you have a tutorial suggestion or you have written a tutorial yourself (or coded a sample code) that you would like to see here, please contact follow these instructions: :ref:`howToWriteTutorial` and :how_to_contribute:`How to contribute <>`.
|
||||
Unfortunately we have no tutorials into this section. And you can help us with that, since OpenCV is a community effort. If you have a tutorial suggestion or you have written a tutorial yourself (or coded a sample code) that you would like to see here, please follow these instructions: :ref:`howToWriteTutorial` and :how_to_contribute:`How to contribute <>`.
|
||||
|
||||
@@ -14,7 +14,7 @@ Whenever you work with video feeds you may eventually want to save your image pr
|
||||
+ What type of video files you can create with OpenCV
|
||||
+ How to extract a given color channel from a video
|
||||
|
||||
As a simple demonstration I'll just extract one of the RGB color channels of an input video file into a new video. You can control the flow of the application from its console line arguments:
|
||||
As a simple demonstration I'll just extract one of the BGR color channels of an input video file into a new video. You can control the flow of the application from its console line arguments:
|
||||
|
||||
.. container:: enumeratevisibleitemswithsquare
|
||||
|
||||
@@ -111,7 +111,7 @@ Afterwards, you use the :hgvideo:`isOpened() <videowriter-isopened>` function to
|
||||
outputVideo.write(res); //or
|
||||
outputVideo << res;
|
||||
|
||||
Extracting a color channel from an RGB image means to set to zero the RGB values of the other channels. You can either do this with image scanning operations or by using the split and merge operations. You first split the channels up into different images, set the other channels to zero images of the same size and type and finally merge them back:
|
||||
Extracting a color channel from an BGR image means to set to zero the BGR values of the other channels. You can either do this with image scanning operations or by using the split and merge operations. You first split the channels up into different images, set the other channels to zero images of the same size and type and finally merge them back:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ Explanation
|
||||
|
||||
.. container:: enumeratevisibleitemswithsquare
|
||||
|
||||
* Load an image (can be RGB or grayscale)
|
||||
* Load an image (can be BGR or grayscale)
|
||||
* Create two windows (one for dilation output, the other for erosion)
|
||||
* Create a set of 02 Trackbars for each operation:
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ Code
|
||||
Explanation
|
||||
===========
|
||||
|
||||
#. Declare variables such as the matrices to store the base image and the two other images to compare ( RGB and HSV )
|
||||
#. Declare variables such as the matrices to store the base image and the two other images to compare ( BGR and HSV )
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ Code
|
||||
int result_cols = img.cols - templ.cols + 1;
|
||||
int result_rows = img.rows - templ.rows + 1;
|
||||
|
||||
result.create( result_cols, result_rows, CV_32FC1 );
|
||||
result.create( result_rows, result_cols, CV_32FC1 );
|
||||
|
||||
/// Do the Matching and Normalize
|
||||
matchTemplate( img, templ, result, match_method );
|
||||
@@ -271,7 +271,7 @@ Explanation
|
||||
int result_cols = img.cols - templ.cols + 1;
|
||||
int result_rows = img.rows - templ.rows + 1;
|
||||
|
||||
result.create( result_cols, result_rows, CV_32FC1 );
|
||||
result.create( result_rows, result_cols, CV_32FC1 );
|
||||
|
||||
#. Perform the template matching operation:
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ How does it work?
|
||||
|
||||
We consider only points such that :math:`r > 0` and :math:`0< \theta < 2 \pi`.
|
||||
|
||||
#. We can do the same operation above for all the points in an image. If the curves of two different points intersect in the plane :math:`\theta` - :math:`r`, that means that both points belong to a same line. For instance, following with the example above and drawing the plot for two more points: :math:`x_{1} = 9`, :math:`y_{1} = 4` and :math:`x_{2} = 12`, :math:`y_{2} = 3`, we get:
|
||||
#. We can do the same operation above for all the points in an image. If the curves of two different points intersect in the plane :math:`\theta` - :math:`r`, that means that both points belong to a same line. For instance, following with the example above and drawing the plot for two more points: :math:`x_{1} = 4`, :math:`y_{1} = 9` and :math:`x_{2} = 12`, :math:`y_{2} = 3`, we get:
|
||||
|
||||
.. image:: images/Hough_Lines_Tutorial_Theory_2.jpg
|
||||
:alt: Polar plot of the family of lines for three points
|
||||
|
||||
@@ -88,7 +88,7 @@ Code
|
||||
GaussianBlur( src, src, Size(3,3), 0, 0, BORDER_DEFAULT );
|
||||
|
||||
/// Convert the image to grayscale
|
||||
cvtColor( src, src_gray, CV_RGB2GRAY );
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
|
||||
/// Create window
|
||||
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
|
||||
@@ -141,7 +141,7 @@ Explanation
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
cvtColor( src, src_gray, CV_RGB2GRAY );
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
|
||||
#. Apply the Laplacian operator to the grayscale image:
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ Code
|
||||
GaussianBlur( src, src, Size(3,3), 0, 0, BORDER_DEFAULT );
|
||||
|
||||
/// Convert it to gray
|
||||
cvtColor( src, src_gray, CV_RGB2GRAY );
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
|
||||
/// Create window
|
||||
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
|
||||
@@ -217,7 +217,7 @@ Explanation
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
cvtColor( src, src_gray, CV_RGB2GRAY );
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
|
||||
#. Second, we calculate the "*derivatives*" in *x* and *y* directions. For this, we use the function :sobel:`Sobel <>` as shown below:
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ The tutorial code's is shown lines below. You can also download it from `here <h
|
||||
src = imread( argv[1], 1 );
|
||||
|
||||
/// Convert the image to Gray
|
||||
cvtColor( src, src_gray, CV_RGB2GRAY );
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
|
||||
/// Create a window to display results
|
||||
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
|
||||
@@ -221,14 +221,14 @@ Explanation
|
||||
|
||||
#. Let's check the general structure of the program:
|
||||
|
||||
* Load an image. If it is RGB we convert it to Grayscale. For this, remember that we can use the function :cvt_color:`cvtColor <>`:
|
||||
* Load an image. If it is BGR we convert it to Grayscale. For this, remember that we can use the function :cvt_color:`cvtColor <>`:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
src = imread( argv[1], 1 );
|
||||
|
||||
/// Convert the image to Gray
|
||||
cvtColor( src, src_gray, CV_RGB2GRAY );
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
|
||||
|
||||
* Create a window to display the result
|
||||
|
||||
@@ -48,10 +48,10 @@ The structure of package contents looks as follows:
|
||||
|
||||
::
|
||||
|
||||
OpenCV-2.4.10-android-sdk
|
||||
OpenCV-2.4.11-android-sdk
|
||||
|_ apk
|
||||
| |_ OpenCV_2.4.10_binary_pack_armv7a.apk
|
||||
| |_ OpenCV_2.4.10_Manager_2.19_XXX.apk
|
||||
| |_ OpenCV_2.4.11_binary_pack_armv7a.apk
|
||||
| |_ OpenCV_2.4.11_Manager_2.20_XXX.apk
|
||||
|
|
||||
|_ doc
|
||||
|_ samples
|
||||
@@ -157,10 +157,10 @@ Get the OpenCV4Android SDK
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
unzip ~/Downloads/OpenCV-2.4.10-android-sdk.zip
|
||||
unzip ~/Downloads/OpenCV-2.4.11-android-sdk.zip
|
||||
|
||||
.. |opencv_android_bin_pack| replace:: :file:`OpenCV-2.4.10-android-sdk.zip`
|
||||
.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.10/OpenCV-2.4.10-android-sdk.zip/download
|
||||
.. |opencv_android_bin_pack| replace:: :file:`OpenCV-2.4.11-android-sdk.zip`
|
||||
.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.11/OpenCV-2.4.11-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/
|
||||
@@ -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.10_Manager_2.19_armv7a-neon.apk
|
||||
<Android SDK path>/platform-tools/adb install <OpenCV4Android SDK path>/apk/OpenCV_2.4.11_Manager_2.20_armv7a-neon.apk
|
||||
|
||||
.. note:: ``armeabi``, ``armv7a-neon``, ``arm7a-neon-android8``, ``mips`` and ``x86`` stand for
|
||||
platform targets:
|
||||
|
||||
@@ -55,14 +55,14 @@ Manager to access OpenCV libraries externally installed in the target system.
|
||||
:guilabel:`File -> Import -> Existing project in your workspace`.
|
||||
|
||||
Press :guilabel:`Browse` button and locate OpenCV4Android SDK
|
||||
(:file:`OpenCV-2.4.10-android-sdk/sdk`).
|
||||
(:file:`OpenCV-2.4.11-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.10``.
|
||||
:guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.11``.
|
||||
|
||||
.. image:: images/eclipse_opencv_dependency1.png
|
||||
:alt: Add dependency from OpenCV library
|
||||
@@ -128,27 +128,27 @@ 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`,
|
||||
press :guilabel:`Browse` button and select OpenCV SDK path
|
||||
(:file:`OpenCV-2.4.10-android-sdk/sdk`).
|
||||
(:file:`OpenCV-2.4.11-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.10``;
|
||||
:guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.11``;
|
||||
|
||||
.. 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.10-android-sdk>/sdk/native/libs/<target_arch>` to your
|
||||
native libs from :file:`<OpenCV-2.4.11-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.10-android-sdk/sdk/native/jni/OpenCV.mk"``
|
||||
``"include path_to_OpenCV-2.4.11-android-sdk/sdk/native/jni/OpenCV.mk"``
|
||||
|
||||
.. code-block:: make
|
||||
:linenos:
|
||||
@@ -221,7 +221,7 @@ taken:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
include C:\Work\OpenCV4Android\OpenCV-2.4.10-android-sdk\sdk\native\jni\OpenCV.mk
|
||||
include C:\Work\OpenCV4Android\OpenCV-2.4.11-android-sdk\sdk\native\jni\OpenCV.mk
|
||||
|
||||
Should be inserted into the :file:`jni/Android.mk` file **after** this line:
|
||||
|
||||
|
||||
@@ -68,13 +68,15 @@ Now we call the :imread:`imread <>` function which loads the image name specifie
|
||||
|
||||
+ CV_LOAD_IMAGE_UNCHANGED (<0) loads the image as is (including the alpha channel if present)
|
||||
+ CV_LOAD_IMAGE_GRAYSCALE ( 0) loads the image as an intensity one
|
||||
+ CV_LOAD_IMAGE_COLOR (>0) loads the image in the RGB format
|
||||
+ CV_LOAD_IMAGE_COLOR (>0) loads the image in the BGR format
|
||||
|
||||
.. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp
|
||||
:language: cpp
|
||||
:tab-width: 4
|
||||
:lines: 17
|
||||
|
||||
If the second argument is not specified, it is implied ``CV_LOAD_IMAGE_COLOR``
|
||||
|
||||
.. note::
|
||||
|
||||
OpenCV offers support for the image formats Windows bitmap (bmp), portable image formats (pbm, pgm, ppm) and Sun raster (sr, ras). With help of plugins (you need to specify to use them if you build yourself the library, nevertheless in the packages we ship present by default) you may also load image formats like JPEG (jpeg, jpg, jpe), JPEG 2000 (jp2 - codenamed in the CMake as Jasper), TIFF files (tiff, tif) and portable network graphics (png). Furthermore, OpenEXR is also a possibility.
|
||||
@@ -91,6 +93,8 @@ After checking that the image data was loaded correctly, we want to display our
|
||||
:lines: 25
|
||||
:tab-width: 4
|
||||
|
||||
If the second argument is not specified by the user, it is implied to be ``WINDOW_AUTOSIZE``, which means you can't change the size of the image.
|
||||
|
||||
Finally, to update the content of the OpenCV window with a new image use the :imshow:`imshow <>` function. Specify the OpenCV window name to update and the image to use during this operation:
|
||||
|
||||
.. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user