mirror of
https://github.com/opencv/opencv.git
synced 2026-07-23 20:33:04 +04:00
Compare commits
1371 Commits
3.0.0-beta
...
3.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| c12243cf4f | |||
| 39fdcf4df3 | |||
| fd1b30fc6f | |||
| 7ee79b73f6 | |||
| 1f3043f618 | |||
| 1d7d22e117 | |||
| 33ab9ea188 | |||
| 8ad6ba82fc | |||
| 737a1e2f12 | |||
| 850e3c1ca2 | |||
| 7541c590e5 | |||
| caffbaafbe | |||
| f57fb2375e | |||
| a28c8d002d | |||
| a4073ed676 | |||
| 78e07d3210 | |||
| 41af58d1d5 | |||
| bf5393ae58 | |||
| b866e2672a | |||
| 1df0f1da97 | |||
| 535dc1e874 | |||
| 24dea1c616 | |||
| 96c3f16a90 | |||
| fd860d7cd0 | |||
| b46719b093 | |||
| 8b8fc9e66b | |||
| 882c0321f4 | |||
| 8c3c6b31fc | |||
| 5a94a95fbf | |||
| 036c438904 | |||
| 5e095c8fbd | |||
| 665a317f1c | |||
| f7ad192842 | |||
| 58cf11bd44 | |||
| 549ef8f141 | |||
| 176dd96698 | |||
| 5f8f56ea0e | |||
| 47d8187bc3 | |||
| 481f786fe7 | |||
| 3408114602 | |||
| bd2c2f3bd1 | |||
| a4a2659dff | |||
| aa932eab41 | |||
| 565d3dde40 | |||
| 85c08dd170 | |||
| 8bc21fc2f0 | |||
| 57c3e917e2 | |||
| 7658c2e2d5 | |||
| 993e0b0bf9 | |||
| 9aaa27d46b | |||
| 6c55e7c039 | |||
| 1df244b6f4 | |||
| 75558ae75c | |||
| eb40dde688 | |||
| bb72206ec5 | |||
| e9c765ee2c | |||
| 83723c15be | |||
| 8454a8f2d1 | |||
| 6aedd4f7b0 | |||
| e96b8ce781 | |||
| b0cbec922b | |||
| 0f7de40e66 | |||
| 5ad4bed70a | |||
| 330b3e87eb | |||
| 8fb37606f6 | |||
| dc587992a0 | |||
| c1c03e16f4 | |||
| 6006790c18 | |||
| bb2e40b999 | |||
| b1a8e4f760 | |||
| ca1d8c1737 | |||
| ff6881efbf | |||
| 3c85200989 | |||
| e944533f01 | |||
| 85149f8686 | |||
| a12ec66a04 | |||
| 9d90b0549c | |||
| 3bc5958c58 | |||
| 2952c10ced | |||
| 55d1f0b7d6 | |||
| 60064b3de7 | |||
| 02eb8e7c70 | |||
| 786d62e3e5 | |||
| 13cd052990 | |||
| a4e5b09ea4 | |||
| 3ec0e0943c | |||
| 653810e4df | |||
| efa2baed83 | |||
| c9481b0fd7 | |||
| 8138e26163 | |||
| a04a0514b9 | |||
| a9ae0c8e82 | |||
| 3c2e12a744 | |||
| cb55d60f98 | |||
| 6e1a595342 | |||
| 5141141e2b | |||
| 7e6947a940 | |||
| bb989f2034 | |||
| 9c8255feeb | |||
| 4f95e6c70b | |||
| 55a5e6be2c | |||
| 607d3b54ce | |||
| 7ca0557b40 | |||
| 25b4cface0 | |||
| e9bc9c47c2 | |||
| 6a50a51b4e | |||
| 22c0238bf1 | |||
| acbc7362db | |||
| 2466ca02bf | |||
| 7fd5b3a0c5 | |||
| a1a35ca5f7 | |||
| 90a78585fb | |||
| f5be8f6c77 | |||
| 526defab85 | |||
| 44d1738d47 | |||
| f32f0486e2 | |||
| 8e392251ba | |||
| 3863dc5b2b | |||
| 671a630f47 | |||
| d2aaa70e93 | |||
| 4418ee6c77 | |||
| c64a15294d | |||
| ef8182e12a | |||
| b204013483 | |||
| af47b6551f | |||
| 892684ebe5 | |||
| 4c67ae1a0b | |||
| 021473e93e | |||
| b116d6c6e8 | |||
| 6b04c2b904 | |||
| 7061bf0000 | |||
| dab78c26b1 | |||
| a6a0fc5b21 | |||
| fede94e979 | |||
| 6d0407b65e | |||
| 05a45ef6dc | |||
| 298c98ea32 | |||
| ab8afc3bcc | |||
| af806bc816 | |||
| d67d32af48 | |||
| 6ac4a4ceb6 | |||
| 5cb70d34d7 | |||
| b5a7122855 | |||
| e936670571 | |||
| fc06a2384b | |||
| 432cf1152a | |||
| 3136010e1a | |||
| 2fc92448df | |||
| e22979f334 | |||
| a5242265d7 | |||
| 8b791477df | |||
| 268283ff16 | |||
| 6613519c2e | |||
| e0136e39f4 | |||
| 546f70a6f0 | |||
| f85eb23c3b | |||
| 78e89ba3ff | |||
| eb41a574b7 | |||
| 187ab0ca61 | |||
| 7cf5de0ed0 | |||
| 68e9d19743 | |||
| f0197006e0 | |||
| a85bb091c8 | |||
| 3d20157d4f | |||
| 55f78f8a83 | |||
| d08cb6b357 | |||
| d40eefd5a4 | |||
| 4a9b244577 | |||
| cc086b9452 | |||
| 35884a7e3f | |||
| 3109c77013 | |||
| a26ab3ab16 | |||
| 66eb270cf7 | |||
| 354ed5c4d6 | |||
| c52092e6f8 | |||
| 52fa55a770 | |||
| a87e1c2f90 | |||
| cc92cd07e8 | |||
| 7dd67f4997 | |||
| 3c769edea0 | |||
| 3c7f7de477 | |||
| ffabbfa778 | |||
| ca90667723 | |||
| 05d888316a | |||
| b37aaa8303 | |||
| 3cb4954d70 | |||
| feb5b6aa93 | |||
| 2e7e754032 | |||
| cab0ecdf19 | |||
| d3b0cb878a | |||
| 71002e0e79 | |||
| a41ac8fd40 | |||
| 8b3b2a52f0 | |||
| fe0ce9282a | |||
| 25bcca2edb | |||
| 31ef944176 | |||
| 06b0fa6fc2 | |||
| 6d1cbc6458 | |||
| 3f91b0d340 | |||
| a7160d9b12 | |||
| e22c09c601 | |||
| 61293a09ff | |||
| c8cb03fd8f | |||
| 6425ac3b13 | |||
| cbaf0ecaf6 | |||
| b95769333c | |||
| 4743184078 | |||
| 3f180b0ad9 | |||
| 1e00a93f97 | |||
| 450a276f87 | |||
| 0f53526598 | |||
| 780f4ae7c5 | |||
| 4af2eb22ab | |||
| 5de9d8e6e1 | |||
| d3ef3cff94 | |||
| 568303ac7f | |||
| 09c26d6805 | |||
| 939c1d2474 | |||
| b8d40b4ad5 | |||
| ae933db526 | |||
| dfc508bb15 | |||
| 05bc7621e6 | |||
| a94fdbe0f0 | |||
| e7fcffeead | |||
| 8e82bed459 | |||
| 3fe69f4e67 | |||
| ab40c2acf7 | |||
| 7cd198623e | |||
| 16e20e5c73 | |||
| 9e97d7b4db | |||
| 26d7da68fc | |||
| f6f5b6035b | |||
| 966d50762d | |||
| 01c3d491e7 | |||
| f052b0bc4d | |||
| a31b29308f | |||
| 3a53e726dd | |||
| d59a6b29d5 | |||
| cfcef3ec98 | |||
| f49544f310 | |||
| 171b58e2ca | |||
| 7a3c0cb70e | |||
| 1756590117 | |||
| c137ba53a0 | |||
| 6b1d5e48b6 | |||
| fb56d5c482 | |||
| d280205245 | |||
| 0ee8634b2f | |||
| 73f760fdf0 | |||
| 931a519969 | |||
| 0baaf0a60f | |||
| 63a63e3eaa | |||
| 6b9e273f92 | |||
| 2c6114f58d | |||
| 8ba1ec22e4 | |||
| 4bf6bd3d37 | |||
| 09930938e8 | |||
| 09e9e8ad9f | |||
| 34dacdea32 | |||
| 9ddb8bdb8b | |||
| 56856a1810 | |||
| 341de5d53f | |||
| b28056e3dd | |||
| 3e25c085ba | |||
| 5b9182ba43 | |||
| 5a31f6b4e1 | |||
| 2ec92ba440 | |||
| 01e351de37 | |||
| 441f93d58d | |||
| a33d7928a4 | |||
| 9c0b740b84 | |||
| 96b5ec14d4 | |||
| 79ac0d05ce | |||
| 40b765b7c2 | |||
| f426778160 | |||
| f148eaace9 | |||
| 9b87c22e01 | |||
| 9fbd1d68ad | |||
| e01b485ac6 | |||
| bbdf21679f | |||
| e2f74309f7 | |||
| 0ec5561b4e | |||
| 74e2b8cbcb | |||
| 7918267d02 | |||
| 135fa85e8f | |||
| d8f360316d | |||
| b73894b271 | |||
| 0746ec7035 | |||
| a8226814c5 | |||
| 30a3ff0de6 | |||
| dadf53f17c | |||
| f39d351d04 | |||
| 0039690f11 | |||
| 07e07655d4 | |||
| e60dcc9b3b | |||
| 7245803405 | |||
| ce7812fcb0 | |||
| bcf02ae439 | |||
| 8919c3162d | |||
| 2200e0fb7e | |||
| 0ded2984b8 | |||
| 5e44aa37ff | |||
| 9efc57f24b | |||
| 20156d1eeb | |||
| 1138a38dbe | |||
| 63dbeeaac5 | |||
| 655b28ee0c | |||
| 5455e38e15 | |||
| b99f7a29df | |||
| b599774e30 | |||
| e6f7e96ff4 | |||
| b4c7c011b7 | |||
| 3b5530fb67 | |||
| 2c73e49dac | |||
| d6c95621e8 | |||
| b94c513cee | |||
| 614edafe73 | |||
| 9f7548ab89 | |||
| d2409d12c6 | |||
| 6a5f413f27 | |||
| 755527a90a | |||
| 1e90b2f51d | |||
| f57063efa2 | |||
| b057a62c8b | |||
| 12a3156aff | |||
| eee210f3b5 | |||
| 34bc3b8595 | |||
| d825b7ee9a | |||
| 5ffb53f229 | |||
| dcf177e372 | |||
| 30912b49f3 | |||
| 882dc0a7f6 | |||
| d8f62673d7 | |||
| 2b2e3ee93c | |||
| 08925330e0 | |||
| 1ea41e7246 | |||
| 7dd19f6d97 | |||
| 415a212d09 | |||
| bac4999ae4 | |||
| 0b20ce696a | |||
| a69b435c92 | |||
| 063e4004ba | |||
| dce0405c4d | |||
| 8e493ef370 | |||
| 887fe932cc | |||
| 0f13208d81 | |||
| 737d866197 | |||
| 4c875dc393 | |||
| 60a51b82d7 | |||
| 99d0fcf49d | |||
| faf84e7100 | |||
| d01ee09fd6 | |||
| 926754a66e | |||
| 78eac67a01 | |||
| fa41653420 | |||
| cca78e0601 | |||
| 0fd1203b3b | |||
| b27467d9f9 | |||
| b4aa37aa30 | |||
| 6916a1438f | |||
| ca9a2887fc | |||
| 37f77e7397 | |||
| 5a552b6d8d | |||
| b02fc039cd | |||
| a362aca783 | |||
| 46a6f70d88 | |||
| 316d76bdb6 | |||
| 92f2ad0a11 | |||
| 17675b4cb8 | |||
| ce7590bd24 | |||
| bfbf864a73 | |||
| 1fcc83b84b | |||
| c7121e8772 | |||
| ee11a2d266 | |||
| 103336c76e | |||
| b80142be69 | |||
| bb0631a365 | |||
| 2358c79db2 | |||
| 00094a8792 | |||
| a0bc0ab7cb | |||
| cb00c7036f | |||
| a2bba1b9e6 | |||
| 81c5d58035 | |||
| 723c317108 | |||
| 17bedd72f0 | |||
| 4686b935c1 | |||
| 3b177eaaa3 | |||
| 3c797b0ca5 | |||
| 2f95acf273 | |||
| dee3a4b528 | |||
| 26997f32c6 | |||
| b639353193 | |||
| 443b3157e0 | |||
| c094c58b51 | |||
| 740ae3581c | |||
| 97c78838a4 | |||
| 369a3d1426 | |||
| 728bd0ba84 | |||
| c436cac797 | |||
| e7c02f376f | |||
| f803c2a7bb | |||
| e630375fd6 | |||
| 4a65f3cee2 | |||
| 5c379aa1b8 | |||
| e800800bec | |||
| 5b3f89df0a | |||
| edb4a7ad03 | |||
| 259e41da73 | |||
| 35b2139929 | |||
| 052593c760 | |||
| 3646967deb | |||
| 0c24ccf538 | |||
| 225da0226e | |||
| 44f112a9de | |||
| bd2be9c79c | |||
| 52c727f09a | |||
| 2d8b4fea9f | |||
| 9cccd87e79 | |||
| 581923fa57 | |||
| 979721c979 | |||
| ac22c524fc | |||
| 08c84e0c34 | |||
| caa03f72b7 | |||
| f75f2ffd48 | |||
| 54ab3137d5 | |||
| 6fd2fdc2e6 | |||
| 03ea24f298 | |||
| 58f20a3b7f | |||
| 085b4ca741 | |||
| be9c6bdd67 | |||
| ed9f933d41 | |||
| 796c15d3e6 | |||
| 240b52151d | |||
| 559dfa297d | |||
| 7e35f76d06 | |||
| a035d39158 | |||
| 246b7abe7e | |||
| da0e2c5bf3 | |||
| 38ce0fe954 | |||
| d2dc7f4c27 | |||
| 0df9dc8fb9 | |||
| 6593422c05 | |||
| 952f9dbe62 | |||
| 5ab26e3202 | |||
| 6aaa6a50e3 | |||
| 80c79d4021 | |||
| ae090fe10d | |||
| 1f04f9d63b | |||
| 75850a1351 | |||
| 7c5084e385 | |||
| 412a2aa4ab | |||
| 149c1c16ba | |||
| afd9de6f1b | |||
| 66e653d24d | |||
| 3fff0e5b3c | |||
| 8f84a73b82 | |||
| 2e86cedef2 | |||
| 864b4e3b26 | |||
| 13a9d4a61f | |||
| d326c77007 | |||
| 4b0543c887 | |||
| fa9c9e791b | |||
| ff682a30b3 | |||
| d279f127c1 | |||
| 602d2c33c0 | |||
| 56b02331f7 | |||
| fab2a947ca | |||
| 5e354fa844 | |||
| 77cbddf715 | |||
| 1381564a84 | |||
| 10e0540e61 | |||
| b123870871 | |||
| b91313a84e | |||
| eff302a231 | |||
| 8d1232cc7a | |||
| 109b696599 | |||
| e94dfcee0d | |||
| 82adf7955f | |||
| 3df6b6fdcf | |||
| 32da602bf7 | |||
| 75a65542ba | |||
| 97bdc92d1b | |||
| 313e799df5 | |||
| 3465cef689 | |||
| 86c7d601b0 | |||
| 0545aeb11b | |||
| bd7c78ffd5 | |||
| 6318409a5d | |||
| f6c561a01b | |||
| dddba2637f | |||
| 5501cfd809 | |||
| 7ea0239776 | |||
| 3c51fdffac | |||
| f7f10a7d2c | |||
| d7cb99254e | |||
| 70ff448067 | |||
| 54deb5ed5a | |||
| 72b3dcd8b5 | |||
| 174593643c | |||
| dec722b2ee | |||
| f18eba44f8 | |||
| 02c3d8d792 | |||
| 660a53e0e0 | |||
| b9b743bbe3 | |||
| 01d3df0d00 | |||
| 70a64ebe72 | |||
| 5f8d688664 | |||
| 9fff7896c5 | |||
| c196df6db0 | |||
| 17d36b7835 | |||
| e64188021a | |||
| 796bf01797 | |||
| 433c3da7cf | |||
| 5a0c7a1330 | |||
| 7ab7322915 | |||
| daa99514fa | |||
| f815bbab24 | |||
| 91bd7df8c1 | |||
| fb8478eb7b | |||
| d2da7dc3e5 | |||
| ce167e233b | |||
| b5529aef9c | |||
| 8616cd875b | |||
| 072a4b5497 | |||
| 86fb9f8409 | |||
| ff48387a8a | |||
| 80069f384a | |||
| decbdd1abb | |||
| 9683f93a76 | |||
| ee4bea72bf | |||
| 9997e6d337 | |||
| 9f08310307 | |||
| e92645c588 | |||
| e157d70d43 | |||
| 231685133e | |||
| 9b9ebe0999 | |||
| 5709ec85d7 | |||
| fab51ac0af | |||
| 5247eacc3c | |||
| 4d7d354498 | |||
| 8779d029b2 | |||
| 349e3b546a | |||
| d5b954c2d4 | |||
| 7335a40a61 | |||
| 5ec908c5f0 | |||
| d1a8171011 | |||
| 8a1d8c8470 | |||
| 6d27d488bf | |||
| e0efda7145 | |||
| 9fbc92aace | |||
| 0c5faa6d24 | |||
| e12a04ac7e | |||
| 903f10c237 | |||
| 0f4d57d59e | |||
| b708969326 | |||
| 8cf45ce0af | |||
| d0ad599a24 | |||
| 52a8d37f11 | |||
| ca19ae8b5a | |||
| 5c352c9146 | |||
| 3c54c50c5a | |||
| f80e7530f3 | |||
| c6e9280373 | |||
| f9b2444735 | |||
| 259a54a6dd | |||
| a1f86d01e2 | |||
| cdc9bc397d | |||
| ac1099deb8 | |||
| 7e3cc44738 | |||
| 8ed4bae4dd | |||
| dcc2512f58 | |||
| 3d2c0ed97f | |||
| 1760078f67 | |||
| 79f512337d | |||
| 7e07220440 | |||
| 930808c22b | |||
| 04f16965d5 | |||
| 133bd56436 | |||
| 18904036dc | |||
| 6cef4eba29 | |||
| 632afe6ae3 | |||
| 50b99e5aef | |||
| 085409340e | |||
| 74e88cc0f1 | |||
| 79a77cb91f | |||
| 06703c9d56 | |||
| 362c1a23ea | |||
| 518fd59a10 | |||
| 49b38fe793 | |||
| b21b24fd8a | |||
| 6f8b3fc633 | |||
| b194812f5a | |||
| 211a131351 | |||
| 052c010d3f | |||
| deb2cb752b | |||
| c71e94f054 | |||
| 8a732e306f | |||
| 87eb3f6e68 | |||
| 35760bb6bf | |||
| 592122bf4f | |||
| 1a3273a7e3 | |||
| 34ad2e0fa4 | |||
| 1858b5cfba | |||
| 6274e1fc5f | |||
| 6b8ebf3e94 | |||
| 82c54104d6 | |||
| 812edb5fdc | |||
| 8aa0783995 | |||
| baf191fab2 | |||
| 3ee03a860d | |||
| 368213290f | |||
| 192e630cb8 | |||
| a9ce2333c3 | |||
| 64bd77cf4d | |||
| 5a7118a88b | |||
| b471f9ee26 | |||
| 1af4521239 | |||
| 4b5753daea | |||
| a594a0677a | |||
| c44488629a | |||
| bf16f74618 | |||
| f94b22fa5e | |||
| 0e5c7720a4 | |||
| ee55e4595c | |||
| 5e3d986ad8 | |||
| 9f1eb70dbc | |||
| 21160137d4 | |||
| cc8d94c6fc | |||
| 324fa26848 | |||
| 9c432f4f75 | |||
| d6534912d8 | |||
| 2113636d29 | |||
| fcdbacdbb0 | |||
| 41ffcc27dd | |||
| 135701feac | |||
| 643bbb2d93 | |||
| 441cd22343 | |||
| 1e82a67cc4 | |||
| ee2d7a1f39 | |||
| 451972f3cf | |||
| a58bfbf3c7 | |||
| 4aa6d10a60 | |||
| cef2cf2852 | |||
| 5d8a1bf813 | |||
| 361eb633f6 | |||
| fd7a76fe5d | |||
| 092f599aac | |||
| a65dbc5dcd | |||
| 8c69266cbf | |||
| 2fb4178f7c | |||
| 32d56c6b43 | |||
| 20efcff166 | |||
| c41efe4e30 | |||
| 4e87deae28 | |||
| 7a52c3d9f1 | |||
| 1f53b65511 | |||
| 217f628915 | |||
| 18be52c05b | |||
| 305cff36e2 | |||
| 2baf1a3c9f | |||
| aa113c5a85 | |||
| b7f2a4da69 | |||
| d164d51380 | |||
| f9b8ce1d25 | |||
| 4f24dc0959 | |||
| 0b99f6bcd6 | |||
| cf4c79ebdd | |||
| e4bc592c46 | |||
| ebac739a35 | |||
| 52e67c1a29 | |||
| f8c454733b | |||
| 27fd810b6f | |||
| 736b42b372 | |||
| 3a4d9a77b2 | |||
| 408f93340a | |||
| f592321771 | |||
| 4bb496409c | |||
| c9ea878d10 | |||
| 4701b22e14 | |||
| bb01231990 | |||
| e7d5e57264 | |||
| 16f36a5fda | |||
| e1abc416cf | |||
| 0f6ea38eac | |||
| a2affe70d9 | |||
| dcff28b778 | |||
| c587bae997 | |||
| b229d6b7ac | |||
| 62b8895814 | |||
| 6820292256 | |||
| d3b74cdcb2 | |||
| f38339c089 | |||
| 26eebb3ee3 | |||
| 1b7066fc95 | |||
| 69eae13ff3 | |||
| d56d04e41b | |||
| ac6771f975 | |||
| ae08884854 | |||
| ed2a23768e | |||
| 87760d13fb | |||
| 7c7a63bebc | |||
| aa506c6521 | |||
| ad1149ff12 | |||
| 530c8dc0c0 | |||
| 22a30af353 | |||
| 213a6bc5c4 | |||
| 59d6a281cd | |||
| 5810845777 | |||
| 86ebf4a2d8 | |||
| cdd23440c9 | |||
| 37c74e38f4 | |||
| 457123027e | |||
| 50bb14a0a8 | |||
| ffc453ebfd | |||
| 4e582b131b | |||
| 5850a9b8c3 | |||
| 22ad72d08e | |||
| e28a5803d9 | |||
| e9d30a9383 | |||
| e43a14ccd2 | |||
| de0997ab32 | |||
| 8e37a693e5 | |||
| 845d3edb67 | |||
| 0a5df01626 | |||
| f3f2f8ba97 | |||
| 7b0abf52b3 | |||
| 73663dcdd1 | |||
| 3bde9e9365 | |||
| a9ff335a89 | |||
| 9f7cac8c59 | |||
| 0fdb95e195 | |||
| 094f143735 | |||
| 7d4d286050 | |||
| aea328e326 | |||
| 4254e35f6a | |||
| 4800a34be3 | |||
| c10f1851cb | |||
| cda6fed41f | |||
| 5748cea80d | |||
| 43a4124bdd | |||
| 98d7e52b0a | |||
| d696fac8b8 | |||
| c5a80193a8 | |||
| 57b8640a76 | |||
| 12180bd7b1 | |||
| 44e41baffe | |||
| f8484e3266 | |||
| f73c6e6147 | |||
| 79bc85fb09 | |||
| 59d6279d4b | |||
| b963d84b41 | |||
| 191336de97 | |||
| eb30799aed | |||
| 0833352660 | |||
| 2311504c44 | |||
| 52effe9e72 | |||
| bdb088dcca | |||
| 457758b537 | |||
| b64b82a1ef | |||
| 0016f6d73d | |||
| 5dc569866e | |||
| 96c824f375 | |||
| 90fb43cd11 | |||
| 1a795ac2ea | |||
| 1fe1ebf20c | |||
| 02488215e6 | |||
| 998a909705 | |||
| 6902fa6b1c | |||
| 370389c7af | |||
| 7401b02022 | |||
| a07d7a70a0 | |||
| 58b3869730 | |||
| eb7a7884f6 | |||
| f454929d9c | |||
| 08dd1e085b | |||
| b8f65d0252 | |||
| 6447c7b2f4 | |||
| 53566f2ec0 | |||
| ea54c01125 | |||
| 0ea009f611 | |||
| 5f7a994ad1 | |||
| 350dccf84a | |||
| 5d97dd0ea5 | |||
| c83044d45a | |||
| 7b270f4c69 | |||
| 0a1da4461b | |||
| aec8fd3243 | |||
| cfccdc9b0c | |||
| 453f384bd7 | |||
| 4a1adab9b4 | |||
| 98a8045aaf | |||
| e6876fecd3 | |||
| f148f23382 | |||
| c4c3e4fe83 | |||
| e57359a3a0 | |||
| 8e7aff4486 | |||
| 6ff2f395e6 | |||
| 009ab70272 | |||
| b64e106bb1 | |||
| 1d356b6a48 | |||
| 6b371865af | |||
| 87f86b31fa | |||
| 4f8bf98e6f | |||
| 2085251df2 | |||
| c41db69f98 | |||
| 553020c448 | |||
| 1944443d10 | |||
| e647b7c7e8 | |||
| baf266c29e | |||
| 671b59aa9d | |||
| 437ef99ba5 | |||
| 2738939126 | |||
| 79e8f0680c | |||
| b51805e245 | |||
| d1a15097fe | |||
| 21ee113af3 | |||
| 103687871d | |||
| da383e65e2 | |||
| fdf31ec14f | |||
| d509ecd19a | |||
| 23633c1945 | |||
| edab3916aa | |||
| 7164f22347 | |||
| a932d8aba1 | |||
| 86b6cab7fa | |||
| 5d79b1092f | |||
| e5696bc5e6 | |||
| c339720af9 | |||
| 5070f2a334 | |||
| 44f906eb35 | |||
| e22678018b | |||
| 42176f8eb1 | |||
| 9a555063e8 | |||
| 584372bbf2 | |||
| 6b04351ce1 | |||
| 6dbf13d7b5 | |||
| d588c717da | |||
| 42db9e7153 | |||
| 49e93747b1 | |||
| ff2509af56 | |||
| 8368fb9ea8 | |||
| c3f8fc41b7 | |||
| e178294b49 | |||
| a5a510da4b | |||
| 5466e321b8 | |||
| f6b82d99ad | |||
| dd1878c64f | |||
| 6a3f33090d | |||
| ea48fcfc9f | |||
| 05e404c2ff | |||
| 79416cdf10 | |||
| ccd33a721e | |||
| 7e273396c1 | |||
| adac8c04bb | |||
| 8c7b3b91fa | |||
| 6c8681a472 | |||
| 098389d8eb | |||
| 1e47c6cc56 | |||
| bbec7f8e89 | |||
| 5524e8d2c0 | |||
| 3f86e7b75a | |||
| 7854ef3840 | |||
| 87c2b8197a | |||
| b90800f0c7 | |||
| 2054123890 | |||
| a9325102a2 | |||
| 2609e77af7 | |||
| ce0570b777 | |||
| 69b146412a | |||
| 8907e6feac | |||
| f5987c258f | |||
| c85197da55 | |||
| 4c52dfc956 | |||
| 94431c23f6 | |||
| e64fb44f67 | |||
| 71a333dd78 | |||
| 72194b2115 | |||
| bbf3607fa8 | |||
| 99aaf4030a | |||
| 9944f46b47 | |||
| 0d72420480 | |||
| 52535b356c | |||
| f282fd0ebf | |||
| 97aa8d3341 | |||
| bdebf4cea7 | |||
| f3311f9e2a | |||
| 7d7d323f53 | |||
| 5cbdce97aa | |||
| cf0a29ce4d | |||
| 10639c9526 | |||
| be1728fba1 | |||
| 4ea2eceb70 | |||
| d08589d435 | |||
| 6e565ab4a4 | |||
| f1fb474459 | |||
| 482feb7266 | |||
| 53c9460454 | |||
| 0a07d780e0 | |||
| fa23a01775 | |||
| 58ad952b1a | |||
| dcb0c68ed3 | |||
| c9e07bbc95 | |||
| 8914fa51ff | |||
| 6ebc95470b | |||
| 2660eee961 | |||
| a0691289f9 | |||
| 124ac15f1e | |||
| ce0e595a4f | |||
| f1e1785386 | |||
| b416e8715d | |||
| 3f1fb281be | |||
| 9c81338cb9 | |||
| f93be25cc8 | |||
| df697f6520 | |||
| 4949f70860 | |||
| 710617034b | |||
| 63ff39f9f3 | |||
| b3a743f09a | |||
| 62f8240b00 | |||
| 03ae1e5aae | |||
| 2dc3b0f7f9 | |||
| 381216aa54 | |||
| 19c6bbe7d9 | |||
| c4b2058d23 | |||
| 71c391cd8d | |||
| 036b13ee05 | |||
| cc1090cf3b | |||
| bd4580a242 | |||
| 03fc3d1ceb | |||
| adbe84425f | |||
| b49fa7d384 | |||
| 479cac2a14 | |||
| 1a15596f21 | |||
| 8722faa167 | |||
| 7a3ca99894 | |||
| 045f8294bb | |||
| e9a6c5db21 | |||
| b5bd2fd880 | |||
| 1ded2de2dd | |||
| 95ecdc3af9 | |||
| 579ce93885 | |||
| 21a9a17478 | |||
| e501c61c04 | |||
| aacb9b7cf5 | |||
| f647054c8c | |||
| 52d3afd798 | |||
| 696a6561d3 | |||
| ea38f7fa66 | |||
| f5b21e8141 | |||
| e97d18ba81 | |||
| 5422cbcecb | |||
| 3f8cefea0e | |||
| 5e92a777ef | |||
| dae188d14f | |||
| 17b1152fa3 | |||
| 381917b762 | |||
| 5cc4aa0e93 | |||
| dc27a13426 | |||
| 225c3e78cb | |||
| 219d315c8d | |||
| fe2a7d23a5 | |||
| 49f2bd6f17 | |||
| bcfcc779f6 | |||
| 3a84444488 | |||
| b6023eab9c | |||
| 5978ef1df5 | |||
| 052fe626b3 | |||
| cc97c57fd4 | |||
| 9a0e038a48 | |||
| 91fbe00caa | |||
| 9a1a9d9aff | |||
| 10cc7c78dd | |||
| 698c367d8d | |||
| 46ed461e22 | |||
| 595ec6b852 | |||
| f676bfb3d7 | |||
| 0376a8643e | |||
| a524a677e4 | |||
| c120001178 | |||
| 14e15fb4f7 | |||
| d84d3a519b | |||
| f48befc6f0 | |||
| df57d038b8 | |||
| 713aa5c5b9 | |||
| 61f111143a | |||
| 997dded1ac | |||
| 16b56e71d9 | |||
| c58373dbea | |||
| 1c9668b371 | |||
| bd6ad79759 | |||
| ce5e2697cb | |||
| bcc9dac087 | |||
| fd60e98c5b | |||
| 02124f19e6 | |||
| dccdadc38a | |||
| d5092a6f7c | |||
| 54f52c3f45 | |||
| 734212a402 | |||
| 8257dc3c1e | |||
| 0af7597d36 | |||
| f126f371b2 | |||
| 1264be8785 | |||
| 01717c83d7 | |||
| 07ab0c1c53 | |||
| efc7dbaae2 | |||
| ff91af825d | |||
| 8a5182662e | |||
| 5f1282afdb | |||
| 8a178da1a4 | |||
| 764d55b81d | |||
| f960a5707d | |||
| 554ddd2ec4 | |||
| 9f77ffb03f | |||
| 14ef62ed66 | |||
| 6f91b7f6a4 | |||
| 1421e306fb | |||
| ecee388236 | |||
| 4cc7b0a74f | |||
| b2a5e66fc5 | |||
| f566f6baa9 | |||
| 2ecca8f59c | |||
| 60cedd7a68 | |||
| bc23f29b27 | |||
| 7b0d1c932e | |||
| 81f786393a | |||
| 1fa37fe733 | |||
| f73b48b8b6 | |||
| 4401095b38 | |||
| 390f17d1e0 | |||
| 9eba746eb8 | |||
| 7fca146b21 | |||
| 33a3fba2d1 | |||
| 8c94568cc3 | |||
| 33176db5dc | |||
| 6bce6ee34a | |||
| 1d3c860411 | |||
| 3b23e57925 | |||
| 0fd8f50522 | |||
| d92f67ee2c | |||
| ef29b15c9a | |||
| 44d89638fd | |||
| 7b060d9122 | |||
| f2cd65cf1e | |||
| 25e99c453f | |||
| 70933ea999 | |||
| 612b8ce2cb | |||
| b2f851af06 | |||
| d87457a025 | |||
| fc0869735d | |||
| 31827d8dfe | |||
| bc394e7516 | |||
| 3a426660ea | |||
| a340ea872e | |||
| e20613a776 | |||
| 584eed633e | |||
| 05e21015e9 | |||
| 51684c109e | |||
| 51e7fb76b6 | |||
| c4c86a8990 | |||
| 93f8800844 | |||
| e1773749ae | |||
| 1c9e886a6a | |||
| 97fad1cb53 | |||
| b99396ab12 | |||
| 940f1e7914 | |||
| fe371bf624 | |||
| 9cacd3261d | |||
| edee922b59 | |||
| 5f2135695e | |||
| bfb45b27e6 | |||
| 1ca35b7424 | |||
| 56f3c92737 | |||
| 63fc6ef316 | |||
| 8870ef4159 | |||
| 116fb275a8 | |||
| 19e77e4787 | |||
| b758dbd384 | |||
| 3a78a22733 | |||
| 5578088983 | |||
| 972ff1d0c4 | |||
| 0a5c9cf145 | |||
| 6ab928fb39 | |||
| a2a8ba17fc | |||
| 8d48632ebe | |||
| d8272b9395 | |||
| c175a86cbb | |||
| 4762728fd5 | |||
| 75c99d65a5 | |||
| 75277bb770 | |||
| a11c02497f | |||
| c7b2e48efe | |||
| 28833421ae | |||
| e607a4ec02 | |||
| 379de5708f | |||
| fd1cae0dcc | |||
| 473964806c | |||
| 61ca38103c | |||
| ecf359b8c9 | |||
| ac47c0c624 | |||
| 68962adc54 | |||
| 60f2f7898a | |||
| 6cb93445e1 | |||
| 2f6db4dfac | |||
| 33a6e5ac04 | |||
| 38d37d2b00 | |||
| d004ee58c5 | |||
| 1c8493fb0d | |||
| c937e15763 | |||
| f792fdc3e0 | |||
| 2bddbd2cb5 | |||
| ba8a971742 | |||
| 2b30759af0 | |||
| 622cf566b9 | |||
| 9c872f5316 | |||
| 083d8645a5 | |||
| f50a061225 | |||
| 220d937d9a | |||
| 2fd01ee24e | |||
| 34f0da6010 | |||
| f8d09945ac | |||
| b4e7ee46c6 | |||
| cd0e95de16 | |||
| a4e598f474 | |||
| 7454189c2a | |||
| 3d0410c147 | |||
| 00e7816c1b | |||
| d04fc15e06 | |||
| 02b2fdeda9 | |||
| 9699fde8d2 | |||
| 46631c4b18 | |||
| 042895977e | |||
| f57136fd79 | |||
| f6b3bc01e5 | |||
| e3b32cce80 | |||
| 9436103ed6 | |||
| 1af7d397d4 | |||
| 2d5e3b57ea | |||
| 2d16026df6 | |||
| b7a3204c57 | |||
| a963ade012 | |||
| 450ba8b43f | |||
| 11591b3e9d | |||
| 3ffae9f7b7 | |||
| b4050c775e | |||
| ec9a17e71a | |||
| ad6a80f68c | |||
| bebf6c47c6 | |||
| d01bedbc61 | |||
| 61991a3330 | |||
| 27b224ac74 | |||
| 61886a61de | |||
| 9c2ef369ed | |||
| 0ff67253f7 | |||
| f85838087a | |||
| 18025c2908 | |||
| 63fc313d02 | |||
| fe3f236aa5 | |||
| f36546dbd2 | |||
| 7c901e39e1 | |||
| 18d1be4530 | |||
| 26afa49d71 | |||
| 9b8c3fd675 | |||
| 128e509527 | |||
| 1bdd86edeb | |||
| cddee22cf2 | |||
| 214f633dd4 | |||
| 5d15676b7b | |||
| 8d4d36f805 | |||
| e4d0652899 | |||
| c4246bc59c | |||
| e7e0da0153 | |||
| b33f3bb2cc | |||
| 8237418be6 | |||
| f054d6316a | |||
| 2f8e1798ca | |||
| 1be1a28920 | |||
| 53862687d5 | |||
| 9210d8e542 | |||
| 1d82aecf45 | |||
| b5ab82fdbd | |||
| 68e08bbecd | |||
| 05d40946f3 | |||
| 7ed38b97c3 | |||
| b75b0c822d | |||
| 864ec5ef45 | |||
| fd6ef87c32 | |||
| 95ec92994d | |||
| d71e001736 | |||
| 06c2a70c49 | |||
| 637b615e08 | |||
| d9f159a554 | |||
| c0005fd293 | |||
| f12bd999bf | |||
| a1df295079 | |||
| 7b20ce4952 | |||
| 432546e4c4 | |||
| 700a388173 | |||
| 5fea331d42 | |||
| 1ab551487d | |||
| 060d67517a | |||
| 199f1aec2e | |||
| 35d730bf2b | |||
| ec33c4ae36 | |||
| 25f33a7e30 | |||
| 48c9c24da6 | |||
| fffe2464cd | |||
| 9811a739b0 | |||
| 9c6da03504 | |||
| 13c0855114 | |||
| ed0ce48179 | |||
| a2a131799f | |||
| 37e018454d | |||
| 4443d6b0a1 | |||
| 99e782e62c | |||
| 33dfeb85be | |||
| 61a7f48bf4 | |||
| 4f906372e2 | |||
| 80a0364465 | |||
| 4f5916f12d | |||
| 1fb966dc61 | |||
| 2e7b9a2c0f | |||
| 969a218057 | |||
| c0019a42e4 | |||
| cb48d7798d | |||
| 0ba3b06efd | |||
| c485aee464 | |||
| b15cf355af | |||
| 96adeb71ca | |||
| 79f770455b | |||
| 13c04120dd | |||
| 1ad1b737c2 | |||
| 620a969285 | |||
| 854a722c70 | |||
| f87f0cc481 | |||
| efa84d8225 | |||
| fd2d800c06 | |||
| 0b429fee7b | |||
| 009aec5164 | |||
| 3c74c23bad | |||
| d54b069ae1 | |||
| bcc630a8dc | |||
| edb608d206 | |||
| 4d12beb723 | |||
| bb873b1de5 | |||
| 5a43c7a28e | |||
| c48f30d4ec | |||
| fed1b3fd59 | |||
| 25378587e2 | |||
| 10dc5a3759 | |||
| 9582c33eab | |||
| 0f7721e915 | |||
| f269828160 | |||
| b35f5d115f | |||
| c762da9893 | |||
| 006384edaf | |||
| 0a4c616d43 | |||
| ef347f4b62 | |||
| e0ab007b2b | |||
| ef534537b4 | |||
| bada364eb3 | |||
| 51963f95dd | |||
| c28fea32c7 | |||
| 893deb4040 | |||
| 1252e870f9 | |||
| ecfd056111 | |||
| 05bc48e8f4 | |||
| fac99de7ec | |||
| 2df606f098 | |||
| 1c9f956b88 | |||
| 2d8c89c40b | |||
| f54b80d2c8 | |||
| 84379140ba | |||
| b3bba3476d | |||
| 270af2ca79 | |||
| bcca34bc96 | |||
| 146d66267f | |||
| a1e04c98aa | |||
| 6d282ddf72 | |||
| cb049657e5 | |||
| be5c910358 | |||
| f61db41d25 | |||
| 46858c4328 | |||
| 726ed2632d | |||
| bf5ff7fcd0 | |||
| d3beb755df | |||
| c669b7e4cd | |||
| 4ccbd44559 | |||
| 41afe54696 | |||
| 812ce48c36 | |||
| 875f922332 | |||
| 36a04ef8de | |||
| c5536534d8 | |||
| 8375182e34 | |||
| 220f671655 | |||
| 03e213ccae | |||
| 1523fdcc1c | |||
| f9a83c28e5 | |||
| 6dcafe0c2d | |||
| 397bf7f2b7 | |||
| 9d89f8d3dc | |||
| ceb6e8bd94 | |||
| 472c210687 | |||
| 8e9ea0e3d1 | |||
| c5a698fb54 | |||
| dcae7698ad | |||
| 1f43999f2a | |||
| aadab03b7b | |||
| 02f4f2f96d | |||
| d368a7ceb4 | |||
| 2f4c11b5e5 | |||
| 7106d3e8c2 | |||
| 6b0952b9bd | |||
| 2dd438c230 | |||
| 88f67ce6b1 | |||
| 44f629f99c | |||
| 3fa02787ac | |||
| b14f7c99d2 | |||
| 8c919ed248 | |||
| 553bb7956e | |||
| 180e54d09d | |||
| 50c9367d7a | |||
| 123ca7e1c5 | |||
| c52a3f7634 | |||
| e88bf2bc30 | |||
| 4ff8a3ad92 | |||
| 6e7050555e | |||
| 6d78cfc0d9 | |||
| f14b8b4341 | |||
| 73ba435610 | |||
| 15952d7188 | |||
| 38e3f2c7f5 | |||
| aad98e545f | |||
| a7757b0eb6 | |||
| ba9bc2d72f | |||
| b009e8d0fb | |||
| 7ed5284ae6 | |||
| f4ba8b13c7 | |||
| 1744098438 | |||
| 555fdf893a | |||
| 68e59d6154 | |||
| 32348604e3 | |||
| 799646e5d0 | |||
| d48e0a04ae | |||
| 986878a881 | |||
| 303868b3c4 | |||
| a9a45e1546 | |||
| 28944336d4 | |||
| 4b97e8c51c | |||
| d4db7807df | |||
| a16a11f32b | |||
| 1189606cd8 | |||
| a8b4c99ed6 | |||
| 4763d8033a | |||
| 6aa7a86ae9 | |||
| 23a81c0fb8 | |||
| 184b6e314c | |||
| 77be6d64c1 | |||
| b3a60b9c22 | |||
| 28103ad386 | |||
| bea86deea9 | |||
| 8340e31f1f | |||
| 701d2386ce | |||
| 7127634aa0 | |||
| 6550cb2a90 | |||
| a181835549 | |||
| 34f23b5917 | |||
| 60cacbfd66 | |||
| ed55d13112 | |||
| 2e05f1e3f8 | |||
| 2981ee00d9 | |||
| 323c922322 |
+14
@@ -8,3 +8,17 @@
|
||||
Thumbs.db
|
||||
tags
|
||||
tegra/
|
||||
bin/
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.obj
|
||||
*.stamp
|
||||
*.depend
|
||||
*.rule
|
||||
*.tmp
|
||||
*/debug
|
||||
*/CMakeFiles
|
||||
CMakeCache.txt
|
||||
*.suo
|
||||
*.log
|
||||
*.tlog
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
The build script is to be fixed.
|
||||
Right now it assumes that 32-bit MinGW is in the system path and
|
||||
64-bit mingw is installed to c:\Apps\MinGW64.
|
||||
|
||||
It is important that gcc is used, not g++!
|
||||
Otherwise the produced DLL will likely be dependent on libgcc_s_dw2-1.dll or similar DLL.
|
||||
While we want to make the DLLs with minimum dependencies: Win32 libraries + msvcrt.dll.
|
||||
|
||||
ffopencv.c is really a C++ source, hence -x c++ is used.
|
||||
|
||||
How to update opencv_ffmpeg.dll and opencv_ffmpeg_64.dll when a new version of FFMPEG is release?
|
||||
|
||||
1. Install 32-bit MinGW + MSYS from
|
||||
http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/
|
||||
Let's assume, it's installed in C:\MSYS32.
|
||||
2. Install 64-bit MinGW. http://mingw-w64.sourceforge.net/
|
||||
Let's assume, it's installed in C:\MSYS64
|
||||
3. Copy C:\MSYS32\msys to C:\MSYS64\msys. Edit C:\MSYS64\msys\etc\fstab, change C:\MSYS32 to C:\MSYS64.
|
||||
|
||||
4. Now you have working MSYS32 and MSYS64 environments.
|
||||
Launch, one by one, C:\MSYS32\msys\msys.bat and C:\MSYS64\msys\msys.bat to create your home directories.
|
||||
|
||||
4. Download ffmpeg-x.y.z.tar.gz (where x.y.z denotes the actual ffmpeg version).
|
||||
Copy it to C:\MSYS{32|64}\msys\home\<loginname> directory.
|
||||
|
||||
5. To build 32-bit ffmpeg libraries, run C:\MSYS32\msys\msys.bat and type the following commands:
|
||||
|
||||
5.1. tar -xzf ffmpeg-x.y.z.tar.gz
|
||||
5.2. mkdir build
|
||||
5.3. cd build
|
||||
5.4. ../ffmpeg-x.y.z/configure --enable-w32threads
|
||||
5.5. make
|
||||
5.6. make install
|
||||
5.7. cd /local/lib
|
||||
5.8. strip -g *.a
|
||||
|
||||
6. Then repeat the same for 64-bit case. The output libs: libavcodec.a etc. need to be renamed to libavcodec64.a etc.
|
||||
|
||||
7. Then, copy all those libs to <opencv>\3rdparty\lib\, copy the headers to <opencv>\3rdparty\include\ffmpeg_.
|
||||
|
||||
8. Then, go to <opencv>\3rdparty\ffmpeg, edit make.bat
|
||||
(change paths to the actual paths to your msys32 and msys64 distributions) and then run make.bat
|
||||
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
+520
@@ -0,0 +1,520 @@
|
||||
Copyright (C) 2001 Fabrice Bellard
|
||||
|
||||
FFmpeg is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
FFmpeg is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with FFmpeg; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
==================================================================================
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
Vendored
+30
-40
@@ -1,42 +1,32 @@
|
||||
The build script is to be fixed.
|
||||
Right now it assumes that 32-bit MinGW is in the system path and
|
||||
64-bit mingw is installed to c:\Apps\MinGW64.
|
||||
* On Linux and other Unix flavors OpenCV uses default or user-built ffmpeg/libav libraries.
|
||||
If user builds ffmpeg/libav from source and wants OpenCV to stay BSD library, not GPL/LGPL,
|
||||
he/she should use --enabled-shared configure flag and make sure that no GPL components are
|
||||
enabled (some notable examples are x264 (H264 encoder) and libac3 (Dolby AC3 audio codec)).
|
||||
See https://www.ffmpeg.org/legal.html for details.
|
||||
|
||||
If you want to play very safe and do not want to use FFMPEG at all, regardless of whether it's installed on
|
||||
your system or not, configure and build OpenCV using CMake with WITH_FFMPEG=OFF flag. OpenCV will then use
|
||||
AVFoundation (OSX), GStreamer (Linux) or other available backends supported by opencv_videoio module.
|
||||
|
||||
There is also our self-contained motion jpeg codec, which you can use without any worries.
|
||||
It handles CV_FOURCC('M', 'J', 'P', 'G') streams within an AVI container (".avi").
|
||||
|
||||
* On Windows OpenCV uses pre-built ffmpeg binaries, built with proper flags (without GPL components) and
|
||||
wrapped with simple, stable OpenCV-compatible API.
|
||||
The binaries are opencv_ffmpeg.dll (version for 32-bit Windows) and
|
||||
opencv_ffmpeg_64.dll (version for 64-bit Windows).
|
||||
|
||||
See build_win32.txt for the build instructions, if you want to rebuild opencv_ffmpeg*.dll from scratch.
|
||||
|
||||
It is important that gcc is used, not g++!
|
||||
Otherwise the produced DLL will likely be dependent on libgcc_s_dw2-1.dll or similar DLL.
|
||||
While we want to make the DLLs with minimum dependencies: Win32 libraries + msvcrt.dll.
|
||||
The pre-built opencv_ffmpeg*.dll is:
|
||||
* LGPL library, not BSD libraries.
|
||||
* Loaded at runtime by opencv_videoio module.
|
||||
If it succeeds, ffmpeg can be used to decode/encode videos;
|
||||
otherwise, other API is used.
|
||||
|
||||
ffopencv.c is really a C++ source, hence -x c++ is used.
|
||||
|
||||
How to update opencv_ffmpeg.dll and opencv_ffmpeg_64.dll when a new version of FFMPEG is release?
|
||||
|
||||
1. Install 32-bit MinGW + MSYS from
|
||||
http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/
|
||||
Let's assume, it's installed in C:\MSYS32.
|
||||
2. Install 64-bit MinGW. http://mingw-w64.sourceforge.net/
|
||||
Let's assume, it's installed in C:\MSYS64
|
||||
3. Copy C:\MSYS32\msys to C:\MSYS64\msys. Edit C:\MSYS64\msys\etc\fstab, change C:\MSYS32 to C:\MSYS64.
|
||||
|
||||
4. Now you have working MSYS32 and MSYS64 environments.
|
||||
Launch, one by one, C:\MSYS32\msys\msys.bat and C:\MSYS64\msys\msys.bat to create your home directories.
|
||||
|
||||
4. Download ffmpeg-x.y.z.tar.gz (where x.y.z denotes the actual ffmpeg version).
|
||||
Copy it to C:\MSYS{32|64}\msys\home\<loginname> directory.
|
||||
|
||||
5. To build 32-bit ffmpeg libraries, run C:\MSYS32\msys\msys.bat and type the following commands:
|
||||
|
||||
5.1. tar -xzf ffmpeg-x.y.z.tar.gz
|
||||
5.2. mkdir build
|
||||
5.3. cd build
|
||||
5.4. ../ffmpeg-x.y.z/configure --enable-w32threads
|
||||
5.5. make
|
||||
5.6. make install
|
||||
5.7. cd /local/lib
|
||||
5.8. strip -g *.a
|
||||
|
||||
6. Then repeat the same for 64-bit case. The output libs: libavcodec.a etc. need to be renamed to libavcodec64.a etc.
|
||||
|
||||
7. Then, copy all those libs to <opencv>\3rdparty\lib\, copy the headers to <opencv>\3rdparty\include\ffmpeg_.
|
||||
|
||||
8. Then, go to <opencv>\3rdparty\ffmpeg, edit make.bat
|
||||
(change paths to the actual paths to your msys32 and msys64 distributions) and then run make.bat
|
||||
If LGPL/GPL software can not be supplied with your OpenCV-based product, simply exclude
|
||||
opencv_ffmpeg*.dll from your distribution; OpenCV will stay fully functional except for the ability to
|
||||
decode/encode videos using FFMPEG (though, it may still be able to do that using other API,
|
||||
such as Video for Windows, Windows Media Foundation or our self-contained motion jpeg codec).
|
||||
|
||||
See license.txt for the FFMPEG copyright notice and the licensing terms.
|
||||
|
||||
Vendored
-1
@@ -842,7 +842,6 @@ static int jas_cmshapmat_apply(jas_cmpxform_t *pxform, jas_cmreal_t *in,
|
||||
*dst++ = a2;
|
||||
}
|
||||
} else {
|
||||
assert(0);
|
||||
while (--cnt >= 0) {
|
||||
a0 = *src++;
|
||||
src++;
|
||||
|
||||
Vendored
+5
-2
@@ -345,6 +345,7 @@ jas_stream_t *jas_stream_tmpfile()
|
||||
{
|
||||
jas_stream_t *stream;
|
||||
jas_stream_fileobj_t *obj;
|
||||
char *tmpname;
|
||||
|
||||
if (!(stream = jas_stream_create())) {
|
||||
return 0;
|
||||
@@ -365,10 +366,12 @@ jas_stream_t *jas_stream_tmpfile()
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Choose a file name. */
|
||||
tmpnam(obj->pathname);
|
||||
tmpname = tempnam(NULL, NULL);
|
||||
strcpy(obj->pathname, tmpname);
|
||||
free(tmpname);
|
||||
|
||||
/* Open the underlying file. */
|
||||
if ((obj->fd = open(obj->pathname, O_CREAT | O_EXCL | O_RDWR | O_TRUNC | O_BINARY,
|
||||
if ((obj->fd = open(obj->pathname, O_CREAT | O_EXCL | O_RDWR | O_TRUNC | O_BINARY | O_TEMPORARY | _O_SHORT_LIVED,
|
||||
JAS_STREAM_PERMS)) < 0) {
|
||||
jas_stream_destroy(stream);
|
||||
return 0;
|
||||
|
||||
Vendored
+7
@@ -15,6 +15,13 @@ else()
|
||||
ocv_list_filterout(lib_srcs jmemnobs.c)
|
||||
endif()
|
||||
|
||||
if(WINRT)
|
||||
add_definitions(-DNO_GETENV)
|
||||
get_directory_property( DirDefs COMPILE_DEFINITIONS )
|
||||
message(STATUS "Adding NO_GETENV to compiler definitions for WINRT:")
|
||||
message(STATUS " COMPILE_DEFINITIONS = ${DirDefs}")
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------------
|
||||
# Define the library target:
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
Vendored
+1
-5
@@ -14,7 +14,7 @@ ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" ${ZLIB_INCLUDE_DIRS})
|
||||
file(GLOB lib_srcs *.c)
|
||||
file(GLOB lib_hdrs *.h)
|
||||
|
||||
if(NEON)
|
||||
if(NEON AND ARM)
|
||||
list(APPEND lib_srcs arm/filter_neon.S)
|
||||
add_definitions(-DPNG_ARM_NEON)
|
||||
endif()
|
||||
@@ -29,10 +29,6 @@ if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
endif(MSVC)
|
||||
|
||||
if (HAVE_WINRT)
|
||||
add_definitions(-DHAVE_WINRT)
|
||||
endif()
|
||||
|
||||
add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARIES})
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@ index 07b2b0b..e7824b8 100644
|
||||
/* Memory model/platform independent fns */
|
||||
#ifndef PNG_ABORT
|
||||
-# ifdef _WINDOWS_
|
||||
+# if defined(_WINDOWS_) && !defined(HAVE_WINRT)
|
||||
+# if defined(_WINDOWS_) && !defined(WINRT)
|
||||
# define PNG_ABORT() ExitProcess(0)
|
||||
# else
|
||||
# define PNG_ABORT() abort()
|
||||
@@ -16,7 +16,7 @@ index 07b2b0b..e7824b8 100644
|
||||
# define png_memset _fmemset
|
||||
#else
|
||||
-# ifdef _WINDOWS_ /* Favor Windows over C runtime fns */
|
||||
+# if defined(_WINDOWS_) && !defined(HAVE_WINRT) /* Favor Windows over C runtime fns */
|
||||
+# if defined(_WINDOWS_) && !defined(WINRT) /* Favor Windows over C runtime fns */
|
||||
# define CVT_PTR(ptr) (ptr)
|
||||
# define CVT_PTR_NOCHECK(ptr) (ptr)
|
||||
# define png_strlen lstrlenA
|
||||
|
||||
Vendored
+2
-2
@@ -360,7 +360,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
|
||||
|
||||
/* Memory model/platform independent fns */
|
||||
#ifndef PNG_ABORT
|
||||
# if defined(_WINDOWS_) && !defined(HAVE_WINRT)
|
||||
# if defined(_WINDOWS_) && !defined(WINRT)
|
||||
# define PNG_ABORT() ExitProcess(0)
|
||||
# else
|
||||
# define PNG_ABORT() abort()
|
||||
@@ -378,7 +378,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
|
||||
# define png_memcpy _fmemcpy
|
||||
# define png_memset _fmemset
|
||||
#else
|
||||
# if defined(_WINDOWS_) && !defined(HAVE_WINRT) /* Favor Windows over C runtime fns */
|
||||
# if defined(_WINDOWS_) && !defined(WINRT) /* Favor Windows over C runtime fns */
|
||||
# define CVT_PTR(ptr) (ptr)
|
||||
# define CVT_PTR_NOCHECK(ptr) (ptr)
|
||||
# define png_strlen lstrlenA
|
||||
|
||||
Vendored
+2
-2
@@ -17,7 +17,7 @@ check_include_file(string.h HAVE_STRING_H)
|
||||
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_file(unistd.h HAVE_UNISTD_H)
|
||||
|
||||
if(WIN32 AND NOT HAVE_WINRT)
|
||||
if(WIN32 AND NOT WINRT)
|
||||
set(USE_WIN32_FILEIO 1)
|
||||
endif()
|
||||
|
||||
@@ -79,7 +79,7 @@ set(lib_srcs
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/tif_config.h"
|
||||
)
|
||||
|
||||
if(WIN32 AND NOT HAVE_WINRT)
|
||||
if(WIN32 AND NOT WINRT)
|
||||
list(APPEND lib_srcs tif_win32.c)
|
||||
else()
|
||||
list(APPEND lib_srcs tif_unix.c)
|
||||
|
||||
Vendored
+1
-1
@@ -54,6 +54,6 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${WEBP_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
||||
ocv_install_target(${WEBP_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
|
||||
Vendored
+19
-25
@@ -6,41 +6,34 @@ In order to use these versions of libraries instead of system ones on UNIX syste
|
||||
should use BUILD_<library_name> CMake flags (for example, BUILD_PNG for the libpng library).
|
||||
|
||||
------------------------------------------------------------------------------------
|
||||
libjpeg 8d (8.4) - The Independent JPEG Group's JPEG software.
|
||||
libjpeg The Independent JPEG Group's JPEG software.
|
||||
Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
|
||||
See IGJ home page http://www.ijg.org
|
||||
for details and links to the source code
|
||||
|
||||
HAVE_JPEG preprocessor flag must be set to make imgcodecs use libjpeg.
|
||||
On UNIX systems configure script takes care of it.
|
||||
WITH_JPEG CMake option must be ON to add libjpeg support to imgcodecs.
|
||||
------------------------------------------------------------------------------------
|
||||
libpng 1.5.12 - Portable Network Graphics library.
|
||||
libpng Portable Network Graphics library.
|
||||
Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson.
|
||||
See libpng home page http://www.libpng.org
|
||||
for details and links to the source code
|
||||
|
||||
HAVE_PNG preprocessor flag must be set to make imgcodecs use libpng.
|
||||
On UNIX systems configure script takes care of it.
|
||||
WITH_PNG CMake option must be ON to add libpng support to imgcodecs.
|
||||
------------------------------------------------------------------------------------
|
||||
libtiff 4.0.2 - Tag Image File Format (TIFF) Software
|
||||
libtiff Tag Image File Format (TIFF) Software
|
||||
Copyright (c) 1988-1997 Sam Leffler
|
||||
Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
||||
See libtiff home page http://www.remotesensing.org/libtiff/
|
||||
for details and links to the source code
|
||||
|
||||
HAVE_TIFF preprocessor flag must be set to make imgcodecs use libtiff.
|
||||
On UNIX systems configure script takes care of it.
|
||||
In this build support for ZIP (LZ77 compression) is turned on.
|
||||
WITH_TIFF CMake option must be ON to add libtiff & zlib support to imgcodecs.
|
||||
------------------------------------------------------------------------------------
|
||||
zlib 1.2.7 - General purpose LZ77 compression library
|
||||
zlib General purpose LZ77 compression library
|
||||
Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler.
|
||||
See zlib home page http://www.zlib.net
|
||||
for details and links to the source code
|
||||
|
||||
No preprocessor definition is needed to make imgcodecs use this library -
|
||||
it is included automatically if either libpng or libtiff are used.
|
||||
------------------------------------------------------------------------------------
|
||||
jasper-1.900.1 - JasPer is a collection of software
|
||||
jasper JasPer is a collection of software
|
||||
(i.e., a library and application programs) for the coding
|
||||
and manipulation of images. This software can handle image data in a
|
||||
variety of formats. One such format supported by JasPer is the JPEG-2000
|
||||
@@ -50,14 +43,9 @@ jasper-1.900.1 - JasPer is a collection of software
|
||||
Copyright (c) 1999-2000 The University of British Columbia
|
||||
Copyright (c) 2001-2003 Michael David Adams
|
||||
|
||||
The JasPer license can be found in src/libjasper.
|
||||
|
||||
OpenCV on Windows uses pre-built libjasper library
|
||||
(lib/libjasper*). To get the latest source code,
|
||||
please, visit the project homepage:
|
||||
http://www.ece.uvic.ca/~mdadams/jasper/
|
||||
The JasPer license can be found in libjasper.
|
||||
------------------------------------------------------------------------------------
|
||||
openexr-1.7.1 - OpenEXR is a high dynamic-range (HDR) image file format developed
|
||||
openexr OpenEXR is a high dynamic-range (HDR) image file format developed
|
||||
by Industrial Light & Magic for use in computer imaging applications.
|
||||
|
||||
Copyright (c) 2006, Industrial Light & Magic, a division of Lucasfilm
|
||||
@@ -66,11 +54,17 @@ openexr-1.7.1 - OpenEXR is a high dynamic-range (HDR) image file format de
|
||||
|
||||
The project homepage: http://www.openexr.com
|
||||
------------------------------------------------------------------------------------
|
||||
ffmpeg-0.8.0 - FFmpeg is a complete, cross-platform solution to record,
|
||||
ffmpeg FFmpeg is a complete, cross-platform solution to record,
|
||||
convert and stream audio and video. It includes libavcodec -
|
||||
the leading audio/video codec library, and also libavformat, libavutils and
|
||||
other helper libraries that are used by OpenCV (in highgui module) to
|
||||
other helper libraries that are used by OpenCV (in videoio module) to
|
||||
read and write video files.
|
||||
|
||||
The project homepage: http://ffmpeg.org/
|
||||
Copyright (c) 2001 Fabrice Bellard
|
||||
|
||||
The project homepage: http://ffmpeg.org/.
|
||||
|
||||
* On Linux/OSX we link user-installed ffmpeg (or ffmpeg fork libav).
|
||||
* On Windows we use pre-built ffmpeg binaries,
|
||||
see opencv/3rdparty/ffmpeg/readme.txt for details and licensing information
|
||||
------------------------------------------------------------------------------------
|
||||
|
||||
+173
-98
@@ -12,6 +12,12 @@ include(cmake/OpenCVMinDepVersions.cmake)
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES Xcode AND XCODE_VERSION VERSION_GREATER 4.3)
|
||||
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
|
||||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
#Required to resolve linker error issues due to incompatibility with CMake v3.0+ policies.
|
||||
#CMake fails to find _fseeko() which leads to subsequent linker error.
|
||||
#See details here: http://www.cmake.org/Wiki/CMake/Policies
|
||||
cmake_policy(VERSION 2.8)
|
||||
else()
|
||||
cmake_minimum_required(VERSION "${MIN_VER_CMAKE}" FATAL_ERROR)
|
||||
endif()
|
||||
@@ -33,11 +39,46 @@ else(NOT CMAKE_TOOLCHAIN_FILE)
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory")
|
||||
endif(NOT CMAKE_TOOLCHAIN_FILE)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
|
||||
set(WINRT TRUE)
|
||||
endif(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
|
||||
|
||||
if(WINRT)
|
||||
add_definitions(-DWINRT -DNO_GETENV)
|
||||
|
||||
# Making definitions available to other configurations and
|
||||
# to filter dependency restrictions at compile time.
|
||||
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone)
|
||||
set(WINRT_PHONE TRUE)
|
||||
add_definitions(-DWINRT_PHONE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES WindowsStore)
|
||||
set(WINRT_STORE TRUE)
|
||||
add_definitions(-DWINRT_STORE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_VERSION MATCHES 8.1)
|
||||
set(WINRT_8_1 TRUE)
|
||||
add_definitions(-DWINRT_8_1)
|
||||
elseif(CMAKE_SYSTEM_VERSION MATCHES 8.0)
|
||||
set(WINRT_8_0 TRUE)
|
||||
add_definitions(-DWINRT_8_0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
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)
|
||||
@@ -115,70 +156,73 @@ endif()
|
||||
|
||||
# Optional 3rd party components
|
||||
# ===================================================
|
||||
OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O" ON IF IOS)
|
||||
OCV_OPTION(WITH_CARBON "Use Carbon for UI instead of Cocoa" OFF IF APPLE )
|
||||
OCV_OPTION(WITH_VTK "Include VTK library support (and build opencv_viz module eiher)" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_VTK "Include VTK library support (and build opencv_viz module eiher)" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (NOT IOS AND NOT APPLE) )
|
||||
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
|
||||
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON IF (NOT WINRT) )
|
||||
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_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
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_GTK_2_X "Use GTK version 2" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_IPP "Include Intel IPP support" ON IF (X86_64 OR X86) )
|
||||
OCV_OPTION(WITH_IPP "Include Intel IPP support" ON IF (X86_64 OR X86) AND NOT WINRT)
|
||||
OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_JPEG "Include JPEG support" ON)
|
||||
OCV_OPTION(WITH_WEBP "Include WebP support" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_OPENEXR "Include ILM support via OpenEXR" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID) )
|
||||
OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_OPENNI2 "Include OpenNI2 support" OFF IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_WEBP "Include WebP support" ON IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENEXR "Include ILM support via OpenEXR" ON IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENNI2 "Include OpenNI2 support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_PNG "Include PNG support" ON)
|
||||
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON IF WIN32 )
|
||||
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON IF WIN32 AND NOT WINRT)
|
||||
OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF IF APPLE )
|
||||
OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENMP "Include OpenMP support" OFF)
|
||||
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF WIN32 )
|
||||
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF (WIN32 AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_PTHREADS_PF "Use pthreads-based parallel_for" OFF IF (NOT WIN32) )
|
||||
OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_LIBV4L "Use libv4l for Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_DSHOW "Build VideoIO with DirectShow support" ON IF (WIN32 AND NOT ARM) )
|
||||
OCV_OPTION(WITH_DSHOW "Build VideoIO with DirectShow support" ON IF (WIN32 AND NOT ARM AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_MSMF "Build VideoIO with Media Foundation support" OFF IF WIN32 )
|
||||
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID) )
|
||||
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_CLP "Include Clp support (EPL)" OFF)
|
||||
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_DIRECTX "Include DirectX support" ON IF WIN32 )
|
||||
OCV_OPTION(WITH_INTELPERC "Include Intel Perceptual Computing support" OFF IF WIN32 )
|
||||
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" NOT ANDROID IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENCL_SVM "Include OpenCL Shared Virtual Memory support" OFF ) # experimental
|
||||
OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_DIRECTX "Include DirectX support" ON IF (WIN32 AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_INTELPERC "Include Intel Perceptual Computing support" OFF IF (WIN32 AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_IPP_A "Include Intel IPP_A support" OFF IF (MSVC OR X86 OR X86_64) )
|
||||
OCV_OPTION(WITH_GDAL "Include GDAL Support" OFF IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_GDAL "Include GDAL Support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_GPHOTO2 "Include gPhoto2 library support" ON IF (UNIX AND NOT ANDROID) )
|
||||
|
||||
# OpenCV build components
|
||||
# ===================================================
|
||||
OCV_OPTION(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" NOT (ANDROID OR IOS) )
|
||||
OCV_OPTION(BUILD_opencv_apps "Build utility applications (used for example to train classifiers)" (NOT ANDROID) IF (NOT IOS) )
|
||||
OCV_OPTION(BUILD_opencv_apps "Build utility applications (used for example to train classifiers)" (NOT ANDROID AND NOT WINRT) IF (NOT IOS) )
|
||||
OCV_OPTION(BUILD_ANDROID_EXAMPLES "Build examples for Android platform" ON IF ANDROID )
|
||||
OCV_OPTION(BUILD_DOCS "Create build rules for OpenCV Documentation" ON )
|
||||
OCV_OPTION(BUILD_DOCS "Create build rules for OpenCV Documentation" ON IF NOT WINRT)
|
||||
OCV_OPTION(BUILD_EXAMPLES "Build all examples" OFF )
|
||||
OCV_OPTION(BUILD_PACKAGE "Enables 'make package_source' command" ON )
|
||||
OCV_OPTION(BUILD_PERF_TESTS "Build performance tests" ON IF (NOT IOS) )
|
||||
OCV_OPTION(BUILD_TESTS "Build accuracy & regression tests" ON IF (NOT IOS) )
|
||||
OCV_OPTION(BUILD_PACKAGE "Enables 'make package_source' command" ON IF NOT WINRT)
|
||||
OCV_OPTION(BUILD_PERF_TESTS "Build performance tests" ON IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(BUILD_TESTS "Build accuracy & regression tests" ON IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(BUILD_WITH_DEBUG_INFO "Include debug info into debug libs (not MSCV only)" ON )
|
||||
OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for staticaly linked OpenCV" ON IF MSVC )
|
||||
OCV_OPTION(BUILD_WITH_DYNAMIC_IPP "Enables dynamic linking of IPP (only for standalone IPP)" OFF )
|
||||
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_ANDROID_SERVICE "Build OpenCV Manager for Google Play" OFF IF ANDROID )
|
||||
OCV_OPTION(BUILD_CUDA_STUBS "Build CUDA modules stubs when no CUDA SDK" OFF IF (NOT IOS) )
|
||||
|
||||
# 3rd party libs
|
||||
@@ -187,7 +231,7 @@ OCV_OPTION(BUILD_TIFF "Build libtiff from source" WIN32 O
|
||||
OCV_OPTION(BUILD_JASPER "Build libjasper from source" WIN32 OR ANDROID OR APPLE )
|
||||
OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 OR ANDROID OR APPLE )
|
||||
OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE )
|
||||
OCV_OPTION(BUILD_OPENEXR "Build openexr from source" WIN32 OR ANDROID OR APPLE )
|
||||
OCV_OPTION(BUILD_OPENEXR "Build openexr from source" (WIN32 OR ANDROID OR APPLE) AND NOT WINRT)
|
||||
OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID )
|
||||
|
||||
# OpenCV installation options
|
||||
@@ -210,19 +254,21 @@ OCV_OPTION(ENABLE_POWERPC "Enable PowerPC for GCC"
|
||||
OCV_OPTION(ENABLE_FAST_MATH "Enable -ffast-math (not recommended for GCC 4.6.x)" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSE "Enable SSE instructions" ON IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSE2 "Enable SSE2 instructions" ON IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSE3 "Enable SSE3 instructions" ON IF ((CV_ICC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSSE3 "Enable SSSE3 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions" OFF IF ((CV_ICC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSE3 "Enable SSE3 instructions" ON IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSSE3 "Enable SSSE3 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_POPCNT "Enable POPCNT instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_AVX "Enable AVX instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_NEON "Enable NEON instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR IOS) )
|
||||
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR IOS) )
|
||||
OCV_OPTION(ENABLE_AVX2 "Enable AVX2 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_FMA3 "Enable FMA3 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 OR AARCH64 OR IOS) )
|
||||
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64 OR IOS) )
|
||||
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
|
||||
OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
|
||||
OCV_OPTION(ENABLE_WINRT_MODE "Build with Windows Runtime support" OFF IF WIN32 )
|
||||
OCV_OPTION(ENABLE_WINRT_MODE_NATIVE "Build with Windows Runtime native C++ support" OFF IF WIN32 )
|
||||
OCV_OPTION(ANDROID_EXAMPLES_WITH_LIBS "Build binaries of Android examples with native libraries" OFF IF ANDROID )
|
||||
OCV_OPTION(ENABLE_IMPL_COLLECTION "Collect implementation data on function call" OFF )
|
||||
OCV_OPTION(GENERATE_ABI_DESCRIPTOR "Generate XML file for abi_compliance_checker tool" OFF IF UNIX)
|
||||
|
||||
if(ENABLE_IMPL_COLLECTION)
|
||||
add_definitions(-DCV_COLLECT_IMPL_DATA)
|
||||
@@ -253,8 +299,6 @@ endif()
|
||||
|
||||
if(ANDROID OR WIN32)
|
||||
set(OPENCV_DOC_INSTALL_PATH doc)
|
||||
elseif(INSTALL_TO_MANGLED_PATHS)
|
||||
set(OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc)
|
||||
else()
|
||||
set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
|
||||
endif()
|
||||
@@ -288,6 +332,20 @@ if(NOT OPENCV_TEST_INSTALL_PATH)
|
||||
set(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
|
||||
endif()
|
||||
|
||||
if (OPENCV_TEST_DATA_PATH)
|
||||
get_filename_component(OPENCV_TEST_DATA_PATH ${OPENCV_TEST_DATA_PATH} ABSOLUTE)
|
||||
endif()
|
||||
|
||||
if(OPENCV_TEST_DATA_PATH AND NOT OPENCV_TEST_DATA_INSTALL_PATH)
|
||||
if(ANDROID)
|
||||
set(OPENCV_TEST_DATA_INSTALL_PATH "sdk/etc/testdata")
|
||||
elseif(WIN32)
|
||||
set(OPENCV_TEST_DATA_INSTALL_PATH "testdata")
|
||||
else()
|
||||
set(OPENCV_TEST_DATA_INSTALL_PATH "share/OpenCV/testdata")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
|
||||
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}")
|
||||
@@ -296,9 +354,11 @@ if(ANDROID)
|
||||
set(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
|
||||
set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
|
||||
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
||||
set(OPENCV_OTHER_INSTALL_PATH sdk/etc)
|
||||
else()
|
||||
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
|
||||
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
|
||||
|
||||
if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||
if(OpenCV_STATIC)
|
||||
set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
||||
@@ -307,10 +367,14 @@ else()
|
||||
endif()
|
||||
set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
||||
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
||||
set(OPENCV_JAR_INSTALL_PATH java)
|
||||
set(OPENCV_OTHER_INSTALL_PATH etc)
|
||||
else()
|
||||
set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
|
||||
set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
|
||||
set(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples)
|
||||
set(OPENCV_JAR_INSTALL_PATH share/OpenCV/java)
|
||||
set(OPENCV_OTHER_INSTALL_PATH share/OpenCV)
|
||||
endif()
|
||||
set(OPENCV_INCLUDE_INSTALL_PATH "include")
|
||||
|
||||
@@ -327,8 +391,16 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
set(OPENCV_INCLUDE_INSTALL_PATH ${OPENCV_INCLUDE_INSTALL_PATH}/opencv-${OPENCV_VERSION})
|
||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_3P_LIB_INSTALL_PATH "${OPENCV_3P_LIB_INSTALL_PATH}")
|
||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_SAMPLES_SRC_INSTALL_PATH "${OPENCV_SAMPLES_SRC_INSTALL_PATH}")
|
||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_CONFIG_INSTALL_PATH "${OPENCV_CONFIG_INSTALL_PATH}")
|
||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_DOC_INSTALL_PATH "${OPENCV_DOC_INSTALL_PATH}")
|
||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_JAR_INSTALL_PATH "${OPENCV_JAR_INSTALL_PATH}")
|
||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_TEST_DATA_INSTALL_PATH "${OPENCV_TEST_DATA_INSTALL_PATH}")
|
||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_OTHER_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}")
|
||||
endif()
|
||||
|
||||
|
||||
if(WIN32)
|
||||
# Postfix of DLLs:
|
||||
set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}")
|
||||
@@ -435,7 +507,7 @@ include(cmake/OpenCVModule.cmake)
|
||||
# Detect endianness of build platform
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL iOS)
|
||||
if(IOS)
|
||||
# test_big_endian needs try_compile, which doesn't work for iOS
|
||||
# http://public.kitware.com/Bug/view.php?id=12288
|
||||
set(WORDS_BIGENDIAN 0)
|
||||
@@ -457,14 +529,22 @@ include(cmake/OpenCVFindLibsPerf.cmake)
|
||||
# Detect other 3rd-party libraries/tools
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# --- LATEX for pdf documentation ---
|
||||
unset(HAVE_DOXYGEN CACHE)
|
||||
# --- Doxygen and PlantUML for documentation ---
|
||||
unset(DOXYGEN_FOUND CACHE)
|
||||
if(BUILD_DOCS)
|
||||
include(cmake/OpenCVFindLATEX.cmake)
|
||||
find_host_program(DOXYGEN_BUILD doxygen)
|
||||
if (DOXYGEN_BUILD)
|
||||
set(HAVE_DOXYGEN 1)
|
||||
endif (DOXYGEN_BUILD)
|
||||
find_package(Doxygen)
|
||||
if (PLANTUML_JAR)
|
||||
message(STATUS "Using PlantUML path from command line: ${PLANTUML_JAR}")
|
||||
elseif(DEFINED ENV{PLANTUML_JAR})
|
||||
set(PLANTUML_JAR $ENV{PLANTUML_JAR})
|
||||
message(STATUS "Using PLantUML path from environment: ${PLANTUML_JAR}")
|
||||
else()
|
||||
message(STATUS "To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake")
|
||||
endif()
|
||||
if (PLANTUML_JAR AND DOXYGEN_VERSION VERSION_LESS 1.8.8)
|
||||
message(STATUS "You need Doxygen version 1.8.8 or later to use PlantUML")
|
||||
unset(PLANTUML_JAR)
|
||||
endif()
|
||||
endif(BUILD_DOCS)
|
||||
|
||||
# --- Python Support ---
|
||||
@@ -557,14 +637,6 @@ if(ANDROID)
|
||||
add_subdirectory(platforms/android/service)
|
||||
endif()
|
||||
|
||||
if(BUILD_ANDROID_PACKAGE)
|
||||
add_subdirectory(platforms/android/package)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
add_subdirectory(platforms/android/libinfo)
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Finalization: generate configuration-based files
|
||||
# ----------------------------------------------------------------------------
|
||||
@@ -584,24 +656,27 @@ include(cmake/OpenCVGenConfig.cmake)
|
||||
# Generate Info.plist for the IOS framework
|
||||
include(cmake/OpenCVGenInfoPlist.cmake)
|
||||
|
||||
# Generate ABI descriptor
|
||||
include(cmake/OpenCVGenABI.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()
|
||||
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)
|
||||
elseif(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)
|
||||
elseif(UNIX)
|
||||
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()
|
||||
|
||||
@@ -686,6 +761,11 @@ else()
|
||||
endif()
|
||||
status(" Precompiled headers:" PCHSupport_FOUND AND ENABLE_PRECOMPILED_HEADERS THEN YES ELSE NO)
|
||||
|
||||
# ========================== Dependencies ============================
|
||||
ocv_get_all_libs(deps_modules deps_extra deps_3rdparty)
|
||||
status(" Extra dependencies:" ${deps_extra})
|
||||
status(" 3rdparty dependencies:" ${deps_3rdparty})
|
||||
|
||||
# ========================== OpenCV modules ==========================
|
||||
status("")
|
||||
status(" OpenCV modules:")
|
||||
@@ -728,18 +808,19 @@ if(ANDROID)
|
||||
status(" Android toolchain:" "${ANDROID_STANDALONE_TOOLCHAIN}")
|
||||
endif()
|
||||
status(" android tool:" ANDROID_EXECUTABLE THEN "${ANDROID_EXECUTABLE} (${ANDROID_TOOLS_Pkg_Desc})" ELSE NO)
|
||||
status(" Google Play package:" BUILD_ANDROID_PACKAGE THEN YES ELSE NO)
|
||||
status(" Google Play manager:" BUILD_ANDROID_SERVICE THEN YES ELSE NO)
|
||||
status(" Android examples:" BUILD_ANDROID_EXAMPLES AND CAN_BUILD_ANDROID_PROJECTS THEN YES ELSE NO)
|
||||
endif()
|
||||
|
||||
# ================== Windows RT features ==================
|
||||
if(WIN32)
|
||||
status("")
|
||||
status(" Windows RT support:" HAVE_WINRT THEN YES ELSE NO)
|
||||
if (ENABLE_WINRT_MODE OR ENABLE_WINRT_MODE_NATIVE)
|
||||
status(" Windows SDK v8.0:" ${WINDOWS_SDK_PATH})
|
||||
status(" Visual Studio 2012:" ${VISUAL_STUDIO_PATH})
|
||||
endif()
|
||||
status(" Windows RT support:" WINRT THEN YES ELSE NO)
|
||||
if(WINRT)
|
||||
status(" Building for Microsoft platform: " ${CMAKE_SYSTEM_NAME})
|
||||
status(" Building for architectures: " ${CMAKE_VS_EFFECTIVE_PLATFORMS})
|
||||
status(" Building for version: " ${CMAKE_SYSTEM_VERSION})
|
||||
endif()
|
||||
endif(WIN32)
|
||||
|
||||
# ========================== GUI ==========================
|
||||
@@ -825,7 +906,7 @@ else()
|
||||
endif()
|
||||
|
||||
if( WITH_GDAL )
|
||||
status(" GDAL:" GDAL_FOUND THEN "${GDAL_LIBRARY}")
|
||||
status(" GDAL:" GDAL_FOUND THEN "${GDAL_LIBRARY}" ELSE "NO")
|
||||
else()
|
||||
status(" GDAL:" "NO")
|
||||
endif()
|
||||
@@ -843,15 +924,6 @@ if(DEFINED WITH_1394)
|
||||
status(" DC1394 2.x:" HAVE_DC1394_2 THEN "YES (ver ${ALIASOF_libdc1394-2_VERSION})" ELSE NO)
|
||||
endif(DEFINED WITH_1394)
|
||||
|
||||
if(ANDROID)
|
||||
if(HAVE_opencv_androidcamera)
|
||||
status(" AndroidNativeCamera:" BUILD_ANDROID_CAMERA_WRAPPER
|
||||
THEN "YES, build for Android${ANDROID_VERSION}" ELSE "YES, use prebuilt libraries")
|
||||
else()
|
||||
status(" AndroidNativeCamera:" "NO (native camera requires Android API level 8 or higher)")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED WITH_AVFOUNDATION)
|
||||
status(" AVFoundation:" WITH_AVFOUNDATION THEN YES ELSE NO)
|
||||
endif(DEFINED WITH_AVFOUNDATION)
|
||||
@@ -866,6 +938,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)
|
||||
|
||||
@@ -889,7 +962,7 @@ endif(DEFINED WITH_OPENNI)
|
||||
|
||||
if(DEFINED WITH_OPENNI2)
|
||||
status(" OpenNI2:" HAVE_OPENNI2 THEN "YES (ver ${OPENNI2_VERSION_STRING}, build ${OPENNI2_VERSION_BUILD})"
|
||||
ELSE NO)
|
||||
ELSE NO)
|
||||
endif(DEFINED WITH_OPENNI2)
|
||||
|
||||
if(DEFINED WITH_PVAPI)
|
||||
@@ -923,8 +996,9 @@ if(DEFINED WITH_V4L)
|
||||
else()
|
||||
set(HAVE_CAMV4L2_STR "NO")
|
||||
endif()
|
||||
status(" V4L/V4L2:" HAVE_LIBV4L THEN "Using libv4l (ver ${ALIASOF_libv4l1_VERSION})"
|
||||
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
|
||||
status(" V4L/V4L2:" HAVE_LIBV4L
|
||||
THEN "Using libv4l1 (ver ${ALIASOF_libv4l1_VERSION}) / libv4l2 (ver ${ALIASOF_libv4l2_VERSION})"
|
||||
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
|
||||
endif(DEFINED WITH_V4L)
|
||||
|
||||
if(DEFINED WITH_DSHOW)
|
||||
@@ -947,6 +1021,10 @@ if(DEFINED WITH_INTELPERC)
|
||||
status(" Intel PerC:" HAVE_INTELPERC THEN "YES" ELSE NO)
|
||||
endif(DEFINED WITH_INTELPERC)
|
||||
|
||||
if(DEFINED WITH_GPHOTO2)
|
||||
status(" gPhoto2:" HAVE_GPHOTO2 THEN "YES" ELSE NO)
|
||||
endif(DEFINED WITH_GPHOTO2)
|
||||
|
||||
|
||||
# ========================== Other third-party libraries ==========================
|
||||
status("")
|
||||
@@ -955,8 +1033,11 @@ status(" Other third-party libraries:")
|
||||
if(WITH_IPP AND HAVE_IPP)
|
||||
status(" Use IPP:" "${IPP_VERSION_STR} [${IPP_VERSION_MAJOR}.${IPP_VERSION_MINOR}.${IPP_VERSION_BUILD}]")
|
||||
status(" at:" "${IPP_ROOT_DIR}")
|
||||
if(NOT HAVE_IPP_ICV_ONLY)
|
||||
status(" linked:" BUILD_WITH_DYNAMIC_IPP THEN "dynamic" ELSE "static")
|
||||
endif()
|
||||
else()
|
||||
status(" Use IPP:" WITH_IPP AND NOT HAVE_IPP THEN "IPP not found" ELSE NO)
|
||||
status(" Use IPP:" WITH_IPP AND NOT HAVE_IPP THEN "IPP not found or implicitly disabled" ELSE NO)
|
||||
endif()
|
||||
|
||||
if(DEFINED WITH_IPP_A)
|
||||
@@ -969,6 +1050,7 @@ status(" Use OpenMP:" HAVE_OPENMP THEN YES ELSE NO)
|
||||
status(" Use GCD" HAVE_GCD THEN YES ELSE NO)
|
||||
status(" Use Concurrency" HAVE_CONCURRENCY THEN YES ELSE NO)
|
||||
status(" Use C=:" HAVE_CSTRIPES THEN YES ELSE NO)
|
||||
status(" Use pthreads for parallel for:" HAVE_PTHREADS_PF THEN YES ELSE NO)
|
||||
status(" Use Cuda:" HAVE_CUDA THEN "YES (ver ${CUDA_VERSION_STRING})" ELSE NO)
|
||||
status(" Use OpenCL:" HAVE_OPENCL THEN YES ELSE NO)
|
||||
|
||||
@@ -1068,15 +1150,8 @@ endif()
|
||||
if(BUILD_DOCS)
|
||||
status("")
|
||||
status(" Documentation:")
|
||||
if(HAVE_SPHINX)
|
||||
status(" Build Documentation:" PDFLATEX_COMPILER THEN YES ELSE "YES (only HTML and without math expressions)")
|
||||
else()
|
||||
status(" Build Documentation:" NO)
|
||||
endif()
|
||||
status(" Sphinx:" HAVE_SPHINX THEN "${SPHINX_BUILD} (ver ${SPHINX_VERSION})" ELSE NO)
|
||||
status(" PdfLaTeX compiler:" PDFLATEX_COMPILER THEN "${PDFLATEX_COMPILER}" ELSE NO)
|
||||
status(" PlantUML:" PLANTUML THEN "${PLANTUML}" ELSE NO)
|
||||
status(" Doxygen:" HAVE_DOXYGEN THEN "YES (${DOXYGEN_BUILD})" ELSE NO)
|
||||
status(" Doxygen:" DOXYGEN_FOUND THEN "${DOXYGEN_EXECUTABLE} (ver ${DOXYGEN_VERSION})" ELSE NO)
|
||||
status(" PlantUML:" PLANTUML_JAR THEN "${PLANTUML_JAR}" ELSE NO)
|
||||
endif()
|
||||
|
||||
# ========================== samples and tests ==========================
|
||||
|
||||
@@ -7,6 +7,14 @@ copy or use the software.
|
||||
For Open Source Computer Vision Library
|
||||
(3-clause BSD License)
|
||||
|
||||
Copyright (C) 2000-2015, Intel Corporation, all rights reserved.
|
||||
Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
|
||||
Copyright (C) 2009-2015, NVIDIA Corporation, all rights reserved.
|
||||
Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
|
||||
Copyright (C) 2015, OpenCV Foundation, all rights reserved.
|
||||
Copyright (C) 2015, Itseez Inc., all rights reserved.
|
||||
Third party copyrights are property of their respective owners.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
|
||||
@@ -2,3 +2,5 @@ add_definitions(-D__OPENCV_BUILD=1)
|
||||
link_libraries(${OPENCV_LINKER_LIBS})
|
||||
|
||||
add_subdirectory(traincascade)
|
||||
add_subdirectory(createsamples)
|
||||
add_subdirectory(annotation)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
SET(OPENCV_ANNOTATION_DEPS opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs opencv_videoio)
|
||||
ocv_check_dependencies(${OPENCV_ANNOTATION_DEPS})
|
||||
|
||||
if(NOT OCV_DEPENDENCIES_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(annotation)
|
||||
set(the_target opencv_annotation)
|
||||
|
||||
ocv_target_include_directories(${the_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
|
||||
ocv_target_include_modules_recurse(${the_target} ${OPENCV_ANNOTATION_DEPS})
|
||||
|
||||
file(GLOB SRCS *.cpp)
|
||||
|
||||
set(annotation_files ${SRCS})
|
||||
ocv_add_executable(${the_target} ${annotation_files})
|
||||
ocv_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,207 @@
|
||||
/*****************************************************************************************************
|
||||
USAGE:
|
||||
./opencv_annotation -images <folder location> -annotations <ouput file>
|
||||
|
||||
Created by: Puttemans Steven
|
||||
*****************************************************************************************************/
|
||||
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/imgcodecs.hpp>
|
||||
#include <opencv2/videoio.hpp>
|
||||
#include <opencv2/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 == 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 == 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;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
set(OPENCV_CREATESAMPLES_DEPS opencv_core opencv_imgproc opencv_objdetect opencv_imgcodecs opencv_highgui opencv_calib3d opencv_features2d opencv_videoio)
|
||||
ocv_check_dependencies(${OPENCV_CREATESAMPLES_DEPS})
|
||||
|
||||
if(NOT OCV_DEPENDENCIES_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(createsamples)
|
||||
set(the_target opencv_createsamples)
|
||||
|
||||
ocv_target_include_directories(${the_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
|
||||
ocv_target_include_modules_recurse(${the_target} ${OPENCV_CREATESAMPLES_DEPS})
|
||||
|
||||
file(GLOB SRCS *.cpp)
|
||||
file(GLOB HDRS *.h*)
|
||||
|
||||
set(createsamples_files ${SRCS} ${HDRS})
|
||||
|
||||
ocv_add_executable(${the_target} ${createsamples_files})
|
||||
ocv_target_link_libraries(${the_target} ${OPENCV_CREATESAMPLES_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_createsamples")
|
||||
|
||||
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} OPTIONAL RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
@@ -0,0 +1,245 @@
|
||||
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||
//
|
||||
// By downloading, copying, installing or using the software you agree to this license.
|
||||
// If you do not agree to this license, do not download, install,
|
||||
// copy or use the software.
|
||||
//
|
||||
//
|
||||
// Intel License Agreement
|
||||
// For Open Source Computer Vision Library
|
||||
//
|
||||
// Copyright (C) 2000, Intel Corporation, all rights reserved.
|
||||
// Third party copyrights are property of their respective owners.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistribution's of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// * The name of Intel Corporation may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// This software is provided by the copyright holders and contributors "as is" and
|
||||
// any express or implied warranties, including, but not limited to, the implied
|
||||
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||
// indirect, incidental, special, exemplary, or consequential damages
|
||||
// (including, but not limited to, procurement of substitute goods or services;
|
||||
// loss of use, data, or profits; or business interruption) however caused
|
||||
// and on any theory of liability, whether in contract, strict liability,
|
||||
// or tort (including negligence or otherwise) arising in any way out of
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
//
|
||||
//M*/
|
||||
|
||||
/*
|
||||
* createsamples.cpp
|
||||
*
|
||||
* Create test/training samples
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <cmath>
|
||||
#include <ctime>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "utility.hpp"
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
int i = 0;
|
||||
char* nullname = (char*)"(NULL)";
|
||||
char* vecname = NULL; /* .vec file name */
|
||||
char* infoname = NULL; /* file name with marked up image descriptions */
|
||||
char* imagename = NULL; /* single sample image */
|
||||
char* bgfilename = NULL; /* background */
|
||||
int num = 1000;
|
||||
int bgcolor = 0;
|
||||
int bgthreshold = 80;
|
||||
int invert = 0;
|
||||
int maxintensitydev = 40;
|
||||
double maxxangle = 1.1;
|
||||
double maxyangle = 1.1;
|
||||
double maxzangle = 0.5;
|
||||
int showsamples = 0;
|
||||
/* the samples are adjusted to this scale in the sample preview window */
|
||||
double scale = 4.0;
|
||||
int width = 24;
|
||||
int height = 24;
|
||||
|
||||
srand((unsigned int)time(0));
|
||||
|
||||
if( argc == 1 )
|
||||
{
|
||||
printf( "Usage: %s\n [-info <collection_file_name>]\n"
|
||||
" [-img <image_file_name>]\n"
|
||||
" [-vec <vec_file_name>]\n"
|
||||
" [-bg <background_file_name>]\n [-num <number_of_samples = %d>]\n"
|
||||
" [-bgcolor <background_color = %d>]\n"
|
||||
" [-inv] [-randinv] [-bgthresh <background_color_threshold = %d>]\n"
|
||||
" [-maxidev <max_intensity_deviation = %d>]\n"
|
||||
" [-maxxangle <max_x_rotation_angle = %f>]\n"
|
||||
" [-maxyangle <max_y_rotation_angle = %f>]\n"
|
||||
" [-maxzangle <max_z_rotation_angle = %f>]\n"
|
||||
" [-show [<scale = %f>]]\n"
|
||||
" [-w <sample_width = %d>]\n [-h <sample_height = %d>]\n",
|
||||
argv[0], num, bgcolor, bgthreshold, maxintensitydev,
|
||||
maxxangle, maxyangle, maxzangle, scale, width, height );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
for( i = 1; i < argc; ++i )
|
||||
{
|
||||
if( !strcmp( argv[i], "-info" ) )
|
||||
{
|
||||
infoname = argv[++i];
|
||||
}
|
||||
else if( !strcmp( argv[i], "-img" ) )
|
||||
{
|
||||
imagename = argv[++i];
|
||||
}
|
||||
else if( !strcmp( argv[i], "-vec" ) )
|
||||
{
|
||||
vecname = argv[++i];
|
||||
}
|
||||
else if( !strcmp( argv[i], "-bg" ) )
|
||||
{
|
||||
bgfilename = argv[++i];
|
||||
}
|
||||
else if( !strcmp( argv[i], "-num" ) )
|
||||
{
|
||||
num = atoi( argv[++i] );
|
||||
}
|
||||
else if( !strcmp( argv[i], "-bgcolor" ) )
|
||||
{
|
||||
bgcolor = atoi( argv[++i] );
|
||||
}
|
||||
else if( !strcmp( argv[i], "-bgthresh" ) )
|
||||
{
|
||||
bgthreshold = atoi( argv[++i] );
|
||||
}
|
||||
else if( !strcmp( argv[i], "-inv" ) )
|
||||
{
|
||||
invert = 1;
|
||||
}
|
||||
else if( !strcmp( argv[i], "-randinv" ) )
|
||||
{
|
||||
invert = CV_RANDOM_INVERT;
|
||||
}
|
||||
else if( !strcmp( argv[i], "-maxidev" ) )
|
||||
{
|
||||
maxintensitydev = atoi( argv[++i] );
|
||||
}
|
||||
else if( !strcmp( argv[i], "-maxxangle" ) )
|
||||
{
|
||||
maxxangle = atof( argv[++i] );
|
||||
}
|
||||
else if( !strcmp( argv[i], "-maxyangle" ) )
|
||||
{
|
||||
maxyangle = atof( argv[++i] );
|
||||
}
|
||||
else if( !strcmp( argv[i], "-maxzangle" ) )
|
||||
{
|
||||
maxzangle = atof( argv[++i] );
|
||||
}
|
||||
else if( !strcmp( argv[i], "-show" ) )
|
||||
{
|
||||
showsamples = 1;
|
||||
if( i+1 < argc && strlen( argv[i+1] ) > 0 && argv[i+1][0] != '-' )
|
||||
{
|
||||
double d;
|
||||
d = strtod( argv[i+1], 0 );
|
||||
if( d != -HUGE_VAL && d != HUGE_VAL && d > 0 ) scale = d;
|
||||
++i;
|
||||
}
|
||||
}
|
||||
else if( !strcmp( argv[i], "-w" ) )
|
||||
{
|
||||
width = atoi( argv[++i] );
|
||||
}
|
||||
else if( !strcmp( argv[i], "-h" ) )
|
||||
{
|
||||
height = atoi( argv[++i] );
|
||||
}
|
||||
}
|
||||
|
||||
printf( "Info file name: %s\n", ((infoname == NULL) ? nullname : infoname ) );
|
||||
printf( "Img file name: %s\n", ((imagename == NULL) ? nullname : imagename ) );
|
||||
printf( "Vec file name: %s\n", ((vecname == NULL) ? nullname : vecname ) );
|
||||
printf( "BG file name: %s\n", ((bgfilename == NULL) ? nullname : bgfilename ) );
|
||||
printf( "Num: %d\n", num );
|
||||
printf( "BG color: %d\n", bgcolor );
|
||||
printf( "BG threshold: %d\n", bgthreshold );
|
||||
printf( "Invert: %s\n", (invert == CV_RANDOM_INVERT) ? "RANDOM"
|
||||
: ( (invert) ? "TRUE" : "FALSE" ) );
|
||||
printf( "Max intensity deviation: %d\n", maxintensitydev );
|
||||
printf( "Max x angle: %g\n", maxxangle );
|
||||
printf( "Max y angle: %g\n", maxyangle );
|
||||
printf( "Max z angle: %g\n", maxzangle );
|
||||
printf( "Show samples: %s\n", (showsamples) ? "TRUE" : "FALSE" );
|
||||
if( showsamples )
|
||||
{
|
||||
printf( "Scale: %g\n", scale );
|
||||
}
|
||||
printf( "Width: %d\n", width );
|
||||
printf( "Height: %d\n", height );
|
||||
|
||||
/* determine action */
|
||||
if( imagename && vecname )
|
||||
{
|
||||
printf( "Create training samples from single image applying distortions...\n" );
|
||||
|
||||
cvCreateTrainingSamples( vecname, imagename, bgcolor, bgthreshold, bgfilename,
|
||||
num, invert, maxintensitydev,
|
||||
maxxangle, maxyangle, maxzangle,
|
||||
showsamples, width, height );
|
||||
|
||||
printf( "Done\n" );
|
||||
}
|
||||
else if( imagename && bgfilename && infoname )
|
||||
{
|
||||
printf( "Create test samples from single image applying distortions...\n" );
|
||||
|
||||
cvCreateTestSamples( infoname, imagename, bgcolor, bgthreshold, bgfilename, num,
|
||||
invert, maxintensitydev,
|
||||
maxxangle, maxyangle, maxzangle, showsamples, width, height );
|
||||
|
||||
printf( "Done\n" );
|
||||
}
|
||||
else if( infoname && vecname )
|
||||
{
|
||||
int total;
|
||||
|
||||
printf( "Create training samples from images collection...\n" );
|
||||
|
||||
total = cvCreateTrainingSamplesFromInfo( infoname, vecname, num, showsamples,
|
||||
width, height );
|
||||
|
||||
printf( "Done. Created %d samples\n", total );
|
||||
}
|
||||
else if( vecname )
|
||||
{
|
||||
printf( "View samples from vec file (press ESC to exit)...\n" );
|
||||
|
||||
cvShowVecSamples( vecname, width, height, scale );
|
||||
|
||||
printf( "Done\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "Nothing to do\n" );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,124 @@
|
||||
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||
//
|
||||
// By downloading, copying, installing or using the software you agree to this license.
|
||||
// If you do not agree to this license, do not download, install,
|
||||
// copy or use the software.
|
||||
//
|
||||
//
|
||||
// Intel License Agreement
|
||||
// For Open Source Computer Vision Library
|
||||
//
|
||||
// Copyright (C) 2000, Intel Corporation, all rights reserved.
|
||||
// Third party copyrights are property of their respective owners.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistribution's of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// * The name of Intel Corporation may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// This software is provided by the copyright holders and contributors "as is" and
|
||||
// any express or implied warranties, including, but not limited to, the implied
|
||||
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||
// indirect, incidental, special, exemplary, or consequential damages
|
||||
// (including, but not limited to, procurement of substitute goods or services;
|
||||
// loss of use, data, or profits; or business interruption) however caused
|
||||
// and on any theory of liability, whether in contract, strict liability,
|
||||
// or tort (including negligence or otherwise) arising in any way out of
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
//
|
||||
//M*/
|
||||
|
||||
#ifndef __CREATESAMPLES_UTILITY_HPP__
|
||||
#define __CREATESAMPLES_UTILITY_HPP__
|
||||
|
||||
#define CV_VERBOSE 1
|
||||
|
||||
/*
|
||||
* cvCreateTrainingSamples
|
||||
*
|
||||
* Create training samples applying random distortions to sample image and
|
||||
* store them in .vec file
|
||||
*
|
||||
* filename - .vec file name
|
||||
* imgfilename - sample image file name
|
||||
* bgcolor - background color for sample image
|
||||
* bgthreshold - background color threshold. Pixels those colors are in range
|
||||
* [bgcolor-bgthreshold, bgcolor+bgthreshold] are considered as transparent
|
||||
* bgfilename - background description file name. If not NULL samples
|
||||
* will be put on arbitrary background
|
||||
* count - desired number of samples
|
||||
* invert - if not 0 sample foreground pixels will be inverted
|
||||
* if invert == CV_RANDOM_INVERT then samples will be inverted randomly
|
||||
* maxintensitydev - desired max intensity deviation of foreground samples pixels
|
||||
* maxxangle - max rotation angles
|
||||
* maxyangle
|
||||
* maxzangle
|
||||
* showsamples - if not 0 samples will be shown
|
||||
* winwidth - desired samples width
|
||||
* winheight - desired samples height
|
||||
*/
|
||||
#define CV_RANDOM_INVERT 0x7FFFFFFF
|
||||
|
||||
void cvCreateTrainingSamples( const char* filename,
|
||||
const char* imgfilename, int bgcolor, int bgthreshold,
|
||||
const char* bgfilename, int count,
|
||||
int invert = 0, int maxintensitydev = 40,
|
||||
double maxxangle = 1.1,
|
||||
double maxyangle = 1.1,
|
||||
double maxzangle = 0.5,
|
||||
int showsamples = 0,
|
||||
int winwidth = 24, int winheight = 24 );
|
||||
|
||||
void cvCreateTestSamples( const char* infoname,
|
||||
const char* imgfilename, int bgcolor, int bgthreshold,
|
||||
const char* bgfilename, int count,
|
||||
int invert, int maxintensitydev,
|
||||
double maxxangle, double maxyangle, double maxzangle,
|
||||
int showsamples,
|
||||
int winwidth, int winheight );
|
||||
|
||||
/*
|
||||
* cvCreateTrainingSamplesFromInfo
|
||||
*
|
||||
* Create training samples from a set of marked up images and store them into .vec file
|
||||
* infoname - file in which marked up image descriptions are stored
|
||||
* num - desired number of samples
|
||||
* showsamples - if not 0 samples will be shown
|
||||
* winwidth - sample width
|
||||
* winheight - sample height
|
||||
*
|
||||
* Return number of successfully created samples
|
||||
*/
|
||||
int cvCreateTrainingSamplesFromInfo( const char* infoname, const char* vecfilename,
|
||||
int num,
|
||||
int showsamples,
|
||||
int winwidth, int winheight );
|
||||
|
||||
/*
|
||||
* cvShowVecSamples
|
||||
*
|
||||
* Shows samples stored in .vec file
|
||||
*
|
||||
* filename
|
||||
* .vec file name
|
||||
* winwidth
|
||||
* sample width
|
||||
* winheight
|
||||
* sample height
|
||||
* scale
|
||||
* the scale each sample is adjusted to
|
||||
*/
|
||||
void cvShowVecSamples( const char* filename, int winwidth, int winheight, double scale );
|
||||
|
||||
#endif //__CREATESAMPLES_UTILITY_HPP__
|
||||
@@ -9,7 +9,7 @@ project(traincascade)
|
||||
set(the_target opencv_traincascade)
|
||||
|
||||
ocv_target_include_directories(${the_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
|
||||
ocv_target_include_modules(${the_target} ${OPENCV_TRAINCASCADE_DEPS})
|
||||
ocv_target_include_modules_recurse(${the_target} ${OPENCV_TRAINCASCADE_DEPS})
|
||||
|
||||
file(GLOB SRCS *.cpp)
|
||||
file(GLOB HDRS *.h*)
|
||||
@@ -35,5 +35,5 @@ if(INSTALL_CREATE_DISTRIB)
|
||||
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)
|
||||
install(TARGETS ${the_target} OPTIONAL RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
+28
-28
@@ -437,7 +437,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];
|
||||
@@ -450,7 +450,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];
|
||||
@@ -467,14 +467,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]];
|
||||
}
|
||||
@@ -484,14 +484,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]];
|
||||
}
|
||||
@@ -677,9 +677,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++)
|
||||
{
|
||||
@@ -747,11 +747,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];
|
||||
|
||||
@@ -862,14 +862,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 )
|
||||
std::sort(udst + fi*sample_count, udst + (fi + 1)*sample_count, LessThanIdx<float, unsigned short>(valCachePtr) );
|
||||
std::sort(udst + (size_t)fi*sample_count, udst + (size_t)(fi + 1)*sample_count, LessThanIdx<float, unsigned short>(valCachePtr) );
|
||||
else
|
||||
std::sort(idst + fi*sample_count, idst + (fi + 1)*sample_count, LessThanIdx<float, int>(valCachePtr) );
|
||||
std::sort(idst + (size_t)fi*sample_count, idst + (size_t)(fi + 1)*sample_count, LessThanIdx<float, int>(valCachePtr) );
|
||||
}
|
||||
}
|
||||
const CvFeatureEvaluator* featureEvaluator;
|
||||
@@ -898,14 +898,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 )
|
||||
std::sort(idst + fi*sample_count, idst + (fi + 1)*sample_count, LessThanIdx<float, unsigned short>(valCache->ptr<float>(fi)) );
|
||||
std::sort(udst + (size_t)fi*sample_count, udst + (size_t)(fi + 1)*sample_count, LessThanIdx<float, unsigned short>(valCache->ptr<float>(fi)) );
|
||||
else
|
||||
std::sort(idst + fi*sample_count, idst + (fi + 1)*sample_count, LessThanIdx<float, int>(valCache->ptr<float>(fi)) );
|
||||
std::sort(idst + (size_t)fi*sample_count, idst + (size_t)(fi + 1)*sample_count, LessThanIdx<float, int>(valCache->ptr<float>(fi)) );
|
||||
}
|
||||
}
|
||||
const CvFeatureEvaluator* featureEvaluator;
|
||||
@@ -1228,9 +1228,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++ )
|
||||
{
|
||||
@@ -1251,9 +1251,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++ )
|
||||
{
|
||||
@@ -1281,9 +1281,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];
|
||||
@@ -1302,9 +1302,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];
|
||||
@@ -1473,7 +1473,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}
|
||||
@@ -1491,7 +1491,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++ )
|
||||
{
|
||||
|
||||
@@ -135,7 +135,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();
|
||||
@@ -168,6 +169,13 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
||||
featureEvaluator = CvFeatureEvaluator::create(cascadeParams.featureType);
|
||||
featureEvaluator->init( 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;
|
||||
@@ -178,6 +186,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();
|
||||
@@ -200,13 +209,18 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
||||
if ( !updateTrainingSet( 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,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 );
|
||||
|
||||
@@ -33,20 +33,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();
|
||||
|
||||
@@ -62,8 +54,10 @@ bool CvCascadeImageReader::NegReader::nextImg()
|
||||
for( size_t i = 0; i < count; i++ )
|
||||
{
|
||||
src = imread( imgFilenames[last++], 0 );
|
||||
if( src.empty() )
|
||||
if( src.empty() ){
|
||||
last %= count;
|
||||
continue;
|
||||
}
|
||||
round += last / count;
|
||||
round = round % (winSize.width * winSize.height);
|
||||
last %= count;
|
||||
|
||||
@@ -122,7 +122,6 @@ CV_INLINE CvParamLattice cvDefaultParamLattice( void )
|
||||
#define CV_TYPE_NAME_ML_SVM "opencv-ml-svm"
|
||||
#define CV_TYPE_NAME_ML_KNN "opencv-ml-knn"
|
||||
#define CV_TYPE_NAME_ML_NBAYES "opencv-ml-bayesian"
|
||||
#define CV_TYPE_NAME_ML_EM "opencv-ml-em"
|
||||
#define CV_TYPE_NAME_ML_BOOSTING "opencv-ml-boost-tree"
|
||||
#define CV_TYPE_NAME_ML_TREE "opencv-ml-tree"
|
||||
#define CV_TYPE_NAME_ML_ANN_MLP "opencv-ml-ann-mlp"
|
||||
@@ -562,100 +561,6 @@ private:
|
||||
CvSVM& operator = (const CvSVM&);
|
||||
};
|
||||
|
||||
/****************************************************************************************\
|
||||
* Expectation - Maximization *
|
||||
\****************************************************************************************/
|
||||
namespace cv
|
||||
{
|
||||
class EM : public Algorithm
|
||||
{
|
||||
public:
|
||||
// Type of covariation matrices
|
||||
enum {COV_MAT_SPHERICAL=0, COV_MAT_DIAGONAL=1, COV_MAT_GENERIC=2, COV_MAT_DEFAULT=COV_MAT_DIAGONAL};
|
||||
|
||||
// Default parameters
|
||||
enum {DEFAULT_NCLUSTERS=5, DEFAULT_MAX_ITERS=100};
|
||||
|
||||
// The initial step
|
||||
enum {START_E_STEP=1, START_M_STEP=2, START_AUTO_STEP=0};
|
||||
|
||||
CV_WRAP EM(int nclusters=EM::DEFAULT_NCLUSTERS, int covMatType=EM::COV_MAT_DIAGONAL,
|
||||
const TermCriteria& termCrit=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS,
|
||||
EM::DEFAULT_MAX_ITERS, FLT_EPSILON));
|
||||
|
||||
virtual ~EM();
|
||||
CV_WRAP virtual void clear();
|
||||
|
||||
CV_WRAP virtual bool train(InputArray samples,
|
||||
OutputArray logLikelihoods=noArray(),
|
||||
OutputArray labels=noArray(),
|
||||
OutputArray probs=noArray());
|
||||
|
||||
CV_WRAP virtual bool trainE(InputArray samples,
|
||||
InputArray means0,
|
||||
InputArray covs0=noArray(),
|
||||
InputArray weights0=noArray(),
|
||||
OutputArray logLikelihoods=noArray(),
|
||||
OutputArray labels=noArray(),
|
||||
OutputArray probs=noArray());
|
||||
|
||||
CV_WRAP virtual bool trainM(InputArray samples,
|
||||
InputArray probs0,
|
||||
OutputArray logLikelihoods=noArray(),
|
||||
OutputArray labels=noArray(),
|
||||
OutputArray probs=noArray());
|
||||
|
||||
CV_WRAP Vec2d predict(InputArray sample,
|
||||
OutputArray probs=noArray()) const;
|
||||
|
||||
CV_WRAP bool isTrained() const;
|
||||
|
||||
AlgorithmInfo* info() const;
|
||||
virtual void read(const FileNode& fn);
|
||||
|
||||
protected:
|
||||
|
||||
virtual void setTrainData(int startStep, const Mat& samples,
|
||||
const Mat* probs0,
|
||||
const Mat* means0,
|
||||
const std::vector<Mat>* covs0,
|
||||
const Mat* weights0);
|
||||
|
||||
bool doTrain(int startStep,
|
||||
OutputArray logLikelihoods,
|
||||
OutputArray labels,
|
||||
OutputArray probs);
|
||||
virtual void eStep();
|
||||
virtual void mStep();
|
||||
|
||||
void clusterTrainSamples();
|
||||
void decomposeCovs();
|
||||
void computeLogWeightDivDet();
|
||||
|
||||
Vec2d computeProbabilities(const Mat& sample, Mat* probs) const;
|
||||
|
||||
// all inner matrices have type CV_64FC1
|
||||
CV_PROP_RW int nclusters;
|
||||
CV_PROP_RW int covMatType;
|
||||
CV_PROP_RW int maxIters;
|
||||
CV_PROP_RW double epsilon;
|
||||
|
||||
Mat trainSamples;
|
||||
Mat trainProbs;
|
||||
Mat trainLogLikelihoods;
|
||||
Mat trainLabels;
|
||||
|
||||
CV_PROP Mat weights;
|
||||
CV_PROP Mat means;
|
||||
CV_PROP std::vector<Mat> covs;
|
||||
|
||||
std::vector<Mat> covsEigenValues;
|
||||
std::vector<Mat> covsRotateMats;
|
||||
std::vector<Mat> invCovsEigenValues;
|
||||
Mat logWeightDivDet;
|
||||
};
|
||||
} // namespace cv
|
||||
|
||||
/****************************************************************************************\
|
||||
* Decision Tree *
|
||||
\****************************************************************************************/\
|
||||
@@ -2155,8 +2060,6 @@ typedef CvGBTreesParams GradientBoostingTreeParams;
|
||||
typedef CvGBTrees GradientBoostingTrees;
|
||||
|
||||
template<> void DefaultDeleter<CvDTreeSplit>::operator ()(CvDTreeSplit* obj) const;
|
||||
|
||||
bool initModule_ml(void);
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
@@ -1200,7 +1200,7 @@ CvBoost::update_weights( CvBoostTree* tree )
|
||||
if (data->is_buf_16u)
|
||||
{
|
||||
unsigned short* labels = (unsigned short*)(dtree_data_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( i = 0; i < n; i++ )
|
||||
{
|
||||
// save original categorical responses {0,1}, convert them to {-1,1}
|
||||
@@ -1218,7 +1218,7 @@ CvBoost::update_weights( CvBoostTree* tree )
|
||||
else
|
||||
{
|
||||
int* labels = dtree_data_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( i = 0; i < n; i++ )
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ void CvStatModel::load( const char* filename, const char* name )
|
||||
{
|
||||
CvFileStorage* fs = 0;
|
||||
|
||||
CV_FUNCNAME( "CvStatModel::load" );
|
||||
CV_FUNCNAME( "CvAlgorithm::load" );
|
||||
|
||||
__BEGIN__;
|
||||
|
||||
|
||||
@@ -424,9 +424,9 @@ void CvDTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
|
||||
int* c_map;
|
||||
|
||||
if (is_buf_16u)
|
||||
udst = (unsigned short*)(buf->data.s + vi*sample_count);
|
||||
udst = (unsigned short*)(buf->data.s + (size_t)vi*sample_count);
|
||||
else
|
||||
idst = buf->data.i + vi*sample_count;
|
||||
idst = buf->data.i + (size_t)vi*sample_count;
|
||||
|
||||
// copy data
|
||||
for( i = 0; i < sample_count; i++ )
|
||||
@@ -540,9 +540,9 @@ void CvDTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
|
||||
else if( ci < 0 ) // process ordered variable
|
||||
{
|
||||
if (is_buf_16u)
|
||||
udst = (unsigned short*)(buf->data.s + vi*sample_count);
|
||||
udst = (unsigned short*)(buf->data.s + (size_t)vi*sample_count);
|
||||
else
|
||||
idst = buf->data.i + vi*sample_count;
|
||||
idst = buf->data.i + (size_t)vi*sample_count;
|
||||
|
||||
for( i = 0; i < sample_count; i++ )
|
||||
{
|
||||
@@ -583,9 +583,9 @@ void CvDTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
|
||||
|
||||
// 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 (i = 0; i < sample_count; i++)
|
||||
{
|
||||
@@ -602,7 +602,7 @@ void CvDTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
|
||||
|
||||
if (is_buf_16u)
|
||||
{
|
||||
usdst = (unsigned short*)(buf->data.s + (get_work_var_count()-1)*sample_count);
|
||||
usdst = (unsigned short*)(buf->data.s + (size_t)(get_work_var_count()-1)*sample_count);
|
||||
for( i = vi = 0; i < sample_count; i++ )
|
||||
{
|
||||
usdst[i] = (unsigned short)vi++;
|
||||
@@ -619,7 +619,7 @@ void CvDTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
|
||||
}
|
||||
else
|
||||
{
|
||||
idst2 = buf->data.i + (get_work_var_count()-1)*sample_count;
|
||||
idst2 = buf->data.i + (size_t)(get_work_var_count()-1)*sample_count;
|
||||
for( i = vi = 0; i < sample_count; i++ )
|
||||
{
|
||||
idst2[i] = vi++;
|
||||
@@ -785,7 +785,7 @@ CvDTreeNode* CvDTreeTrainData::subsample_data( const CvMat* _subsample_idx )
|
||||
if (is_buf_16u)
|
||||
{
|
||||
unsigned short* udst = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
|
||||
vi*sample_count + root->offset);
|
||||
(size_t)vi*sample_count + root->offset);
|
||||
for( i = 0; i < count; i++ )
|
||||
{
|
||||
int val = src[sidx[i]];
|
||||
@@ -796,7 +796,7 @@ CvDTreeNode* CvDTreeTrainData::subsample_data( const CvMat* _subsample_idx )
|
||||
else
|
||||
{
|
||||
int* idst = buf->data.i + root->buf_idx*get_length_subbuf() +
|
||||
vi*sample_count + root->offset;
|
||||
(size_t)vi*sample_count + root->offset;
|
||||
for( i = 0; i < count; i++ )
|
||||
{
|
||||
int val = src[sidx[i]];
|
||||
@@ -822,7 +822,7 @@ CvDTreeNode* CvDTreeTrainData::subsample_data( const CvMat* _subsample_idx )
|
||||
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( i = 0; i < num_valid; i++ )
|
||||
{
|
||||
idx = src_idx[i];
|
||||
@@ -846,7 +846,7 @@ CvDTreeNode* CvDTreeTrainData::subsample_data( const CvMat* _subsample_idx )
|
||||
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( i = 0; i < num_valid; i++ )
|
||||
{
|
||||
idx = src_idx[i];
|
||||
@@ -874,14 +874,14 @@ CvDTreeNode* CvDTreeTrainData::subsample_data( const CvMat* _subsample_idx )
|
||||
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 (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 (i = 0; i < count; i++)
|
||||
sample_idx_dst[i] = sample_idx_src[sidx[i]];
|
||||
}
|
||||
@@ -1192,10 +1192,10 @@ void CvDTreeTrainData::get_ord_var_data( CvDTreeNode* n, int vi, float* ord_valu
|
||||
|
||||
if( !is_buf_16u )
|
||||
*sorted_indices = buf->data.i + n->buf_idx*get_length_subbuf() +
|
||||
vi*sample_count + n->offset;
|
||||
(size_t)vi*sample_count + n->offset;
|
||||
else {
|
||||
const unsigned short* short_indices = (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 < node_sample_count; i++ )
|
||||
sorted_indices_buf[i] = short_indices[i];
|
||||
*sorted_indices = sorted_indices_buf;
|
||||
@@ -1266,10 +1266,10 @@ const int* CvDTreeTrainData::get_cat_var_data( CvDTreeNode* n, int vi, int* cat_
|
||||
const int* cat_values = 0;
|
||||
if( !is_buf_16u )
|
||||
cat_values = buf->data.i + n->buf_idx*get_length_subbuf() +
|
||||
vi*sample_count + n->offset;
|
||||
(size_t)vi*sample_count + n->offset;
|
||||
else {
|
||||
const unsigned short* short_values = (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 < n->sample_count; i++ )
|
||||
cat_values_buf[i] = short_values[i];
|
||||
cat_values = cat_values_buf;
|
||||
|
||||
@@ -12,9 +12,10 @@ int main( int argc, char* argv[] )
|
||||
int numNeg = 1000;
|
||||
int numStages = 20;
|
||||
int numThreads = getNumThreads();
|
||||
int precalcValBufSize = 256,
|
||||
precalcIdxBufSize = 256;
|
||||
int precalcValBufSize = 1024,
|
||||
precalcIdxBufSize = 1024;
|
||||
bool baseFormatSave = false;
|
||||
double acceptanceRatioBreakValue = -1.0;
|
||||
|
||||
CvCascadeParams cascadeParams;
|
||||
CvCascadeBoostParams stageParams;
|
||||
@@ -36,6 +37,7 @@ int main( int argc, char* argv[] )
|
||||
cout << " [-precalcIdxBufSize <precalculated_idxs_buffer_size_in_Mb = " << precalcIdxBufSize << ">]" << endl;
|
||||
cout << " [-baseFormatSave]" << endl;
|
||||
cout << " [-numThreads <max_number_of_threads = " << numThreads << ">]" << endl;
|
||||
cout << " [-acceptanceRatioBreakValue <value> = " << acceptanceRatioBreakValue << ">]" << endl;
|
||||
cascadeParams.printDefaults();
|
||||
stageParams.printDefaults();
|
||||
for( int fi = 0; fi < fc; fi++ )
|
||||
@@ -86,6 +88,10 @@ int main( int argc, char* argv[] )
|
||||
{
|
||||
numThreads = atoi(argv[++i]);
|
||||
}
|
||||
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 )
|
||||
@@ -112,6 +118,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)
|
||||
|
||||
@@ -2,47 +2,37 @@ if(NOT MSVC)
|
||||
message(FATAL_ERROR "CRT options are available only for MSVC")
|
||||
endif()
|
||||
|
||||
#INCLUDE (CheckIncludeFiles)
|
||||
#if (${CMAKE_SYSTEM_NAME} MATCHES "WindowsStore" OR ${CMAKE_SYSTEM_NAME} MATCHES "WindowsPhone")
|
||||
# set(WINRT TRUE)
|
||||
|
||||
set(HAVE_WINRT FALSE)
|
||||
|
||||
# search Windows Platform SDK
|
||||
message(STATUS "Checking for Windows Platform SDK")
|
||||
GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
|
||||
if(WINDOWS_SDK_PATH STREQUAL "")
|
||||
set(HAVE_MSPDK FALSE)
|
||||
message(STATUS "Windows Platform SDK 8.0 was not found")
|
||||
else()
|
||||
set(HAVE_MSPDK TRUE)
|
||||
if (WINRT)
|
||||
add_definitions(/DWINVER=_WIN32_WINNT_WIN8 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=_WIN32_WINNT_WIN8)
|
||||
endif()
|
||||
|
||||
#search for Visual Studio 11.0 install directory
|
||||
message(STATUS "Checking for Visual Studio 2012")
|
||||
GET_FILENAME_COMPONENT(VISUAL_STUDIO_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH CACHE)
|
||||
if(VISUAL_STUDIO_PATH STREQUAL "")
|
||||
set(HAVE_MSVC2012 FALSE)
|
||||
message(STATUS "Visual Studio 2012 was not found")
|
||||
else()
|
||||
set(HAVE_MSVC2012 TRUE)
|
||||
endif()
|
||||
# Removing LNK4075 warnings for debug WinRT builds
|
||||
# "LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification"
|
||||
# "LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification"
|
||||
if(MSVC AND WINRT)
|
||||
# Optional verification checks since we don't know existing contents of variables below
|
||||
string(REPLACE "/OPT:ICF " "/OPT:NOICF " CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
|
||||
string(REPLACE "/OPT:REF " "/OPT:NOREF " CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
|
||||
string(REPLACE "/INCREMENTAL:YES " "/INCREMENTAL:NO " CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
|
||||
string(REPLACE "/INCREMENTAL " "/INCREMENTAL:NO " CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
|
||||
|
||||
try_compile(HAVE_WINRT_SDK
|
||||
"${OpenCV_BINARY_DIR}"
|
||||
"${OpenCV_SOURCE_DIR}/cmake/checks/winrttest.cpp")
|
||||
string(REPLACE "/OPT:ICF " "/OPT:NOICF " CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
|
||||
string(REPLACE "/OPT:REF " "/OPT:NORE F" CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
|
||||
string(REPLACE "/INCREMENTAL:YES " "/INCREMENTAL:NO " CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
|
||||
string(REPLACE "/INCREMENTAL " "/INCREMENTAL:NO " CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
|
||||
|
||||
if(ENABLE_WINRT_MODE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
|
||||
set(HAVE_WINRT TRUE)
|
||||
set(HAVE_WINRT_CX TRUE)
|
||||
elseif(ENABLE_WINRT_MODE_NATIVE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
|
||||
set(HAVE_WINRT TRUE)
|
||||
set(HAVE_WINRT_CX FALSE)
|
||||
endif()
|
||||
string(REPLACE "/OPT:ICF " "/OPT:NOICF " CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
|
||||
string(REPLACE "/OPT:REF " "/OPT:NOREF " CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
|
||||
string(REPLACE "/INCREMENTAL:YES " "/INCREMENTAL:NO " CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
|
||||
string(REPLACE "/INCREMENTAL " "/INCREMENTAL:NO " CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
|
||||
|
||||
if(HAVE_WINRT)
|
||||
add_definitions(/DWINVER=0x0602 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=0x0602)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /appcontainer")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /appcontainer")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /appcontainer")
|
||||
# Mandatory
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF")
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS AND BUILD_WITH_STATIC_CRT)
|
||||
@@ -77,7 +67,7 @@ else()
|
||||
endforeach(flag_var)
|
||||
endif()
|
||||
|
||||
if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8 AND NOT ${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} LESS 8.6)
|
||||
if(CMAKE_VERSION VERSION_GREATER "2.8.6")
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(N)
|
||||
if(NOT N EQUAL 0)
|
||||
|
||||
@@ -98,6 +98,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_extra_compiler_option(-pthread)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_CLANGCXX)
|
||||
add_extra_compiler_option(-Qunused-arguments)
|
||||
endif()
|
||||
|
||||
if(OPENCV_WARNINGS_ARE_ERRORS)
|
||||
add_extra_compiler_option(-Werror)
|
||||
endif()
|
||||
@@ -127,11 +131,13 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif()
|
||||
if(ENABLE_SSE2)
|
||||
add_extra_compiler_option(-msse2)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-sse2)
|
||||
endif()
|
||||
if (ENABLE_NEON)
|
||||
if(ENABLE_NEON)
|
||||
add_extra_compiler_option("-mfpu=neon")
|
||||
endif()
|
||||
if (ENABLE_VFPV3 AND NOT ENABLE_NEON)
|
||||
if(ENABLE_VFPV3 AND NOT ENABLE_NEON)
|
||||
add_extra_compiler_option("-mfpu=vfpv3")
|
||||
endif()
|
||||
|
||||
@@ -139,24 +145,45 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(NOT MINGW)
|
||||
if(ENABLE_AVX)
|
||||
add_extra_compiler_option(-mavx)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-avx)
|
||||
endif()
|
||||
if(ENABLE_AVX2)
|
||||
add_extra_compiler_option(-mavx2)
|
||||
|
||||
if(ENABLE_FMA3)
|
||||
add_extra_compiler_option(-mfma)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# GCC depresses SSEx instructions when -mavx is used. Instead, it generates new AVX instructions or AVX equivalence for all SSEx instructions when needed.
|
||||
if(NOT OPENCV_EXTRA_CXX_FLAGS MATCHES "-mavx")
|
||||
if(ENABLE_SSE3)
|
||||
add_extra_compiler_option(-msse3)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-sse3)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SSSE3)
|
||||
add_extra_compiler_option(-mssse3)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-ssse3)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SSE41)
|
||||
add_extra_compiler_option(-msse4.1)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-sse4.1)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SSE42)
|
||||
add_extra_compiler_option(-msse4.2)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-sse4.2)
|
||||
endif()
|
||||
|
||||
if(ENABLE_POPCNT)
|
||||
add_extra_compiler_option(-mpopcnt)
|
||||
endif()
|
||||
endif()
|
||||
endif(NOT MINGW)
|
||||
@@ -171,10 +198,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_NEON)
|
||||
add_extra_compiler_option(-mfpu=neon)
|
||||
endif()
|
||||
|
||||
# Profiling?
|
||||
if(ENABLE_PROFILING)
|
||||
add_extra_compiler_option("-pg -g")
|
||||
@@ -218,7 +241,10 @@ if(MSVC)
|
||||
set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi")
|
||||
endif()
|
||||
|
||||
if(ENABLE_AVX AND NOT MSVC_VERSION LESS 1600)
|
||||
if(ENABLE_AVX2 AND NOT MSVC_VERSION LESS 1800)
|
||||
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /arch:AVX2")
|
||||
endif()
|
||||
if(ENABLE_AVX AND NOT MSVC_VERSION LESS 1600 AND NOT OPENCV_EXTRA_FLAGS MATCHES "/arch:")
|
||||
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /arch:AVX")
|
||||
endif()
|
||||
|
||||
@@ -240,7 +266,7 @@ if(MSVC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_SSE OR ENABLE_SSE2 OR ENABLE_SSE3 OR ENABLE_SSE4_1 OR ENABLE_AVX)
|
||||
if(ENABLE_SSE OR ENABLE_SSE2 OR ENABLE_SSE3 OR ENABLE_SSE4_1 OR ENABLE_AVX OR ENABLE_AVX2)
|
||||
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /Oi")
|
||||
endif()
|
||||
|
||||
@@ -255,6 +281,11 @@ 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)
|
||||
# Android does not need these settings because they are already set by toolchain file
|
||||
@@ -312,6 +343,7 @@ if(MSVC)
|
||||
endforeach()
|
||||
|
||||
if(NOT ENABLE_NOISY_WARNINGS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251") #class 'std::XXX' needs to have dll-interface to be used by clients of YYY
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4251) # class 'std::XXX' needs to have dll-interface to be used by clients of YYY
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4324) # 'struct_name' : structure was padded due to __declspec(align())
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# If the module is found then OPENCV_<MODULE>_FOUND is set to TRUE.
|
||||
#
|
||||
# This file will define the following variables:
|
||||
# - OpenCV_LIBS : The list of libraries to links against.
|
||||
# - OpenCV_LIBS : The list of libraries to link against.
|
||||
# - OpenCV_LIB_DIR : The directory(es) where lib files are. Calling LINK_DIRECTORIES
|
||||
# with this path is NOT needed.
|
||||
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
|
||||
@@ -47,7 +47,7 @@ endif()
|
||||
|
||||
if(NOT DEFINED OpenCV_STATIC)
|
||||
# look for global setting
|
||||
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(OpenCV_STATIC OFF)
|
||||
else()
|
||||
set(OpenCV_STATIC ON)
|
||||
@@ -65,6 +65,9 @@ if(MSVC)
|
||||
if(CMAKE_CL_64)
|
||||
set(OpenCV_ARCH x64)
|
||||
set(OpenCV_TBB_ARCH intel64)
|
||||
elseif((CMAKE_GENERATOR MATCHES "ARM") OR ("${arch_hint}" STREQUAL "ARM") OR (CMAKE_VS_EFFECTIVE_PLATFORMS MATCHES "ARM|arm"))
|
||||
# see Modules/CmakeGenericSystem.cmake
|
||||
set(OpenCV_ARCH ARM)
|
||||
else()
|
||||
set(OpenCV_ARCH x86)
|
||||
set(OpenCV_TBB_ARCH ia32)
|
||||
@@ -79,6 +82,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 +91,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()
|
||||
@@ -124,8 +129,8 @@ endif()
|
||||
if(OpenCV_LIB_PATH AND EXISTS "${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
|
||||
set(OpenCV_LIB_DIR_OPT "${OpenCV_LIB_PATH}" CACHE PATH "Path where release OpenCV libraries are located" FORCE)
|
||||
set(OpenCV_LIB_DIR_DBG "${OpenCV_LIB_PATH}" CACHE PATH "Path where debug OpenCV libraries are located" FORCE)
|
||||
set(OpenCV_3RDPARTY_LIB_DIR_OPT "${OpenCV_LIB_PATH}" CACHE PATH "Path where release 3rdpaty OpenCV dependencies are located" FORCE)
|
||||
set(OpenCV_3RDPARTY_LIB_DIR_DBG "${OpenCV_LIB_PATH}" CACHE PATH "Path where debug 3rdpaty OpenCV dependencies are located" FORCE)
|
||||
set(OpenCV_3RDPARTY_LIB_DIR_OPT "${OpenCV_LIB_PATH}" CACHE PATH "Path where release 3rdparty OpenCV dependencies are located" FORCE)
|
||||
set(OpenCV_3RDPARTY_LIB_DIR_DBG "${OpenCV_LIB_PATH}" CACHE PATH "Path where debug 3rdparty OpenCV dependencies are located" FORCE)
|
||||
|
||||
include("${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
|
||||
|
||||
@@ -159,7 +164,7 @@ if(OpenCV_LIB_PATH AND EXISTS "${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
|
||||
else()
|
||||
if(NOT OpenCV_FIND_QUIETLY)
|
||||
message(WARNING
|
||||
"Found OpenCV Windows Pack but it has not binaries compatible with your configuration.
|
||||
"Found OpenCV Windows Pack but it has no binaries compatible with your configuration.
|
||||
You should manually point CMake variable OpenCV_DIR to your build of OpenCV library."
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -180,7 +180,7 @@ unset(__android_project_chain CACHE)
|
||||
# add_android_project(target_name ${path} NATIVE_DEPS opencv_core LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11)
|
||||
macro(add_android_project target path)
|
||||
# parse arguments
|
||||
set(android_proj_arglist NATIVE_DEPS LIBRARY_DEPS SDK_TARGET IGNORE_JAVA IGNORE_MANIFEST)
|
||||
set(android_proj_arglist NATIVE_DEPS LIBRARY_DEPS SDK_TARGET IGNORE_JAVA IGNORE_MANIFEST COPY_LIBS)
|
||||
set(__varname "android_proj_")
|
||||
foreach(v ${android_proj_arglist})
|
||||
set(${__varname}${v} "")
|
||||
@@ -334,14 +334,17 @@ macro(add_android_project target path)
|
||||
add_dependencies(${target} ${android_proj_native_deps})
|
||||
endif()
|
||||
|
||||
if(ANDROID_EXAMPLES_WITH_LIBS)
|
||||
if (android_proj_COPY_LIBS OR ANDROID_EXAMPLES_WITH_LIBS)
|
||||
message(STATUS "Android project with libs: " ${target})
|
||||
add_custom_target(
|
||||
${target}_copy_libs
|
||||
COMMAND ${CMAKE_COMMAND} -DSRC_DIR=${OpenCV_BINARY_DIR}/lib -DDST_DIR=${android_proj_bin_dir}/libs -P ${OpenCV_SOURCE_DIR}/cmake/copyAndroidLibs.cmake
|
||||
WORKING_DIRECTORY ${OpenCV_BINARY_DIR}/lib
|
||||
DEPENDS "${OpenCV_BINARY_DIR}/bin/classes.jar.dephelper" opencv_java
|
||||
)
|
||||
add_dependencies(${target} ${target}_copy_libs)
|
||||
if (ANDROID_EXAMPLES_WITH_LIBS)
|
||||
add_dependencies(${target}_copy_libs "${OpenCV_BINARY_DIR}/bin/classes.jar.dephelper" opencv_java)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(__android_project_chain)
|
||||
|
||||
@@ -10,19 +10,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 "${MIN_VER_CUDA}" QUIET)
|
||||
|
||||
foreach(var INCLUDE LIBRARY PROGRAM)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_${var} "${__old_frpm_${var}}")
|
||||
endforeach()
|
||||
if(ANDROID)
|
||||
set(CUDA_TARGET_OS_VARIANT "Android")
|
||||
endif()
|
||||
find_host_package(CUDA "${MIN_VER_CUDA}" QUIET)
|
||||
|
||||
list(REMOVE_AT CMAKE_MODULE_PATH 0)
|
||||
|
||||
@@ -89,11 +80,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()
|
||||
@@ -152,7 +150,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}")
|
||||
|
||||
@@ -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()
|
||||
@@ -107,12 +107,14 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
|
||||
set(X86_64 1)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*")
|
||||
set(X86 1)
|
||||
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|ARM.*")
|
||||
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)
|
||||
@@ -125,6 +127,9 @@ endif()
|
||||
if(MSVC)
|
||||
if(CMAKE_CL_64)
|
||||
set(OpenCV_ARCH x64)
|
||||
elseif((CMAKE_GENERATOR MATCHES "ARM") OR ("${arch_hint}" STREQUAL "ARM") OR (CMAKE_VS_EFFECTIVE_PLATFORMS MATCHES "ARM|arm"))
|
||||
# see Modules/CmakeGenericSystem.cmake
|
||||
set(OpenCV_ARCH ARM)
|
||||
else()
|
||||
set(OpenCV_ARCH x86)
|
||||
endif()
|
||||
@@ -138,15 +143,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)
|
||||
|
||||
@@ -10,6 +10,11 @@ else(APPLE)
|
||||
set(OPENCL_INCLUDE_DIR "${OpenCV_SOURCE_DIR}/3rdparty/include/opencl/1.2")
|
||||
endif(APPLE)
|
||||
|
||||
if(WINRT)
|
||||
set(OPENCL_FOUND NO)
|
||||
set(HAVE_OPENCL_STATIC OFF)
|
||||
endif(WINRT)
|
||||
|
||||
if(OPENCL_FOUND)
|
||||
if(NOT HAVE_OPENCL_STATIC)
|
||||
try_compile(__VALID_OPENCL
|
||||
@@ -24,7 +29,13 @@ if(OPENCL_FOUND)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(HAVE_OPENCL 1)
|
||||
if(NOT WINRT)
|
||||
set(HAVE_OPENCL 1)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCL_SVM)
|
||||
set(HAVE_OPENCL_SVM 1)
|
||||
endif()
|
||||
|
||||
if(HAVE_OPENCL_STATIC)
|
||||
set(OPENCL_LIBRARIES "${OPENCL_LIBRARY}")
|
||||
|
||||
@@ -37,7 +37,7 @@ function(find_python preferred_version min_version library_env include_dir_env
|
||||
# standard FindPythonInterp always prefers executable from system path
|
||||
# this is really important because we are using the interpreter for numpy search and for choosing the install location
|
||||
foreach(_CURRENT_VERSION ${Python_ADDITIONAL_VERSIONS} "${preferred_version}" "${min_version}")
|
||||
find_host_program(executable
|
||||
find_host_program(PYTHON_EXECUTABLE
|
||||
NAMES python${_CURRENT_VERSION} python
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\${_CURRENT_VERSION}\\\\InstallPath]
|
||||
@@ -75,10 +75,10 @@ function(find_python preferred_version min_version library_env include_dir_env
|
||||
|
||||
if(NOT ANDROID AND NOT IOS)
|
||||
ocv_check_environment_variables(${library_env} ${include_dir_env})
|
||||
if(${library})
|
||||
if(NOT ${${library_env}} EQUAL "")
|
||||
set(PYTHON_LIBRARY "${${library_env}}")
|
||||
endif()
|
||||
if(${include_dir})
|
||||
if(NOT ${${include_dir_env}} EQUAL "")
|
||||
set(PYTHON_INCLUDE_DIR "${${include_dir_env}}")
|
||||
endif()
|
||||
|
||||
@@ -237,21 +237,3 @@ if(PYTHON2INTERP_FOUND)
|
||||
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
|
||||
set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON2_EXECUTABLE}")
|
||||
endif()
|
||||
|
||||
unset(HAVE_SPHINX CACHE)
|
||||
|
||||
if(BUILD_DOCS)
|
||||
find_host_program(SPHINX_BUILD sphinx-build)
|
||||
find_host_program(PLANTUML plantuml)
|
||||
if(SPHINX_BUILD)
|
||||
execute_process(COMMAND "${SPHINX_BUILD}"
|
||||
OUTPUT_QUIET
|
||||
ERROR_VARIABLE SPHINX_OUTPUT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(SPHINX_OUTPUT MATCHES "Sphinx v([0-9][^ \n]*)")
|
||||
set(SPHINX_VERSION "${CMAKE_MATCH_1}")
|
||||
set(HAVE_SPHINX 1)
|
||||
message(STATUS "Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}")
|
||||
endif()
|
||||
endif()
|
||||
endif(BUILD_DOCS)
|
||||
|
||||
+41
-18
@@ -34,8 +34,10 @@ unset(IPP_VERSION_MAJOR)
|
||||
unset(IPP_VERSION_MINOR)
|
||||
unset(IPP_VERSION_BUILD)
|
||||
|
||||
set(IPP_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
|
||||
set(IPP_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
if (X86 AND UNIX AND NOT APPLE AND NOT ANDROID AND BUILD_SHARED_LIBS)
|
||||
message(STATUS "On 32-bit Linux IPP can not currently be used with dynamic libs because of linker errors. Set BUILD_SHARED_LIBS=OFF")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(IPP_X64 0)
|
||||
if(CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
|
||||
@@ -125,19 +127,32 @@ macro(ipp_detect_version)
|
||||
endif()
|
||||
|
||||
macro(_ipp_add_library name)
|
||||
# dynamic linking is only supported for standalone version of IPP
|
||||
if (BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY)
|
||||
set(IPP_LIB_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
|
||||
set(IPP_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
else ()
|
||||
set(IPP_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
|
||||
set(IPP_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
endif ()
|
||||
if (EXISTS ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
|
||||
add_library(ipp${name} STATIC IMPORTED)
|
||||
set_target_properties(ipp${name} PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES ""
|
||||
IMPORTED_LOCATION ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
)
|
||||
list(APPEND IPP_LIBRARIES ipp${name})
|
||||
# CMake doesn't support "install(TARGETS ipp${name} " command with imported targets
|
||||
install(FILES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
||||
string(TOUPPER ${name} uname)
|
||||
set(IPP${uname}_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_3P_LIB_INSTALL_PATH}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}" CACHE INTERNAL "" FORCE)
|
||||
set(IPP${uname}_LOCATION_PATH "${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}" CACHE INTERNAL "" FORCE)
|
||||
if (BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY)
|
||||
# When using dynamic libraries from standalone IPP it is your responsibility to install those on the target system
|
||||
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
|
||||
else ()
|
||||
add_library(ipp${name} STATIC IMPORTED)
|
||||
set_target_properties(ipp${name} PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES ""
|
||||
IMPORTED_LOCATION ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
)
|
||||
list(APPEND IPP_LIBRARIES ipp${name})
|
||||
# CMake doesn't support "install(TARGETS ${IPP_PREFIX}${name} " command with imported targets
|
||||
install(FILES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
string(TOUPPER ${name} uname)
|
||||
set(IPP${uname}_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_3P_LIB_INSTALL_PATH}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}" CACHE INTERNAL "" FORCE)
|
||||
set(IPP${uname}_LOCATION_PATH "${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}" CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Can't find IPP library: ${name} at ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}")
|
||||
endif()
|
||||
@@ -145,10 +160,18 @@ macro(ipp_detect_version)
|
||||
|
||||
set(IPP_PREFIX "ipp")
|
||||
if(${IPP_VERSION_STR} VERSION_LESS "8.0")
|
||||
set(IPP_SUFFIX "_l") # static not threaded libs suffix IPP 7.x
|
||||
else()
|
||||
if (BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY)
|
||||
set(IPP_SUFFIX "") # dynamic not threaded libs suffix IPP 7.x
|
||||
else ()
|
||||
set(IPP_SUFFIX "_l") # static not threaded libs suffix IPP 7.x
|
||||
endif ()
|
||||
else ()
|
||||
if(WIN32)
|
||||
set(IPP_SUFFIX "mt") # static not threaded libs suffix IPP 8.x for Windows
|
||||
if (BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY)
|
||||
set(IPP_SUFFIX "") # dynamic not threaded libs suffix IPP 8.x for Windows
|
||||
else ()
|
||||
set(IPP_SUFFIX "mt") # static not threaded libs suffix IPP 8.x for Windows
|
||||
endif ()
|
||||
else()
|
||||
set(IPP_SUFFIX "") # static not threaded libs suffix IPP 8.x for Linux/OS X
|
||||
endif()
|
||||
@@ -191,7 +214,7 @@ macro(ipp_detect_version)
|
||||
if (EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/${IPP_LIB_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
list(APPEND IPP_LIBRARIES ${INTEL_COMPILER_LIBRARY_DIR}/${IPP_LIB_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
else()
|
||||
message(STATUS "Can't find compiler library: ${name}")
|
||||
message(STATUS "Can't find compiler library: ${name} at ${INTEL_COMPILER_LIBRARY_DIR}/${IPP_LIB_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
@@ -208,5 +208,6 @@ if(WITH_GDAL)
|
||||
set(HAVE_GDAL NO)
|
||||
else()
|
||||
set(HAVE_GDAL YES)
|
||||
ocv_include_directories(${GDAL_INCLUDE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -93,8 +93,25 @@ else()
|
||||
set(HAVE_CSTRIPES 0)
|
||||
endif()
|
||||
|
||||
# --- GCD ---
|
||||
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)
|
||||
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}")
|
||||
file(REMOVE "${_fname}")
|
||||
else()
|
||||
set(HAVE_CONCURRENCY 0)
|
||||
endif()
|
||||
|
||||
# --- OpenMP ---
|
||||
if(WITH_OPENMP AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
if(WITH_OPENMP)
|
||||
find_package(OpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
@@ -103,19 +120,12 @@ if(WITH_OPENMP AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
set(HAVE_OPENMP "${OPENMP_FOUND}")
|
||||
endif()
|
||||
|
||||
# --- GCD ---
|
||||
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
|
||||
set(HAVE_GCD 1)
|
||||
if(UNIX OR ANDROID)
|
||||
if(NOT APPLE AND NOT HAVE_TBB AND NOT HAVE_OPENMP)
|
||||
set(HAVE_PTHREADS_PF 1)
|
||||
else()
|
||||
set(HAVE_GCD 0)
|
||||
set(HAVE_PTHREADS_PF 0)
|
||||
endif()
|
||||
|
||||
# --- Concurrency ---
|
||||
if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
|
||||
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/concurrencytest.cpp")
|
||||
file(WRITE "${_fname}" "#if _MSC_VER < 1600\n#error\n#endif\nint main() { return 0; }\n")
|
||||
try_compile(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}" "${_fname}")
|
||||
file(REMOVE "${_fname}")
|
||||
else()
|
||||
set(HAVE_CONCURRENCY 0)
|
||||
set(HAVE_PTHREADS_PF 0)
|
||||
endif()
|
||||
|
||||
@@ -32,7 +32,7 @@ if(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10)
|
||||
endif(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10)
|
||||
|
||||
# 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)
|
||||
if(WITH_GSTREAMER AND NOT HAVE_GSTREAMER OR WITH_GSTREAMER_0_10)
|
||||
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 +47,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 AND NOT HAVE_GSTREAMER OR WITH_GSTREAMER_0_10)
|
||||
|
||||
# --- unicap ---
|
||||
ocv_clear_vars(HAVE_UNICAP)
|
||||
@@ -153,7 +153,13 @@ endif(WITH_XINE)
|
||||
ocv_clear_vars(HAVE_LIBV4L HAVE_CAMV4L HAVE_CAMV4L2 HAVE_VIDEOIO)
|
||||
if(WITH_V4L)
|
||||
if(WITH_LIBV4L)
|
||||
CHECK_MODULE(libv4l1 HAVE_LIBV4L)
|
||||
CHECK_MODULE(libv4l1 HAVE_LIBV4L1)
|
||||
CHECK_MODULE(libv4l2 HAVE_LIBV4L2)
|
||||
if(HAVE_LIBV4L1 AND HAVE_LIBV4L2)
|
||||
set(HAVE_LIBV4L YES)
|
||||
else()
|
||||
set(HAVE_LIBV4L NO)
|
||||
endif()
|
||||
endif()
|
||||
CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L)
|
||||
CHECK_INCLUDE_FILE(linux/videodev2.h HAVE_CAMV4L2)
|
||||
@@ -181,7 +187,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")
|
||||
@@ -190,6 +196,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)
|
||||
@@ -209,42 +216,55 @@ 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")
|
||||
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}")
|
||||
find_library(FFMPEG_RESAMPLE_LIB "avresample" HINTS "${FFMPEG_LIB_DIR}")
|
||||
if(FFMPEG_CODEC_LIB)
|
||||
set(HAVE_FFMPEG_CODEC 1)
|
||||
endif()
|
||||
if(FFMPEG_FORMAT_LIB)
|
||||
set(HAVE_FFMPEG_FORMAT 1)
|
||||
endif()
|
||||
if(FFMPEG_UTIL_LIB)
|
||||
set(HAVE_FFMPEG_UTIL 1)
|
||||
endif()
|
||||
if(FFMPEG_SWSCALE_LIB)
|
||||
set(HAVE_FFMPEG_SWSCALE 1)
|
||||
endif()
|
||||
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()
|
||||
set(ALIASOF_libavutil_VERSION "Unknown")
|
||||
set(ALIASOF_libswscale_VERSION "Unknown")
|
||||
set(HAVE_FFMPEG 1)
|
||||
if(FFMPEG_RESAMPLE_LIB)
|
||||
set(HAVE_FFMPEG_RESAMPLE 1)
|
||||
set(ALIASOF_libavresample_VERSION "Unknown")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif(FFMPEG_INCLUDE_DIR)
|
||||
if(HAVE_FFMPEG)
|
||||
set(VIDEOIO_LIBRARIES ${VIDEOIO_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
|
||||
"${FFMPEG_LIB_DIR}/libavformat.a" "${FFMPEG_LIB_DIR}/libavutil.a"
|
||||
"${FFMPEG_LIB_DIR}/libswscale.a")
|
||||
ocv_include_directories(${FFMPEG_INCLUDE_DIR})
|
||||
endif(FFMPEG_INCLUDE_DIR)
|
||||
if(HAVE_FFMPEG)
|
||||
set(VIDEOIO_LIBRARIES ${VIDEOIO_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
|
||||
"${FFMPEG_LIB_DIR}/libavformat.a" "${FFMPEG_LIB_DIR}/libavutil.a"
|
||||
"${FFMPEG_LIB_DIR}/libswscale.a")
|
||||
if(HAVE_FFMPEG_RESAMPLE)
|
||||
set(VIDEOIO_LIBRARIES ${VIDEOIO_LIBRARIES} "${FFMPEG_LIB_DIR}/libavresample.a")
|
||||
endif()
|
||||
ocv_include_directories(${FFMPEG_INCLUDE_DIR})
|
||||
endif(HAVE_FFMPEG)
|
||||
endif()
|
||||
endif(APPLE)
|
||||
endif()
|
||||
endif(WITH_FFMPEG)
|
||||
|
||||
# --- VideoInput/DirectShow ---
|
||||
@@ -262,7 +282,9 @@ endif(WITH_MSMF)
|
||||
# --- Extra HighGUI and VideoIO libs on Windows ---
|
||||
if(WIN32)
|
||||
list(APPEND HIGHGUI_LIBRARIES comctl32 gdi32 ole32 setupapi ws2_32)
|
||||
list(APPEND VIDEOIO_LIBRARIES vfw32)
|
||||
if(HAVE_VFW)
|
||||
list(APPEND VIDEOIO_LIBRARIES vfw32)
|
||||
endif()
|
||||
if(MINGW64)
|
||||
list(APPEND VIDEOIO_LIBRARIES avifil32 avicap32 winmm msvfw32)
|
||||
list(REMOVE_ITEM VIDEOIO_LIBRARIES vfw32)
|
||||
@@ -289,3 +311,9 @@ endif()
|
||||
if(WITH_INTELPERC)
|
||||
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIntelPerCSDK.cmake")
|
||||
endif(WITH_INTELPERC)
|
||||
|
||||
# --- gPhoto2 ---
|
||||
ocv_clear_vars(HAVE_GPHOTO2)
|
||||
if(WITH_GPHOTO2)
|
||||
CHECK_MODULE(libgphoto2 HAVE_GPHOTO2)
|
||||
endif(WITH_GPHOTO2)
|
||||
|
||||
@@ -17,12 +17,12 @@ if(WIN32)
|
||||
find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS "$ENV{OPEN_NI_INSTALL_PATH}Include" DOC "OpenNI2 c++ interface header")
|
||||
find_library(OPENNI2_LIBRARY "OpenNI2" PATHS $ENV{OPENNI2_LIB} DOC "OpenNI2 library")
|
||||
else()
|
||||
find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS "$ENV{OPEN_NI_INSTALL_PATH64}Include" DOC "OpenNI2 c++ interface header")
|
||||
find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS $ENV{OPENNI2_INCLUDE64} "$ENV{OPEN_NI_INSTALL_PATH64}Include" DOC "OpenNI2 c++ interface header")
|
||||
find_library(OPENNI2_LIBRARY "OpenNI2" PATHS $ENV{OPENNI2_LIB64} DOC "OpenNI2 library")
|
||||
endif()
|
||||
elseif(UNIX OR APPLE)
|
||||
find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS "/usr/include/ni2" "/usr/include/openni2" DOC "OpenNI2 c++ interface header")
|
||||
find_library(OPENNI2_LIBRARY "OpenNI2" PATHS "/usr/lib" DOC "OpenNI2 library")
|
||||
find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS "/usr/include/ni2" "/usr/include/openni2" $ENV{OPENNI2_INCLUDE} DOC "OpenNI2 c++ interface header")
|
||||
find_library(OPENNI2_LIBRARY "OpenNI2" PATHS "/usr/lib" $ENV{OPENNI2_REDIST} DOC "OpenNI2 library")
|
||||
endif()
|
||||
|
||||
if(OPENNI2_LIBRARY AND OPENNI2_INCLUDES)
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
if (NOT GENERATE_ABI_DESCRIPTOR)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(filename "opencv_abi.xml")
|
||||
set(path1 "${CMAKE_BINARY_DIR}/${filename}")
|
||||
|
||||
set(modules "${OPENCV_MODULES_PUBLIC}")
|
||||
ocv_list_filterout(modules "opencv_ts")
|
||||
|
||||
message(STATUS "Generating ABI compliance checker configuration: ${filename}")
|
||||
|
||||
if (OPENCV_VCSVERSION AND NOT OPENCV_VCSVERSION STREQUAL "unknown")
|
||||
set(OPENCV_ABI_VERSION "${OPENCV_VCSVERSION}")
|
||||
else()
|
||||
set(OPENCV_ABI_VERSION "${OPENCV_VERSION}")
|
||||
endif()
|
||||
|
||||
# Headers
|
||||
set(OPENCV_ABI_HEADERS "{RELPATH}/${OPENCV_INCLUDE_INSTALL_PATH}")
|
||||
|
||||
# Libraries
|
||||
set(OPENCV_ABI_LIBRARIES "{RELPATH}/${OPENCV_LIB_INSTALL_PATH}")
|
||||
|
||||
set(OPENCV_ABI_SKIP_HEADERS "")
|
||||
set(OPENCV_ABI_SKIP_LIBRARIES "")
|
||||
foreach(mod ${OPENCV_MODULES_BUILD})
|
||||
string(REGEX REPLACE "^opencv_" "" mod "${mod}")
|
||||
if(NOT "${OPENCV_MODULE_opencv_${mod}_LOCATION}" STREQUAL "${OpenCV_SOURCE_DIR}/modules/${mod}")
|
||||
# headers
|
||||
foreach(h ${OPENCV_MODULE_opencv_${mod}_HEADERS})
|
||||
file(RELATIVE_PATH h "${OPENCV_MODULE_opencv_${mod}_LOCATION}/include" "${h}")
|
||||
list(APPEND OPENCV_ABI_SKIP_HEADERS "${h}")
|
||||
endforeach()
|
||||
# libraries
|
||||
set(lib_name "")
|
||||
get_target_property(lib_name opencv_${mod} LOCATION)
|
||||
get_filename_component(lib_name "${lib_name}" NAME)
|
||||
list(APPEND OPENCV_ABI_SKIP_LIBRARIES "${lib_name}")
|
||||
endif()
|
||||
endforeach()
|
||||
string(REPLACE ";" "\n " OPENCV_ABI_SKIP_HEADERS "${OPENCV_ABI_SKIP_HEADERS}")
|
||||
string(REPLACE ";" "\n " OPENCV_ABI_SKIP_LIBRARIES "${OPENCV_ABI_SKIP_LIBRARIES}")
|
||||
|
||||
# Options
|
||||
set(OPENCV_ABI_GCC_OPTIONS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
string(REGEX REPLACE "([^ ]) +([^ ])" "\\1\\n \\2" OPENCV_ABI_GCC_OPTIONS "${OPENCV_ABI_GCC_OPTIONS}")
|
||||
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_abi.xml.in" "${path1}")
|
||||
@@ -19,58 +19,18 @@ if(ANDROID)
|
||||
set(OPENCV_STATIC_LIBTYPE_CONFIGMAKE ${OPENCV_LIBTYPE_CONFIGMAKE})
|
||||
endif()
|
||||
|
||||
# setup lists of camera libs
|
||||
foreach(abi ARMEABI ARMEABI_V7A X86 MIPS)
|
||||
ANDROID_GET_ABI_RAWNAME(${abi} ndkabi)
|
||||
if(BUILD_ANDROID_CAMERA_WRAPPER)
|
||||
if(ndkabi STREQUAL ANDROID_NDK_ABI_NAME)
|
||||
set(OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE "native_camera_r${ANDROID_VERSION}")
|
||||
else()
|
||||
set(OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE "")
|
||||
endif()
|
||||
elseif(HAVE_opencv_androidcamera)
|
||||
set(OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE "")
|
||||
file(GLOB OPENCV_CAMERA_LIBS "${OpenCV_SOURCE_DIR}/3rdparty/lib/${ndkabi}/libnative_camera_r*.so")
|
||||
if(OPENCV_CAMERA_LIBS)
|
||||
list(SORT OPENCV_CAMERA_LIBS)
|
||||
endif()
|
||||
foreach(cam_lib ${OPENCV_CAMERA_LIBS})
|
||||
get_filename_component(cam_lib "${cam_lib}" NAME)
|
||||
string(REGEX REPLACE "lib(native_camera_r[0-9]+\\.[0-9]+\\.[0-9]+)\\.so" "\\1" cam_lib "${cam_lib}")
|
||||
set(OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE "${OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE} ${cam_lib}")
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# build the list of opencv libs and dependencies for all modules
|
||||
set(OPENCV_MODULES_CONFIGMAKE "")
|
||||
set(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "")
|
||||
set(OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE "")
|
||||
foreach(m ${OPENCV_MODULES_PUBLIC})
|
||||
list(INSERT OPENCV_MODULES_CONFIGMAKE 0 ${${m}_MODULE_DEPS_${ocv_optkind}} ${m})
|
||||
if(${m}_EXTRA_DEPS_${ocv_optkind})
|
||||
list(INSERT OPENCV_EXTRA_COMPONENTS_CONFIGMAKE 0 ${${m}_EXTRA_DEPS_${ocv_optkind}})
|
||||
endif()
|
||||
endforeach()
|
||||
ocv_get_all_libs(OPENCV_MODULES_CONFIGMAKE OPENCV_EXTRA_COMPONENTS_CONFIGMAKE OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE)
|
||||
|
||||
# split 3rdparty libs and modules
|
||||
foreach(mod ${OPENCV_MODULES_CONFIGMAKE})
|
||||
if(NOT mod MATCHES "^opencv_.+$")
|
||||
list(INSERT OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE 0 ${mod})
|
||||
endif()
|
||||
endforeach()
|
||||
if(OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE)
|
||||
list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE})
|
||||
endif()
|
||||
# list -> string
|
||||
string(REPLACE ";" " " OPENCV_MODULES_CONFIGMAKE "${OPENCV_MODULES_CONFIGMAKE}")
|
||||
string(REPLACE ";" " " OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "${OPENCV_EXTRA_COMPONENTS_CONFIGMAKE}")
|
||||
string(REPLACE ";" " " OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE "${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE}")
|
||||
|
||||
# convert CMake lists to makefile literals
|
||||
foreach(lst OPENCV_MODULES_CONFIGMAKE OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE OPENCV_EXTRA_COMPONENTS_CONFIGMAKE)
|
||||
ocv_list_unique(${lst})
|
||||
ocv_list_reverse(${lst})
|
||||
string(REPLACE ";" " " ${lst} "${${lst}}")
|
||||
endforeach()
|
||||
# replace 'opencv_<module>' -> '<module>''
|
||||
string(REPLACE "opencv_" "" OPENCV_MODULES_CONFIGMAKE "${OPENCV_MODULES_CONFIGMAKE}")
|
||||
|
||||
|
||||
# prepare 3rd-party component list without TBB for armeabi and mips platforms. TBB is useless there.
|
||||
set(OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE})
|
||||
foreach(mod ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB})
|
||||
@@ -78,7 +38,7 @@ if(ANDROID)
|
||||
endforeach()
|
||||
|
||||
if(BUILD_FAT_JAVA_LIB)
|
||||
set(OPENCV_LIBS_CONFIGMAKE java)
|
||||
set(OPENCV_LIBS_CONFIGMAKE java3)
|
||||
else()
|
||||
set(OPENCV_LIBS_CONFIGMAKE "${OPENCV_MODULES_CONFIGMAKE}")
|
||||
endif()
|
||||
|
||||
@@ -101,10 +101,7 @@ configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.
|
||||
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}/opencv" "\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}\"")
|
||||
|
||||
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "${OPENCV_3P_LIB_INSTALL_PATH}")
|
||||
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE}\"")
|
||||
endif()
|
||||
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_3P_LIB_INSTALL_PATH}\"")
|
||||
|
||||
if(UNIX) # ANDROID configuration is created here also
|
||||
#http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference
|
||||
@@ -114,23 +111,13 @@ if(UNIX) # ANDROID configuration is created here also
|
||||
# <prefix>/(share|lib)/<name>*/ (U)
|
||||
# <prefix>/(share|lib)/<name>*/(cmake|CMake)/ (U)
|
||||
if(USE_IPPICV)
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/" ${IPPICV_INSTALL_PATH})
|
||||
else()
|
||||
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}/" ${IPPICV_INSTALL_PATH})
|
||||
endif()
|
||||
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}/" ${IPPICV_INSTALL_PATH})
|
||||
endif()
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" @ONLY)
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY)
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ COMPONENT dev)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ COMPONENT dev)
|
||||
install(EXPORT OpenCVModules DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
||||
else()
|
||||
install(FILES "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
||||
install(EXPORT OpenCVModules DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
||||
endif()
|
||||
install(FILES "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
||||
install(EXPORT OpenCVModules DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# platform-specific config file
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h")
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/cvconfig.h")
|
||||
install(FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT dev)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# opencv_modules.hpp based on actual modules list
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
if(OPENCV_EXTRA_WORLD)
|
||||
set(OPENCV_APPLE_BUNDLE_NAME "OpenCV_contrib")
|
||||
set(OPENCV_APPLE_BUNDLE_ID "org.opencv_contrib")
|
||||
else()
|
||||
set(OPENCV_APPLE_BUNDLE_NAME "OpenCV")
|
||||
set(OPENCV_APPLE_BUNDLE_ID "org.opencv")
|
||||
endif()
|
||||
|
||||
if(IOS)
|
||||
configure_file("${OpenCV_SOURCE_DIR}/platforms/ios/Info.plist.in"
|
||||
"${CMAKE_BINARY_DIR}/ios/Info.plist")
|
||||
|
||||
@@ -8,69 +8,82 @@
|
||||
#
|
||||
# ${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)
|
||||
else()
|
||||
set(ocv_optkind DBG)
|
||||
endif()
|
||||
macro(fix_prefix lst isown)
|
||||
set(_lst)
|
||||
foreach(item ${${lst}})
|
||||
if(TARGET ${item})
|
||||
get_target_property(item "${item}" LOCATION_${CMAKE_BUILD_TYPE})
|
||||
if("${isown}")
|
||||
get_filename_component(item "${item}" NAME_WE)
|
||||
string(REGEX REPLACE "^lib(.*)" "\\1" item "${item}")
|
||||
endif()
|
||||
endif()
|
||||
if(item MATCHES "^-l")
|
||||
list(APPEND _lst "${item}")
|
||||
elseif(item MATCHES "[\\/]")
|
||||
get_filename_component(libdir "${item}" PATH)
|
||||
get_filename_component(libname "${item}" NAME_WE)
|
||||
string(REGEX REPLACE "^lib(.*)" "\\1" libname "${libname}")
|
||||
list(APPEND _lst "-L${libdir}" "-l${libname}")
|
||||
else()
|
||||
list(APPEND _lst "-l${item}")
|
||||
endif()
|
||||
endforeach()
|
||||
set(${lst} ${_lst})
|
||||
unset(_lst)
|
||||
endmacro()
|
||||
|
||||
#build the list of opencv libs and dependencies for all modules
|
||||
set(OpenCV_LIB_COMPONENTS "")
|
||||
set(OpenCV_EXTRA_COMPONENTS "")
|
||||
foreach(m ${OPENCV_MODULES_PUBLIC})
|
||||
list(INSERT OpenCV_LIB_COMPONENTS 0 ${${m}_MODULE_DEPS_${ocv_optkind}} ${m})
|
||||
if(${m}_EXTRA_DEPS_${ocv_optkind})
|
||||
list(INSERT OpenCV_EXTRA_COMPONENTS 0 ${${m}_EXTRA_DEPS_${ocv_optkind}})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
ocv_list_unique(OpenCV_LIB_COMPONENTS)
|
||||
ocv_list_unique(OpenCV_EXTRA_COMPONENTS)
|
||||
ocv_list_reverse(OpenCV_LIB_COMPONENTS)
|
||||
ocv_list_reverse(OpenCV_EXTRA_COMPONENTS)
|
||||
# build the list of opencv libs and dependencies for all modules
|
||||
ocv_get_all_libs(_modules _extra _3rdparty)
|
||||
|
||||
#build the list of components
|
||||
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()
|
||||
# Note:
|
||||
# when linking against static libraries, if libfoo depends on libbar, then
|
||||
# libfoo must come first in the linker flags.
|
||||
|
||||
#need better solution....
|
||||
if(libpath MATCHES "3rdparty")
|
||||
set(installDir "share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}")
|
||||
else()
|
||||
set(installDir "${OPENCV_LIB_INSTALL_PATH}")
|
||||
endif()
|
||||
|
||||
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")
|
||||
endif()
|
||||
|
||||
set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${maybe_l_prefix}${extra_component}")
|
||||
|
||||
endforeach()
|
||||
# world and contrib_world are special targets whose library should come first,
|
||||
# especially for static link.
|
||||
if(_modules MATCHES "opencv_world")
|
||||
set(_modules "opencv_world")
|
||||
endif()
|
||||
|
||||
if(_modules MATCHES "opencv_contrib_world")
|
||||
list(REMOVE_ITEM _modules "opencv_contrib_world")
|
||||
list(INSERT _modules 0 "opencv_contrib_world")
|
||||
endif()
|
||||
|
||||
fix_prefix(_modules TRUE)
|
||||
fix_prefix(_extra FALSE)
|
||||
fix_prefix(_3rdparty TRUE)
|
||||
|
||||
ocv_list_unique(_modules)
|
||||
ocv_list_unique(_extra)
|
||||
ocv_list_unique(_3rdparty)
|
||||
|
||||
set(OPENCV_PC_LIBS
|
||||
"-L\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}"
|
||||
"${_modules}"
|
||||
)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(OPENCV_PC_LIBS_PRIVATE "${_extra}")
|
||||
else()
|
||||
set(OPENCV_PC_LIBS_PRIVATE
|
||||
"-L\${exec_prefix}/${OPENCV_3P_LIB_INSTALL_PATH}"
|
||||
"${_3rdparty}"
|
||||
"${_extra}"
|
||||
)
|
||||
endif()
|
||||
string(REPLACE ";" " " OPENCV_PC_LIBS "${OPENCV_PC_LIBS}")
|
||||
string(REPLACE ";" " " OPENCV_PC_LIBS_PRIVATE "${OPENCV_PC_LIBS_PRIVATE}")
|
||||
|
||||
#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()
|
||||
|
||||
+151
-43
@@ -19,6 +19,9 @@
|
||||
# OPENCV_MODULE_${the_module}_PRIVATE_REQ_DEPS
|
||||
# OPENCV_MODULE_${the_module}_PRIVATE_OPT_DEPS
|
||||
# OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD
|
||||
# OPENCV_MODULE_${the_module}_CUDA_OBJECTS - compiled CUDA objects list
|
||||
# OPENCV_MODULE_${the_module}_CHILDREN - list of submodules for compound modules (cmake >= 2.8.8)
|
||||
# OPENCV_MODULE_${the_module}_WRAPPERS - list of wrappers supporting this module
|
||||
# HAVE_${the_module} - for fast check of module availability
|
||||
|
||||
# To control the setup of the module you could also set:
|
||||
@@ -26,6 +29,7 @@
|
||||
# OPENCV_MODULE_TYPE - STATIC|SHARED - set to force override global settings for current module
|
||||
# OPENCV_MODULE_IS_PART_OF_WORLD - ON|OFF (default ON) - should the module be added to the opencv_world?
|
||||
# BUILD_${the_module}_INIT - ON|OFF (default ON) - initial value for BUILD_${the_module}
|
||||
# OPENCV_MODULE_CHILDREN - list of submodules
|
||||
|
||||
# The verbose template for OpenCV module:
|
||||
#
|
||||
@@ -57,6 +61,7 @@ foreach(mod ${OPENCV_MODULES_BUILD} ${OPENCV_MODULES_DISABLED_USER} ${OPENCV_MOD
|
||||
unset(OPENCV_MODULE_${mod}_PRIVATE_REQ_DEPS CACHE)
|
||||
unset(OPENCV_MODULE_${mod}_PRIVATE_OPT_DEPS CACHE)
|
||||
unset(OPENCV_MODULE_${mod}_LINK_DEPS CACHE)
|
||||
unset(OPENCV_MODULE_${mod}_WRAPPERS CACHE)
|
||||
endforeach()
|
||||
|
||||
# clean modules info which needs to be recalculated
|
||||
@@ -69,7 +74,7 @@ unset(OPENCV_WORLD_MODULES CACHE)
|
||||
|
||||
# adds dependencies to OpenCV module
|
||||
# Usage:
|
||||
# add_dependencies(opencv_<name> [REQUIRED] [<list of dependencies>] [OPTIONAL <list of modules>])
|
||||
# add_dependencies(opencv_<name> [REQUIRED] [<list of dependencies>] [OPTIONAL <list of modules>] [WRAP <list of wrappers>])
|
||||
# Notes:
|
||||
# * <list of dependencies> - can include full names of modules or full pathes to shared/static libraries or cmake targets
|
||||
macro(ocv_add_dependencies full_modname)
|
||||
@@ -84,16 +89,28 @@ macro(ocv_add_dependencies full_modname)
|
||||
set(__depsvar OPENCV_MODULE_${full_modname}_PRIVATE_REQ_DEPS)
|
||||
elseif(d STREQUAL "PRIVATE_OPTIONAL")
|
||||
set(__depsvar OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS)
|
||||
elseif(d STREQUAL "WRAP")
|
||||
set(__depsvar OPENCV_MODULE_${full_modname}_WRAPPERS)
|
||||
else()
|
||||
list(APPEND ${__depsvar} "${d}")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(__depsvar)
|
||||
|
||||
# hack for python
|
||||
set(__python_idx)
|
||||
list(FIND OPENCV_MODULE_${full_modname}_WRAPPERS "python" __python_idx)
|
||||
if (NOT __python_idx EQUAL -1)
|
||||
list(REMOVE_ITEM OPENCV_MODULE_${full_modname}_WRAPPERS "python")
|
||||
list(APPEND OPENCV_MODULE_${full_modname}_WRAPPERS "python2" "python3")
|
||||
endif()
|
||||
unset(__python_idx)
|
||||
|
||||
ocv_list_unique(OPENCV_MODULE_${full_modname}_REQ_DEPS)
|
||||
ocv_list_unique(OPENCV_MODULE_${full_modname}_OPT_DEPS)
|
||||
ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_REQ_DEPS)
|
||||
ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS)
|
||||
ocv_list_unique(OPENCV_MODULE_${full_modname}_WRAPPERS)
|
||||
|
||||
set(OPENCV_MODULE_${full_modname}_REQ_DEPS ${OPENCV_MODULE_${full_modname}_REQ_DEPS}
|
||||
CACHE INTERNAL "Required dependencies of ${full_modname} module")
|
||||
@@ -103,17 +120,18 @@ macro(ocv_add_dependencies full_modname)
|
||||
CACHE INTERNAL "Required private dependencies of ${full_modname} module")
|
||||
set(OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS ${OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS}
|
||||
CACHE INTERNAL "Optional private dependencies of ${full_modname} module")
|
||||
set(OPENCV_MODULE_${full_modname}_WRAPPERS ${OPENCV_MODULE_${full_modname}_WRAPPERS}
|
||||
CACHE INTERNAL "List of wrappers supporting module ${full_modname}")
|
||||
endmacro()
|
||||
|
||||
# declare new OpenCV module in current folder
|
||||
# Usage:
|
||||
# ocv_add_module(<name> [INTERNAL|BINDINGS] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
|
||||
# ocv_add_module(<name> [INTERNAL|BINDINGS] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>] [WRAP <list of wrappers>])
|
||||
# Example:
|
||||
# ocv_add_module(yaom INTERNAL opencv_core opencv_highgui opencv_flann OPTIONAL opencv_cuda)
|
||||
# ocv_add_module(yaom INTERNAL opencv_core opencv_highgui opencv_flann OPTIONAL opencv_cudev)
|
||||
macro(ocv_add_module _name)
|
||||
ocv_debug_message("ocv_add_module(" ${_name} ${ARGN} ")")
|
||||
string(TOLOWER "${_name}" name)
|
||||
string(REGEX REPLACE "^opencv_" "" ${name} "${name}")
|
||||
set(the_module opencv_${name})
|
||||
|
||||
# the first pass - collect modules info, the second pass - create targets
|
||||
@@ -158,8 +176,14 @@ macro(ocv_add_module _name)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# add HAL as dependency
|
||||
if(NOT "${the_module}" STREQUAL "opencv_hal")
|
||||
ocv_add_dependencies(${the_module} opencv_hal)
|
||||
endif()
|
||||
|
||||
# add self to the world dependencies
|
||||
if((NOT DEFINED OPENCV_MODULE_IS_PART_OF_WORLD AND NOT OPENCV_MODULE_${the_module}_CLASS STREQUAL "BINDINGS"
|
||||
if((NOT DEFINED OPENCV_MODULE_IS_PART_OF_WORLD
|
||||
AND NOT OPENCV_MODULE_${the_module}_CLASS STREQUAL "BINDINGS"
|
||||
AND NOT OPENCV_PROCESSING_EXTRA_MODULES)
|
||||
OR OPENCV_MODULE_IS_PART_OF_WORLD
|
||||
)
|
||||
@@ -175,7 +199,13 @@ macro(ocv_add_module _name)
|
||||
set(OPENCV_MODULES_DISABLED_USER ${OPENCV_MODULES_DISABLED_USER} "${the_module}" CACHE INTERNAL "List of OpenCV modules explicitly disabled by user")
|
||||
endif()
|
||||
|
||||
# TODO: add submodules if any
|
||||
# add submodules if any
|
||||
set(OPENCV_MODULE_${the_module}_CHILDREN "${OPENCV_MODULE_CHILDREN}" CACHE INTERNAL "List of ${the_module} submodules")
|
||||
|
||||
# add reverse wrapper dependencies
|
||||
foreach (wrapper ${OPENCV_MODULE_${the_module}_WRAPPERS})
|
||||
ocv_add_dependencies(opencv_${wrapper} OPTIONAL ${the_module})
|
||||
endforeach()
|
||||
|
||||
# stop processing of current file
|
||||
return()
|
||||
@@ -302,27 +332,42 @@ endfunction()
|
||||
# sort modules by dependencies
|
||||
function(__ocv_sort_modules_by_deps __lst)
|
||||
ocv_list_sort(${__lst})
|
||||
set(${__lst}_ORDERED ${${__lst}} CACHE INTERNAL "")
|
||||
set(__result "")
|
||||
foreach (m ${${__lst}})
|
||||
list(LENGTH __result __lastindex)
|
||||
set(__index ${__lastindex})
|
||||
foreach (__d ${__result})
|
||||
set(__deps "${OPENCV_MODULE_${__d}_DEPS}")
|
||||
if(";${__deps};" MATCHES ";${m};")
|
||||
list(FIND __result "${__d}" __i)
|
||||
if(__i LESS "${__index}")
|
||||
set(__index "${__i}")
|
||||
set(input ${${__lst}})
|
||||
set(result "")
|
||||
while(input)
|
||||
list(LENGTH input length_before)
|
||||
foreach (m ${input})
|
||||
# check if module is in the result already
|
||||
if (NOT ";${result};" MATCHES ";${m};")
|
||||
# scan through module dependencies...
|
||||
set(unresolved_deps_found FALSE)
|
||||
foreach (d ${OPENCV_MODULE_${m}_CHILDREN} ${OPENCV_MODULE_${m}_DEPS})
|
||||
# ... which are not already in the result and are enabled
|
||||
if ((NOT ";${result};" MATCHES ";${d};") AND HAVE_${d})
|
||||
set(unresolved_deps_found TRUE)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
# chek if all dependencies for this module has been resolved
|
||||
if (NOT unresolved_deps_found)
|
||||
list(APPEND result ${m})
|
||||
list(REMOVE_ITEM input ${m})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
if(__index STREQUAL __lastindex)
|
||||
list(APPEND __result "${m}")
|
||||
else()
|
||||
list(INSERT __result ${__index} "${m}")
|
||||
list(LENGTH input length_after)
|
||||
# check for infinite loop or unresolved dependencies
|
||||
if (NOT length_after LESS length_before)
|
||||
message(WARNING "Unresolved dependencies or loop in dependency graph (${length_after})\n"
|
||||
"Processed ${__lst}: ${${__lst}}\n"
|
||||
"Good modules: ${result}\n"
|
||||
"Bad modules: ${input}"
|
||||
)
|
||||
list(APPEND result ${input})
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
set(${__lst} "${__result}" PARENT_SCOPE)
|
||||
endwhile()
|
||||
set(${__lst} "${result}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# resolve dependensies
|
||||
@@ -477,6 +522,18 @@ macro(ocv_include_modules)
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# same as previous but with dependencies
|
||||
macro(ocv_include_modules_recurse)
|
||||
ocv_include_modules(${ARGN})
|
||||
foreach(d ${ARGN})
|
||||
if(d MATCHES "^opencv_" AND HAVE_${d} AND DEFINED OPENCV_MODULE_${d}_DEPS)
|
||||
foreach (sub ${OPENCV_MODULE_${d}_DEPS})
|
||||
ocv_include_modules(${sub})
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# setup include paths for the list of passed modules
|
||||
macro(ocv_target_include_modules target)
|
||||
foreach(d ${ARGN})
|
||||
@@ -641,13 +698,43 @@ macro(_ocv_create_module)
|
||||
get_native_precompiled_header(${the_module} precomp.hpp)
|
||||
endif()
|
||||
|
||||
set(sub_objs "")
|
||||
set(sub_links "")
|
||||
set(cuda_objs "")
|
||||
if (OPENCV_MODULE_${the_module}_CHILDREN)
|
||||
status("Complex module ${the_module}")
|
||||
foreach (m ${OPENCV_MODULE_${the_module}_CHILDREN})
|
||||
if (BUILD_${m} AND TARGET ${m}_object)
|
||||
get_target_property(_sub_links ${m} LINK_LIBRARIES)
|
||||
list(APPEND sub_objs $<TARGET_OBJECTS:${m}_object>)
|
||||
list(APPEND sub_links ${_sub_links})
|
||||
status(" + ${m}")
|
||||
else()
|
||||
status(" - ${m}")
|
||||
endif()
|
||||
list(APPEND cuda_objs ${OPENCV_MODULE_${m}_CUDA_OBJECTS})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
ocv_add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}
|
||||
"${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp"
|
||||
${${the_module}_pch})
|
||||
if(NOT the_module STREQUAL opencv_ts)
|
||||
set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS OPENCV_NOSTL)
|
||||
${${the_module}_pch} ${sub_objs})
|
||||
|
||||
if (cuda_objs)
|
||||
target_link_libraries(${the_module} ${cuda_objs})
|
||||
endif()
|
||||
|
||||
# TODO: is it needed?
|
||||
if (sub_links)
|
||||
ocv_list_filterout(sub_links "^opencv_")
|
||||
ocv_list_unique(sub_links)
|
||||
target_link_libraries(${the_module} ${sub_links})
|
||||
endif()
|
||||
|
||||
unset(sub_objs)
|
||||
unset(sub_links)
|
||||
unset(cuda_objs)
|
||||
|
||||
ocv_target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK})
|
||||
ocv_target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK})
|
||||
ocv_target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
|
||||
@@ -682,6 +769,7 @@ macro(_ocv_create_module)
|
||||
|
||||
if((NOT DEFINED OPENCV_MODULE_TYPE AND BUILD_SHARED_LIBS)
|
||||
OR (DEFINED OPENCV_MODULE_TYPE AND OPENCV_MODULE_TYPE STREQUAL SHARED))
|
||||
set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS CVAPI_EXPORTS)
|
||||
set_target_properties(${the_module} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS)
|
||||
endif()
|
||||
|
||||
@@ -692,22 +780,42 @@ macro(_ocv_create_module)
|
||||
set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libc /DEBUG")
|
||||
endif()
|
||||
|
||||
ocv_install_target(${the_module} EXPORT OpenCVModules
|
||||
ocv_install_target(${the_module} EXPORT OpenCVModules OPTIONAL
|
||||
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
|
||||
)
|
||||
|
||||
# only "public" headers need to be installed
|
||||
if(OPENCV_MODULE_${the_module}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${the_module};")
|
||||
foreach(hdr ${OPENCV_MODULE_${the_module}_HEADERS})
|
||||
string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}")
|
||||
if(NOT hdr2 MATCHES "opencv2/${the_module}/private.*" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" )
|
||||
install(FILES ${hdr} DESTINATION "${OPENCV_INCLUDE_INSTALL_PATH}/${CMAKE_MATCH_1}" COMPONENT dev)
|
||||
endif()
|
||||
endforeach()
|
||||
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()
|
||||
|
||||
foreach(m ${OPENCV_MODULE_${the_module}_CHILDREN} ${the_module})
|
||||
# only "public" headers need to be installed
|
||||
if(OPENCV_MODULE_${m}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${m};")
|
||||
foreach(hdr ${OPENCV_MODULE_${m}_HEADERS})
|
||||
string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}")
|
||||
if(NOT hdr2 MATCHES "opencv2/${m}/private.*" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" )
|
||||
install(FILES ${hdr} OPTIONAL DESTINATION "${OPENCV_INCLUDE_INSTALL_PATH}/${CMAKE_MATCH_1}" COMPONENT dev)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
_ocv_add_precompiled_headers(${the_module})
|
||||
|
||||
if (TARGET ${the_module}_object)
|
||||
# copy COMPILE_DEFINITIONS
|
||||
get_target_property(main_defs ${the_module} COMPILE_DEFINITIONS)
|
||||
if (main_defs)
|
||||
set_target_properties(${the_module}_object PROPERTIES COMPILE_DEFINITIONS ${main_defs})
|
||||
endif()
|
||||
# use same PCH
|
||||
if (TARGET pch_Generate_${the_module})
|
||||
add_dependencies(${the_module}_object pch_Generate_${the_module} )
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# opencv precompiled headers macro (can add pch to modules and tests)
|
||||
@@ -731,7 +839,7 @@ endmacro()
|
||||
# short command for adding simple OpenCV module
|
||||
# see ocv_add_module for argument details
|
||||
# Usage:
|
||||
# ocv_define_module(module_name [INTERNAL] [EXCLUDE_CUDA] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
|
||||
# ocv_define_module(module_name [INTERNAL] [EXCLUDE_CUDA] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>] [WRAP <list of wrappers>])
|
||||
macro(ocv_define_module module_name)
|
||||
ocv_debug_message("ocv_define_module(" ${module_name} ${ARGN} ")")
|
||||
set(_argn ${ARGN})
|
||||
@@ -782,7 +890,7 @@ macro(__ocv_parse_test_sources tests_type)
|
||||
set(__file_group_sources "")
|
||||
elseif(arg STREQUAL "DEPENDS_ON")
|
||||
set(__currentvar "OPENCV_${tests_type}_${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}")
|
||||
@@ -803,7 +911,7 @@ function(ocv_add_perf_tests)
|
||||
__ocv_parse_test_sources(PERF ${ARGN})
|
||||
|
||||
# opencv_imgcodecs is required for imread/imwrite
|
||||
set(perf_deps ${the_module} opencv_ts opencv_imgcodecs ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
|
||||
set(perf_deps opencv_ts ${the_module} opencv_imgcodecs ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
|
||||
ocv_check_dependencies(${perf_deps})
|
||||
|
||||
if(OCV_DEPENDENCIES_FOUND)
|
||||
@@ -824,7 +932,7 @@ function(ocv_add_perf_tests)
|
||||
|
||||
ocv_add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch})
|
||||
ocv_target_include_modules(${the_target} ${perf_deps} "${perf_path}")
|
||||
ocv_target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${perf_deps} ${OPENCV_LINKER_LIBS})
|
||||
ocv_target_link_libraries(${the_target} ${perf_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS})
|
||||
add_dependencies(opencv_perf_tests ${the_target})
|
||||
|
||||
# Additional target properties
|
||||
@@ -859,7 +967,7 @@ function(ocv_add_accuracy_tests)
|
||||
__ocv_parse_test_sources(TEST ${ARGN})
|
||||
|
||||
# opencv_imgcodecs is required for imread/imwrite
|
||||
set(test_deps ${the_module} opencv_ts opencv_imgcodecs opencv_videoio ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
|
||||
set(test_deps opencv_ts ${the_module} opencv_imgcodecs opencv_videoio ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
|
||||
ocv_check_dependencies(${test_deps})
|
||||
if(OCV_DEPENDENCIES_FOUND)
|
||||
set(the_target "opencv_test_${name}")
|
||||
@@ -879,7 +987,7 @@ function(ocv_add_accuracy_tests)
|
||||
|
||||
ocv_add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch})
|
||||
ocv_target_include_modules(${the_target} ${test_deps} "${test_path}")
|
||||
ocv_target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
|
||||
ocv_target_link_libraries(${the_target} ${test_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS})
|
||||
add_dependencies(opencv_tests ${the_target})
|
||||
|
||||
# Additional target properties
|
||||
|
||||
+45
-31
@@ -57,54 +57,68 @@ 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_COMPONENT_tests_DEPENDS libs)
|
||||
set(CPACK_COMPONENT_LIBS_REQUIRED 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_COMPONENT_TESTS_DEPENDS libs)
|
||||
|
||||
if(HAVE_CUDA)
|
||||
string(REPLACE "." "-" cuda_version_suffix ${CUDA_VERSION})
|
||||
set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
|
||||
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}")
|
||||
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}")
|
||||
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}")
|
||||
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}")
|
||||
endif()
|
||||
endif()
|
||||
set(CPACK_COMPONENT_dev_DEPENDS libs)
|
||||
set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
|
||||
endif()
|
||||
|
||||
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_DESCRIPTION "Open Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_LIBS_NAME "lib${CMAKE_PROJECT_NAME}")
|
||||
|
||||
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_DESCRIPTION "Python bindings for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_PYTHON_NAME "lib${CMAKE_PROJECT_NAME}-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_DESCRIPTION "Java bindings for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_JAVA_NAME "lib${CMAKE_PROJECT_NAME}-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_DESCRIPTION "Development files for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_DEV_NAME "lib${CMAKE_PROJECT_NAME}-dev")
|
||||
|
||||
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_DESCRIPTION "Documentation for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_DOCS_NAME "lib${CMAKE_PROJECT_NAME}-docs")
|
||||
|
||||
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_DESCRIPTION "Samples for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_SAMPLES_NAME "lib${CMAKE_PROJECT_NAME}-samples")
|
||||
|
||||
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_DESCRIPTION "Accuracy and performance tests for Open Source Computer Vision Library")
|
||||
set(CPACK_DEBIAN_COMPONENT_TESTS_NAME "lib${CMAKE_PROJECT_NAME}-tests")
|
||||
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)
|
||||
|
||||
include(CPack)
|
||||
|
||||
ENDif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
+74
-27
@@ -276,12 +276,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()
|
||||
@@ -415,31 +415,6 @@ function(status text)
|
||||
endfunction()
|
||||
|
||||
|
||||
# splits cmake libraries list of format "general;item1;debug;item2;release;item3" to two lists
|
||||
macro(ocv_split_libs_list lst lstdbg lstopt)
|
||||
set(${lstdbg} "")
|
||||
set(${lstopt} "")
|
||||
set(perv_keyword "")
|
||||
foreach(word ${${lst}})
|
||||
if(word STREQUAL "debug" OR word STREQUAL "optimized")
|
||||
set(perv_keyword ${word})
|
||||
elseif(word STREQUAL "general")
|
||||
set(perv_keyword "")
|
||||
elseif(perv_keyword STREQUAL "debug")
|
||||
list(APPEND ${lstdbg} "${word}")
|
||||
set(perv_keyword "")
|
||||
elseif(perv_keyword STREQUAL "optimized")
|
||||
list(APPEND ${lstopt} "${word}")
|
||||
set(perv_keyword "")
|
||||
else()
|
||||
list(APPEND ${lstdbg} "${word}")
|
||||
list(APPEND ${lstopt} "${word}")
|
||||
set(perv_keyword "")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
|
||||
# remove all matching elements from the list
|
||||
macro(ocv_list_filterout lst regex)
|
||||
foreach(item ${${lst}})
|
||||
@@ -756,6 +731,9 @@ endfunction()
|
||||
function(_ocv_append_target_includes target)
|
||||
if(DEFINED OCV_TARGET_INCLUDE_DIRS_${target})
|
||||
target_include_directories(${target} PRIVATE ${OCV_TARGET_INCLUDE_DIRS_${target}})
|
||||
if (TARGET ${target}_object)
|
||||
target_include_directories(${target}_object PRIVATE ${OCV_TARGET_INCLUDE_DIRS_${target}})
|
||||
endif()
|
||||
unset(OCV_TARGET_INCLUDE_DIRS_${target} CACHE)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -780,8 +758,77 @@ function(ocv_add_library target)
|
||||
ocv_include_directories(${CUDA_INCLUDE_DIRS})
|
||||
ocv_cuda_compile(cuda_objs ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
||||
endif()
|
||||
set(OPENCV_MODULE_${target}_CUDA_OBJECTS ${cuda_objs} CACHE INTERNAL "Compiled CUDA object files")
|
||||
endif()
|
||||
|
||||
add_library(${target} ${ARGN} ${cuda_objs})
|
||||
|
||||
# Add OBJECT library (added in cmake 2.8.8) to use in compound modules
|
||||
if (NOT CMAKE_VERSION VERSION_LESS "2.8.8"
|
||||
AND NOT OPENCV_MODULE_${target}_CHILDREN
|
||||
AND NOT OPENCV_MODULE_${target}_CLASS STREQUAL "BINDINGS"
|
||||
AND NOT ${target} STREQUAL "opencv_ts"
|
||||
)
|
||||
set(sources ${ARGN})
|
||||
ocv_list_filterout(sources "\\\\.(cl|inc)$")
|
||||
add_library(${target}_object OBJECT ${sources})
|
||||
set_target_properties(${target}_object PROPERTIES
|
||||
EXCLUDE_FROM_ALL True
|
||||
EXCLUDE_FROM_DEFAULT_BUILD True
|
||||
POSITION_INDEPENDENT_CODE True
|
||||
)
|
||||
if (ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${target}_object PROPERTIES FOLDER "object_libraries")
|
||||
endif()
|
||||
unset(sources)
|
||||
endif()
|
||||
|
||||
_ocv_append_target_includes(${target})
|
||||
endfunction()
|
||||
|
||||
# build the list of opencv libs and dependencies for all modules
|
||||
# _modules - variable to hold list of all modules
|
||||
# _extra - variable to hold list of extra dependencies
|
||||
# _3rdparty - variable to hold list of prebuilt 3rdparty libraries
|
||||
macro(ocv_get_all_libs _modules _extra _3rdparty)
|
||||
set(${_modules} "")
|
||||
set(${_extra} "")
|
||||
set(${_3rdparty} "")
|
||||
foreach(m ${OPENCV_MODULES_PUBLIC})
|
||||
get_target_property(deps ${m} INTERFACE_LINK_LIBRARIES)
|
||||
if(NOT deps)
|
||||
set(deps "")
|
||||
endif()
|
||||
list(INSERT ${_modules} 0 ${deps} ${m})
|
||||
foreach (dep ${deps} ${OPENCV_LINKER_LIBS})
|
||||
if (NOT DEFINED OPENCV_MODULE_${dep}_LOCATION)
|
||||
if (TARGET ${dep})
|
||||
get_target_property(_output ${dep} ARCHIVE_OUTPUT_DIRECTORY)
|
||||
if ("${_output}" STREQUAL "${3P_LIBRARY_OUTPUT_PATH}")
|
||||
list(INSERT ${_3rdparty} 0 ${dep})
|
||||
else()
|
||||
list(INSERT ${_extra} 0 ${dep})
|
||||
endif()
|
||||
else()
|
||||
list(INSERT ${_extra} 0 ${dep})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
# ippicv specific handling
|
||||
list(FIND ${_extra} "ippicv" ippicv_idx)
|
||||
if (${ippicv_idx} GREATER -1)
|
||||
list(REMOVE_ITEM ${_extra} "ippicv")
|
||||
list(INSERT ${_3rdparty} 0 "ippicv")
|
||||
endif()
|
||||
|
||||
# split 3rdparty libs and modules
|
||||
list(REMOVE_ITEM ${_modules} ${${_3rdparty}} ${${_extra}})
|
||||
|
||||
# convert CMake lists to makefile literals
|
||||
foreach(lst ${_modules} ${_3rdparty} ${_extra})
|
||||
ocv_list_unique(${lst})
|
||||
ocv_list_reverse(${lst})
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#include <wrl/client.h>
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -28,6 +28,7 @@ ${nested_namespace_start}
|
||||
|
||||
set(STR_HPP "// This file is auto-generated. Do not edit!
|
||||
|
||||
#include \"opencv2/core/ocl.hpp\"
|
||||
#include \"opencv2/core/ocl_genbase.hpp\"
|
||||
#include \"opencv2/core/opencl/ocl_defs.hpp\"
|
||||
|
||||
|
||||
@@ -54,23 +54,6 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OPENCV_CAMERA_MODULES),on)
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi)
|
||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_CONFIGCMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_V7A_CONFIGCMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_X86_CONFIGCMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),mips)
|
||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_MIPS_CONFIGCMAKE@
|
||||
endif
|
||||
else
|
||||
OPENCV_CAMERA_MODULES:=
|
||||
endif
|
||||
|
||||
ifeq ($(OPENCV_LIB_TYPE),SHARED)
|
||||
OPENCV_LIB_SUFFIX:=so
|
||||
else
|
||||
@@ -92,20 +75,12 @@ define add_opencv_3rdparty_component
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
endef
|
||||
|
||||
define add_opencv_camera_module
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE:=$1
|
||||
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/lib$1.so
|
||||
include $(PREBUILT_SHARED_LIBRARY)
|
||||
endef
|
||||
|
||||
ifeq ($(OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED),)
|
||||
ifeq ($(OPENCV_INSTALL_MODULES),on)
|
||||
$(foreach module,$(OPENCV_LIBS),$(eval $(call add_opencv_module,$(module))))
|
||||
endif
|
||||
|
||||
$(foreach module,$(OPENCV_3RDPARTY_COMPONENTS),$(eval $(call add_opencv_3rdparty_component,$(module))))
|
||||
$(foreach module,$(OPENCV_CAMERA_MODULES),$(eval $(call add_opencv_camera_module,$(module))))
|
||||
|
||||
ifneq ($(OPENCV_BASEDIR),)
|
||||
OPENCV_LOCAL_C_INCLUDES += $(foreach mod, $(OPENCV_MODULES), $(OPENCV_BASEDIR)/modules/$(mod)/include)
|
||||
|
||||
@@ -34,13 +34,27 @@
|
||||
# - OpenCV_LIB_COMPONENTS : Present OpenCV modules list
|
||||
# - OpenCV_USE_MANGLED_PATHS : Mangled OpenCV path flag
|
||||
# - OpenCV_MODULES_SUFFIX : The suffix for OpenCVModules-XXX.cmake file
|
||||
# - OpenCV_HAVE_ANDROID_CAMERA : Presence of Android native camera wrappers
|
||||
#
|
||||
# Deprecated variables:
|
||||
# - OpenCV_VERSION_TWEAK : Always "0"
|
||||
#
|
||||
# ===================================================================================
|
||||
|
||||
# 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}")
|
||||
@@ -62,6 +76,13 @@ if("@USE_IPPICV@" STREQUAL "TRUE") # value is defined by package builder (use ST
|
||||
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()
|
||||
|
||||
@@ -105,9 +126,6 @@ if(NOT WIN32 OR ANDROID)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Presence of Android native camera wrappers
|
||||
set(OpenCV_HAVE_ANDROID_CAMERA @HAVE_opencv_androidcamera@)
|
||||
|
||||
# ======================================================
|
||||
# Include directories to add to the user project:
|
||||
# ======================================================
|
||||
@@ -122,8 +140,8 @@ set(OpenCV_INCLUDE_DIRS @OpenCV_INCLUDE_DIRS_CONFIGCMAKE@)
|
||||
# Provide the libs directories to the caller
|
||||
set(OpenCV_LIB_DIR_OPT @OpenCV_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where release OpenCV libraries are located")
|
||||
set(OpenCV_LIB_DIR_DBG @OpenCV_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where debug OpenCV libraries are located")
|
||||
set(OpenCV_3RDPARTY_LIB_DIR_OPT @OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where release 3rdpaty OpenCV dependencies are located")
|
||||
set(OpenCV_3RDPARTY_LIB_DIR_DBG @OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where debug 3rdpaty OpenCV dependencies are located")
|
||||
set(OpenCV_3RDPARTY_LIB_DIR_OPT @OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where release 3rdparty OpenCV dependencies are located")
|
||||
set(OpenCV_3RDPARTY_LIB_DIR_DBG @OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where debug 3rdparty OpenCV dependencies are located")
|
||||
mark_as_advanced(FORCE OpenCV_LIB_DIR_OPT OpenCV_LIB_DIR_DBG OpenCV_3RDPARTY_LIB_DIR_OPT OpenCV_3RDPARTY_LIB_DIR_DBG OpenCV_CONFIG_PATH)
|
||||
|
||||
# ======================================================
|
||||
@@ -255,7 +273,7 @@ foreach(__opttype OPT DBG)
|
||||
# CUDA
|
||||
if(OpenCV_CUDA_VERSION)
|
||||
if(NOT CUDA_FOUND)
|
||||
find_package(CUDA ${OpenCV_CUDA_VERSION} EXACT REQUIRED)
|
||||
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}")
|
||||
@@ -292,7 +310,9 @@ foreach(__opttype OPT DBG)
|
||||
set(OpenCV_CUDA_LIBS_RELPATH "")
|
||||
foreach(l ${OpenCV_CUDA_LIBS_ABSPATH})
|
||||
get_filename_component(_tmp ${l} PATH)
|
||||
list(APPEND OpenCV_CUDA_LIBS_RELPATH ${_tmp})
|
||||
if(NOT ${_tmp} MATCHES "-Wl.*")
|
||||
list(APPEND OpenCV_CUDA_LIBS_RELPATH ${_tmp})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list(REMOVE_DUPLICATES OpenCV_CUDA_LIBS_RELPATH)
|
||||
@@ -300,24 +320,6 @@ foreach(__opttype OPT DBG)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# ==============================================================
|
||||
# Android camera helper macro
|
||||
# ==============================================================
|
||||
if(OpenCV_HAVE_ANDROID_CAMERA)
|
||||
macro(COPY_NATIVE_CAMERA_LIBS target)
|
||||
get_target_property(target_location ${target} LOCATION)
|
||||
get_filename_component(target_location "${target_location}" PATH)
|
||||
file(GLOB camera_wrappers "${OpenCV_LIB_DIR_OPT}/libnative_camera_r*.so")
|
||||
foreach(wrapper ${camera_wrappers})
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${wrapper}" "${target_location}"
|
||||
)
|
||||
endforeach()
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
# ==============================================================
|
||||
# Compatibility stuff
|
||||
# ==============================================================
|
||||
@@ -371,6 +373,10 @@ macro(ocv_include_modules)
|
||||
include_directories(BEFORE "${OpenCV_INCLUDE_DIRS}")
|
||||
endmacro()
|
||||
|
||||
macro(ocv_include_modules_recurse)
|
||||
include_directories(BEFORE "${OpenCV_INCLUDE_DIRS}")
|
||||
endmacro()
|
||||
|
||||
macro(ocv_target_link_libraries)
|
||||
target_link_libraries(${ARGN})
|
||||
endmacro()
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
/* OpenCL Support */
|
||||
#cmakedefine HAVE_OPENCL
|
||||
#cmakedefine HAVE_OPENCL_STATIC
|
||||
#cmakedefine HAVE_OPENCL_SVM
|
||||
|
||||
/* OpenEXR codec */
|
||||
#cmakedefine HAVE_OPENEXR
|
||||
@@ -168,9 +169,6 @@
|
||||
/* Win32 UI */
|
||||
#cmakedefine HAVE_WIN32UI
|
||||
|
||||
/* Windows Runtime support */
|
||||
#cmakedefine HAVE_WINRT
|
||||
|
||||
/* XIMEA camera support */
|
||||
#cmakedefine HAVE_XIMEA
|
||||
|
||||
@@ -180,3 +178,6 @@
|
||||
/* Define if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#cmakedefine WORDS_BIGENDIAN
|
||||
|
||||
/* gPhoto2 library */
|
||||
#cmakedefine HAVE_GPHOTO2
|
||||
|
||||
@@ -9,5 +9,6 @@ includedir_new=@includedir@
|
||||
Name: OpenCV
|
||||
Description: Open Source Computer Vision Library
|
||||
Version: @OPENCV_VERSION_PLAIN@
|
||||
Libs: @OpenCV_LIB_COMPONENTS@
|
||||
Libs: @OPENCV_PC_LIBS@
|
||||
Libs.private: @OPENCV_PC_LIBS_PRIVATE@
|
||||
Cflags: -I${includedir_old} -I${includedir_new}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
|
||||
This file is auto-generated
|
||||
|
||||
-->
|
||||
|
||||
<descriptor>
|
||||
|
||||
<version>
|
||||
@OPENCV_ABI_VERSION@
|
||||
</version>
|
||||
|
||||
<headers>
|
||||
@OPENCV_ABI_HEADERS@
|
||||
</headers>
|
||||
|
||||
<libs>
|
||||
@OPENCV_ABI_LIBRARIES@
|
||||
</libs>
|
||||
|
||||
<skip_headers>
|
||||
opencv2/hal/intrin*
|
||||
opencv2/core/cuda*
|
||||
opencv2/core/private*
|
||||
opencv/cxeigen.hpp
|
||||
opencv2/core/eigen.hpp
|
||||
opencv2/flann/hdf5.h
|
||||
opencv2/imgcodecs/ios.h
|
||||
opencv2/videoio/cap_ios.h
|
||||
opencv2/ts.hpp
|
||||
opencv2/ts/*
|
||||
opencv2/xobjdetect/private.hpp
|
||||
@OPENCV_ABI_SKIP_HEADERS@
|
||||
</skip_headers>
|
||||
|
||||
<skip_libs>
|
||||
@OPENCV_ABI_SKIP_LIBRARIES@
|
||||
</skip_libs>
|
||||
|
||||
<gcc_options>
|
||||
@OPENCV_ABI_GCC_OPTIONS@
|
||||
</gcc_options>
|
||||
|
||||
</descriptor>
|
||||
@@ -1,25 +1,142 @@
|
||||
#!/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
|
||||
|
||||
# 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"`
|
||||
report="$test_name-`date --rfc-3339=date`.xml"
|
||||
|
||||
cmd="$t --perf_min_samples=1 --perf_force_samples=1 --gtest_output=xml:\"$report\""
|
||||
|
||||
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"
|
||||
$cmd | 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
|
||||
test_name=`basename "$t"`
|
||||
report="$test_name-`date --rfc-3339=date`.xml"
|
||||
|
||||
cmd="py.test --junitxml $report \"$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" | 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
|
||||
+4
-17
@@ -1,22 +1,9 @@
|
||||
file(GLOB HAAR_CASCADES haarcascades/*.xml)
|
||||
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)
|
||||
install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT libs)
|
||||
install(FILES ${LBP_CASCADES} DESTINATION share/OpenCV/lbpcascades COMPONENT libs)
|
||||
endif()
|
||||
install(FILES ${HAAR_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/haarcascades COMPONENT libs)
|
||||
install(FILES ${LBP_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/lbpcascades COMPONENT libs)
|
||||
|
||||
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)
|
||||
# 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
|
||||
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
DESTINATION share/OpenCV/testdata COMPONENT tests)
|
||||
endif()
|
||||
endif()
|
||||
install(DIRECTORY "${OPENCV_TEST_DATA_PATH}/" DESTINATION "${OPENCV_TEST_DATA_INSTALL_PATH}" COMPONENT "tests")
|
||||
endif()
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -139,8 +139,8 @@ Thanks to Martin Spengler, ETH Zurich, for providing the demo movie.
|
||||
<opencv_storage>
|
||||
<cascade type_id="opencv-cascade-classifier"><stageType>BOOST</stageType>
|
||||
<featureType>HAAR</featureType>
|
||||
<height>14</height>
|
||||
<width>28</width>
|
||||
<height>28</height>
|
||||
<width>14</width>
|
||||
<stageParams>
|
||||
<maxWeakCount>107</maxWeakCount></stageParams>
|
||||
<featureParams>
|
||||
|
||||
@@ -139,8 +139,8 @@ Thanks to Martin Spengler, ETH Zurich, for providing the demo movie.
|
||||
<opencv_storage>
|
||||
<cascade type_id="opencv-cascade-classifier"><stageType>BOOST</stageType>
|
||||
<featureType>HAAR</featureType>
|
||||
<height>19</height>
|
||||
<width>23</width>
|
||||
<height>23</height>
|
||||
<width>19</width>
|
||||
<stageParams>
|
||||
<maxWeakCount>89</maxWeakCount></stageParams>
|
||||
<featureParams>
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
<opencv_storage>
|
||||
<cascade type_id="opencv-cascade-classifier"><stageType>BOOST</stageType>
|
||||
<featureType>HAAR</featureType>
|
||||
<height>36</height>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
<width>36</width>
|
||||
<stageParams>
|
||||
<maxWeakCount>53</maxWeakCount></stageParams>
|
||||
<featureParams>
|
||||
|
||||
@@ -139,8 +139,8 @@ Thanks to Martin Spengler, ETH Zurich, for providing the demo movie.
|
||||
<opencv_storage>
|
||||
<cascade type_id="opencv-cascade-classifier"><stageType>BOOST</stageType>
|
||||
<featureType>HAAR</featureType>
|
||||
<height>22</height>
|
||||
<width>18</width>
|
||||
<height>18</height>
|
||||
<width>22</width>
|
||||
<stageParams>
|
||||
<maxWeakCount>152</maxWeakCount></stageParams>
|
||||
<featureParams>
|
||||
|
||||
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
+117
-150
@@ -2,7 +2,11 @@
|
||||
# CMake file for OpenCV docs
|
||||
#-----------------------
|
||||
|
||||
set(HAVE_DOC_GENERATOR BUILD_DOCS AND (HAVE_SPHINX OR HAVE_DOXYGEN))
|
||||
if(BUILD_DOCS AND DOXYGEN_FOUND)
|
||||
set(HAVE_DOC_GENERATOR TRUE)
|
||||
else()
|
||||
set(HAVE_DOC_GENERATOR FALSE)
|
||||
endif()
|
||||
|
||||
if(HAVE_DOC_GENERATOR)
|
||||
project(opencv_docs)
|
||||
@@ -23,168 +27,131 @@ if(HAVE_DOC_GENERATOR)
|
||||
set(FIXED_ORDER_MODULES core imgproc imgcodecs videoio highgui video calib3d features2d objdetect ml flann photo stitching)
|
||||
list(REMOVE_ITEM BASE_MODULES ${FIXED_ORDER_MODULES})
|
||||
set(BASE_MODULES ${FIXED_ORDER_MODULES} ${BASE_MODULES})
|
||||
|
||||
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 "")
|
||||
|
||||
function(ocv_doc_add_file_to_fake_root source destination)
|
||||
add_custom_command(
|
||||
OUTPUT "${DOC_FAKE_ROOT}/${destination}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy "${source}" "${DOC_FAKE_ROOT}/${destination}"
|
||||
DEPENDS "${source}"
|
||||
COMMENT "Copying ${destination} to fake root..."
|
||||
VERBATIM
|
||||
)
|
||||
list(APPEND DOC_FAKE_ROOT_FILES "${DOC_FAKE_ROOT}/${destination}")
|
||||
set(DOC_FAKE_ROOT_FILES "${DOC_FAKE_ROOT_FILES}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(ocv_doc_add_to_fake_root source)
|
||||
if(ARGC GREATER 1)
|
||||
set(destination "${ARGV1}")
|
||||
else()
|
||||
file(RELATIVE_PATH destination "${OpenCV_SOURCE_DIR}" "${source}")
|
||||
endif()
|
||||
|
||||
if(IS_DIRECTORY "${source}")
|
||||
file(GLOB_RECURSE files RELATIVE "${source}" "${source}/*")
|
||||
|
||||
foreach(file ${files})
|
||||
ocv_doc_add_file_to_fake_root("${source}/${file}" "${destination}/${file}")
|
||||
endforeach()
|
||||
else()
|
||||
ocv_doc_add_file_to_fake_root("${source}" "${destination}")
|
||||
endif()
|
||||
|
||||
set(DOC_FAKE_ROOT_FILES "${DOC_FAKE_ROOT_FILES}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
set(OPENCV_REFMAN_TOC "")
|
||||
|
||||
foreach(mod ${BASE_MODULES} ${EXTRA_MODULES})
|
||||
if(EXISTS "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/${mod}.rst")
|
||||
ocv_doc_add_to_fake_root("${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc" modules/${mod}/doc)
|
||||
set(OPENCV_REFMAN_TOC "${OPENCV_REFMAN_TOC} ${mod}/doc/${mod}.rst\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
configure_file("${OpenCV_SOURCE_DIR}/modules/refman.rst.in" "${DOC_FAKE_ROOT}/modules/refman.rst" @ONLY)
|
||||
|
||||
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/index.rst")
|
||||
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/doc")
|
||||
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/platforms/android")
|
||||
ocv_doc_add_to_fake_root("${OpenCV_SOURCE_DIR}/samples")
|
||||
|
||||
set(BUILD_PLANTUML "")
|
||||
if(PLANTUML)
|
||||
set(BUILD_PLANTUML "-tplantuml")
|
||||
endif()
|
||||
|
||||
if(PDFLATEX_COMPILER)
|
||||
add_custom_target(docs
|
||||
COMMAND ${SPHINX_BUILD} ${BUILD_PLANTUML} -b latex -c "${CMAKE_CURRENT_SOURCE_DIR}" "${DOC_FAKE_ROOT}" .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMAND ${PYTHON_DEFAULT_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/patch_refman_latex.py" opencv2refman.tex
|
||||
COMMAND ${PYTHON_DEFAULT_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/patch_refman_latex.py" opencv2manager.tex
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Generating opencv2refman.pdf"
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv2refman.tex
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv2refman.tex
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Generating opencv2manager.pdf"
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv2manager.tex
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv2manager.tex
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Generating opencv_user.pdf"
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv_user.tex
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv_user.tex
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Generating opencv_tutorials.pdf"
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv_tutorials.tex
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode opencv_tutorials.tex
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Generating opencv_cheatsheet.pdf"
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode "${CMAKE_CURRENT_SOURCE_DIR}/opencv_cheatsheet.tex"
|
||||
COMMAND ${PDFLATEX_COMPILER} -interaction=batchmode "${CMAKE_CURRENT_SOURCE_DIR}/opencv_cheatsheet.tex"
|
||||
DEPENDS ${DOC_FAKE_ROOT_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating the PDF Manuals"
|
||||
)
|
||||
|
||||
LIST(APPEND OPTIONAL_DOC_LIST "${CMAKE_BINARY_DIR}/doc/opencv2refman.pdf" "${CMAKE_BINARY_DIR}/doc/opencv2manager.pdf"
|
||||
"${CMAKE_BINARY_DIR}/doc/opencv_user.pdf" "${CMAKE_BINARY_DIR}/doc/opencv_tutorials.pdf" "${CMAKE_BINARY_DIR}/doc/opencv_cheatsheet.pdf")
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(docs PROPERTIES FOLDER "documentation")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_custom_target(html_docs
|
||||
COMMAND "${SPHINX_BUILD}" ${BUILD_PLANTUML} -b html -c "${CMAKE_CURRENT_SOURCE_DIR}" "${DOC_FAKE_ROOT}" ./_html
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS ${DOC_FAKE_ROOT_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating Online Documentation"
|
||||
)
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
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$")
|
||||
|
||||
if(BUILD_DOCS AND DOXYGEN_FOUND)
|
||||
# not documented modules list
|
||||
list(APPEND blacklist "ts" "java" "python2" "python3" "world" "contrib_world")
|
||||
|
||||
# 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})
|
||||
set(paths_include)
|
||||
set(paths_doc)
|
||||
set(paths_bib)
|
||||
set(paths_sample)
|
||||
set(paths_tutorial)
|
||||
set(refs_main)
|
||||
set(refs_extra)
|
||||
set(deps)
|
||||
foreach(m ${BASE_MODULES} ${EXTRA_MODULES})
|
||||
list(FIND blacklist ${m} _pos)
|
||||
if(${_pos} EQUAL -1)
|
||||
# include folder
|
||||
set(header_dir "${OPENCV_MODULE_opencv_${m}_LOCATION}/include")
|
||||
if(EXISTS "${header_dir}")
|
||||
list(APPEND paths_include "${header_dir}")
|
||||
list(APPEND deps ${header_dir})
|
||||
endif()
|
||||
# doc folder
|
||||
set(docs_dir "${OPENCV_MODULE_opencv_${m}_LOCATION}/doc")
|
||||
if(EXISTS "${docs_dir}")
|
||||
list(APPEND paths_doc "${docs_dir}")
|
||||
list(APPEND deps ${docs_dir})
|
||||
endif()
|
||||
# sample folder
|
||||
set(sample_dir "${OPENCV_MODULE_opencv_${m}_LOCATION}/samples")
|
||||
if(EXISTS "${sample_dir}")
|
||||
list(APPEND paths_sample "${sample_dir}")
|
||||
list(APPEND deps ${sample_dir})
|
||||
endif()
|
||||
# tutorial folder
|
||||
set(tutorial_dir "${OPENCV_MODULE_opencv_${m}_LOCATION}/tutorials")
|
||||
if(EXISTS "${tutorial_dir}")
|
||||
list(APPEND paths_tutorial "${tutorial_dir}")
|
||||
list(APPEND deps ${tutorial_dir})
|
||||
endif()
|
||||
# BiBTeX file
|
||||
set(bib_file "${docs_dir}/${m}.bib")
|
||||
if(EXISTS "${bib_file}")
|
||||
set(paths_bib "${paths_bib} ${bib_file}")
|
||||
list(APPEND deps ${bib_file})
|
||||
endif()
|
||||
# Reference entry
|
||||
# set(one_ref "@ref ${m} | ${m}\n")
|
||||
set(one_ref "\t- ${m}. @ref ${m}\n")
|
||||
list(FIND EXTRA_MODULES ${m} _pos)
|
||||
if(${_pos} EQUAL -1)
|
||||
set(refs_main "${refs_main}${one_ref}")
|
||||
else()
|
||||
set(refs_extra "${refs_extra}${one_ref}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# fix references
|
||||
# set(ref_header "Module name | Folder\n----------- | ------")
|
||||
# if(refs_main)
|
||||
# set(refs_main "### Main modules\n${ref_header}\n${refs_main}")
|
||||
# endif()
|
||||
# if(refs_extra)
|
||||
# set(refs_extra "### Extra modules\n${ref_header}\n${refs_extra}")
|
||||
# endif()
|
||||
if(refs_main)
|
||||
set(refs_main "- Main modules:\n${refs_main}")
|
||||
endif()
|
||||
if(refs_extra)
|
||||
set(refs_extra "- Extra modules:\n${refs_extra}")
|
||||
endif()
|
||||
|
||||
# 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(doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
|
||||
set(rootfile "${CMAKE_CURRENT_BINARY_DIR}/root.markdown")
|
||||
set(bibfile "${CMAKE_CURRENT_SOURCE_DIR}/opencv.bib")
|
||||
set(faqfile "${CMAKE_CURRENT_SOURCE_DIR}/faq.markdown")
|
||||
set(tutorial_path "${CMAKE_CURRENT_SOURCE_DIR}/tutorials")
|
||||
set(tutorial_py_path "${CMAKE_CURRENT_SOURCE_DIR}/py_tutorials")
|
||||
set(example_path "${CMAKE_SOURCE_DIR}/samples")
|
||||
|
||||
# set export variables
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_INPUT_LIST "${rootfile} ; ${faqfile} ; ${paths_include} ; ${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${paths_tutorial}")
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_IMAGE_PATH "${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${paths_tutorial}")
|
||||
# TODO: remove paths_doc from EXAMPLE_PATH after face module tutorials/samples moved to separate folders
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_EXAMPLE_PATH "${example_path} ; ${paths_doc} ; ${paths_sample}")
|
||||
set(CMAKE_DOXYGEN_LAYOUT "${CMAKE_CURRENT_SOURCE_DIR}/DoxygenLayout.xml")
|
||||
set(CMAKE_DOXYGEN_OUTPUT_PATH "doxygen")
|
||||
set(CMAKE_DOXYGEN_MAIN_REFERENCE "${refs_main}")
|
||||
set(CMAKE_DOXYGEN_EXTRA_REFERENCE "${refs_extra}")
|
||||
set(CMAKE_EXTRA_BIB_FILES "${bibfile} ${paths_bib}")
|
||||
if (CMAKE_DOXYGEN_GENERATE_QHP)
|
||||
set(CMAKE_DOXYGEN_GENERATE_QHP "YES")
|
||||
else()
|
||||
set(CMAKE_DOXYGEN_GENERATE_QHP "NO")
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_DOXYGEN_HTML_FILES "${CMAKE_CURRENT_SOURCE_DIR}/opencv.ico")
|
||||
list(APPEND CMAKE_DOXYGEN_HTML_FILES "${CMAKE_CURRENT_SOURCE_DIR}/pattern.png")
|
||||
list(APPEND CMAKE_DOXYGEN_HTML_FILES "${CMAKE_CURRENT_SOURCE_DIR}/acircles_pattern.png")
|
||||
list(APPEND CMAKE_DOXYGEN_HTML_FILES "${CMAKE_CURRENT_SOURCE_DIR}/bodybg.png")
|
||||
list(APPEND CMAKE_DOXYGEN_HTML_FILES "${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty")
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_HTML_FILES "${CMAKE_DOXYGEN_HTML_FILES}")
|
||||
|
||||
if(PLANTUML_JAR)
|
||||
set(CMAKE_DOXYGEN_PLANTUML_SUPPORT "PLANTUML_JAR_PATH = ${PLANTUML_JAR}\n")
|
||||
else()
|
||||
set(CMAKE_DOXYGEN_PLANTUML_SUPPORT "ALIASES += startuml{1}=\"@warning __No plantuml!__ \\n \\n @if DUMMY_PLANTUML_CODE\" enduml=\"@endif\"\n")
|
||||
endif()
|
||||
|
||||
# writing file
|
||||
set(doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
|
||||
configure_file(Doxyfile.in ${doxyfile} @ONLY)
|
||||
configure_file(root.markdown.in ${rootfile} @ONLY)
|
||||
|
||||
add_custom_target(doxygen
|
||||
COMMAND ${DOXYGEN_BUILD} ${doxyfile}
|
||||
DEPENDS ${doxyfile} ${all_headers} ${all_images})
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
|
||||
DEPENDS ${doxyfile} ${rootfile} ${bibfile} ${deps}
|
||||
)
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html
|
||||
DESTINATION "${OPENCV_DOC_INSTALL_PATH}"
|
||||
COMPONENT "docs" OPTIONAL
|
||||
)
|
||||
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(HAVE_DOC_GENERATOR)
|
||||
|
||||
+56
-39
@@ -21,8 +21,8 @@ ABBREVIATE_BRIEF = "The $name class" \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = NO
|
||||
STRIP_FROM_PATH =
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@/modules
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
@@ -39,7 +39,7 @@ OPTIMIZE_FOR_FORTRAN = NO
|
||||
OPTIMIZE_OUTPUT_VHDL = NO
|
||||
EXTENSION_MAPPING =
|
||||
MARKDOWN_SUPPORT = YES
|
||||
AUTOLINK_SUPPORT = NO
|
||||
AUTOLINK_SUPPORT = YES
|
||||
BUILTIN_STL_SUPPORT = YES
|
||||
CPP_CLI_SUPPORT = NO
|
||||
SIP_SUPPORT = NO
|
||||
@@ -53,7 +53,7 @@ LOOKUP_CACHE_SIZE = 0
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_PACKAGE = NO
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
EXTRACT_ANON_NSPACES = NO
|
||||
@@ -66,11 +66,11 @@ CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
SHOW_GROUPED_MEMB_INC = NO
|
||||
FORCE_LOCAL_INCLUDES = NO
|
||||
FORCE_LOCAL_INCLUDES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_MEMBERS_CTORS_1ST = NO
|
||||
SORT_BRIEF_DOCS = YES
|
||||
SORT_MEMBERS_CTORS_1ST = YES
|
||||
SORT_GROUP_NAMES = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
STRICT_PROTO_MATCHING = NO
|
||||
@@ -85,8 +85,8 @@ SHOW_FILES = YES
|
||||
SHOW_NAMESPACES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
LAYOUT_FILE = @CMAKE_DOXYGEN_LAYOUT@
|
||||
CITE_BIB_FILES =
|
||||
QUIET = NO
|
||||
CITE_BIB_FILES = @CMAKE_EXTRA_BIB_FILES@
|
||||
QUIET = YES
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
@@ -99,20 +99,17 @@ FILE_PATTERNS =
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXCLUDE_SYMBOLS = CV_WRAP \
|
||||
CV_EXPORTS \
|
||||
CV_EXPORTS_W \
|
||||
CV_WRAP_AS
|
||||
EXAMPLE_PATH =
|
||||
EXCLUDE_PATTERNS = *.inl.hpp *.impl.hpp *_detail.hpp */cudev/**/detail/*.hpp
|
||||
EXCLUDE_SYMBOLS = cv::DataType<*> int void
|
||||
EXAMPLE_PATH = @CMAKE_DOXYGEN_EXAMPLE_PATH@
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
EXAMPLE_RECURSIVE = YES
|
||||
IMAGE_PATH = @CMAKE_DOXYGEN_IMAGE_PATH@
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
FILTER_SOURCE_PATTERNS =
|
||||
USE_MDFILE_AS_MAINPAGE = @CMAKE_DOXYGEN_INDEX_MD@
|
||||
USE_MDFILE_AS_MAINPAGE =
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
@@ -122,17 +119,17 @@ REFERENCES_LINK_SOURCE = YES
|
||||
SOURCE_TOOLTIPS = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = NO
|
||||
ALPHABETICAL_INDEX = NO
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_HEADER = @CMAKE_CURRENT_SOURCE_DIR@/header.html
|
||||
HTML_FOOTER = @CMAKE_CURRENT_SOURCE_DIR@/footer.html
|
||||
HTML_STYLESHEET =
|
||||
HTML_EXTRA_STYLESHEET =
|
||||
HTML_EXTRA_FILES =
|
||||
HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/stylesheet.css
|
||||
HTML_EXTRA_FILES = @CMAKE_DOXYGEN_HTML_FILES@
|
||||
HTML_COLORSTYLE_HUE = 220
|
||||
HTML_COLORSTYLE_SAT = 100
|
||||
HTML_COLORSTYLE_GAMMA = 80
|
||||
@@ -151,28 +148,28 @@ 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
|
||||
GENERATE_QHP = @CMAKE_DOXYGEN_GENERATE_QHP@
|
||||
QCH_FILE = ../opencv-@OPENCV_VERSION@.qch
|
||||
QHP_NAMESPACE = org.itseez.opencv.@OPENCV_VERSION@
|
||||
QHP_VIRTUAL_FOLDER = opencv
|
||||
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
|
||||
DISABLE_INDEX = NO
|
||||
GENERATE_TREEVIEW = NO
|
||||
ENUM_VALUES_PER_LINE = 1
|
||||
TREEVIEW_WIDTH = 250
|
||||
EXT_LINKS_IN_WINDOW = YES
|
||||
FORMULA_FONTSIZE = 10
|
||||
FORMULA_FONTSIZE = 14
|
||||
FORMULA_TRANSPARENT = YES
|
||||
USE_MATHJAX = NO
|
||||
USE_MATHJAX = YES
|
||||
MATHJAX_FORMAT = HTML-CSS
|
||||
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
|
||||
MATHJAX_EXTENSIONS =
|
||||
MATHJAX_CODEFILE =
|
||||
MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
|
||||
MATHJAX_CODEFILE = @CMAKE_CURRENT_SOURCE_DIR@/mymath.js
|
||||
SEARCHENGINE = YES
|
||||
SERVER_BASED_SEARCH = NO
|
||||
EXTERNAL_SEARCH = NO
|
||||
@@ -180,13 +177,13 @@ SEARCHENGINE_URL =
|
||||
SEARCHDATA_FILE = searchdata.xml
|
||||
EXTERNAL_SEARCH_ID =
|
||||
EXTRA_SEARCH_MAPPINGS =
|
||||
GENERATE_LATEX = YES
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4
|
||||
EXTRA_PACKAGES =
|
||||
EXTRA_PACKAGES = mymath
|
||||
LATEX_HEADER =
|
||||
LATEX_FOOTER =
|
||||
LATEX_EXTRA_FILES =
|
||||
@@ -222,12 +219,31 @@ EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = CV_WRAP= \
|
||||
__cplusplus=1 \
|
||||
PREDEFINED = __cplusplus=1 \
|
||||
HAVE_IPP_A=1 \
|
||||
CVAPI(x)=x \
|
||||
CV_PROP_RW= \
|
||||
CV_DOXYGEN= \
|
||||
CV_EXPORTS= \
|
||||
CV_EXPORTS_W=
|
||||
CV_EXPORTS_W= \
|
||||
CV_EXPORTS_W_SIMPLE= \
|
||||
CV_EXPORTS_AS(x)= \
|
||||
CV_EXPORTS_W_MAP= \
|
||||
CV_IN_OUT= \
|
||||
CV_OUT= \
|
||||
CV_PROP= \
|
||||
CV_PROP_RW= \
|
||||
CV_WRAP= \
|
||||
CV_WRAP_AS(x)= \
|
||||
CV_CDECL= \
|
||||
CV_Func = \
|
||||
CV_DO_PRAGMA(x)= \
|
||||
CV_SUPPRESS_DEPRECATED_START= \
|
||||
CV_SUPPRESS_DEPRECATED_END= \
|
||||
CV_INLINE= \
|
||||
CV_NORETURN= \
|
||||
CV_DEFAULT(x)=" = x" \
|
||||
CV_NEON=1 \
|
||||
FLANN_DEPRECATED=
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
TAGFILES =
|
||||
@@ -269,3 +285,4 @@ DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
@CMAKE_DOXYGEN_PLANTUML_SUPPORT@
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<tab type="globals" visible="yes" title="Global objects" intro=""/>
|
||||
</tab>
|
||||
<tab type="examples" visible="yes" title="" intro=""/>
|
||||
<tab type="user" url="/3.0-last-rst" title="Sphinx Documentation"/>
|
||||
</navindex>
|
||||
|
||||
<!-- Layout definition for a class page -->
|
||||
|
||||
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
-227
@@ -1,227 +0,0 @@
|
||||
{#
|
||||
basic/layout.html
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Master layout template for Sphinx themes.
|
||||
|
||||
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- block doctype -%}
|
||||
<!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
|
||||
(sidebars != []) %}
|
||||
{%- set url_root = pathto('', 1) %}
|
||||
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
|
||||
<script type="text/javascript">
|
||||
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-33108845-1']);
|
||||
_gaq.push(['_setDomainName', 'opencv.org']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
|
||||
</script>
|
||||
{%- macro relbar() %}
|
||||
<div class="related">
|
||||
<h3>{{ _('Navigation') }}</h3>
|
||||
<ul>
|
||||
{%- for rellink in rellinks %}
|
||||
<li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
|
||||
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
|
||||
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
|
||||
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
|
||||
{%- endfor %}
|
||||
{%- block rootrellink %}
|
||||
<li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
|
||||
{%- endblock %}
|
||||
{%- for parent in parents %}
|
||||
<li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
|
||||
{%- endfor %}
|
||||
{%- block relbaritems %} {% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
|
||||
{%- macro sidebar() %}
|
||||
{%- if render_sidebar %}
|
||||
<div class="sphinxsidebar">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
{%- block sidebarlogo %}
|
||||
{%- if logo %}
|
||||
<p class="logo"><a href="{{ pathto(master_doc) }}">
|
||||
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
|
||||
</a></p>
|
||||
{%- endif %}
|
||||
{%- endblock %}
|
||||
{%- if sidebars == None %}
|
||||
{%- block sidebarsearch %}
|
||||
{%- include "searchbox.html" %}
|
||||
{%- endblock %}
|
||||
{%- endif %}
|
||||
{%- if sidebars != None %}
|
||||
{#- new style sidebar: explicitly include/exclude templates #}
|
||||
{%- for sidebartemplate in sidebars %}
|
||||
{%- include sidebartemplate %}
|
||||
{%- endfor %}
|
||||
{%- else %}
|
||||
{#- old style sidebars: using blocks -- should be deprecated #}
|
||||
{%- block sidebartoc %}
|
||||
{%- include "localtoc.html" %}
|
||||
{%- endblock %}
|
||||
{%- block sidebarrel %}
|
||||
{%- include "relations.html" %}
|
||||
{%- endblock %}
|
||||
{%- block sidebarsourcelink %}
|
||||
{%- include "sourcelink.html" %}
|
||||
{%- endblock %}
|
||||
{%- if customsidebar %}
|
||||
{%- include customsidebar %}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
</div>
|
||||
{%- endif %}
|
||||
{%- endmacro %}
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
|
||||
{{ metatags }}
|
||||
{%- if not embedded and docstitle %}
|
||||
{%- set titlesuffix = " — "|safe + docstitle|e %}
|
||||
{%- else %}
|
||||
{%- set titlesuffix = "" %}
|
||||
{%- endif %}
|
||||
{%- block htmltitle %}
|
||||
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
|
||||
{%- endblock %}
|
||||
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
|
||||
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
|
||||
{%- for cssfile in css_files %}
|
||||
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
|
||||
{%- endfor %}
|
||||
{%- if not embedded %}
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '{{ url_root }}',
|
||||
VERSION: '{{ release|e }}',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
|
||||
HAS_SOURCE: {{ has_source|lower }}
|
||||
};
|
||||
</script>
|
||||
{%- for scriptfile in script_files %}
|
||||
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
|
||||
{%- endfor %}
|
||||
{%- if use_opensearch %}
|
||||
<link rel="search" type="application/opensearchdescription+xml"
|
||||
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
|
||||
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
|
||||
{%- endif %}
|
||||
{%- if favicon %}
|
||||
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- block linktags %}
|
||||
{%- if hasdoc('about') %}
|
||||
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
|
||||
{%- endif %}
|
||||
{%- if hasdoc('genindex') %}
|
||||
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
|
||||
{%- endif %}
|
||||
{%- if hasdoc('search') %}
|
||||
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
|
||||
{%- endif %}
|
||||
{%- if hasdoc('copyright') %}
|
||||
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
|
||||
{%- endif %}
|
||||
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
|
||||
{%- if parents %}
|
||||
<link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" />
|
||||
{%- endif %}
|
||||
{%- if next %}
|
||||
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
|
||||
{%- endif %}
|
||||
{%- if prev %}
|
||||
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
|
||||
{%- endif %}
|
||||
{%- endblock %}
|
||||
{%- block extrahead %} {% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{%- block header %}{% endblock %}
|
||||
|
||||
{%- block relbar1 %}{{ relbar() }}{% endblock %}
|
||||
|
||||
{%- block content %}
|
||||
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
|
||||
|
||||
<div class="document">
|
||||
{% block document %}
|
||||
<div class="documentwrapper">
|
||||
{%- if not embedded %}{% if not theme_nosidebar|tobool %}
|
||||
<div class="bodywrapper">
|
||||
{%- endif %}{% endif %}
|
||||
<div class="body">
|
||||
{% block body %} {% endblock %}
|
||||
</div>
|
||||
<div class="feedback">
|
||||
<h2>Help and Feedback</h2>
|
||||
You did not find what you were looking for?
|
||||
<ul>
|
||||
{% if theme_lang == 'c' %}
|
||||
{% endif %}
|
||||
{% if theme_lang == 'cpp' %}
|
||||
<li>Try the <a href="http://docs.opencv.org/opencv_cheatsheet.pdf">Cheatsheet</a>.</li>
|
||||
{% endif %}
|
||||
{% if theme_lang == 'py' %}
|
||||
<li>Try the <a href="cookbook.html">Cookbook</a>.</li>
|
||||
{% endif %}
|
||||
<li>Ask a question on the <a href="http://answers.opencv.org">Q&A forum</a>.</li>
|
||||
<li>If you think something is missing or wrong in the documentation,
|
||||
please file a <a href="http://code.opencv.org">bug report</a>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
{%- if not embedded %}{% if not theme_nosidebar|tobool %}
|
||||
</div>
|
||||
{%- endif %}{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{%- block sidebar2 %}{{ sidebar() }}{% endblock %}
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
{%- endblock %}
|
||||
|
||||
{%- block relbar2 %}{{ relbar() }}{% endblock %}
|
||||
|
||||
{%- block footer %}
|
||||
<div class="footer">
|
||||
{%- if show_copyright %}
|
||||
{%- if hasdoc('copyright') %}
|
||||
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
|
||||
{%- else %}
|
||||
{% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- if last_updated %}
|
||||
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
|
||||
{%- endif %}
|
||||
{%- if show_sphinx %}
|
||||
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- endblock %}
|
||||
</body>
|
||||
</html>
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
{#
|
||||
basic/searchbox.html
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Sphinx sidebar template: quick search box.
|
||||
|
||||
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- if pagename != "search" %}
|
||||
<div id="searchbox" style="display: none">
|
||||
<form class="search" action="{{ pathto('search') }}" method="get">
|
||||
<input type="text" name="q" size="18" />
|
||||
<input type="submit" value="{{ _('Search') }}" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||||
{%- endif %}
|
||||
-390
@@ -1,390 +0,0 @@
|
||||
/**
|
||||
* Sphinx stylesheet -- default theme
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
@import url("basic.css");
|
||||
|
||||
/* -- page layout ----------------------------------------------------------- */
|
||||
|
||||
body {
|
||||
font-family: {{ theme_bodyfont }};
|
||||
font-size: 100%;
|
||||
background-color: {{ theme_footerbgcolor }};
|
||||
color: #000;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
img.logo {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
div.document {
|
||||
background-color: {{ theme_sidebarbgcolor }};
|
||||
}
|
||||
|
||||
div.documentwrapper {
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.bodywrapper {
|
||||
margin: 0 0 0 270px;
|
||||
}
|
||||
|
||||
div.body {
|
||||
background-color: {{ theme_bgcolor }};
|
||||
color: {{ theme_textcolor }};
|
||||
padding: 0 20px 30px 20px;
|
||||
}
|
||||
|
||||
div.feedback {
|
||||
background-color: {{ theme_feedbackbgcolor }};
|
||||
color: {{ theme_feedbacktextcolor }};
|
||||
padding: 20px 20px 30px 20px;
|
||||
}
|
||||
|
||||
div.feedback h2 {
|
||||
margin: 10px 0 10px 0;
|
||||
}
|
||||
|
||||
div.feedback a {
|
||||
color: {{ theme_feedbacklinkcolor }};
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
{%- if theme_rightsidebar|tobool %}
|
||||
div.bodywrapper {
|
||||
margin: 0 230px 0 0;
|
||||
}
|
||||
{%- endif %}
|
||||
|
||||
div.footer {
|
||||
color: {{ theme_footertextcolor }};
|
||||
width: 100%;
|
||||
padding: 9px 0 9px 0;
|
||||
text-align: center;
|
||||
font-size: 75%;
|
||||
}
|
||||
|
||||
div.footer a {
|
||||
color: {{ theme_footertextcolor }};
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
div.related {
|
||||
background-color: {{ theme_relbarbgcolor }};
|
||||
line-height: 30px;
|
||||
color: {{ theme_relbartextcolor }};
|
||||
}
|
||||
|
||||
div.related a {
|
||||
color: {{ theme_relbarlinkcolor }};
|
||||
}
|
||||
|
||||
div.sphinxsidebar {
|
||||
word-wrap: break-word;
|
||||
width: 270px;
|
||||
{%- if theme_stickysidebar|tobool %}
|
||||
top: 30px;
|
||||
margin: 0;
|
||||
position: fixed;
|
||||
overflow: auto;
|
||||
height: 100%;
|
||||
{%- endif %}
|
||||
{%- if theme_rightsidebar|tobool %}
|
||||
float: right;
|
||||
{%- if theme_stickysidebar|tobool %}
|
||||
right: 0;
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
}
|
||||
|
||||
{%- if theme_stickysidebar|tobool %}
|
||||
/* this is nice, but it it leads to hidden headings when jumping
|
||||
to an anchor */
|
||||
/*
|
||||
div.related {
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
div.documentwrapper {
|
||||
margin-top: 30px;
|
||||
}
|
||||
*/
|
||||
{%- endif %}
|
||||
|
||||
div.sphinxsidebar h3 {
|
||||
font-family: {{ theme_headfont }};
|
||||
color: {{ theme_sidebartextcolor }};
|
||||
font-size: 1.4em;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3 a {
|
||||
color: {{ theme_sidebartextcolor }};
|
||||
}
|
||||
|
||||
div.sphinxsidebar h4 {
|
||||
font-family: {{ theme_headfont }};
|
||||
color: {{ theme_sidebartextcolor }};
|
||||
font-size: 1.3em;
|
||||
font-weight: normal;
|
||||
margin: 5px 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar p {
|
||||
color: {{ theme_sidebartextcolor }};
|
||||
}
|
||||
|
||||
div.sphinxsidebar p.topless {
|
||||
margin: 5px 10px 10px 10px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul {
|
||||
margin: 10px 0 10px 10px;
|
||||
padding: 0;
|
||||
color: {{ theme_sidebartextcolor }};
|
||||
}
|
||||
|
||||
div.sphinxsidebar a {
|
||||
color: {{ theme_sidebarlinkcolor }};
|
||||
}
|
||||
|
||||
div.sphinxsidebar input {
|
||||
border: 1px solid {{ theme_sidebarlinkcolor }};
|
||||
font-family: sans-serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/* -- body styles ----------------------------------------------------------- */
|
||||
|
||||
a {
|
||||
color: {{ theme_linkcolor }};
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
div.body p, div.body dd, div.body li {
|
||||
text-align: justify;
|
||||
line-height: 130%;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
div.toctree-wrapper li, ul.simple li {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
div.body h1,
|
||||
div.body h2,
|
||||
div.body h3,
|
||||
div.body h4,
|
||||
div.body h5,
|
||||
div.body h6 {
|
||||
font-family: {{ theme_headfont }};
|
||||
background-color: {{ theme_headbgcolor }};
|
||||
font-weight: normal;
|
||||
color: {{ theme_headtextcolor }};
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin: 20px -20px 10px -20px;
|
||||
padding: 3px 0 3px 10px;
|
||||
}
|
||||
|
||||
a.toc-backref, a.toc-backref:hover {
|
||||
font-family: {{ theme_headfont }};
|
||||
background-color: {{ theme_headbgcolor }};
|
||||
font-weight: normal;
|
||||
color: {{ theme_headtextcolor }};
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div.body h1 { margin-top: 0; font-size: 200%; }
|
||||
div.body h2 { font-size: 160%; }
|
||||
div.body h3 { font-size: 140%; }
|
||||
div.body h4 { font-size: 120%; }
|
||||
div.body h5 { font-size: 110%; }
|
||||
div.body h6 { font-size: 100%; }
|
||||
|
||||
a.headerlink {
|
||||
color: {{ theme_headlinkcolor }};
|
||||
font-size: 0.8em;
|
||||
padding: 0 4px 0 4px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.headerlink:hover {
|
||||
background-color: {{ theme_headlinkcolor }};
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
div.body p, div.body dd, div.body li {
|
||||
text-align: justify;
|
||||
line-height: 130%;
|
||||
}
|
||||
|
||||
div.admonition p.admonition-title + p {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
div.note {
|
||||
background-color: #eee;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
div.seealso {
|
||||
background-color: #ffc;
|
||||
border: 1px solid #ff6;
|
||||
}
|
||||
|
||||
div.topic {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
div.warning {
|
||||
background-color: #ffe4e4;
|
||||
border: 1px solid #f66;
|
||||
}
|
||||
|
||||
p.admonition-title {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
p.admonition-title:after {
|
||||
content: ":";
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 5px;
|
||||
background-color: {{ theme_codebgcolor }};
|
||||
color: {{ theme_codetextcolor }};
|
||||
line-height: 120%;
|
||||
border: 1px solid #ace;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
tt {
|
||||
color: {{ theme_headtextcolor }};
|
||||
/*background-color: #ecf0f3;*/
|
||||
padding: 0 1px 0 1px;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
tt.descname {
|
||||
color: {{ theme_headtextcolor }};
|
||||
/*background-color: #ecf0f3;*/
|
||||
padding: 0 1px 0 1px;
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
div.math p {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
dl.function > dt:first-child {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
dl.cfunction > dt:first-child {
|
||||
margin-bottom: 7px;
|
||||
color: #8080B0;
|
||||
}
|
||||
|
||||
dl.cfunction > dt:first-child tt.descname
|
||||
{
|
||||
color: #8080B0;
|
||||
}
|
||||
|
||||
|
||||
dl.pyfunction > dt:first-child {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
dl.jfunction > dt:first-child {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
table.field-list {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/*ul.simple {
|
||||
list-style: none;
|
||||
}*/
|
||||
|
||||
em.menuselection, em.guilabel {
|
||||
font-family: {{ theme_guifont }};
|
||||
}
|
||||
|
||||
.enumeratevisibleitemswithsquare ul {
|
||||
list-style: square;
|
||||
margin-bottom: 0px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.enumeratevisibleitemswithsquare li {
|
||||
margin-bottom: 0.2em;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
|
||||
.enumeratevisibleitemswithsquare p {
|
||||
margin-bottom: 0pt;
|
||||
margin-top: 1pt;
|
||||
}
|
||||
|
||||
.enumeratevisibleitemswithsquare dl{
|
||||
margin-bottom: 0px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.toctableopencv
|
||||
{
|
||||
width: 100% ;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
|
||||
.toctableopencv colgroup col:first-child
|
||||
{
|
||||
width: 100pt !important;
|
||||
max-width: 100pt !important;
|
||||
min-width: 100pt !important;
|
||||
}
|
||||
|
||||
.toctableopencv colgroup col:nth-child(2)
|
||||
{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
div.body ul.search li {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.linenodiv {
|
||||
min-width: 1em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.sphinxsidebar #searchbox input[type="text"] {
|
||||
width:auto;
|
||||
}
|
||||
|
||||
div.sphinxsidebar #searchbox input[type="submit"] {
|
||||
width:auto;
|
||||
}
|
||||
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
[theme]
|
||||
inherit = basic
|
||||
stylesheet = default.css
|
||||
pygments_style = sphinx
|
||||
|
||||
[options]
|
||||
rightsidebar = false
|
||||
stickysidebar = false
|
||||
footerbgcolor = #004068
|
||||
footertextcolor = #ffffff
|
||||
sidebarbgcolor = #006090
|
||||
sidebartextcolor = #ffffff
|
||||
sidebarlinkcolor = #cceeff
|
||||
relbarbgcolor = #003048
|
||||
relbartextcolor = #ffffff
|
||||
relbarlinkcolor = #ffffff
|
||||
bgcolor = #ffffff
|
||||
textcolor = #000000
|
||||
headbgcolor = #f2f2f2
|
||||
headtextcolor = #003048
|
||||
headlinkcolor = #65a136
|
||||
linkcolor = #0090d9
|
||||
codebgcolor = #e0f5ff
|
||||
codetextcolor = #333333
|
||||
feedbackbgcolor = #004068
|
||||
feedbacktextcolor = #ffffff
|
||||
feedbacklinkcolor = #ffffff
|
||||
bodyfont = sans-serif
|
||||
headfont = 'Trebuchet MS', sans-serif
|
||||
guifont = "Lucida Sans","Lucida Sans Unicode","Lucida Grande",Verdana,Arial,Helvetica,sans-serif
|
||||
lang = none
|
||||
Vendored
-274
@@ -1,274 +0,0 @@
|
||||
{#
|
||||
basic/layout.html
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Master layout template for Sphinx themes.
|
||||
|
||||
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- block doctype -%}
|
||||
<!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
|
||||
(sidebars != []) %}
|
||||
{%- set url_root = pathto('', 1) %}
|
||||
{# XXX necessary? #}
|
||||
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
|
||||
{%- if not embedded and docstitle %}
|
||||
{%- set titlesuffix = " — "|safe + docstitle|e %}
|
||||
{%- else %}
|
||||
{%- set titlesuffix = "" %}
|
||||
{%- endif %}
|
||||
<script type="text/javascript">
|
||||
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-33108845-1']);
|
||||
_gaq.push(['_setDomainName', 'opencv.org']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
|
||||
</script>
|
||||
{%- macro relbar() %}
|
||||
<div class="related">
|
||||
<h3>{{ _('Navigation') }}</h3>
|
||||
<ul>
|
||||
{%- for rellink in rellinks %}
|
||||
<li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
|
||||
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
|
||||
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
|
||||
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
|
||||
{%- endfor %}
|
||||
{%- block rootrellink %}
|
||||
<li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
|
||||
{%- endblock %}
|
||||
{%- for parent in parents %}
|
||||
<li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
|
||||
{%- endfor %}
|
||||
{%- block relbaritems %} {% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
|
||||
{%- macro sidebar() %}
|
||||
{%- if render_sidebar %}
|
||||
<div class="sphinxsidebar">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
{%- block sidebarlogo %}
|
||||
{%- if logo %}
|
||||
<p class="logo"><a href="{{ pathto(master_doc) }}">
|
||||
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
|
||||
</a></p>
|
||||
{%- endif %}
|
||||
{%- endblock %}
|
||||
{%- if sidebars == None %}
|
||||
{%- block sidebarsearch %}
|
||||
{%- include "searchbox.html" %}
|
||||
{%- endblock %}
|
||||
{%- endif %}
|
||||
{%- if sidebars != None %}
|
||||
{#- new style sidebar: explicitly include/exclude templates #}
|
||||
{%- for sidebartemplate in sidebars %}
|
||||
{%- include sidebartemplate %}
|
||||
{%- endfor %}
|
||||
{%- else %}
|
||||
{#- old style sidebars: using blocks -- should be deprecated #}
|
||||
{%- block sidebartoc %}
|
||||
{%- include "localtoc.html" %}
|
||||
{%- endblock %}
|
||||
{%- block sidebarrel %}
|
||||
{%- include "relations.html" %}
|
||||
{%- endblock %}
|
||||
{%- if customsidebar %}
|
||||
{%- include customsidebar %}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
</div>
|
||||
{%- endif %}
|
||||
{%- endmacro %}
|
||||
|
||||
{%- macro script() %}
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '{{ url_root }}',
|
||||
VERSION: '{{ release|e }}',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
|
||||
HAS_SOURCE: {{ has_source|lower }}
|
||||
};
|
||||
</script>
|
||||
{%- for scriptfile in script_files %}
|
||||
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
|
||||
{%- endfor %}
|
||||
{%- endmacro %}
|
||||
|
||||
{%- macro css() %}
|
||||
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
|
||||
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
|
||||
{%- for cssfile in css_files %}
|
||||
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
|
||||
{%- endfor %}
|
||||
{%- endmacro %}
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
|
||||
{{ metatags }}
|
||||
{%- block htmltitle %}
|
||||
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
|
||||
{%- endblock %}
|
||||
{{ css() }}
|
||||
{%- if not embedded %}
|
||||
{{ script() }}
|
||||
{%- if use_opensearch %}
|
||||
<link rel="search" type="application/opensearchdescription+xml"
|
||||
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
|
||||
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
|
||||
{%- endif %}
|
||||
{%- if favicon %}
|
||||
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- block linktags %}
|
||||
{%- if hasdoc('about') %}
|
||||
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
|
||||
{%- endif %}
|
||||
{%- if hasdoc('genindex') %}
|
||||
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
|
||||
{%- endif %}
|
||||
{%- if hasdoc('search') %}
|
||||
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
|
||||
{%- endif %}
|
||||
{%- if hasdoc('copyright') %}
|
||||
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
|
||||
{%- endif %}
|
||||
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
|
||||
{%- if parents %}
|
||||
<link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" />
|
||||
{%- endif %}
|
||||
{%- if next %}
|
||||
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
|
||||
{%- endif %}
|
||||
{%- if prev %}
|
||||
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
|
||||
{%- endif %}
|
||||
{%- endblock %}
|
||||
{%- block extrahead %}
|
||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,700'
|
||||
rel='stylesheet' type='text/css' />
|
||||
{%- if not embedded %}
|
||||
<style type="text/css">
|
||||
table.right { float: right; margin-left: 20px; }
|
||||
table.right td { border: 1px solid #ccc; }
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
// intelligent scrolling of the sidebar content
|
||||
$(window).scroll(function() {
|
||||
var sb = $('.sphinxsidebarwrapper');
|
||||
var win = $(window);
|
||||
var sbh = sb.height();
|
||||
var offset = $('.sphinxsidebar').position()['top'];
|
||||
var wintop = win.scrollTop();
|
||||
var winbot = wintop + win.innerHeight();
|
||||
var curtop = sb.position()['top'];
|
||||
var curbot = curtop + sbh;
|
||||
// does sidebar fit in window?
|
||||
if (sbh < win.innerHeight()) {
|
||||
// yes: easy case -- always keep at the top
|
||||
sb.css('top', $u.min([$u.max([0, wintop - offset - 10]),
|
||||
$(document).height() - sbh - 200]));
|
||||
} else {
|
||||
// no: only scroll if top/bottom edge of sidebar is at
|
||||
// top/bottom edge of window
|
||||
if (curtop > wintop && curbot > winbot) {
|
||||
sb.css('top', $u.max([wintop - offset - 10, 0]));
|
||||
} else if (curtop < wintop && curbot < winbot) {
|
||||
sb.css('top', $u.min([winbot - sbh - offset - 20,
|
||||
$(document).height() - sbh - 200]));
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{%- endif %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
{%- block header %}{% endblock %}
|
||||
|
||||
{%- block relbar1 %}{{ relbar() }}{% endblock %}
|
||||
|
||||
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
|
||||
{%- block sidebar2 %}{{ sidebar() }}{% endblock %}
|
||||
<body>
|
||||
|
||||
{%- block content %}
|
||||
|
||||
<div class="document">
|
||||
{%- block document %}
|
||||
<div class="documentwrapper">
|
||||
{%- if render_sidebar %}
|
||||
<div class="bodywrapper">
|
||||
{%- endif %}
|
||||
<div class="body">
|
||||
{% block body %} {% endblock %}
|
||||
</div>
|
||||
<div class="feedback">
|
||||
<h2>Help and Feedback</h2>
|
||||
You did not find what you were looking for?
|
||||
<ul>
|
||||
{% if theme_lang == 'c' %}
|
||||
{% endif %}
|
||||
{% if theme_lang == 'cpp' %}
|
||||
<li>Try the <a href="http://docs.opencv.org/opencv_cheatsheet.pdf">Cheatsheet</a>.</li>
|
||||
{% endif %}
|
||||
{% if theme_lang == 'py' %}
|
||||
<li>Try the <a href="cookbook.html">Cookbook</a>.</li>
|
||||
{% endif %}
|
||||
<li>Ask a question on the <a href="http://answers.opencv.org">Q&A forum</a>.</li>
|
||||
<li>If you think something is missing or wrong in the documentation,
|
||||
please file a <a href="http://code.opencv.org">bug report</a>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
{%- if render_sidebar %}
|
||||
</div>
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- endblock %}
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
{%- endblock %}
|
||||
|
||||
{%- block relbar2 %}{{ relbar() }}{% endblock %}
|
||||
|
||||
{%- block footer %}
|
||||
<div class="footer">
|
||||
{%- if show_copyright %}
|
||||
{%- if hasdoc('copyright') %}
|
||||
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
|
||||
{%- else %}
|
||||
{% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- if last_updated %}
|
||||
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
|
||||
{%- endif %}
|
||||
{%- if show_sphinx %}
|
||||
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
|
||||
{%- endif %}
|
||||
{%- if show_source and has_source and sourcename %}
|
||||
<a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow">{{ _('Show this page source.') }}</a>
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- endblock %}
|
||||
</body>
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user