mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Compare commits
1722 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 59975db6a4 | |||
| ec2ff7f0c0 | |||
| 5d038686b1 | |||
| 6084901610 | |||
| e58c28974b | |||
| 1b4bd6a905 | |||
| 67fe57a0a3 | |||
| db0ae2ca50 | |||
| de164b0ccf | |||
| 194f1beae8 | |||
| 3bd6912e01 | |||
| 1a41ed2fda | |||
| 9d71c19939 | |||
| 5b73f3a316 | |||
| 96d747f030 | |||
| 5164c4ba31 | |||
| 13858cd561 | |||
| 772d9689e9 | |||
| ff3bb9f4e6 | |||
| e90b697cb0 | |||
| 70bc268c1a | |||
| b6d8c9d990 | |||
| a7ce9a176b | |||
| 52ba3778e3 | |||
| c7b6353a3c | |||
| 34b3d31f54 | |||
| 6f139b4f8e | |||
| 86a725933a | |||
| 64f02aa72d | |||
| 12a8f5486d | |||
| 97ac59cb73 | |||
| 762965897a | |||
| ea3746bd15 | |||
| ef2a376baf | |||
| dc8bb23a7d | |||
| 24361733e4 | |||
| b5fbb2b1c8 | |||
| b8ce65bec8 | |||
| 96903dc4ad | |||
| da669569e1 | |||
| eb40afa26a | |||
| 421fcf9e35 | |||
| d142c05d61 | |||
| 9a5d7f1a0b | |||
| 9d49cef29e | |||
| 1fbc6ab05d | |||
| 93c4dfb16d | |||
| 52b9207105 | |||
| d2e451e877 | |||
| 00e91fd3d0 | |||
| afc62f076a | |||
| 9c4204b89e | |||
| 3afb5a6006 | |||
| 7e44faf635 | |||
| 8cfc87cf01 | |||
| ea049e147d | |||
| 60f73eee7e | |||
| c1f3c41bab | |||
| d29eb2938c | |||
| a61b19b524 | |||
| 25b4d8a1b5 | |||
| aaa30dc5b6 | |||
| e0f426f78b | |||
| 8a09d95eab | |||
| 068769263e | |||
| 21e9edd1a3 | |||
| 544824ffc1 | |||
| d6e2097435 | |||
| cf43790a27 | |||
| 69eaa89e22 | |||
| e835878661 | |||
| 912592de4c | |||
| 85793d0138 | |||
| a57b03c356 | |||
| 5a5378b3bf | |||
| f01f1bc5e6 | |||
| 85c7190e41 | |||
| f2e4bec925 | |||
| 4a8d1147c2 | |||
| bb1c2d71a8 | |||
| be565c2235 | |||
| 389f176a67 | |||
| 5c21ca2697 | |||
| 4f5d585184 | |||
| c01fd16291 | |||
| 537d1322b4 | |||
| 8a803865cf | |||
| 6e22020dad | |||
| f91ada572a | |||
| f7c8f74ac1 | |||
| c4e80952ce | |||
| 178ed63e1a | |||
| 46edb54ac3 | |||
| 7cb78451d1 | |||
| 2897da037e | |||
| 4fa14f75b8 | |||
| 0886f6fe62 | |||
| 681df84036 | |||
| 07a58c47cb | |||
| 53ed1a8c03 | |||
| 4d598719da | |||
| 130d4b1bdf | |||
| 42001234ab | |||
| 6e885e5775 | |||
| 5c0cdd4d2d | |||
| 969f0c4456 | |||
| 739d7caa32 | |||
| 6148c3525e | |||
| df55aaec1e | |||
| eebd4cad66 | |||
| 0050df8750 | |||
| 01b5971c94 | |||
| 8d3850ac02 | |||
| 1862d1995f | |||
| fc1694c97c | |||
| 2799829bc9 | |||
| d5e6503fe5 | |||
| 6441620f45 | |||
| 0f288d1082 | |||
| 82c1c68560 | |||
| 780b713016 | |||
| 1b6dd03fd7 | |||
| 28974e7290 | |||
| ffb9e877e9 | |||
| 1e879e1ab1 | |||
| 57829d81ea | |||
| a20a273982 | |||
| e9b31a70bf | |||
| a1532582a6 | |||
| 68bcff26fb | |||
| 433bc81b30 | |||
| c8bf176558 | |||
| cfd5caf29d | |||
| f461d0cb7a | |||
| 09b0193186 | |||
| 252feb4774 | |||
| 537a978dcf | |||
| 33dc41056f | |||
| b6e8a47fca | |||
| ed0065266e | |||
| c21ed69731 | |||
| 03e7b71707 | |||
| e06c696b3c | |||
| 40ce9f97d6 | |||
| 0bc44376a5 | |||
| fdf549b921 | |||
| 021ff0efa6 | |||
| 1e869c5e49 | |||
| f49936a849 | |||
| 4552ca98c4 | |||
| 9e2395e7e0 | |||
| 05945bf00e | |||
| 9d78a1ea9f | |||
| 8e40becab1 | |||
| 60eda6f25c | |||
| 2e78a3e5e9 | |||
| 966d35a9fb | |||
| 42447a7610 | |||
| ca50969c2b | |||
| 2d3e170370 | |||
| 8a37fc8223 | |||
| a5c20f8592 | |||
| 96a2edb375 | |||
| 15b313ce4b | |||
| 1ea6568951 | |||
| 56654ae360 | |||
| 9a3e53e738 | |||
| 2243bfa181 | |||
| 33cd7f38a8 | |||
| 2fc0ce5c24 | |||
| c5d009d6c4 | |||
| 7d28541bbe | |||
| 95d6002f16 | |||
| e245aed6bb | |||
| 497d92e7d1 | |||
| 1cb0dfa669 | |||
| 4dc2313527 | |||
| 938d42a89f | |||
| 937a096bf1 | |||
| 78a566611d | |||
| 73240b736b | |||
| bf41e791ff | |||
| bac151675a | |||
| 341e7b3be2 | |||
| 98c26d95e5 | |||
| bba8c0beac | |||
| bd34f6dd98 | |||
| 55a9fdf051 | |||
| d16fb30512 | |||
| 8b23d1ec64 | |||
| ff00220302 | |||
| 8ed25ad75f | |||
| 408107ce6d | |||
| 3558da9ab7 | |||
| 9d24b3c3b0 | |||
| 779dad12fb | |||
| 297a92cd94 | |||
| 0d5b739d35 | |||
| ec5244a73a | |||
| 454e5e5fa4 | |||
| bb9bd3132a | |||
| e539a9632d | |||
| 406cfc48c9 | |||
| 59082c8ee8 | |||
| cb1dc7cb6e | |||
| 58a11ac079 | |||
| 69d84c8f3e | |||
| 79ab6567ee | |||
| 60a689d27c | |||
| 5df2713b16 | |||
| 134a3f165d | |||
| 4a68cc1675 | |||
| f838a832b2 | |||
| 6f2fb383e6 | |||
| e1b0d341e4 | |||
| 08ad3b500b | |||
| 56f17e4921 | |||
| 293ea03dcc | |||
| bef1b5322e | |||
| e6f3f3c029 | |||
| 7746d9b7cc | |||
| 3494d640df | |||
| c22cc67ba8 | |||
| 558054a53d | |||
| c7b471f10f | |||
| f4ffcae8d9 | |||
| 0422054aa1 | |||
| a81f0a5123 | |||
| c36582d2df | |||
| d50c07e303 | |||
| 54693b3fa7 | |||
| 3c3bc123fc | |||
| ac33cd688c | |||
| b5e42d8cc1 | |||
| 7e4e8921bc | |||
| 6dcd455ac4 | |||
| 1d58e1a14a | |||
| d122510c4f | |||
| 6613d14261 | |||
| a14e524b32 | |||
| 226ff93917 | |||
| d28e6c9b36 | |||
| c16f465ff5 | |||
| 3231c2f995 | |||
| 16bcc30e42 | |||
| 69c50e0181 | |||
| 486c40f578 | |||
| 08e38e9ff9 | |||
| ba3b902da7 | |||
| bf94e6a91c | |||
| ecc53dd7a4 | |||
| fc0e0239b8 | |||
| 7825cbeb7d | |||
| d38fee7599 | |||
| fb4b4cbf58 | |||
| b23e536894 | |||
| 8b33c6fa8f | |||
| 1c3d83df54 | |||
| b29cde552a | |||
| 3ef067cc65 | |||
| f903192c17 | |||
| e2a9df408f | |||
| cba401fe53 | |||
| f3af90c6c7 | |||
| 036c3b4e6d | |||
| 9df5400200 | |||
| 6fefc53e56 | |||
| 76235cbb70 | |||
| 9d006f6a1d | |||
| 6a05939e1c | |||
| 7b1eb3af7b | |||
| 3934d61de7 | |||
| a98ee0d3b2 | |||
| 73a8e65cbd | |||
| ae0d428b62 | |||
| 32d7c1950a | |||
| 5603617b7c | |||
| 43aae3fee8 | |||
| a7a4a2ae30 | |||
| 1b8c2589c0 | |||
| 887736bcd4 | |||
| 5b1967f80c | |||
| 3a1bb93340 | |||
| dfb49097e3 | |||
| d7bb1025f3 | |||
| dc441f50cd | |||
| be499b42d9 | |||
| 74f5eaf70c | |||
| 7ddc0bdd37 | |||
| 94cf5430d0 | |||
| 4ab2771957 | |||
| bef2b27155 | |||
| 702afcd760 | |||
| 9734abdc1a | |||
| 3b97549bb1 | |||
| fc0b997064 | |||
| 4722b2d0e5 | |||
| f100cdb6d4 | |||
| a00b37d209 | |||
| b757359ff8 | |||
| 3172e6d54b | |||
| 75fcedf0ed | |||
| c19ed39a78 | |||
| 793bdaada7 | |||
| dbd7912b88 | |||
| 370d1ff21a | |||
| 47cee8715b | |||
| b70e27e076 | |||
| d1b882ddcf | |||
| b2489d31d6 | |||
| 7719da9552 | |||
| 8d264d9f64 | |||
| 855765986e | |||
| d0210f510e | |||
| 34aa4e4578 | |||
| 447b8bf58a | |||
| e9539061db | |||
| 98078c231e | |||
| 1d92a73a55 | |||
| ba7bf1ef68 | |||
| 5a53f41622 | |||
| 80844fd554 | |||
| 5262371660 | |||
| a96a6bf149 | |||
| b7c9aaa471 | |||
| 1245cd1752 | |||
| 1f5fd865aa | |||
| 9a3dccab20 | |||
| ac6ca660f4 | |||
| 6f47c26acf | |||
| 945663bc9b | |||
| 0263b49298 | |||
| c2f59a0f73 | |||
| 9eda260495 | |||
| 3ed54b9008 | |||
| 6b954cd24e | |||
| 42ba5c7d16 | |||
| 72ddeea479 | |||
| 869dda4117 | |||
| 07de67c32f | |||
| c467d0d553 | |||
| 0906744788 | |||
| 67158b12cd | |||
| 9e50cf5375 | |||
| 4bf82e50d0 | |||
| 2e86d46cf2 | |||
| 707d10f115 | |||
| 83a4ad5f51 | |||
| e7b82a8561 | |||
| 546e68dc65 | |||
| b7c2a46830 | |||
| 719099ad6d | |||
| 2e9004813e | |||
| 50842b9036 | |||
| 3d6413cfc6 | |||
| 799622affd | |||
| 57ab0d4d17 | |||
| 02f8b85dd9 | |||
| 1fbdca0c9b | |||
| 9eaac6105f | |||
| 83ace8d580 | |||
| 851ce27240 | |||
| 70f8d807c8 | |||
| daa21a4385 | |||
| 13cef0cdfc | |||
| 083aced3b4 | |||
| 72ec9c159e | |||
| 5b00d9da49 | |||
| 74bb0beeb0 | |||
| 08714c510f | |||
| acfbed8654 | |||
| 6212084046 | |||
| d89b6226a3 | |||
| 11d1909e6b | |||
| 3c6fe75149 | |||
| 00d9f690f6 | |||
| ae79fe10dc | |||
| 62fc342d35 | |||
| 36924d6dbb | |||
| ede4943d7e | |||
| 9d148c76ca | |||
| 21d8b588a2 | |||
| 5d66b1130b | |||
| 0550b2c1fe | |||
| d58d277707 | |||
| 95eed59f2d | |||
| 62bc647731 | |||
| 7f63776395 | |||
| b9792fdc14 | |||
| 0410fe6978 | |||
| 242e64c08d | |||
| cc94b393c5 | |||
| 58dd70e8dc | |||
| 53ff537f1c | |||
| a5814871d9 | |||
| 1aa03cecf1 | |||
| f10537cdd6 | |||
| 9d294cbcf5 | |||
| f1bec940b1 | |||
| dd93d48be4 | |||
| ad3123adfd | |||
| f939d80f4c | |||
| ee316758ca | |||
| 6d7a61cbdc | |||
| b44b1ab47b | |||
| 2e47a1a61b | |||
| 72685cf01c | |||
| 612888c066 | |||
| e7b55f4982 | |||
| 3004f5fa30 | |||
| 9682d2afff | |||
| 87d655325c | |||
| db25e44a17 | |||
| b7a9e672c5 | |||
| 8e49ab1d3b | |||
| 00c36e88ef | |||
| cde697dd14 | |||
| e49e75da06 | |||
| 1d40946959 | |||
| 2598392295 | |||
| 17cc5e2c40 | |||
| 4b14400976 | |||
| 4704a254f7 | |||
| 7708e9882e | |||
| fe1bd0cc2f | |||
| a752f25944 | |||
| bb44316028 | |||
| 0b2cfcfda2 | |||
| 9c02caf392 | |||
| d87c30dc84 | |||
| 63d6cc5ca6 | |||
| 9682430a69 | |||
| b69ffe6376 | |||
| 1f72815637 | |||
| 90c3d7d361 | |||
| f4eebc46b2 | |||
| 2b1103c1d3 | |||
| 007a3ef8b6 | |||
| 83eb1d3608 | |||
| 5c12c92243 | |||
| 9e29762838 | |||
| da229cce9a | |||
| 36af97d00c | |||
| d705c651f2 | |||
| 08848c56b7 | |||
| ebe979090e | |||
| 901d4995e3 | |||
| aad95c7d8c | |||
| d9b7b300b4 | |||
| 044de4105e | |||
| 7a5aa06b9e | |||
| a21fb63c28 | |||
| eaa9b78121 | |||
| fd4df0f67d | |||
| 6decc2596d | |||
| 41b920344d | |||
| 82668e06d4 | |||
| a81374c1d7 | |||
| 66fc6126d2 | |||
| 8b58b59df4 | |||
| f0595b8254 | |||
| 1e01441767 | |||
| c797746b6e | |||
| 1bf4427a5c | |||
| ac3ec0d96d | |||
| 5c6c537044 | |||
| f8c82fc214 | |||
| 40b762bceb | |||
| 89e3c508d8 | |||
| cbdddb473c | |||
| b4c2891ef3 | |||
| 1325213303 | |||
| fb15bdfb21 | |||
| 9d2d173485 | |||
| 26e3bcb9de | |||
| 960dee8ab8 | |||
| 847976de4e | |||
| ceec0eb33a | |||
| 4840c4ae6f | |||
| 02e29fc99c | |||
| 7ce116695d | |||
| c879b1ab09 | |||
| a984da911b | |||
| df55be3c3d | |||
| 55339de684 | |||
| f08dd510fa | |||
| de8d8720a2 | |||
| d308ed3712 | |||
| 6d0f8aa893 | |||
| bea98bd22a | |||
| 4539607ab1 | |||
| b320138dba | |||
| 95ea12588e | |||
| bcd08b5d18 | |||
| 19298ae3cb | |||
| 5e06da3050 | |||
| 17ac18a7b9 | |||
| c259590b26 | |||
| 3f3ca85103 | |||
| 05ddc16eaa | |||
| 2ba77614aa | |||
| ef347aa6a4 | |||
| b1cdb91139 | |||
| a09ad35d98 | |||
| 1b5835cd35 | |||
| 9932bbad3a | |||
| 39ac84ff04 | |||
| fcbefaff86 | |||
| bf2256fb89 | |||
| b0b2fc9e3f | |||
| 1ccd64e102 | |||
| 23bf3e337a | |||
| 3cf265992f | |||
| a855d230ec | |||
| 6a6619ec1e | |||
| 8c2bde2af4 | |||
| d22516872c | |||
| 17608f7ade | |||
| 81ebe28c24 | |||
| f7792f0be2 | |||
| 27302c367c | |||
| a153948a19 | |||
| 4273534c92 | |||
| 7274e2ff1a | |||
| 0e8bfff386 | |||
| 8c55d7be5e | |||
| f6de017171 | |||
| cc63452f65 | |||
| eeae81e903 | |||
| e30139edc3 | |||
| f01b2413c3 | |||
| 772fcf4088 | |||
| b8c00854fe | |||
| ba0a8dc723 | |||
| 100c2dd91c | |||
| 58c9135626 | |||
| 6e121b2e29 | |||
| e6619cf580 | |||
| 122b9f8e17 | |||
| d948b2a235 | |||
| ebd7d08408 | |||
| 140051b18c | |||
| b7276359e9 | |||
| 83d6d70a56 | |||
| a9d4e05346 | |||
| e5e6367223 | |||
| 5678ba1227 | |||
| b01f067614 | |||
| 65b0ecfec5 | |||
| d1902a1276 | |||
| 56cae1b293 | |||
| 7c740b6a31 | |||
| d430664791 | |||
| d057828ee3 | |||
| c9bb18b9f7 | |||
| 297e2b6f1a | |||
| 3853a18e0e | |||
| 226b4e3ed5 | |||
| 756c1a22d9 | |||
| a7bf1d53d8 | |||
| 7711cd284b | |||
| 8755ffbf31 | |||
| 69344f175b | |||
| d14a1de947 | |||
| 514b3b520c | |||
| 4a6b1805e0 | |||
| 4ab525c880 | |||
| 7d665a4754 | |||
| f7d52c774e | |||
| 8efdfd9dfc | |||
| cd42e38013 | |||
| 339e6aa782 | |||
| 309eb3c122 | |||
| 2594e5e384 | |||
| 3a7ea37090 | |||
| 9f0cd9ee10 | |||
| 13694c8ae8 | |||
| dde7c22fad | |||
| 29e7eb7719 | |||
| 3419c704a9 | |||
| cdbb661eab | |||
| afdf319f36 | |||
| 488babf3b3 | |||
| 2c57717ca2 | |||
| e9b4813bb2 | |||
| 9185b62a1d | |||
| ac8045b9c6 | |||
| 417f1e51a4 | |||
| b595812bd0 | |||
| 0172bd6beb | |||
| e02d6e2c8f | |||
| 7458dfc082 | |||
| bed8cb42be | |||
| c849492dfa | |||
| 4f5d30a865 | |||
| 2c0ef660bf | |||
| 21bbed7baf | |||
| 1e95c964f3 | |||
| 2c9547e314 | |||
| f73a97b53b | |||
| 387a0f26fb | |||
| c147ab1e85 | |||
| a5b293b412 | |||
| 7d4cbbd7aa | |||
| b7be49426d | |||
| 96d7bcc2a9 | |||
| 2d2ecbf3ee | |||
| e03136e951 | |||
| 1c6e9fdfae | |||
| d56dd0e091 | |||
| baabd95f30 | |||
| 877058aaed | |||
| 42b1c6440c | |||
| 35a89b1541 | |||
| 8ae6402799 | |||
| 720fd144ef | |||
| 0832b47d21 | |||
| dcc569ee5c | |||
| 0cbe2f2eab | |||
| 3df13ff564 | |||
| c2944dbc0c | |||
| c059f7ddcd | |||
| cf54e3b97e | |||
| 6d52ea8984 | |||
| b8c60234c3 | |||
| 2136c3f3c8 | |||
| a46166d30f | |||
| 85fd599939 | |||
| f3210b58a1 | |||
| d34a52042e | |||
| 99ae48f0b4 | |||
| 96e5300fdd | |||
| 4f621de849 | |||
| 3649a1a179 | |||
| 352485fc54 | |||
| c1e3ca170e | |||
| 9665e08bac | |||
| 65e4df751c | |||
| 4e8aac5308 | |||
| a649aea82a | |||
| 4fcfcfd002 | |||
| 4ce31c7c1a | |||
| 49bc100e51 | |||
| f5a14e5594 | |||
| dc21a0a6b5 | |||
| d218f28070 | |||
| e8a7394009 | |||
| 6a3a6416d7 | |||
| 9e3a826263 | |||
| 8714219dab | |||
| 6c4b3c1efe | |||
| 49fe496914 | |||
| 77578d415f | |||
| ff4c42d182 | |||
| 3d46c1f960 | |||
| 0387f8ad56 | |||
| 9a62173a5b | |||
| 682fdcfc9b | |||
| b9a6edfe3d | |||
| 606a646435 | |||
| 94d14c637f | |||
| cd1ca7b08b | |||
| 98f9a013d1 | |||
| c60fa84027 | |||
| 50eb661df8 | |||
| a87ccb9ac0 | |||
| 8e1b1a845b | |||
| 5253265342 | |||
| 2b303f38a8 | |||
| e6ac64008b | |||
| 7bb8c50080 | |||
| 8c68f1f626 | |||
| 98a157f589 | |||
| a1cc9380e5 | |||
| e938563de5 | |||
| 0ab4bbf771 | |||
| ab40630ff4 | |||
| 8548a8430e | |||
| 06b97b7b67 | |||
| cf852972d1 | |||
| 1f47c22371 | |||
| 602b034a03 | |||
| 8764b17ffc | |||
| ddc1b965b6 | |||
| be6b847675 | |||
| 9206ec30a2 | |||
| a7e9760316 | |||
| 7e1068919b | |||
| 30d46313ec | |||
| c1252a1089 | |||
| a86dc747b3 | |||
| c481e06e87 | |||
| 3bfe4f711d | |||
| 5245c7454c | |||
| 2fabe56bbe | |||
| 2ca39c910d | |||
| cf5a7b9679 | |||
| 9a6a046caf | |||
| c29c52a216 | |||
| 07c9a88d9c | |||
| f3439de480 | |||
| 28dd3aae79 | |||
| 0a5b200da2 | |||
| 9e9327e2f8 | |||
| 9fb0f5ac51 | |||
| 911be68a41 | |||
| 72d90ba8d2 | |||
| d277a1ba75 | |||
| 396f7e1a17 | |||
| 12a3eb776d | |||
| 6628714fc6 | |||
| 187befd665 | |||
| 1292fdf71a | |||
| 3425c90b66 | |||
| b0c5f49170 | |||
| 9cadc1e530 | |||
| c0d76ef984 | |||
| 72063bf136 | |||
| 36c1dce264 | |||
| 964d5a20e9 | |||
| 177478a8ad | |||
| a1c5740044 | |||
| 042ff210d5 | |||
| 091c7a3821 | |||
| c778011f14 | |||
| 4e9cb475da | |||
| e02418e904 | |||
| 840088e021 | |||
| e23ba9215d | |||
| ad71efb2cb | |||
| 8acd4c3ff4 | |||
| 0f263e125b | |||
| 82bd82e2f8 | |||
| c0a8d4e1ef | |||
| a5969aec96 | |||
| b01cdf28ca | |||
| ba84eb58f2 | |||
| d00f36ec75 | |||
| 7ec6d8a336 | |||
| c105b72945 | |||
| 1ed22204c8 | |||
| 034ff3ce13 | |||
| 1386489f41 | |||
| 08da247a87 | |||
| 63bc4d4b7f | |||
| cc024d3ef2 | |||
| 20d957d212 | |||
| 03df7831ab | |||
| 2425dac9a1 | |||
| 9071598a65 | |||
| 16ce114e0c | |||
| 183454a723 | |||
| ba612fc9bd | |||
| 91e21847e2 | |||
| 241991c677 | |||
| 4ef03ccbe1 | |||
| 73d1ea9a52 | |||
| db9a0cfbc0 | |||
| ff7ea605ef | |||
| 6cc5959356 | |||
| ce81433aff | |||
| 63c49be487 | |||
| 4f82b3588a | |||
| 3481c1caec | |||
| 35f96d6da7 | |||
| 2bda7aaf61 | |||
| 3212dd5465 | |||
| 7efc917ee0 | |||
| ec57a938c0 | |||
| c5b6c0456d | |||
| 1b73530b75 | |||
| 7512b5fdde | |||
| eeb997261d | |||
| 3dd1afe4ec | |||
| f151b1d277 | |||
| 047b1ca457 | |||
| 8ebd474c0e | |||
| 9086d6a230 | |||
| d9164bdd4c | |||
| 42b1bd56cc | |||
| eedde323ce | |||
| da6a38f9f6 | |||
| 92e08c9863 | |||
| 773e621190 | |||
| d2f19a3a0d | |||
| a3f05474c9 | |||
| 2d8673197c | |||
| d8ca61b01b | |||
| ec335b7398 | |||
| 7d8e5f623a | |||
| 2b8229f716 | |||
| b80a3a91a8 | |||
| 13d67b6ae7 | |||
| e05a0bc6c5 | |||
| 3da1144cef | |||
| b476bf2a00 | |||
| 23b28a6700 | |||
| eceada586b | |||
| 67635c6d65 | |||
| a26e496d00 | |||
| d579d3e596 | |||
| 5a77176654 | |||
| a28cde9c3b | |||
| 529af7a90e | |||
| 8bf58937a9 | |||
| 7dce2d0b8f | |||
| 2e393ab833 | |||
| 0c3722be82 | |||
| 09fb7512ed | |||
| b59aaae2dc | |||
| d77088b19b | |||
| b5a6df4966 | |||
| 67e50b4415 | |||
| 0cf170587f | |||
| 0c2ccd3bae | |||
| 1692801fc5 | |||
| 84f33d0578 | |||
| 5c07e0b6d3 | |||
| e0827069c1 | |||
| 9b55c09999 | |||
| 6bb6039ebb | |||
| ba7c92b0e8 | |||
| 4f8a1213bd | |||
| edf54ac3a9 | |||
| f44c29ad7d | |||
| 0c57dc2e00 | |||
| 07bd58a0e8 | |||
| 7bff337828 | |||
| 24580e348a | |||
| cfdcf9f2d2 | |||
| 63ac69cadf | |||
| 263621aed8 | |||
| 40efd17be4 | |||
| 0f2b7fbc45 | |||
| 1ce31dcd62 | |||
| f55c1cc0fb | |||
| 81c0537b0c | |||
| 32f978ff4b | |||
| 8f3b876ee6 | |||
| 6b0cd392f0 | |||
| ea50be0529 | |||
| b11b08b478 | |||
| a5e89bf724 | |||
| 0d196529f7 | |||
| 77b57459c4 | |||
| 5dde172452 | |||
| d83372a8dc | |||
| 5a797ae7de | |||
| ff8e32453b | |||
| fb2012def2 | |||
| d7ba03a9cb | |||
| 1e744bf5b1 | |||
| 8364ea3954 | |||
| c24e6f7ae9 | |||
| ed2fb773cd | |||
| afb164cc15 | |||
| 474897ff01 | |||
| 29fb2b6e47 | |||
| af72e6b8f4 | |||
| 38bb0db9db | |||
| 2ad8c6dbd0 | |||
| 5c96021172 | |||
| 4b1bb702ce | |||
| a77a2f357c | |||
| 7e78b5d06e | |||
| 11c81067dc | |||
| 7018f94959 | |||
| 533fde66e3 | |||
| 5bd18155be | |||
| aa6b5ac124 | |||
| ca40a749b6 | |||
| d54d580f79 | |||
| 774d6c1d0a | |||
| 302d80d744 | |||
| 286c6b496d | |||
| 44da1f795f | |||
| 71c4e96e17 | |||
| 60fd5c2a3a | |||
| 8271c4e9c4 | |||
| 1f4fe3bb27 | |||
| a0431acb37 | |||
| e3f1d722e7 | |||
| 1c3c94fd2c | |||
| 45a1063c4a | |||
| 1cc80f10ba | |||
| a160158cb3 | |||
| 6a53cb9307 | |||
| 1920232268 | |||
| 7f4eb4f6c6 | |||
| de6edcc48a | |||
| e88a36621e | |||
| e9f7c4aeba | |||
| 467f5fc90f | |||
| ad018da224 | |||
| 90a1c6b1f0 | |||
| 93d1ceae43 | |||
| 073a7ff95a | |||
| 5bf1a4c08c | |||
| 562ff9d111 | |||
| 32f6e1a554 | |||
| 10bbcca11e | |||
| 19b3aab23f | |||
| df28bb5ccd | |||
| d4ec359f11 | |||
| 3603102c89 | |||
| a615102947 | |||
| 9c91d0103f | |||
| 37a1767286 | |||
| 03662c0589 | |||
| 7c354c14f7 | |||
| d2ba09e6ff | |||
| 934394c5e2 | |||
| 6c3cadbd73 | |||
| 4dda2002f6 | |||
| 539f8032dc | |||
| f8c5128729 | |||
| 150487feda | |||
| b767613d20 | |||
| 197b2e75e1 | |||
| 3516e14e05 | |||
| d82b918a7b | |||
| f60726b090 | |||
| 1675b23a64 | |||
| aa9da6e433 | |||
| 772f6208db | |||
| 0cf1de8eea | |||
| 5947519ff4 | |||
| 084835ec30 | |||
| a67484668e | |||
| 26fd37b27d | |||
| ccaedaedc8 | |||
| c5de129c36 | |||
| 533dd85299 | |||
| 48dc18ed59 | |||
| bac492fff6 | |||
| 1d2d579bd6 | |||
| 80687c8a56 | |||
| 8a1d3929cc | |||
| 281ce7a054 | |||
| 343f4b3026 | |||
| 882426a9b2 | |||
| cf15b9e8ad | |||
| f4f7522fe7 | |||
| 1b4e3ec35a | |||
| b9d5f3f6e9 | |||
| 587402859e | |||
| 0421da78b3 | |||
| b027a84fa1 | |||
| fbbf4e380f | |||
| faed8f43d6 | |||
| 9a15c7a899 | |||
| 35768ed638 | |||
| 161f50962d | |||
| e638b9e805 | |||
| d7737528d1 | |||
| 18c0511d3c | |||
| 06a1c90679 | |||
| e929dd4d98 | |||
| bdb82d181f | |||
| 10a2c51c52 | |||
| 4664a339ae | |||
| fb81e4df1c | |||
| 89833853fa | |||
| cb1e9adc63 | |||
| 562796e41b | |||
| bb93c53948 | |||
| 00575b346d | |||
| 25d125fba1 | |||
| 7316676c41 | |||
| d1229efeec | |||
| fd7a2defae | |||
| fcc481e751 | |||
| 1984aacb27 | |||
| eaaa2d27d5 | |||
| 77585bf8af | |||
| c821cb1489 | |||
| 86c1babd03 | |||
| 2205b2f5bc | |||
| 975e40f1c0 | |||
| 74d8527f8a | |||
| 57cf3d1766 | |||
| f81b3101e8 | |||
| 81aefed13a | |||
| 41040e589f | |||
| 6eb26c1519 | |||
| ad7a871708 | |||
| 634ffed488 | |||
| ebe36d6e7c | |||
| d68e62c968 | |||
| b027eac173 | |||
| 2ed24876af | |||
| b08a6ccd9d | |||
| d558260a8e | |||
| 023a42ba55 | |||
| 7409f21e9f | |||
| 62f27b28ed | |||
| 599f5ef51b | |||
| 86e12b6074 | |||
| 5dff283b39 | |||
| 341c3d5933 | |||
| 628b23acc8 | |||
| 988555a5d9 | |||
| e11333dd83 | |||
| af2434c547 | |||
| a4c883c098 | |||
| 0a531815c5 | |||
| a15db2d9cf | |||
| efc1c39315 | |||
| 3334b1437b | |||
| 34103ef1cb | |||
| e7f348e720 | |||
| da9be8231f | |||
| ed2cdb71e5 | |||
| bbe48eaac6 | |||
| bab826a381 | |||
| 77294855d7 | |||
| d8187f7518 | |||
| 9e83463128 | |||
| e98c9a7ce3 | |||
| 204651e0e2 | |||
| 042892f0d7 | |||
| 7cefaa49dd | |||
| fc41e8850b | |||
| 38b3698b97 | |||
| c2746b5d2a | |||
| daff2a0674 | |||
| ad5c2de97c | |||
| f8758da289 | |||
| ca9c52ac97 | |||
| 9c285da329 | |||
| de37cfc224 | |||
| 946c09f58c | |||
| 4e168ffdf3 | |||
| d7bbafd683 | |||
| e90c233551 | |||
| 06897dbdb5 | |||
| 39020fc9cf | |||
| d5489f3a68 | |||
| 5a5a487612 | |||
| 46775ad186 | |||
| 901d9b70b0 | |||
| 0b4e043442 | |||
| d0c3c4c373 | |||
| 6c5dc17a1e | |||
| cf3757448d | |||
| 8578f9c565 | |||
| c9c09262f7 | |||
| faac7f18c7 | |||
| b2790973a3 | |||
| 8d58b238ca | |||
| 51bd56f19d | |||
| b111fb94b7 | |||
| 544dd8b130 | |||
| 246a793d82 | |||
| e650d87e47 | |||
| feb74b125d | |||
| 3c0b0b0f94 | |||
| d31a0eab9e | |||
| ccbc764c02 | |||
| 60a5ada454 | |||
| d3c2b15f82 | |||
| b030d7e6a1 | |||
| 64d8cf1e2e | |||
| d262b04d99 | |||
| cce2d9927e | |||
| 79878a57a9 | |||
| 03fe86f0a3 | |||
| 13a0c14e6c | |||
| 6e022dcb06 | |||
| c38023f4e7 | |||
| cbb5fc0acc | |||
| 2df3abe16b | |||
| ecec53f509 | |||
| 023102c804 | |||
| 52c05e75cc | |||
| 3d48994a72 | |||
| 7b160fa3cb | |||
| 71d3654832 | |||
| 2c29ee9e00 | |||
| aafda43df1 | |||
| 39127d942e | |||
| b068e63618 | |||
| 4b8fb6c246 | |||
| 133d861d65 | |||
| 8539d424b2 | |||
| dcf96b2da7 | |||
| b1ac35e14a | |||
| 43e4946cca | |||
| 1b18ebf28a | |||
| f6cf68094f | |||
| d826bcdbbb | |||
| 070be56e14 | |||
| 939c60bcaa | |||
| 95550c2582 | |||
| ebb0255e19 | |||
| 5c8cd76893 | |||
| 3a8af7d691 | |||
| 7936faf9a3 | |||
| 5c85f816c9 | |||
| 56683e6d11 | |||
| fbac578c79 | |||
| ade46bd428 | |||
| 1138fbb940 | |||
| 436342d5f4 | |||
| b21b8ff9d7 | |||
| fb8fa3fdac | |||
| f45da9866a | |||
| 98421e5970 | |||
| 84bb77e914 | |||
| 6882970248 | |||
| 05e0b3b7e6 | |||
| 6a94862fef | |||
| cb69a5c29a | |||
| 75742fcd01 | |||
| c99ce0f427 | |||
| 660d7cd3ae | |||
| b6e25a9fc7 | |||
| 2b2ce3f6e9 | |||
| 3391caf434 | |||
| 3500c940d4 | |||
| 4d0848b3e8 | |||
| 1f4ddbe5b6 | |||
| 4ef311949b | |||
| 64344f4545 | |||
| 02b32d86d3 | |||
| fc610979bb | |||
| 11a09ef5cc | |||
| f08d88fa78 | |||
| 59c8edfd98 | |||
| 1a1cd9b4e9 | |||
| 7c44a07810 | |||
| cd3aa0184a | |||
| 1020a93fa3 | |||
| 9a5e9d3442 | |||
| 0ea572d772 | |||
| 2bacd8b702 | |||
| aa170cfb5b | |||
| e6f6905868 | |||
| 766600529b | |||
| 09f9b35bc6 | |||
| fea4396023 | |||
| ec99f96c62 | |||
| 2f8b5731da | |||
| 8d4a76925c | |||
| 00367cfb00 | |||
| e63d7de87c | |||
| 511ed4388e | |||
| 8a3b93773d | |||
| bcd63766ce | |||
| 7ea1bf3cf0 | |||
| 3678020c28 | |||
| 976da2f3d3 | |||
| 0d2fab86b4 | |||
| ca40d635e4 | |||
| 651b13f72a | |||
| bea46c90b5 | |||
| 0b4eb6a964 | |||
| 988b108858 | |||
| 44acfc38a1 | |||
| e30939f09b | |||
| 118b27f5b4 | |||
| eded87de5b | |||
| 12207ac763 | |||
| f77aa45cfb | |||
| 7fc764f5e5 | |||
| 06b335b2d7 | |||
| 62e0759ba2 | |||
| a46f119fdf | |||
| c9cb480844 | |||
| 746185652a | |||
| f16503743f | |||
| ea038436e6 | |||
| 6a93b43cae | |||
| 0ebde64701 | |||
| c30fef1f9d | |||
| 55bff44810 | |||
| 75a1743f35 | |||
| 83b7fe1b82 | |||
| 7e2f7f45d7 | |||
| 1f72873c55 | |||
| 7e56cfafbc | |||
| 6ecd553810 | |||
| 55a714c83b | |||
| 1d557e6702 | |||
| 10f89b9c8b | |||
| 4a24ecd176 | |||
| 2cf6cea90f | |||
| c607dadc49 | |||
| 83e2731c94 | |||
| 63e508abd2 | |||
| 006956c324 | |||
| ff2d76ec0d | |||
| bc7b21609a | |||
| f0547e5e05 | |||
| 67b562d543 | |||
| 6c118ebc51 | |||
| 09674623cf | |||
| ecfb1ab4f8 | |||
| a0a8fb4fd9 | |||
| 6c59e39f7c | |||
| e96de8821c | |||
| b382984810 | |||
| 2b4241c10b | |||
| e8376c789d | |||
| e4a9c0f184 | |||
| 5e47aa6300 | |||
| d67c9aabff | |||
| bb5a22c504 | |||
| a9c7db7518 | |||
| c74fed1fcf | |||
| 7c9caab1fb | |||
| aa76ef9a98 | |||
| 78f660024b | |||
| 19a2495067 | |||
| 77275031ab | |||
| 99475e2976 | |||
| 349ff631a5 | |||
| e50ef2dab5 | |||
| 942401de16 | |||
| 629461c836 | |||
| f9ff9c5618 | |||
| e2c7adc7c4 | |||
| 36afd4ef55 | |||
| 4c66614e07 | |||
| b1a28a52fa | |||
| 38db7a78df | |||
| 5efd2056f0 | |||
| 1f94b7dfc9 | |||
| ef01044b2f | |||
| 59cf62ad9e | |||
| 50b291995a | |||
| f0d4ccc6cf | |||
| c2341fd446 | |||
| 897d0a9aaf | |||
| c1aee0c312 | |||
| dfdb09386f | |||
| 6fb83f869c | |||
| e6aa8ce932 | |||
| f0f741b796 | |||
| 05ee15f108 | |||
| 5042ab1f32 | |||
| 35e1b322cb | |||
| 9c7e0bfd33 | |||
| 4fb5680d91 | |||
| cccdcac0c8 | |||
| f27a886314 | |||
| 3d25d70627 | |||
| 7ba4212529 | |||
| 6a5a0fe803 | |||
| df8e28283f | |||
| 4c2db3d6e7 | |||
| 8ab224746b | |||
| dae04aacc3 | |||
| b66adc81a4 | |||
| 211d44cfc5 | |||
| eb89f5207c | |||
| 29d1bce85f | |||
| 79eb3c5cde | |||
| befbe89bdf | |||
| eb45cf0c93 | |||
| 9b52b61451 | |||
| a01659825c | |||
| c098c18942 | |||
| b033a63e63 | |||
| cb8ddb1179 | |||
| 3f95818252 | |||
| 990295644e | |||
| 9eb0e7d99b | |||
| 267241b889 | |||
| 8271bd5f14 | |||
| 1cee868e88 | |||
| d822d6f101 | |||
| f8d922ad3e | |||
| 0c30b18769 | |||
| a8cb5c3983 | |||
| e23f7303a6 | |||
| 0d5ffec521 | |||
| 97eac3f394 | |||
| bb3c0c066c | |||
| 9b9769169f | |||
| 7df92bbb77 | |||
| eeed9ce247 | |||
| 1f4586f3dd | |||
| 6d368dc1e7 | |||
| 51530d4d8e | |||
| 8541b7bf92 | |||
| b852108262 | |||
| 3747d2643f | |||
| 7d82171af4 | |||
| e6e817e613 | |||
| 0469c18726 | |||
| f5fecc7e9a | |||
| 4382970739 | |||
| d17740ec87 | |||
| 91511c1521 | |||
| 2e3e106676 | |||
| a1798cb28e | |||
| 80df44bd75 | |||
| bb05af8ece | |||
| 73042b32e1 | |||
| a1d151924d | |||
| fa5705613d | |||
| a7f9677378 | |||
| c1acbb02bc | |||
| 63a746c6ea | |||
| 7e03a8b279 | |||
| 5effebb5f5 | |||
| 8af175b81b | |||
| 4d3f9228aa | |||
| ac19420907 | |||
| f8a100f3e0 | |||
| 04b1822cff | |||
| bcb0ee3e4b | |||
| 9aa6528fd7 | |||
| 7efb09fb8f | |||
| 60803afe8f | |||
| ae89787984 | |||
| cf3a2e30cd | |||
| 259b9e093c | |||
| 5421d741bc | |||
| c4a63f6a86 | |||
| 20b6191842 | |||
| 64d679ecb4 | |||
| 9dc51a1aa4 | |||
| 2d3aa3861c | |||
| 244f126ff6 | |||
| 3b65b710b6 | |||
| 0dba5bdc4a | |||
| 46d39aff68 | |||
| 6bf4a7ce01 | |||
| dc21e2cc0e | |||
| fe5eaae102 | |||
| 846266fde4 | |||
| 49efc250d3 | |||
| a66018d14d | |||
| b0ad84cfa2 | |||
| c9f51d5eed | |||
| 640e180efe | |||
| 034ef02409 | |||
| 9c7ba6db90 | |||
| 68c57a1e82 | |||
| 284b2fc1e7 | |||
| 17713f6831 | |||
| a1e5bd71f1 | |||
| 0a16d93e1d | |||
| b4e4f13f9e | |||
| 4d9698a4cf | |||
| bff92da970 | |||
| d76226e21b | |||
| bfb1ba371c | |||
| 0470bb0e29 | |||
| 16869225ff | |||
| 3940b6163b | |||
| 51cb6998ea | |||
| 0c02e5de25 | |||
| a489d86e5f | |||
| ae036838dd | |||
| 6b8de222d7 | |||
| 5f94a205d1 | |||
| 882971151d | |||
| 136e5eb804 | |||
| 24d8cbf940 | |||
| 80708008a4 | |||
| 5726e80f77 | |||
| f9484bae8a | |||
| 61c347fb76 | |||
| 357a856cf6 | |||
| 6f76e7b42d | |||
| adc15c2bba | |||
| 3ebfe60008 | |||
| 8e79de35a8 | |||
| a5afcd9f11 | |||
| a87607e3ef | |||
| 836635d2d5 | |||
| 4d7a593c25 | |||
| 1bb0c5747c | |||
| 0084dee05b | |||
| 1f8df38dba | |||
| 3eff05e3eb | |||
| 45969bb3ae | |||
| 0eaeff0641 | |||
| 229aa62300 | |||
| f351540eda | |||
| 806e9241a6 | |||
| b3e18d23a3 | |||
| f7a474180b | |||
| fde0185a77 | |||
| 22f42a639f | |||
| 4aa891e773 | |||
| 60ce2b2e9f | |||
| da70b04262 | |||
| 3c1917771b | |||
| b184d7f27b | |||
| ba4513503e | |||
| b5248dbf3f | |||
| fa3f29f2b5 | |||
| 099ea91823 | |||
| a600267b9f | |||
| 29deff8707 | |||
| af8aa8a2fa | |||
| fb7e74c511 | |||
| eedf86402d | |||
| 767b28f2e3 | |||
| fbc69e444b | |||
| c1c3139368 | |||
| 409bd162ff | |||
| e6f6707558 | |||
| 7dc22b4ea6 | |||
| a228633d31 | |||
| 1db1a83410 | |||
| 7dc549f166 | |||
| c78142acb0 | |||
| dbb7aa7856 | |||
| d695d4a0bf | |||
| e1a598c5b3 | |||
| 681a8c6e18 | |||
| ced8e7a813 | |||
| 2b0c3eb170 | |||
| 1cf75c0cab | |||
| 51421098dd | |||
| dc50dc7254 | |||
| 3e5890694e | |||
| f5330a44e8 | |||
| 31c8f2ec57 | |||
| 46d128e073 | |||
| aa5311ea9f | |||
| efafd4a9e5 | |||
| 7fd21d217a | |||
| ce42593fe6 | |||
| 7cbc4e88de | |||
| 4c1ed13846 | |||
| 8754adc021 | |||
| af9368d35f | |||
| c35dab9046 | |||
| 6f19ef8631 | |||
| 5cb2d1c20d | |||
| e460a29cab | |||
| da9bdf9c15 | |||
| 77df5948e7 | |||
| e35d98e566 | |||
| b7659c62f3 | |||
| 394c74b349 | |||
| e6420c523d | |||
| de6d13088f | |||
| 689589ebaa | |||
| 95d7ecb33f | |||
| 13182da945 | |||
| a0a4f6c23d | |||
| 224124b69e | |||
| 38ef8894b7 | |||
| 017a282c7a | |||
| 01527c44fd | |||
| a8eab26bae | |||
| 63235f51f0 | |||
| cc529d971b | |||
| 8236181c62 | |||
| 01a980aa9e | |||
| e8d26b02ac | |||
| 7358b44222 | |||
| 9a98cd6e65 | |||
| b6dafed5ba | |||
| 8cbb284b7b | |||
| 9fcb0b2201 | |||
| aad289a3a2 | |||
| 150e522bee | |||
| 510680a5df | |||
| 03bd82796d | |||
| 56754e907d | |||
| 1a5dfe421d | |||
| ed1aa73dd3 | |||
| cce225f6e9 | |||
| e2f5001b11 | |||
| 8b8c368148 | |||
| b4845d8c9f | |||
| d1606b4aa3 | |||
| e0d991cf46 | |||
| fa272c43c2 | |||
| a1de9e9ad5 | |||
| 1ce5165cb7 | |||
| 1454843b81 | |||
| b92a46c130 | |||
| ea51396731 | |||
| aa82f921cc | |||
| 2da7eae2c4 | |||
| ecbe843061 | |||
| b4a535272c | |||
| dbe7634286 | |||
| 25159d8e81 | |||
| b8d8b0568c | |||
| eb247d826f | |||
| 9e69e2a07a | |||
| 7da3e98dfd | |||
| 55b9c0374c | |||
| 91ab92c349 | |||
| 879c0196d4 | |||
| f40ffe4763 | |||
| 116311b7b4 | |||
| 5d43d3ca88 | |||
| e55679079f | |||
| 3994cfbc59 | |||
| d02c291160 | |||
| 8bbce0a2a2 | |||
| e55f2b2602 | |||
| 9aef26e2ad | |||
| 261546f6f6 | |||
| bb4199b177 | |||
| 281666887e | |||
| f1ef3a4865 | |||
| 9997aa8187 | |||
| f15b42018c | |||
| f9e9ae85bd | |||
| a49beb7c73 | |||
| 51dff5b9e8 | |||
| 826fc00374 | |||
| c10692deff | |||
| daa7b9ce5f | |||
| 1ab02631b0 | |||
| 3e755b2290 | |||
| f15a167df4 | |||
| f6367a2ea5 | |||
| 5f88e2b496 | |||
| 2c7cf52e3b | |||
| b7c5083a87 | |||
| d5d88efd5d | |||
| 6cb7a7be18 | |||
| cdea6b532f | |||
| d01e3529a6 | |||
| 7c13d3277c | |||
| 345b3b0bdd | |||
| a65d7d4dd3 | |||
| 5e986f3347 | |||
| 27a8bb471b | |||
| 7868733002 | |||
| 469aef2e5e | |||
| 5e00fc6afe | |||
| f1c062c30a | |||
| 5dc17f5d58 | |||
| 069dd8a068 | |||
| f8ccc115ef | |||
| 17fea0dd0a | |||
| 998aefd1d1 | |||
| 975a6299fa | |||
| eb8728d727 | |||
| 63dbe66b41 | |||
| 3cc27c769c | |||
| becbfa6281 | |||
| 8b44a42a40 | |||
| 5170f0b5da | |||
| dc2dbb4173 | |||
| 1d68a89947 | |||
| 79e4f7eb78 | |||
| cc73c7000f | |||
| 8bb26fa5de | |||
| 48612d7c58 | |||
| 8ba84f4b47 | |||
| 48f95d92ae | |||
| 5dbdadb769 | |||
| 5a8363a44e | |||
| d534d04f25 | |||
| bfc27271e2 | |||
| b86088b89c | |||
| c1b6bf21d5 | |||
| 3e1f74f2ca | |||
| b10d4b05ed | |||
| 5d099df578 | |||
| 3e4bb371c8 | |||
| b6ba1f226c | |||
| da44a2fac1 | |||
| bc653add74 | |||
| 34b02f6437 | |||
| 6ae4a9b09b | |||
| e91b818e3e | |||
| a078653ab4 | |||
| 530702c5f2 | |||
| feed2c074d | |||
| 65b4d77959 | |||
| 4ab891e9e5 | |||
| 435615ba2e | |||
| ccda4bf008 | |||
| 0cd0e4749b | |||
| 286fe261d0 | |||
| a098fb1803 | |||
| b8c6adc569 | |||
| cd1ffd169c | |||
| a1ad1f0800 | |||
| 214cbabc40 | |||
| a138e5a6a5 | |||
| d8f7377122 | |||
| ede5b23753 | |||
| 215f78eee2 | |||
| 4425dac7f4 | |||
| 4f79b9de48 | |||
| 397ac5e68f | |||
| 43c75c64b5 | |||
| c319625a07 | |||
| a7d0448faa | |||
| ca10e5e8ae | |||
| 32414afe72 | |||
| ed10f50d25 | |||
| 48d9be70d5 | |||
| 2bef73c968 | |||
| a518d7a1cb | |||
| 9ef8aeadd3 | |||
| e2db68f822 | |||
| 952027a853 | |||
| e91bf95d58 | |||
| dbce90692a | |||
| e630be3890 | |||
| 8401ed9395 | |||
| 7161b5bbad | |||
| 7e6293d9ec | |||
| b13d4bafa8 | |||
| 49731ad530 | |||
| 3d261e8a01 | |||
| 87935f3560 | |||
| 063d8b4211 | |||
| c6b31481b6 | |||
| d14e007fdb | |||
| 40f6f679b8 | |||
| 2b3013fd20 | |||
| c815043607 | |||
| e7e63fac6c | |||
| 0dad2876e2 | |||
| 514b714cc2 | |||
| 5ae9add102 | |||
| d45350a06a | |||
| 7fec87d3f6 | |||
| 3e59ddbace | |||
| d9dc5ffa91 | |||
| 7a0a9d010b | |||
| 51aa649499 | |||
| c41e8006c7 | |||
| eb9d7c4dd5 | |||
| 73389b2b9c | |||
| 00d555f051 | |||
| 6cf7d6ef4e | |||
| 452ea4c15f | |||
| 39201e68e2 | |||
| f332cba14b | |||
| 3dc2dbc17e | |||
| 3ebdcafdd3 | |||
| d093cb54d5 | |||
| 64fd54ffb4 | |||
| a348f3eeaa | |||
| 33f423de04 | |||
| d6ba52c3f9 | |||
| e9638d0997 | |||
| 5cb0084547 | |||
| 24caa80143 | |||
| 086792ec06 | |||
| 0a4a1d7526 | |||
| 078d49609e | |||
| dca5684145 | |||
| 9145985ff4 | |||
| 7ff9d7eb2d | |||
| 3715f71aaf | |||
| 167a26642e | |||
| a4b34e7ae1 | |||
| dda999545c | |||
| 7821fe2bde | |||
| b75cbfde45 | |||
| a548a08129 | |||
| 32bc89f094 | |||
| 33d42b740c | |||
| d847387694 | |||
| eabcfa5652 | |||
| 6cb90c0e97 | |||
| 130914d9f4 | |||
| 02ebc4368c | |||
| 64244e160b | |||
| 6bf599b1bc | |||
| 088535fa56 | |||
| 58afe5dd17 | |||
| 5f8d8c0069 | |||
| 4e4a7d0353 | |||
| ee97a5e757 | |||
| f02204847a | |||
| 8dbc96fed8 | |||
| 8ce691e679 | |||
| 2272a58769 | |||
| 2fde4d8a94 | |||
| 2443e8090e | |||
| 49dfa5a17f | |||
| 4c99196399 | |||
| 9628abc786 | |||
| 87e0c26129 | |||
| 5d2edced26 | |||
| a7821c60e5 | |||
| f197d8b91c | |||
| 890f1baff0 | |||
| 4d28e8243c | |||
| ae795e5797 | |||
| a13e32f5ab | |||
| d509165d96 | |||
| bf4994554d | |||
| 7acea48788 | |||
| 58882e5c22 | |||
| 6b9ebcbf3d | |||
| 601b7d1dd3 | |||
| 2ae20c74a2 | |||
| 3f458c6eb1 | |||
| d3e24f3cbf | |||
| e21c6e19db | |||
| 5327482b46 | |||
| 4f9c081dc3 | |||
| 157202fc8d | |||
| b036fc756a | |||
| 4ce684e61c | |||
| 795c108f2b | |||
| 6811d2ab24 | |||
| 5db1754d49 | |||
| 09d25e11c6 | |||
| a0c98dcefa | |||
| 44970ddf56 | |||
| 9cb48606ba | |||
| 8e93c19de3 | |||
| e85bacff7b | |||
| d3ac1bc314 | |||
| 0d19685f95 | |||
| fa749de0dc | |||
| 5aeeaa6fce | |||
| 45e0e5f8e9 |
@@ -1,6 +1,7 @@
|
|||||||
*.autosave
|
*.autosave
|
||||||
*.pyc
|
*.pyc
|
||||||
*.user
|
*.user
|
||||||
|
*~
|
||||||
.*.swp
|
.*.swp
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.sw[a-z]
|
.sw[a-z]
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[tgit]
|
||||||
|
icon = doc/opencv.ico
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ippicv
|
||||||
Vendored
+2
@@ -3,9 +3,11 @@ set(HAVE_FFMPEG_CODEC 1)
|
|||||||
set(HAVE_FFMPEG_FORMAT 1)
|
set(HAVE_FFMPEG_FORMAT 1)
|
||||||
set(HAVE_FFMPEG_UTIL 1)
|
set(HAVE_FFMPEG_UTIL 1)
|
||||||
set(HAVE_FFMPEG_SWSCALE 1)
|
set(HAVE_FFMPEG_SWSCALE 1)
|
||||||
|
set(HAVE_FFMPEG_RESAMPLE 0)
|
||||||
set(HAVE_GENTOO_FFMPEG 1)
|
set(HAVE_GENTOO_FFMPEG 1)
|
||||||
|
|
||||||
set(ALIASOF_libavcodec_VERSION 55.18.102)
|
set(ALIASOF_libavcodec_VERSION 55.18.102)
|
||||||
set(ALIASOF_libavformat_VERSION 55.12.100)
|
set(ALIASOF_libavformat_VERSION 55.12.100)
|
||||||
set(ALIASOF_libavutil_VERSION 52.38.100)
|
set(ALIASOF_libavutil_VERSION 52.38.100)
|
||||||
set(ALIASOF_libswscale_VERSION 2.3.100)
|
set(ALIASOF_libswscale_VERSION 2.3.100)
|
||||||
|
set(ALIASOF_libavresample_VERSION 1.0.1)
|
||||||
+1
-1
@@ -210,7 +210,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(linux) || defined(__APPLE__) || defined(__MACOSX)
|
#if defined(__linux__) || defined(__APPLE__) || defined(__MACOSX)
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
|
|
||||||
#include <emmintrin.h>
|
#include <emmintrin.h>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
+1
-1
@@ -46,5 +46,5 @@ if(ENABLE_SOLUTION_FOLDERS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT BUILD_SHARED_LIBS)
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Vendored
+2
-2
@@ -26,7 +26,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align -Wshadow -Wunused)
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align -Wshadow -Wunused)
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wshift-negative-value) # clang
|
||||||
|
|
||||||
set_target_properties(${JPEG_LIBRARY}
|
set_target_properties(${JPEG_LIBRARY}
|
||||||
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
|
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
|
||||||
@@ -39,5 +39,5 @@ if(ENABLE_SOLUTION_FOLDERS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT BUILD_SHARED_LIBS)
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Vendored
+2
-2
@@ -14,7 +14,7 @@ ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" ${ZLIB_INCLUDE_DIR})
|
|||||||
file(GLOB lib_srcs *.c)
|
file(GLOB lib_srcs *.c)
|
||||||
file(GLOB lib_hdrs *.h)
|
file(GLOB lib_hdrs *.h)
|
||||||
|
|
||||||
if(NEON)
|
if(ARM AND NEON)
|
||||||
list(APPEND lib_srcs arm/filter_neon.S)
|
list(APPEND lib_srcs arm/filter_neon.S)
|
||||||
add_definitions(-DPNG_ARM_NEON)
|
add_definitions(-DPNG_ARM_NEON)
|
||||||
endif()
|
endif()
|
||||||
@@ -55,5 +55,5 @@ if(ENABLE_SOLUTION_FOLDERS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT BUILD_SHARED_LIBS)
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Vendored
+2
-1
@@ -93,6 +93,7 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4100 /wd4127 /wd4311 /wd4701 /wd
|
|||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267 /wd4305 /wd4306) # vs2008 Win64
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267 /wd4305 /wd4306) # vs2008 Win64
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4703) # vs2012
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4703) # vs2012
|
||||||
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456 /wd4457 /wd4312) # vs2015
|
||||||
|
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018)
|
ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018)
|
||||||
|
|
||||||
@@ -115,5 +116,5 @@ if(ENABLE_SOLUTION_FOLDERS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT BUILD_SHARED_LIBS)
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
ocv_install_target(${TIFF_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
ocv_install_target(${TIFF_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
+2
-10
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
|
/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
|
||||||
(Intel) */
|
(Intel) */
|
||||||
#define HOST_BIGENDIAN 0
|
#define HOST_BIGENDIAN @WORDS_BIGENDIAN@
|
||||||
|
|
||||||
/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
|
/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
|
||||||
#define HOST_FILLORDER FILLORDER_LSB2MSB
|
#define HOST_FILLORDER FILLORDER_LSB2MSB
|
||||||
@@ -156,15 +156,7 @@
|
|||||||
|
|
||||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
#cmakedefine WORDS_BIGENDIAN 1
|
||||||
# if defined __BIG_ENDIAN__
|
|
||||||
# define WORDS_BIGENDIAN 1
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# ifndef WORDS_BIGENDIAN
|
|
||||||
/* # undef WORDS_BIGENDIAN */
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Support Deflate compression */
|
/* Support Deflate compression */
|
||||||
#define ZIP_SUPPORT 1
|
#define ZIP_SUPPORT 1
|
||||||
|
|||||||
Vendored
+3
-1
@@ -38,10 +38,12 @@ source_group("Include" FILES ${lib_hdrs} )
|
|||||||
source_group("Src" FILES ${lib_srcs})
|
source_group("Src" FILES ${lib_srcs})
|
||||||
|
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch -Wparentheses -Warray-bounds -Wextra)
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch -Wparentheses -Warray-bounds -Wextra)
|
||||||
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wdeprecated-declarations)
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4099 /wd4100 /wd4101 /wd4127 /wd4189 /wd4245 /wd4305 /wd4389 /wd4512 /wd4701 /wd4702 /wd4706 /wd4800) # vs2005
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4099 /wd4100 /wd4101 /wd4127 /wd4189 /wd4245 /wd4305 /wd4389 /wd4512 /wd4701 /wd4702 /wd4706 /wd4800) # vs2005
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4334) # vs2005 Win64
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4334) # vs2005 Win64
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267) # vs2008 Win64
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267) # vs2008 Win64
|
||||||
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456 /wd4457 /wd4312) # vs2015
|
||||||
|
|
||||||
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
|
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
||||||
@@ -62,7 +64,7 @@ if(ENABLE_SOLUTION_FOLDERS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT BUILD_SHARED_LIBS)
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
ocv_install_target(IlmImf EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
ocv_install_target(IlmImf EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATHS} PARENT_SCOPE)
|
set(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATHS} PARENT_SCOPE)
|
||||||
|
|||||||
Vendored
+26
-20
@@ -5,21 +5,26 @@ if (WIN32 AND NOT ARM)
|
|||||||
message(FATAL_ERROR "BUILD_TBB option supports Windows on ARM only!\nUse regular official TBB build instead of the BUILD_TBB option!")
|
message(FATAL_ERROR "BUILD_TBB option supports Windows on ARM only!\nUse regular official TBB build instead of the BUILD_TBB option!")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32 AND ARM)
|
set(tbb_ver "tbb43_20141204oss")
|
||||||
# 4.1 update 4 - The first release that supports Windows RT. Hangs on some Android devices
|
set(tbb_url "http://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb43_20141204oss_src.tgz")
|
||||||
set(tbb_ver "tbb41_20130613oss")
|
set(tbb_md5 "e903dd92d9433701f097fa7ca29a3c1f")
|
||||||
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
|
set(tbb_version_file "version_string.ver")
|
||||||
set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
||||||
set(tbb_version_file "version_string.ver")
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
|
||||||
else()
|
# 4.1 update 4 - The first release that supports Windows RT. Hangs on some Android devices
|
||||||
# 4.1 update 2 - works fine
|
#set(tbb_ver "tbb41_20130613oss")
|
||||||
set(tbb_ver "tbb41_20130116oss")
|
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
|
||||||
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
|
#set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
|
||||||
set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
|
#set(tbb_version_file "version_string.ver")
|
||||||
set(tbb_version_file "version_string.ver")
|
#ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
|
|
||||||
endif()
|
# 4.1 update 2 - works fine
|
||||||
|
#set(tbb_ver "tbb41_20130116oss")
|
||||||
|
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
|
||||||
|
#set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
|
||||||
|
#set(tbb_version_file "version_string.ver")
|
||||||
|
#ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
|
||||||
|
|
||||||
# 4.1 update 3 dev - Hangs on some Android devices
|
# 4.1 update 3 dev - Hangs on some Android devices
|
||||||
#set(tbb_ver "tbb41_20130401oss")
|
#set(tbb_ver "tbb41_20130401oss")
|
||||||
@@ -113,7 +118,7 @@ if(NOT EXISTS "${tbb_tarball}")
|
|||||||
message(STATUS "Downloading ${tbb_ver}_src.tgz")
|
message(STATUS "Downloading ${tbb_ver}_src.tgz")
|
||||||
file(DOWNLOAD "${tbb_url}" "${tbb_tarball}" TIMEOUT 600 STATUS __statvar)
|
file(DOWNLOAD "${tbb_url}" "${tbb_tarball}" TIMEOUT 600 STATUS __statvar)
|
||||||
if(NOT __statvar EQUAL 0)
|
if(NOT __statvar EQUAL 0)
|
||||||
message(FATAL_ERROR "Failed to download TBB sources: ${tbb_url}")
|
message(FATAL_ERROR "Failed to download TBB sources (${__statvar}): ${tbb_url}")
|
||||||
endif()
|
endif()
|
||||||
getMD5("${tbb_tarball}" tbb_local_md5)
|
getMD5("${tbb_tarball}" tbb_local_md5)
|
||||||
if(NOT tbb_local_md5 STREQUAL tbb_md5)
|
if(NOT tbb_local_md5 STREQUAL tbb_md5)
|
||||||
@@ -169,6 +174,7 @@ if (WIN32)
|
|||||||
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} /APPCONTAINER")
|
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} /APPCONTAINER")
|
||||||
else()
|
else()
|
||||||
add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
|
add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
|
||||||
|
-D__TBB_WEAK_SYMBOLS_PRESENT=0 #required for 4.3
|
||||||
-D__TBB_BUILD=1 #required
|
-D__TBB_BUILD=1 #required
|
||||||
-D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support
|
-D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support
|
||||||
-DTBB_USE_DEBUG=0 #just to be sure
|
-DTBB_USE_DEBUG=0 #just to be sure
|
||||||
@@ -198,7 +204,7 @@ endif()
|
|||||||
|
|
||||||
set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs})
|
set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs})
|
||||||
|
|
||||||
if (ARM AND NOT WIN32)
|
if ((ARM OR AARCH64) AND NOT WIN32)
|
||||||
if (NOT ANDROID)
|
if (NOT ANDROID)
|
||||||
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp")
|
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp")
|
||||||
endif()
|
endif()
|
||||||
@@ -248,9 +254,9 @@ if(ENABLE_SOLUTION_FOLDERS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
ocv_install_target(tbb EXPORT OpenCVModules
|
ocv_install_target(tbb EXPORT OpenCVModules
|
||||||
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main
|
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs
|
||||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main
|
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs
|
||||||
ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main
|
ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev
|
||||||
)
|
)
|
||||||
|
|
||||||
# get TBB version
|
# get TBB version
|
||||||
|
|||||||
Vendored
+2
-2
@@ -82,7 +82,7 @@ if(UNIX)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations)
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wshorten-64-to-32 -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshift-negative-value)
|
||||||
|
|
||||||
set_target_properties(${ZLIB_LIBRARY} PROPERTIES
|
set_target_properties(${ZLIB_LIBRARY} PROPERTIES
|
||||||
OUTPUT_NAME ${ZLIB_LIBRARY}
|
OUTPUT_NAME ${ZLIB_LIBRARY}
|
||||||
@@ -95,5 +95,5 @@ if(ENABLE_SOLUTION_FOLDERS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT BUILD_SHARED_LIBS)
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
ocv_install_target(${ZLIB_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
ocv_install_target(${ZLIB_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
+145
-17
@@ -47,12 +47,24 @@ if(POLICY CMP0022)
|
|||||||
cmake_policy(SET CMP0022 OLD)
|
cmake_policy(SET CMP0022 OLD)
|
||||||
endif()
|
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
|
# must go before the project command
|
||||||
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
|
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
|
||||||
if(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8")
|
if(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8")
|
||||||
set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
|
set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
enable_testing()
|
||||||
|
|
||||||
project(OpenCV CXX C)
|
project(OpenCV CXX C)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
@@ -128,20 +140,22 @@ OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON
|
|||||||
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O" ON IF IOS)
|
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O" ON IF IOS)
|
||||||
OCV_OPTION(WITH_CARBON "Use Carbon for UI instead of Cocoa" OFF IF APPLE )
|
OCV_OPTION(WITH_CARBON "Use Carbon for UI instead of Cocoa" OFF IF APPLE )
|
||||||
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
|
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
|
||||||
|
OCV_OPTION(WITH_VTK "Include VTK library support (and build opencv_viz module eiher)" OFF IF (NOT ANDROID AND NOT IOS AND NOT CMAKE_CROSSCOMPILING) )
|
||||||
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
|
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
|
||||||
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
|
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
|
||||||
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS AND NOT APPLE) )
|
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS AND NOT APPLE) )
|
||||||
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
|
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
|
||||||
OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF WIN32 )
|
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_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS))
|
||||||
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT ANDROID) )
|
||||||
|
OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF )
|
||||||
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||||
OCV_OPTION(WITH_IMAGEIO "ImageIO support for OS X" OFF IF APPLE )
|
OCV_OPTION(WITH_IMAGEIO "ImageIO support for OS X" OFF IF APPLE )
|
||||||
OCV_OPTION(WITH_IPP "Include Intel IPP support" OFF IF (MSVC OR X86 OR X86_64) )
|
OCV_OPTION(WITH_IPP "Include Intel IPP support" OFF IF (MSVC OR X86 OR X86_64) )
|
||||||
OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) )
|
OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) )
|
||||||
OCV_OPTION(WITH_JPEG "Include JPEG support" ON)
|
OCV_OPTION(WITH_JPEG "Include JPEG support" ON)
|
||||||
OCV_OPTION(WITH_OPENEXR "Include ILM support via OpenEXR" ON IF (NOT IOS) )
|
OCV_OPTION(WITH_OPENEXR "Include ILM support via OpenEXR" ON IF (NOT IOS) )
|
||||||
OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT APPLE) )
|
OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID) )
|
||||||
OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS) )
|
OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS) )
|
||||||
OCV_OPTION(WITH_PNG "Include PNG support" ON)
|
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_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||||
@@ -158,7 +172,7 @@ OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON
|
|||||||
OCV_OPTION(WITH_LIBV4L "Use libv4l for Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
|
OCV_OPTION(WITH_LIBV4L "Use libv4l for Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
|
||||||
OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON IF (WIN32 AND NOT ARM) )
|
OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON IF (WIN32 AND NOT ARM) )
|
||||||
OCV_OPTION(WITH_MSMF "Build HighGUI with Media Foundation support" OFF IF WIN32 )
|
OCV_OPTION(WITH_MSMF "Build HighGUI with Media Foundation support" OFF IF WIN32 )
|
||||||
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE) )
|
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID) )
|
||||||
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||||
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT IOS) )
|
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT IOS) )
|
||||||
OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON IF (NOT ANDROID AND NOT IOS) )
|
OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||||
@@ -180,6 +194,7 @@ OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for sta
|
|||||||
OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX )
|
OCV_OPTION(BUILD_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_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_PACKAGE "Build platform-specific package for Google Play" OFF IF ANDROID )
|
||||||
|
OCV_OPTION(BUILD_TINY_GPU_MODULE "Build tiny gpu module with limited image format support" OFF )
|
||||||
|
|
||||||
# 3rd party libs
|
# 3rd party libs
|
||||||
OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE )
|
OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE )
|
||||||
@@ -197,7 +212,7 @@ OCV_OPTION(INSTALL_C_EXAMPLES "Install C examples" OFF )
|
|||||||
OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
|
OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
|
||||||
OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
|
OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
|
||||||
OCV_OPTION(INSTALL_TO_MANGLED_PATHS "Enables mangled install paths, that help with side by side installs." OFF IF (UNIX AND NOT ANDROID AND NOT IOS AND BUILD_SHARED_LIBS) )
|
OCV_OPTION(INSTALL_TO_MANGLED_PATHS "Enables mangled install paths, that help with side by side installs." OFF IF (UNIX AND NOT ANDROID AND NOT IOS AND BUILD_SHARED_LIBS) )
|
||||||
|
OCV_OPTION(INSTALL_TESTS "Install accuracy and performance test binaries and test data" OFF)
|
||||||
|
|
||||||
# OpenCV build options
|
# OpenCV build options
|
||||||
# ===================================================
|
# ===================================================
|
||||||
@@ -205,6 +220,7 @@ OCV_OPTION(ENABLE_DYNAMIC_CUDA "Enabled dynamic CUDA linkage"
|
|||||||
OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (NOT IOS) )
|
OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (NOT IOS) )
|
||||||
OCV_OPTION(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) IF (CMAKE_VERSION VERSION_GREATER "2.8.0") )
|
OCV_OPTION(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) IF (CMAKE_VERSION VERSION_GREATER "2.8.0") )
|
||||||
OCV_OPTION(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF IF CMAKE_COMPILER_IS_GNUCXX )
|
OCV_OPTION(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF IF CMAKE_COMPILER_IS_GNUCXX )
|
||||||
|
OCV_OPTION(ENABLE_COVERAGE "Enable coverage collection with GCov" OFF IF CMAKE_COMPILER_IS_GNUCXX )
|
||||||
OCV_OPTION(ENABLE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON IF CMAKE_COMPILER_IS_GNUCXX AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX) )
|
OCV_OPTION(ENABLE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON IF CMAKE_COMPILER_IS_GNUCXX AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX) )
|
||||||
OCV_OPTION(ENABLE_POWERPC "Enable PowerPC for GCC" ON IF (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*) )
|
OCV_OPTION(ENABLE_POWERPC "Enable PowerPC for GCC" ON IF (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*) )
|
||||||
OCV_OPTION(ENABLE_FAST_MATH "Enable -ffast-math (not recommended for GCC 4.6.x)" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
OCV_OPTION(ENABLE_FAST_MATH "Enable -ffast-math (not recommended for GCC 4.6.x)" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
||||||
@@ -215,12 +231,17 @@ OCV_OPTION(ENABLE_SSSE3 "Enable SSSE3 instructions"
|
|||||||
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_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_SSE42 "Enable SSE4.2 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
||||||
OCV_OPTION(ENABLE_AVX "Enable AVX instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
OCV_OPTION(ENABLE_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 )
|
OCV_OPTION(ENABLE_AVX2 "Enable AVX2 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||||
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND ARM )
|
OCV_OPTION(ENABLE_NEON "Enable NEON instructions" AARCH64 IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64))
|
||||||
|
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" AARCH64 IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64))
|
||||||
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
|
OCV_OPTION(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(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 "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(ENABLE_WINRT_MODE_NATIVE "Build with Windows Runtime native C++ support" OFF IF WIN32 )
|
||||||
|
OCV_OPTION(ENABLE_LIBVS2013 "Build VS2013 with Visual Studio 2013 libraries" OFF IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
|
||||||
|
OCV_OPTION(ENABLE_WINSDK81 "Build VS2013 with Windows 8.1 SDK" OFF IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
|
||||||
|
OCV_OPTION(ENABLE_WINPHONESDK80 "Build with Windows Phone 8.0 SDK" OFF IF WIN32 AND (MSVC_VERSION EQUAL 1700) )
|
||||||
|
OCV_OPTION(ENABLE_WINPHONESDK81 "Build VS2013 with Windows Phone 8.1 SDK" OFF IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
|
||||||
|
|
||||||
# uncategorized options
|
# uncategorized options
|
||||||
# ===================================================
|
# ===================================================
|
||||||
@@ -268,13 +289,27 @@ if(WIN32)
|
|||||||
message(STATUS "Can't detect runtime and/or arch")
|
message(STATUS "Can't detect runtime and/or arch")
|
||||||
set(OpenCV_INSTALL_BINARIES_PREFIX "")
|
set(OpenCV_INSTALL_BINARIES_PREFIX "")
|
||||||
endif()
|
endif()
|
||||||
|
elseif(ANDROID)
|
||||||
|
set(OpenCV_INSTALL_BINARIES_PREFIX "sdk/native/")
|
||||||
else()
|
else()
|
||||||
set(OpenCV_INSTALL_BINARIES_PREFIX "")
|
set(OpenCV_INSTALL_BINARIES_PREFIX "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
|
if(ANDROID)
|
||||||
|
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples/${ANDROID_NDK_ABI_NAME}")
|
||||||
|
else()
|
||||||
|
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
|
if(ANDROID)
|
||||||
|
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin/${ANDROID_NDK_ABI_NAME}")
|
||||||
|
else()
|
||||||
|
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT OPENCV_TEST_INSTALL_PATH)
|
||||||
|
set(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
|
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
|
||||||
@@ -283,6 +318,7 @@ if(ANDROID)
|
|||||||
set(OPENCV_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
|
set(OPENCV_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
|
||||||
set(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
|
set(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
|
||||||
set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
|
set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
|
||||||
|
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
||||||
else()
|
else()
|
||||||
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
|
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
|
||||||
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
|
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
|
||||||
@@ -293,9 +329,11 @@ else()
|
|||||||
set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}")
|
set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}")
|
||||||
endif()
|
endif()
|
||||||
set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
||||||
|
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
||||||
else()
|
else()
|
||||||
set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
|
set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
|
||||||
set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
|
set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
|
||||||
|
set(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples)
|
||||||
endif()
|
endif()
|
||||||
set(OPENCV_INCLUDE_INSTALL_PATH "include")
|
set(OPENCV_INCLUDE_INSTALL_PATH "include")
|
||||||
|
|
||||||
@@ -415,6 +453,8 @@ if(UNIX)
|
|||||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|DragonFly")
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|DragonFly")
|
||||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m pthread)
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m pthread)
|
||||||
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
|
||||||
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m)
|
||||||
else()
|
else()
|
||||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
|
||||||
endif()
|
endif()
|
||||||
@@ -426,6 +466,19 @@ endif()
|
|||||||
include(cmake/OpenCVPCHSupport.cmake)
|
include(cmake/OpenCVPCHSupport.cmake)
|
||||||
include(cmake/OpenCVModule.cmake)
|
include(cmake/OpenCVModule.cmake)
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Detect endianness of build platform
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL iOS)
|
||||||
|
# test_big_endian needs try_compile, which doesn't work for iOS
|
||||||
|
# http://public.kitware.com/Bug/view.php?id=12288
|
||||||
|
set(WORDS_BIGENDIAN 0)
|
||||||
|
else()
|
||||||
|
include(TestBigEndian)
|
||||||
|
test_big_endian(WORDS_BIGENDIAN)
|
||||||
|
endif()
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Detect 3rd-party libraries
|
# Detect 3rd-party libraries
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@@ -435,14 +488,18 @@ include(cmake/OpenCVFindLibsGUI.cmake)
|
|||||||
include(cmake/OpenCVFindLibsVideo.cmake)
|
include(cmake/OpenCVFindLibsVideo.cmake)
|
||||||
include(cmake/OpenCVFindLibsPerf.cmake)
|
include(cmake/OpenCVFindLibsPerf.cmake)
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Detect other 3rd-party libraries/tools
|
# Detect other 3rd-party libraries/tools
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
# --- LATEX for pdf documentation ---
|
# --- LATEX for pdf documentation ---
|
||||||
|
unset(HAVE_DOXYGEN CACHE)
|
||||||
if(BUILD_DOCS)
|
if(BUILD_DOCS)
|
||||||
include(cmake/OpenCVFindLATEX.cmake)
|
include(cmake/OpenCVFindLATEX.cmake)
|
||||||
|
find_host_program(DOXYGEN_BUILD doxygen)
|
||||||
|
if (DOXYGEN_BUILD)
|
||||||
|
set(HAVE_DOXYGEN 1)
|
||||||
|
endif (DOXYGEN_BUILD)
|
||||||
endif(BUILD_DOCS)
|
endif(BUILD_DOCS)
|
||||||
|
|
||||||
# --- Python Support ---
|
# --- Python Support ---
|
||||||
@@ -471,6 +528,9 @@ if(WITH_OPENCL)
|
|||||||
include(cmake/OpenCVDetectOpenCL.cmake)
|
include(cmake/OpenCVDetectOpenCL.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# --- VTK support ---
|
||||||
|
include(cmake/OpenCVDetectVTK.cmake)
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Add CUDA libraries (needed for apps/tools, samples)
|
# Add CUDA libraries (needed for apps/tools, samples)
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@@ -558,6 +618,61 @@ include(cmake/OpenCVGenConfig.cmake)
|
|||||||
# Generate Info.plist for the IOS framework
|
# Generate Info.plist for the IOS framework
|
||||||
include(cmake/OpenCVGenInfoPlist.cmake)
|
include(cmake/OpenCVGenInfoPlist.cmake)
|
||||||
|
|
||||||
|
# Generate environment setup file
|
||||||
|
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 . COMPONENT tests)
|
||||||
|
elseif(WIN32 OR UNIX)
|
||||||
|
set(OPENCV_PYTHON_TESTS_LIST "")
|
||||||
|
if(BUILD_opencv_python)
|
||||||
|
file(GLOB py_tests modules/python/test/*.py)
|
||||||
|
install(PROGRAMS ${py_tests} DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
|
||||||
|
if(BUILD_opencv_nonfree)
|
||||||
|
file(GLOB py_nonfree_tests modules/python/test/nonfree_tests/*.py)
|
||||||
|
install(PROGRAMS ${py_nonfree_tests} DESTINATION ${OPENCV_TEST_INSTALL_PATH}/nonfree_tests COMPONENT tests)
|
||||||
|
endif()
|
||||||
|
set(OPENCV_PYTHON_TESTS_LIST "test.py")
|
||||||
|
endif()
|
||||||
|
if(WIN32)
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_windows.cmd.in"
|
||||||
|
"${CMAKE_BINARY_DIR}/win-install/opencv_run_all_tests.cmd" @ONLY)
|
||||||
|
install(PROGRAMS "${CMAKE_BINARY_DIR}/win-install/opencv_run_all_tests.cmd"
|
||||||
|
DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
|
||||||
|
else()
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_unix.sh.in"
|
||||||
|
"${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
|
||||||
|
install(PROGRAMS "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
|
||||||
|
DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT OPENCV_README_FILE)
|
||||||
|
if(ANDROID)
|
||||||
|
set(OPENCV_README_FILE ${CMAKE_CURRENT_SOURCE_DIR}/platforms/android/README.android)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT OPENCV_LICENSE_FILE)
|
||||||
|
set(OPENCV_LICENSE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# for UNIX it does not make sense as LICENSE and readme will be part of the package automatically
|
||||||
|
if(ANDROID OR NOT UNIX)
|
||||||
|
install(FILES ${OPENCV_LICENSE_FILE}
|
||||||
|
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
|
||||||
|
DESTINATION . COMPONENT libs)
|
||||||
|
if(OPENCV_README_FILE)
|
||||||
|
install(FILES ${OPENCV_README_FILE}
|
||||||
|
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
|
||||||
|
DESTINATION . COMPONENT libs)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Summary:
|
# Summary:
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@@ -668,8 +783,8 @@ if(WIN32)
|
|||||||
status("")
|
status("")
|
||||||
status(" Windows RT support:" HAVE_WINRT THEN YES ELSE NO)
|
status(" Windows RT support:" HAVE_WINRT THEN YES ELSE NO)
|
||||||
if (ENABLE_WINRT_MODE OR ENABLE_WINRT_MODE_NATIVE)
|
if (ENABLE_WINRT_MODE OR ENABLE_WINRT_MODE_NATIVE)
|
||||||
status(" Windows SDK v8.0:" ${WINDOWS_SDK_PATH})
|
status(" Windows (Phone) SDK v8.0/v8.1:" ${WINDOWS_SDK_PATH})
|
||||||
status(" Visual Studio 2012:" ${VISUAL_STUDIO_PATH})
|
status(" Visual Studio 2012/2013:" ${VISUAL_STUDIO_PATH})
|
||||||
endif()
|
endif()
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
@@ -705,6 +820,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
status(" OpenGL support:" HAVE_OPENGL THEN "YES (${OPENGL_LIBRARIES})" ELSE NO)
|
status(" OpenGL support:" HAVE_OPENGL THEN "YES (${OPENGL_LIBRARIES})" ELSE NO)
|
||||||
|
status(" VTK support:" HAVE_VTK THEN "YES (ver ${VTK_VERSION})" ELSE NO)
|
||||||
|
|
||||||
# ========================== MEDIA IO ==========================
|
# ========================== MEDIA IO ==========================
|
||||||
status("")
|
status("")
|
||||||
@@ -777,16 +893,19 @@ if(DEFINED WITH_FFMPEG)
|
|||||||
status(" format:" HAVE_FFMPEG_FORMAT THEN "YES (ver ${ALIASOF_libavformat_VERSION})" ELSE NO)
|
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(" 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(" 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)
|
status(" gentoo-style:" HAVE_GENTOO_FFMPEG THEN YES ELSE NO)
|
||||||
endif(DEFINED WITH_FFMPEG)
|
endif(DEFINED WITH_FFMPEG)
|
||||||
|
|
||||||
if(DEFINED WITH_GSTREAMER)
|
if(DEFINED WITH_GSTREAMER)
|
||||||
status(" GStreamer:" HAVE_GSTREAMER THEN "" ELSE NO)
|
status(" GStreamer:" HAVE_GSTREAMER THEN "" ELSE NO)
|
||||||
if(HAVE_GSTREAMER)
|
if(HAVE_GSTREAMER)
|
||||||
status(" base:" "YES (ver ${ALIASOF_gstreamer-base-0.10_VERSION})")
|
status(" base:" "YES (ver ${GSTREAMER_BASE_VERSION})")
|
||||||
status(" app:" "YES (ver ${ALIASOF_gstreamer-app-0.10_VERSION})")
|
status(" video:" "YES (ver ${GSTREAMER_VIDEO_VERSION})")
|
||||||
status(" video:" "YES (ver ${ALIASOF_gstreamer-video-0.10_VERSION})")
|
status(" app:" "YES (ver ${GSTREAMER_APP_VERSION})")
|
||||||
endif()
|
status(" riff:" "YES (ver ${GSTREAMER_RIFF_VERSION})")
|
||||||
|
status(" pbutils:" "YES (ver ${GSTREAMER_PBUTILS_VERSION})")
|
||||||
|
endif(HAVE_GSTREAMER)
|
||||||
endif(DEFINED WITH_GSTREAMER)
|
endif(DEFINED WITH_GSTREAMER)
|
||||||
|
|
||||||
if(DEFINED WITH_OPENNI)
|
if(DEFINED WITH_OPENNI)
|
||||||
@@ -827,8 +946,9 @@ if(DEFINED WITH_V4L)
|
|||||||
else()
|
else()
|
||||||
set(HAVE_CAMV4L2_STR "NO")
|
set(HAVE_CAMV4L2_STR "NO")
|
||||||
endif()
|
endif()
|
||||||
status(" V4L/V4L2:" HAVE_LIBV4L THEN "Using libv4l (ver ${ALIASOF_libv4l1_VERSION})"
|
status(" V4L/V4L2:" HAVE_LIBV4L
|
||||||
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
|
THEN "Using libv4l1 (ver ${ALIASOF_libv4l1_VERSION}) / libv4l2 (ver ${ALIASOF_libv4l2_VERSION})"
|
||||||
|
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
|
||||||
endif(DEFINED WITH_V4L)
|
endif(DEFINED WITH_V4L)
|
||||||
|
|
||||||
if(DEFINED WITH_DSHOW)
|
if(DEFINED WITH_DSHOW)
|
||||||
@@ -882,6 +1002,7 @@ if(HAVE_CUDA)
|
|||||||
status(" NVIDIA GPU arch:" ${OPENCV_CUDA_ARCH_BIN})
|
status(" NVIDIA GPU arch:" ${OPENCV_CUDA_ARCH_BIN})
|
||||||
status(" NVIDIA PTX archs:" ${OPENCV_CUDA_ARCH_PTX})
|
status(" NVIDIA PTX archs:" ${OPENCV_CUDA_ARCH_PTX})
|
||||||
status(" Use fast math:" CUDA_FAST_MATH THEN YES ELSE NO)
|
status(" Use fast math:" CUDA_FAST_MATH THEN YES ELSE NO)
|
||||||
|
status(" Tiny gpu module:" BUILD_TINY_GPU_MODULE THEN YES ELSE NO)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(HAVE_OPENCL)
|
if(HAVE_OPENCL)
|
||||||
@@ -950,6 +1071,7 @@ if(BUILD_DOCS)
|
|||||||
endif()
|
endif()
|
||||||
status(" Sphinx:" HAVE_SPHINX THEN "${SPHINX_BUILD} (ver ${SPHINX_VERSION})" ELSE NO)
|
status(" Sphinx:" HAVE_SPHINX THEN "${SPHINX_BUILD} (ver ${SPHINX_VERSION})" ELSE NO)
|
||||||
status(" PdfLaTeX compiler:" PDFLATEX_COMPILER THEN "${PDFLATEX_COMPILER}" ELSE NO)
|
status(" PdfLaTeX compiler:" PDFLATEX_COMPILER THEN "${PDFLATEX_COMPILER}" ELSE NO)
|
||||||
|
status(" Doxygen:" HAVE_DOXYGEN THEN "YES (${DOXYGEN_BUILD})" ELSE NO)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ========================== samples and tests ==========================
|
# ========================== samples and tests ==========================
|
||||||
@@ -975,3 +1097,9 @@ ocv_finalize_status()
|
|||||||
if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
message(WARNING "The source directory is the same as binary directory. \"make clean\" may damage the source tree")
|
message(WARNING "The source directory is the same as binary directory. \"make clean\" may damage the source tree")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# CPack stuff
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
include(cmake/OpenCVPackaging.cmake)
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
## Contributing guidelines
|
||||||
|
|
||||||
|
All guidelines for contributing to the OpenCV repository can be found at [`How to contribute guideline`](https://github.com/Itseez/opencv/wiki/How_to_contribute).
|
||||||
@@ -1,16 +1,11 @@
|
|||||||
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,
|
||||||
By downloading, copying, installing or using the software you agree to this license.
|
copy or use the software.
|
||||||
If you do not agree to this license, do not download, install,
|
|
||||||
copy or use the software.
|
|
||||||
|
|
||||||
|
|
||||||
License Agreement
|
License Agreement
|
||||||
For Open Source Computer Vision Library
|
For Open Source Computer Vision Library
|
||||||
|
(3-clause BSD License)
|
||||||
Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
|
|
||||||
Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
|
|
||||||
Third party copyrights are property of their respective owners.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
are permitted provided that the following conditions are met:
|
are permitted provided that the following conditions are met:
|
||||||
@@ -22,13 +17,14 @@ are permitted provided that the following conditions are met:
|
|||||||
this list of conditions and the following disclaimer in the documentation
|
this list of conditions and the following disclaimer in the documentation
|
||||||
and/or other materials provided with the distribution.
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
* The name of the copyright holders may not be used to endorse or promote products
|
* Neither the names of the copyright holders nor the names of the contributors
|
||||||
derived from this software without specific prior written permission.
|
may 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
|
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
|
any express or implied warranties, including, but not limited to, the implied
|
||||||
warranties of merchantability and fitness for a particular purpose are disclaimed.
|
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,
|
In no event shall copyright holders or contributors be liable for any direct,
|
||||||
indirect, incidental, special, exemplary, or consequential damages
|
indirect, incidental, special, exemplary, or consequential damages
|
||||||
(including, but not limited to, procurement of substitute goods or services;
|
(including, but not limited to, procurement of substitute goods or services;
|
||||||
loss of use, data, or profits; or business interruption) however caused
|
loss of use, data, or profits; or business interruption) however caused
|
||||||
@@ -18,6 +18,3 @@ Summary of guidelines:
|
|||||||
* Include tests and documentation;
|
* Include tests and documentation;
|
||||||
* Clean up "oops" commits before submitting;
|
* Clean up "oops" commits before submitting;
|
||||||
* Follow the coding style guide.
|
* Follow the coding style guide.
|
||||||
|
|
||||||
[](https://www.gittip.com/OpenCV/)
|
|
||||||
[](https://www.paypal.com/cgi-bin/webscr?item_name=Donation+to+OpenCV&cmd=_donations&business=accountant%40opencv.org)
|
|
||||||
@@ -2,3 +2,5 @@ link_libraries(${OPENCV_LINKER_LIBS})
|
|||||||
|
|
||||||
add_subdirectory(haartraining)
|
add_subdirectory(haartraining)
|
||||||
add_subdirectory(traincascade)
|
add_subdirectory(traincascade)
|
||||||
|
add_subdirectory(annotation)
|
||||||
|
add_subdirectory(visualisation)
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
SET(OPENCV_ANNOTATION_DEPS opencv_core opencv_highgui opencv_imgproc)
|
||||||
|
ocv_check_dependencies(${OPENCV_ANNOTATION_DEPS})
|
||||||
|
|
||||||
|
if(NOT OCV_DEPENDENCIES_FOUND)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
project(annotation)
|
||||||
|
|
||||||
|
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
|
||||||
|
ocv_include_modules(${OPENCV_ANNOTATION_DEPS})
|
||||||
|
|
||||||
|
set(annotation_files opencv_annotation.cpp)
|
||||||
|
set(the_target opencv_annotation)
|
||||||
|
|
||||||
|
add_executable(${the_target} ${annotation_files})
|
||||||
|
target_link_libraries(${the_target} ${OPENCV_ANNOTATION_DEPS})
|
||||||
|
|
||||||
|
set_target_properties(${the_target} PROPERTIES
|
||||||
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
||||||
|
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,319 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||||
|
//
|
||||||
|
// By downloading, copying, installing or using the software you agree to this license.
|
||||||
|
// If you do not agree to this license, do not download, install,
|
||||||
|
// copy or use the software.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// License Agreement
|
||||||
|
// For Open Source Computer Vision Library
|
||||||
|
//
|
||||||
|
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
|
||||||
|
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
|
||||||
|
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
|
||||||
|
// Third party copyrights are property of their respective owners.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
// are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// * Redistribution's of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer in the documentation
|
||||||
|
// and/or other materials provided with the distribution.
|
||||||
|
//
|
||||||
|
// * The name of the copyright holders may not be used to endorse or promote products
|
||||||
|
// derived from this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// This software is provided by the copyright holders and contributors "as is" and
|
||||||
|
// any express or implied warranties, including, but not limited to, the implied
|
||||||
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||||
|
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||||
|
// indirect, incidental, special, exemplary, or consequential damages
|
||||||
|
// (including, but not limited to, procurement of substitute goods or services;
|
||||||
|
// loss of use, data, or profits; or business interruption) however caused
|
||||||
|
// and on any theory of liability, whether in contract, strict liability,
|
||||||
|
// or tort (including negligence or otherwise) arising in any way out of
|
||||||
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/*****************************************************************************************************
|
||||||
|
USAGE:
|
||||||
|
./opencv_annotation -images <folder location> -annotations <ouput file>
|
||||||
|
|
||||||
|
Created by: Puttemans Steven - February 2015
|
||||||
|
Adapted by: Puttemans Steven - April 2016 - Vectorize the process to enable better processing
|
||||||
|
+ early leave and store by pressing an ESC key
|
||||||
|
+ enable delete `d` button, to remove last annotation
|
||||||
|
*****************************************************************************************************/
|
||||||
|
|
||||||
|
#include <opencv2/core/core.hpp>
|
||||||
|
#include <opencv2/highgui/highgui.hpp>
|
||||||
|
#include <opencv2/imgproc/imgproc.hpp>
|
||||||
|
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#include <direct.h>
|
||||||
|
#else
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace cv;
|
||||||
|
|
||||||
|
// Function prototypes
|
||||||
|
void on_mouse(int, int, int, int, void*);
|
||||||
|
vector<Rect> get_annotations(Mat);
|
||||||
|
|
||||||
|
// 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, stop = 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 and drawing is enabled
|
||||||
|
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 : returns a vector of Rect objects given an image containing positive object instances
|
||||||
|
vector<Rect> get_annotations(Mat input_image)
|
||||||
|
{
|
||||||
|
vector<Rect> current_annotations;
|
||||||
|
|
||||||
|
// Make it possible to exit the annotation process
|
||||||
|
stop = false;
|
||||||
|
|
||||||
|
// Init window interface and couple mouse actions
|
||||||
|
namedWindow(window_name, WINDOW_AUTOSIZE);
|
||||||
|
setMouseCallback(window_name, on_mouse);
|
||||||
|
|
||||||
|
image = input_image;
|
||||||
|
imshow(window_name, image);
|
||||||
|
int key_pressed = 0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// Get a temporary image clone
|
||||||
|
Mat temp_image = input_image.clone();
|
||||||
|
Rect currentRect(0, 0, 0, 0);
|
||||||
|
|
||||||
|
// 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
|
||||||
|
// <d> = 100 delete the last annotation made
|
||||||
|
// <ESC> = 27 exit program
|
||||||
|
key_pressed = 0xFF & waitKey(0);
|
||||||
|
switch( key_pressed )
|
||||||
|
{
|
||||||
|
case 27:
|
||||||
|
destroyWindow(window_name);
|
||||||
|
stop = true;
|
||||||
|
break;
|
||||||
|
case 99:
|
||||||
|
// Draw initiated from top left corner
|
||||||
|
if(roi_x0<roi_x1 && roi_y0<roi_y1)
|
||||||
|
{
|
||||||
|
currentRect.x = roi_x0;
|
||||||
|
currentRect.y = roi_y0;
|
||||||
|
currentRect.width = roi_x1-roi_x0;
|
||||||
|
currentRect.height = roi_y1-roi_y0;
|
||||||
|
}
|
||||||
|
// Draw initiated from bottom right corner
|
||||||
|
if(roi_x0>roi_x1 && roi_y0>roi_y1)
|
||||||
|
{
|
||||||
|
currentRect.x = roi_x1;
|
||||||
|
currentRect.y = roi_y1;
|
||||||
|
currentRect.width = roi_x0-roi_x1;
|
||||||
|
currentRect.height = roi_y0-roi_y1;
|
||||||
|
}
|
||||||
|
// Draw initiated from top right corner
|
||||||
|
if(roi_x0>roi_x1 && roi_y0<roi_y1)
|
||||||
|
{
|
||||||
|
currentRect.x = roi_x1;
|
||||||
|
currentRect.y = roi_y0;
|
||||||
|
currentRect.width = roi_x0-roi_x1;
|
||||||
|
currentRect.height = roi_y1-roi_y0;
|
||||||
|
}
|
||||||
|
// Draw initiated from bottom left corner
|
||||||
|
if(roi_x0<roi_x1 && roi_y0>roi_y1)
|
||||||
|
{
|
||||||
|
currentRect.x = roi_x0;
|
||||||
|
currentRect.y = roi_y1;
|
||||||
|
currentRect.width = roi_x1-roi_x0;
|
||||||
|
currentRect.height = roi_y0-roi_y1;
|
||||||
|
}
|
||||||
|
// Draw the rectangle on the canvas
|
||||||
|
// Add the rectangle to the vector of annotations
|
||||||
|
current_annotations.push_back(currentRect);
|
||||||
|
break;
|
||||||
|
case 100:
|
||||||
|
// Remove the last annotation
|
||||||
|
if(current_annotations.size() > 0){
|
||||||
|
current_annotations.pop_back();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// Default case --> do nothing at all
|
||||||
|
// Other keystrokes can simply be ignored
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if escape has been pressed
|
||||||
|
if(stop)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw all the current rectangles onto the top image and make sure that the global image is linked
|
||||||
|
for(int i=0; i < (int)current_annotations.size(); i++){
|
||||||
|
rectangle(temp_image, current_annotations[i], Scalar(0,255,0), 1);
|
||||||
|
}
|
||||||
|
image = temp_image;
|
||||||
|
|
||||||
|
// Force an explicit redraw of the canvas --> necessary to visualize delete correctly
|
||||||
|
imshow(window_name, image);
|
||||||
|
}
|
||||||
|
// Continue as long as the next image key has not been pressed
|
||||||
|
while(key_pressed != 110);
|
||||||
|
|
||||||
|
// Close down the window
|
||||||
|
destroyWindow(window_name);
|
||||||
|
|
||||||
|
// Return the data
|
||||||
|
return current_annotations;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
cout << "TIP: Use absolute paths to avoid any problems with the software!" << endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read in the input arguments
|
||||||
|
string image_folder;
|
||||||
|
string annotations_file;
|
||||||
|
for(int i = 1; i < argc; ++i )
|
||||||
|
{
|
||||||
|
if( !strcmp( argv[i], "-images" ) )
|
||||||
|
{
|
||||||
|
image_folder = argv[++i];
|
||||||
|
}
|
||||||
|
else if( !strcmp( argv[i], "-annotations" ) )
|
||||||
|
{
|
||||||
|
annotations_file = argv[++i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the folder actually exists
|
||||||
|
// If -1 is returned then the folder actually exists, and thus you can continue
|
||||||
|
// In all other cases there was a folder creation and thus the folder did not exist
|
||||||
|
#if defined(_WIN32)
|
||||||
|
if(_mkdir(image_folder.c_str()) != -1){
|
||||||
|
// Generate an error message
|
||||||
|
cerr << "The image folder given does not exist. Please check again!" << endl;
|
||||||
|
// Remove the created folder again, to ensure a second run with same code fails again
|
||||||
|
_rmdir(image_folder.c_str());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if(mkdir(image_folder.c_str(), 0777) != -1){
|
||||||
|
// Generate an error message
|
||||||
|
cerr << "The image folder given does not exist. Please check again!" << endl;
|
||||||
|
// Remove the created folder again, to ensure a second run with same code fails again
|
||||||
|
remove(image_folder.c_str());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Start by processing the data
|
||||||
|
// Return the image filenames inside the image folder
|
||||||
|
vector< vector<Rect> > annotations;
|
||||||
|
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]);
|
||||||
|
|
||||||
|
// Check if the image is actually read - avoid other files in the folder, because glob() takes them all
|
||||||
|
// If not then simply skip this iteration
|
||||||
|
if(current_image.empty()){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Perform annotations & store the result inside the vectorized structure
|
||||||
|
vector<Rect> current_annotations = get_annotations(current_image);
|
||||||
|
annotations.push_back(current_annotations);
|
||||||
|
|
||||||
|
// Check if the ESC key was hit, then exit earlier then expected
|
||||||
|
if(stop){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// When all data is processed, store the data gathered inside the proper file
|
||||||
|
// This now even gets called when the ESC button was hit to store preliminary results
|
||||||
|
ofstream output(annotations_file.c_str());
|
||||||
|
if ( !output.is_open() ){
|
||||||
|
cerr << "The path for the output file contains an error and could not be opened. Please check again!" << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store the annotations, write to the output file
|
||||||
|
for(int i = 0; i < (int)annotations.size(); i++){
|
||||||
|
output << filenames[i] << " " << annotations[i].size();
|
||||||
|
for(int j=0; j < (int)annotations[i].size(); j++){
|
||||||
|
Rect temp = annotations[i][j];
|
||||||
|
output << " " << temp.x << " " << temp.y << " " << temp.width << " " << temp.height;
|
||||||
|
}
|
||||||
|
output << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -14,8 +14,6 @@ if(WIN32)
|
|||||||
link_directories(${CMAKE_CURRENT_BINARY_DIR})
|
link_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
link_libraries(${OPENCV_HAARTRAINING_DEPS} opencv_haartraining_engine)
|
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Library
|
# Library
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
@@ -29,14 +27,17 @@ set(cvhaartraining_lib_src
|
|||||||
cvhaarclassifier.cpp
|
cvhaarclassifier.cpp
|
||||||
cvhaartraining.cpp
|
cvhaartraining.cpp
|
||||||
cvsamples.cpp
|
cvsamples.cpp
|
||||||
|
cvsamplesoutput.cpp
|
||||||
|
cvsamplesoutput.h
|
||||||
|
ioutput.h
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(opencv_haartraining_engine STATIC ${cvhaartraining_lib_src})
|
add_library(opencv_haartraining_engine STATIC ${cvhaartraining_lib_src})
|
||||||
|
target_link_libraries(opencv_haartraining_engine ${OPENCV_HAARTRAINING_DEPS})
|
||||||
set_target_properties(opencv_haartraining_engine PROPERTIES
|
set_target_properties(opencv_haartraining_engine PROPERTIES
|
||||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
||||||
INSTALL_NAME_DIR lib
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
@@ -44,6 +45,7 @@ set_target_properties(opencv_haartraining_engine PROPERTIES
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
|
|
||||||
add_executable(opencv_haartraining cvhaartraining.h haartraining.cpp)
|
add_executable(opencv_haartraining cvhaartraining.h haartraining.cpp)
|
||||||
|
target_link_libraries(opencv_haartraining ${OPENCV_HAARTRAINING_DEPS} opencv_haartraining_engine)
|
||||||
set_target_properties(opencv_haartraining PROPERTIES
|
set_target_properties(opencv_haartraining PROPERTIES
|
||||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||||
OUTPUT_NAME "opencv_haartraining")
|
OUTPUT_NAME "opencv_haartraining")
|
||||||
@@ -53,6 +55,7 @@ set_target_properties(opencv_haartraining PROPERTIES
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
|
|
||||||
add_executable(opencv_createsamples cvhaartraining.h createsamples.cpp)
|
add_executable(opencv_createsamples cvhaartraining.h createsamples.cpp)
|
||||||
|
target_link_libraries(opencv_createsamples ${OPENCV_HAARTRAINING_DEPS} opencv_haartraining_engine)
|
||||||
set_target_properties(opencv_createsamples PROPERTIES
|
set_target_properties(opencv_createsamples PROPERTIES
|
||||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||||
OUTPUT_NAME "opencv_createsamples")
|
OUTPUT_NAME "opencv_createsamples")
|
||||||
@@ -61,6 +64,7 @@ set_target_properties(opencv_createsamples PROPERTIES
|
|||||||
# performance
|
# performance
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
add_executable(opencv_performance performance.cpp)
|
add_executable(opencv_performance performance.cpp)
|
||||||
|
target_link_libraries(opencv_performance ${OPENCV_HAARTRAINING_DEPS} opencv_haartraining_engine)
|
||||||
set_target_properties(opencv_performance PROPERTIES
|
set_target_properties(opencv_performance PROPERTIES
|
||||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||||
OUTPUT_NAME "opencv_performance")
|
OUTPUT_NAME "opencv_performance")
|
||||||
@@ -71,14 +75,14 @@ set_target_properties(opencv_performance PROPERTIES
|
|||||||
|
|
||||||
if(INSTALL_CREATE_DISTRIB)
|
if(INSTALL_CREATE_DISTRIB)
|
||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
|
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
|
||||||
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
|
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
|
||||||
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
|
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
|
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
|
||||||
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
|
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
|
||||||
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
|
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_SOLUTION_FOLDERS)
|
if(ENABLE_SOLUTION_FOLDERS)
|
||||||
|
|||||||
@@ -50,10 +50,12 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include "cvhaartraining.h"
|
#include "cvhaartraining.h"
|
||||||
|
#include "ioutput.h"
|
||||||
|
|
||||||
int main( int argc, char* argv[] )
|
int main( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
@@ -71,11 +73,12 @@ int main( int argc, char* argv[] )
|
|||||||
double maxxangle = 1.1;
|
double maxxangle = 1.1;
|
||||||
double maxyangle = 1.1;
|
double maxyangle = 1.1;
|
||||||
double maxzangle = 0.5;
|
double maxzangle = 0.5;
|
||||||
int showsamples = 0;
|
bool showsamples = false;
|
||||||
/* the samples are adjusted to this scale in the sample preview window */
|
/* the samples are adjusted to this scale in the sample preview window */
|
||||||
double scale = 4.0;
|
double scale = 4.0;
|
||||||
int width = 24;
|
int width = 24;
|
||||||
int height = 24;
|
int height = 24;
|
||||||
|
bool pngoutput = false; /* whether to make the samples in png or in jpg*/
|
||||||
|
|
||||||
srand((unsigned int)time(0));
|
srand((unsigned int)time(0));
|
||||||
|
|
||||||
@@ -92,7 +95,8 @@ int main( int argc, char* argv[] )
|
|||||||
" [-maxyangle <max_y_rotation_angle = %f>]\n"
|
" [-maxyangle <max_y_rotation_angle = %f>]\n"
|
||||||
" [-maxzangle <max_z_rotation_angle = %f>]\n"
|
" [-maxzangle <max_z_rotation_angle = %f>]\n"
|
||||||
" [-show [<scale = %f>]]\n"
|
" [-show [<scale = %f>]]\n"
|
||||||
" [-w <sample_width = %d>]\n [-h <sample_height = %d>]\n",
|
" [-w <sample_width = %d>]\n [-h <sample_height = %d>]\n"
|
||||||
|
" [-pngoutput]",
|
||||||
argv[0], num, bgcolor, bgthreshold, maxintensitydev,
|
argv[0], num, bgcolor, bgthreshold, maxintensitydev,
|
||||||
maxxangle, maxyangle, maxzangle, scale, width, height );
|
maxxangle, maxyangle, maxzangle, scale, width, height );
|
||||||
|
|
||||||
@@ -155,7 +159,7 @@ int main( int argc, char* argv[] )
|
|||||||
}
|
}
|
||||||
else if( !strcmp( argv[i], "-show" ) )
|
else if( !strcmp( argv[i], "-show" ) )
|
||||||
{
|
{
|
||||||
showsamples = 1;
|
showsamples = true;
|
||||||
if( i+1 < argc && strlen( argv[i+1] ) > 0 && argv[i+1][0] != '-' )
|
if( i+1 < argc && strlen( argv[i+1] ) > 0 && argv[i+1][0] != '-' )
|
||||||
{
|
{
|
||||||
double d;
|
double d;
|
||||||
@@ -172,6 +176,10 @@ int main( int argc, char* argv[] )
|
|||||||
{
|
{
|
||||||
height = atoi( argv[++i] );
|
height = atoi( argv[++i] );
|
||||||
}
|
}
|
||||||
|
else if( !strcmp( argv[i], "-pngoutput" ) )
|
||||||
|
{
|
||||||
|
pngoutput = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf( "Info file name: %s\n", ((infoname == NULL) ? nullname : infoname ) );
|
printf( "Info file name: %s\n", ((infoname == NULL) ? nullname : infoname ) );
|
||||||
@@ -190,10 +198,14 @@ int main( int argc, char* argv[] )
|
|||||||
printf( "Show samples: %s\n", (showsamples) ? "TRUE" : "FALSE" );
|
printf( "Show samples: %s\n", (showsamples) ? "TRUE" : "FALSE" );
|
||||||
if( showsamples )
|
if( showsamples )
|
||||||
{
|
{
|
||||||
printf( "Scale: %g\n", scale );
|
printf( "Scale applied to display : %g\n", scale );
|
||||||
|
}
|
||||||
|
if( !pngoutput)
|
||||||
|
{
|
||||||
|
printf( "Original image will be scaled to:\n");
|
||||||
|
printf( "\tWidth: $backgroundWidth / %d\n", width );
|
||||||
|
printf( "\tHeight: $backgroundHeight / %d\n", height );
|
||||||
}
|
}
|
||||||
printf( "Width: %d\n", width );
|
|
||||||
printf( "Height: %d\n", height );
|
|
||||||
|
|
||||||
/* determine action */
|
/* determine action */
|
||||||
if( imagename && vecname )
|
if( imagename && vecname )
|
||||||
@@ -207,13 +219,24 @@ int main( int argc, char* argv[] )
|
|||||||
|
|
||||||
printf( "Done\n" );
|
printf( "Done\n" );
|
||||||
}
|
}
|
||||||
else if( imagename && bgfilename && infoname )
|
else if( imagename && bgfilename && infoname)
|
||||||
{
|
{
|
||||||
printf( "Create test samples from single image applying distortions...\n" );
|
printf( "Create data set from single image applying distortions...\n"
|
||||||
|
"Output format: %s\n",
|
||||||
|
(( pngoutput ) ? "PNG" : "JPG") );
|
||||||
|
|
||||||
cvCreateTestSamples( infoname, imagename, bgcolor, bgthreshold, bgfilename, num,
|
std::auto_ptr<DatasetGenerator> creator;
|
||||||
invert, maxintensitydev,
|
if( pngoutput )
|
||||||
maxxangle, maxyangle, maxzangle, showsamples, width, height );
|
{
|
||||||
|
creator = std::auto_ptr<DatasetGenerator>( new PngDatasetGenerator( infoname ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
creator = std::auto_ptr<DatasetGenerator>( new JpgDatasetGenerator( infoname ) );
|
||||||
|
}
|
||||||
|
creator->create( imagename, bgcolor, bgthreshold, bgfilename, num,
|
||||||
|
invert, maxintensitydev, maxxangle, maxyangle, maxzangle,
|
||||||
|
showsamples, width, height );
|
||||||
|
|
||||||
printf( "Done\n" );
|
printf( "Done\n" );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ typedef enum CvBoostType
|
|||||||
CV_LKCLASS = 5, /* classification (K class problem) */
|
CV_LKCLASS = 5, /* classification (K class problem) */
|
||||||
CV_LSREG = 6, /* least squares regression */
|
CV_LSREG = 6, /* least squares regression */
|
||||||
CV_LADREG = 7, /* least absolute deviation regression */
|
CV_LADREG = 7, /* least absolute deviation regression */
|
||||||
CV_MREG = 8, /* M-regression (Huber loss) */
|
CV_MREG = 8 /* M-regression (Huber loss) */
|
||||||
} CvBoostType;
|
} CvBoostType;
|
||||||
|
|
||||||
/****************************************************************************************\
|
/****************************************************************************************\
|
||||||
|
|||||||
@@ -48,6 +48,8 @@
|
|||||||
#include "cvhaartraining.h"
|
#include "cvhaartraining.h"
|
||||||
#include "_cvhaartraining.h"
|
#include "_cvhaartraining.h"
|
||||||
|
|
||||||
|
#include "ioutput.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
@@ -2841,14 +2843,12 @@ void cvCreateTreeCascadeClassifier( const char* dirname,
|
|||||||
cvReleaseMat( &features_idx );
|
cvReleaseMat( &features_idx );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void cvCreateTrainingSamples( const char* filename,
|
void cvCreateTrainingSamples( const char* filename,
|
||||||
const char* imgfilename, int bgcolor, int bgthreshold,
|
const char* imgfilename, int bgcolor, int bgthreshold,
|
||||||
const char* bgfilename, int count,
|
const char* bgfilename, int count,
|
||||||
int invert, int maxintensitydev,
|
int invert, int maxintensitydev,
|
||||||
double maxxangle, double maxyangle, double maxzangle,
|
double maxxangle, double maxyangle, double maxzangle,
|
||||||
int showsamples,
|
bool showsamples,
|
||||||
int winwidth, int winheight )
|
int winwidth, int winheight )
|
||||||
{
|
{
|
||||||
CvSampleDistortionData data;
|
CvSampleDistortionData data;
|
||||||
@@ -2915,7 +2915,7 @@ void cvCreateTrainingSamples( const char* filename,
|
|||||||
cvShowImage( "Sample", &sample );
|
cvShowImage( "Sample", &sample );
|
||||||
if( cvWaitKey( 0 ) == 27 )
|
if( cvWaitKey( 0 ) == 27 )
|
||||||
{
|
{
|
||||||
showsamples = 0;
|
showsamples = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2942,45 +2942,43 @@ void cvCreateTrainingSamples( const char* filename,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CV_INFO_FILENAME "info.dat"
|
DatasetGenerator::DatasetGenerator( IOutput* _writer )
|
||||||
|
:writer(_writer)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void cvCreateTestSamples( const char* infoname,
|
void DatasetGenerator::showSamples(bool* show, CvMat *img) const
|
||||||
const char* imgfilename, int bgcolor, int bgthreshold,
|
{
|
||||||
const char* bgfilename, int count,
|
if( *show )
|
||||||
int invert, int maxintensitydev,
|
{
|
||||||
double maxxangle, double maxyangle, double maxzangle,
|
cvShowImage( "Image", img);
|
||||||
int showsamples,
|
if( cvWaitKey( 0 ) == 27 )
|
||||||
int winwidth, int winheight )
|
{
|
||||||
|
*show = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DatasetGenerator::create(const char* imgfilename, int bgcolor, int bgthreshold,
|
||||||
|
const char* bgfilename, int count,
|
||||||
|
int invert, int maxintensitydev,
|
||||||
|
double maxxangle, double maxyangle, double maxzangle,
|
||||||
|
bool showsamples,
|
||||||
|
int winwidth, int winheight )
|
||||||
{
|
{
|
||||||
CvSampleDistortionData data;
|
CvSampleDistortionData data;
|
||||||
|
|
||||||
assert( infoname != NULL );
|
|
||||||
assert( imgfilename != NULL );
|
assert( imgfilename != NULL );
|
||||||
assert( bgfilename != NULL );
|
assert( bgfilename != NULL );
|
||||||
|
|
||||||
if( !icvMkDir( infoname ) )
|
|
||||||
{
|
|
||||||
|
|
||||||
#if CV_VERBOSE
|
|
||||||
fprintf( stderr, "Unable to create directory hierarchy: %s\n", infoname );
|
|
||||||
#endif /* CV_VERBOSE */
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if( icvStartSampleDistortion( imgfilename, bgcolor, bgthreshold, &data ) )
|
if( icvStartSampleDistortion( imgfilename, bgcolor, bgthreshold, &data ) )
|
||||||
{
|
{
|
||||||
char fullname[PATH_MAX];
|
|
||||||
char* filename;
|
|
||||||
CvMat win;
|
CvMat win;
|
||||||
FILE* info;
|
|
||||||
|
|
||||||
if( icvInitBackgroundReaders( bgfilename, cvSize( 10, 10 ) ) )
|
if( icvInitBackgroundReaders( bgfilename, cvSize( 10, 10 ) ) )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int x, y, width, height;
|
|
||||||
float scale;
|
|
||||||
float maxscale;
|
|
||||||
int inverse;
|
int inverse;
|
||||||
|
|
||||||
if( showsamples )
|
if( showsamples )
|
||||||
@@ -2988,73 +2986,112 @@ void cvCreateTestSamples( const char* infoname,
|
|||||||
cvNamedWindow( "Image", CV_WINDOW_AUTOSIZE );
|
cvNamedWindow( "Image", CV_WINDOW_AUTOSIZE );
|
||||||
}
|
}
|
||||||
|
|
||||||
info = fopen( infoname, "w" );
|
|
||||||
strcpy( fullname, infoname );
|
|
||||||
filename = strrchr( fullname, '\\' );
|
|
||||||
if( filename == NULL )
|
|
||||||
{
|
|
||||||
filename = strrchr( fullname, '/' );
|
|
||||||
}
|
|
||||||
if( filename == NULL )
|
|
||||||
{
|
|
||||||
filename = fullname;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
filename++;
|
|
||||||
}
|
|
||||||
|
|
||||||
count = MIN( count, cvbgdata->count );
|
count = MIN( count, cvbgdata->count );
|
||||||
inverse = invert;
|
inverse = invert;
|
||||||
|
|
||||||
for( i = 0; i < count; i++ )
|
for( i = 0; i < count; i++ )
|
||||||
{
|
{
|
||||||
icvGetNextFromBackgroundData( cvbgdata, cvbgreader );
|
icvGetNextFromBackgroundData( cvbgdata, cvbgreader );
|
||||||
|
|
||||||
maxscale = MIN( 0.7F * cvbgreader->src.cols / winwidth,
|
CvRect boundingBox = getObjectPosition( cvSize( cvbgreader->src.cols,
|
||||||
0.7F * cvbgreader->src.rows / winheight );
|
cvbgreader->src.rows ),
|
||||||
if( maxscale < 1.0F ) continue;
|
cvGetSize(data.img),
|
||||||
|
cvSize( winwidth, winheight ) );
|
||||||
|
if(boundingBox.width <= 0 || boundingBox.height <= 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
scale = (maxscale - 1.0F) * rand() / RAND_MAX + 1.0F;
|
cvGetSubArr( &cvbgreader->src, &win, boundingBox );
|
||||||
width = (int) (scale * winwidth);
|
|
||||||
height = (int) (scale * winheight);
|
|
||||||
x = (int) ((0.1+0.8 * rand()/RAND_MAX) * (cvbgreader->src.cols - width));
|
|
||||||
y = (int) ((0.1+0.8 * rand()/RAND_MAX) * (cvbgreader->src.rows - height));
|
|
||||||
|
|
||||||
cvGetSubArr( &cvbgreader->src, &win, cvRect( x, y ,width, height ) );
|
|
||||||
if( invert == CV_RANDOM_INVERT )
|
if( invert == CV_RANDOM_INVERT )
|
||||||
{
|
{
|
||||||
inverse = (rand() > (RAND_MAX/2));
|
inverse = (rand() > (RAND_MAX/2));
|
||||||
}
|
}
|
||||||
|
|
||||||
icvPlaceDistortedSample( &win, inverse, maxintensitydev,
|
icvPlaceDistortedSample( &win, inverse, maxintensitydev,
|
||||||
maxxangle, maxyangle, maxzangle,
|
maxxangle, maxyangle, maxzangle,
|
||||||
1, 0.0, 0.0, &data );
|
1, 0.0, 0.0, &data );
|
||||||
|
|
||||||
|
writer->write( cvbgreader->src, boundingBox );
|
||||||
|
|
||||||
sprintf( filename, "%04d_%04d_%04d_%04d_%04d.jpg",
|
showSamples(&showsamples, &cvbgreader->src);
|
||||||
(i + 1), x, y, width, height );
|
|
||||||
|
|
||||||
if( info )
|
|
||||||
{
|
|
||||||
fprintf( info, "%s %d %d %d %d %d\n",
|
|
||||||
filename, 1, x, y, width, height );
|
|
||||||
}
|
|
||||||
|
|
||||||
cvSaveImage( fullname, &cvbgreader->src );
|
|
||||||
if( showsamples )
|
|
||||||
{
|
|
||||||
cvShowImage( "Image", &cvbgreader->src );
|
|
||||||
if( cvWaitKey( 0 ) == 27 )
|
|
||||||
{
|
|
||||||
showsamples = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if( info ) fclose( info );
|
|
||||||
icvDestroyBackgroundReaders();
|
icvDestroyBackgroundReaders();
|
||||||
}
|
}
|
||||||
icvEndSampleDistortion( &data );
|
icvEndSampleDistortion( &data );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DatasetGenerator::~DatasetGenerator()
|
||||||
|
{
|
||||||
|
delete writer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JpgDatasetGenerator::JpgDatasetGenerator( const char* filename )
|
||||||
|
:DatasetGenerator( IOutput::createOutput( filename, IOutput::JPG_DATASET ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CvSize JpgDatasetGenerator::scaleObjectSize( const CvSize& bgImgSize,
|
||||||
|
const CvSize& ,
|
||||||
|
const CvSize& sampleSize) const
|
||||||
|
{
|
||||||
|
float scale;
|
||||||
|
float maxscale;
|
||||||
|
|
||||||
|
maxscale = MIN( 0.7F * bgImgSize.width / sampleSize.width,
|
||||||
|
0.7F * bgImgSize.height / sampleSize.height );
|
||||||
|
if( maxscale < 1.0F )
|
||||||
|
{
|
||||||
|
scale = -1.f;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scale = (maxscale - 1.0F) * rand() / RAND_MAX + 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
int width = (int) (scale * sampleSize.width);
|
||||||
|
int height = (int) (scale * sampleSize.height);
|
||||||
|
|
||||||
|
return cvSize( width, height );
|
||||||
|
}
|
||||||
|
|
||||||
|
CvRect DatasetGenerator::getObjectPosition(const CvSize& bgImgSize,
|
||||||
|
const CvSize& imgSize,
|
||||||
|
const CvSize& sampleSize) const
|
||||||
|
{
|
||||||
|
CvSize size = scaleObjectSize( bgImgSize, imgSize, sampleSize );
|
||||||
|
|
||||||
|
int width = size.width;
|
||||||
|
int height = size.height;
|
||||||
|
int x = (int) ((0.1 + 0.8 * rand() / RAND_MAX) * (bgImgSize.width - width));
|
||||||
|
int y = (int) ((0.1 + 0.8 * rand() / RAND_MAX) * (bgImgSize.height - height));
|
||||||
|
|
||||||
|
return cvRect( x, y, width, height );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PngDatasetGenerator::PngDatasetGenerator(const char* filename)
|
||||||
|
:DatasetGenerator( IOutput::createOutput( filename, IOutput::PNG_DATASET ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CvSize PngDatasetGenerator::scaleObjectSize( const CvSize& bgImgSize,
|
||||||
|
const CvSize& imgSize,
|
||||||
|
const CvSize& ) const
|
||||||
|
{
|
||||||
|
float scale;
|
||||||
|
|
||||||
|
scale = MIN( 0.3F * bgImgSize.width / imgSize.width,
|
||||||
|
0.3F * bgImgSize.height / imgSize.height );
|
||||||
|
|
||||||
|
|
||||||
|
int width = (int) (scale * imgSize.width);
|
||||||
|
int height = (int) (scale * imgSize.height);
|
||||||
|
|
||||||
|
return cvSize( width, height );
|
||||||
|
}
|
||||||
|
|
||||||
/* End of file. */
|
/* End of file. */
|
||||||
|
|||||||
@@ -48,6 +48,11 @@
|
|||||||
#ifndef _CVHAARTRAINING_H_
|
#ifndef _CVHAARTRAINING_H_
|
||||||
#define _CVHAARTRAINING_H_
|
#define _CVHAARTRAINING_H_
|
||||||
|
|
||||||
|
class IOutput;
|
||||||
|
struct CvRect;
|
||||||
|
struct CvSize;
|
||||||
|
struct CvMat;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cvCreateTrainingSamples
|
* cvCreateTrainingSamples
|
||||||
*
|
*
|
||||||
@@ -74,23 +79,30 @@
|
|||||||
*/
|
*/
|
||||||
#define CV_RANDOM_INVERT 0x7FFFFFFF
|
#define CV_RANDOM_INVERT 0x7FFFFFFF
|
||||||
|
|
||||||
void cvCreateTrainingSamples( const char* filename,
|
void cvCreateTrainingSamples(const char* filename,
|
||||||
const char* imgfilename, int bgcolor, int bgthreshold,
|
const char* imgfilename, int bgcolor, int bgthreshold,
|
||||||
const char* bgfilename, int count,
|
const char* bgfilename, int count,
|
||||||
int invert = 0, int maxintensitydev = 40,
|
int invert = 0, int maxintensitydev = 40,
|
||||||
double maxxangle = 1.1,
|
double maxxangle = 1.1,
|
||||||
double maxyangle = 1.1,
|
double maxyangle = 1.1,
|
||||||
double maxzangle = 0.5,
|
double maxzangle = 0.5,
|
||||||
int showsamples = 0,
|
bool showsamples = false,
|
||||||
int winwidth = 24, int winheight = 24 );
|
int winwidth = 24, int winheight = 24 );
|
||||||
|
|
||||||
void cvCreateTestSamples( const char* infoname,
|
void cvCreatePngTrainingSet(const char* imgfilename, int bgcolor, int bgthreshold,
|
||||||
const char* imgfilename, int bgcolor, int bgthreshold,
|
const char* bgfilename, int count,
|
||||||
|
int invert, int maxintensitydev,
|
||||||
|
double maxxangle, double maxyangle, double maxzangle,
|
||||||
|
int winwidth, int winheight,
|
||||||
|
IOutput *writer );
|
||||||
|
|
||||||
|
void cvCreateTestSamples(const char* imgfilename, int bgcolor, int bgthreshold,
|
||||||
const char* bgfilename, int count,
|
const char* bgfilename, int count,
|
||||||
int invert, int maxintensitydev,
|
int invert, int maxintensitydev,
|
||||||
double maxxangle, double maxyangle, double maxzangle,
|
double maxxangle, double maxyangle, double maxzangle,
|
||||||
int showsamples,
|
int showsamples,
|
||||||
int winwidth, int winheight );
|
int winwidth, int winheight,
|
||||||
|
IOutput* writer);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cvCreateTrainingSamplesFromInfo
|
* cvCreateTrainingSamplesFromInfo
|
||||||
@@ -189,4 +201,50 @@ void cvCreateTreeCascadeClassifier( const char* dirname,
|
|||||||
int boosttype, int stumperror,
|
int boosttype, int stumperror,
|
||||||
int maxtreesplits, int minpos, bool bg_vecfile = false );
|
int maxtreesplits, int minpos, bool bg_vecfile = false );
|
||||||
|
|
||||||
|
|
||||||
|
class DatasetGenerator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DatasetGenerator( IOutput* _writer );
|
||||||
|
void create( const char* imgfilename, int bgcolor, int bgthreshold,
|
||||||
|
const char* bgfilename, int count,
|
||||||
|
int invert, int maxintensitydev,
|
||||||
|
double maxxangle, double maxyangle, double maxzangle,
|
||||||
|
bool showsamples,
|
||||||
|
int winwidth, int winheight);
|
||||||
|
virtual ~DatasetGenerator();
|
||||||
|
private:
|
||||||
|
virtual void showSamples( bool* showSamples, CvMat* img ) const;
|
||||||
|
|
||||||
|
CvRect getObjectPosition( const CvSize& bgImgSize,
|
||||||
|
const CvSize& imgSize,
|
||||||
|
const CvSize& sampleSize ) const;
|
||||||
|
virtual CvSize scaleObjectSize(const CvSize& bgImgSize,
|
||||||
|
const CvSize& imgSize ,
|
||||||
|
const CvSize& sampleSize) const =0 ;
|
||||||
|
private:
|
||||||
|
IOutput* writer;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Provides the functionality of test set generating */
|
||||||
|
class JpgDatasetGenerator: public DatasetGenerator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
JpgDatasetGenerator(const char* filename);
|
||||||
|
private:
|
||||||
|
CvSize scaleObjectSize(const CvSize& bgImgSize,
|
||||||
|
const CvSize& ,
|
||||||
|
const CvSize& sampleSize) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
class PngDatasetGenerator: public DatasetGenerator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PngDatasetGenerator(const char *filename);
|
||||||
|
private:
|
||||||
|
CvSize scaleObjectSize(const CvSize& bgImgSize,
|
||||||
|
const CvSize& imgSize ,
|
||||||
|
const CvSize& ) const;
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* _CVHAARTRAINING_H_ */
|
#endif /* _CVHAARTRAINING_H_ */
|
||||||
|
|||||||
@@ -0,0 +1,227 @@
|
|||||||
|
#include "cvsamplesoutput.h"
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
#include "_cvcommon.h"
|
||||||
|
#include "highgui.h"
|
||||||
|
|
||||||
|
/* print statistic info */
|
||||||
|
#define CV_VERBOSE 1
|
||||||
|
|
||||||
|
IOutput::IOutput()
|
||||||
|
: currentIdx(0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void IOutput::findFilePathPart(char **partOfPath, char *fullPath)
|
||||||
|
{
|
||||||
|
*partOfPath = strrchr( fullPath, '\\' );
|
||||||
|
if( *partOfPath == NULL )
|
||||||
|
{
|
||||||
|
*partOfPath = strrchr( fullPath, '/' );
|
||||||
|
}
|
||||||
|
if( *partOfPath == NULL )
|
||||||
|
{
|
||||||
|
*partOfPath = fullPath;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*partOfPath += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IOutput* IOutput::createOutput(const char *filename,
|
||||||
|
IOutput::OutputType type)
|
||||||
|
{
|
||||||
|
IOutput* output = 0;
|
||||||
|
switch (type) {
|
||||||
|
case IOutput::PNG_DATASET:
|
||||||
|
output = new PngDatasetOutput();
|
||||||
|
break;
|
||||||
|
case IOutput::JPG_DATASET:
|
||||||
|
output = new JpgDatasetOutput();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
#if CV_VERBOSE
|
||||||
|
fprintf( stderr, "Invalid output type, valid types are: PNG_TRAINING_SET, JPG_TEST_SET");
|
||||||
|
#endif /* CV_VERBOSE */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( output->init( filename ) )
|
||||||
|
return output;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PngDatasetOutput::init( const char* annotationsListFileName )
|
||||||
|
{
|
||||||
|
IOutput::init( annotationsListFileName );
|
||||||
|
|
||||||
|
if(imgFileName == imgFullPath)
|
||||||
|
{
|
||||||
|
#if CV_VERBOSE
|
||||||
|
fprintf( stderr, "Invalid path to annotations file: %s\n"
|
||||||
|
"It should contain a parent directory name\n", imgFullPath );
|
||||||
|
#endif /* CV_VERBOSE */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const char* annotationsdirname = "/annotations/";
|
||||||
|
const char* positivesdirname = "/pos/";
|
||||||
|
|
||||||
|
imgFileName[-1] = '\0'; //erase slash at the end of the path
|
||||||
|
imgFileName -= 1;
|
||||||
|
|
||||||
|
//copy path to dataset top-level dir
|
||||||
|
strcpy(annotationFullPath, imgFullPath);
|
||||||
|
//find the name of annotation starting from the top-level dataset dir
|
||||||
|
findFilePathPart(&annotationRelativePath, annotationFullPath);
|
||||||
|
if( !strcmp( annotationRelativePath, ".." ) || !strcmp( annotationRelativePath, "." ) )
|
||||||
|
{
|
||||||
|
#if CV_VERBOSE
|
||||||
|
fprintf( stderr, "Invalid path to annotations file: %s\n"
|
||||||
|
"It should contain a parent directory name\n", annotationsListFileName );
|
||||||
|
#endif /* CV_VERBOSE */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//find the name of output image starting from the top-level dataset dir
|
||||||
|
findFilePathPart(&imgRelativePath, imgFullPath);
|
||||||
|
annotationFileName = annotationFullPath + strlen(annotationFullPath);
|
||||||
|
|
||||||
|
sprintf(annotationFileName, "%s", annotationsdirname);
|
||||||
|
annotationFileName += strlen(annotationFileName);
|
||||||
|
sprintf(imgFileName, "%s", positivesdirname);
|
||||||
|
imgFileName += strlen(imgFileName);
|
||||||
|
|
||||||
|
if( !icvMkDir( annotationFullPath ) )
|
||||||
|
{
|
||||||
|
#if CV_VERBOSE
|
||||||
|
fprintf( stderr, "Unable to create directory hierarchy: %s\n", annotationFullPath );
|
||||||
|
#endif /* CV_VERBOSE */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if( !icvMkDir( imgFullPath ) )
|
||||||
|
{
|
||||||
|
#if CV_VERBOSE
|
||||||
|
fprintf( stderr, "Unable to create directory hierarchy: %s\n", imgFullPath );
|
||||||
|
#endif /* CV_VERBOSE */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PngDatasetOutput::write( const CvMat& img,
|
||||||
|
const CvRect& boundingBox )
|
||||||
|
{
|
||||||
|
CvRect bbox = addBoundingboxBorder(boundingBox);
|
||||||
|
|
||||||
|
sprintf( imgFileName,
|
||||||
|
"%04d_%04d_%04d_%04d_%04d",
|
||||||
|
++currentIdx,
|
||||||
|
bbox.x,
|
||||||
|
bbox.y,
|
||||||
|
bbox.width,
|
||||||
|
bbox.height );
|
||||||
|
|
||||||
|
sprintf( annotationFileName, "%s.txt", imgFileName );
|
||||||
|
fprintf( annotationsList, "%s\n", annotationRelativePath );
|
||||||
|
|
||||||
|
FILE* annotationFile = fopen( annotationFullPath, "w" );
|
||||||
|
if(annotationFile == 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf( imgFileName + strlen(imgFileName), ".%s", extension );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fprintf( annotationFile,
|
||||||
|
"Image filename : \"%s\"\n"
|
||||||
|
"Bounding box for object 1 \"PASperson\" (Xmin, Ymin) - (Xmax, Ymax) : (%d, %d) - (%d, %d)",
|
||||||
|
imgRelativePath,
|
||||||
|
bbox.x,
|
||||||
|
bbox.y,
|
||||||
|
bbox.x + bbox.width,
|
||||||
|
bbox.y + bbox.height );
|
||||||
|
fclose( annotationFile );
|
||||||
|
|
||||||
|
cvSaveImage( imgFullPath, &img);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
CvRect PngDatasetOutput::addBoundingboxBorder(const CvRect& bbox) const
|
||||||
|
{
|
||||||
|
CvRect boundingBox = bbox;
|
||||||
|
int border = 5;
|
||||||
|
|
||||||
|
boundingBox.x -= border;
|
||||||
|
boundingBox.y -= border;
|
||||||
|
boundingBox.width += 2*border;
|
||||||
|
boundingBox.height += 2*border;
|
||||||
|
|
||||||
|
return boundingBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
IOutput::~IOutput()
|
||||||
|
{
|
||||||
|
if(annotationsList)
|
||||||
|
{
|
||||||
|
fclose(annotationsList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IOutput::init(const char *filename)
|
||||||
|
{
|
||||||
|
assert( filename != NULL );
|
||||||
|
|
||||||
|
if( !icvMkDir( filename ) )
|
||||||
|
{
|
||||||
|
|
||||||
|
#if CV_VERBOSE
|
||||||
|
fprintf( stderr, "Unable to create directory hierarchy: %s\n", filename );
|
||||||
|
#endif /* CV_VERBOSE */
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
annotationsList = fopen( filename, "w" );
|
||||||
|
if( annotationsList == NULL )
|
||||||
|
{
|
||||||
|
#if CV_VERBOSE
|
||||||
|
fprintf( stderr, "Unable to create info file: %s\n", filename );
|
||||||
|
#endif /* CV_VERBOSE */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
strcpy( imgFullPath, filename );
|
||||||
|
|
||||||
|
findFilePathPart( &imgFileName, imgFullPath );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool JpgDatasetOutput::write( const CvMat& img,
|
||||||
|
const CvRect& boundingBox )
|
||||||
|
{
|
||||||
|
sprintf( imgFileName, "%04d_%04d_%04d_%04d_%04d.jpg",
|
||||||
|
++currentIdx,
|
||||||
|
boundingBox.x,
|
||||||
|
boundingBox.y,
|
||||||
|
boundingBox.width,
|
||||||
|
boundingBox.height );
|
||||||
|
|
||||||
|
fprintf( annotationsList, "%s %d %d %d %d %d\n",
|
||||||
|
imgFileName,
|
||||||
|
1,
|
||||||
|
boundingBox.x,
|
||||||
|
boundingBox.y,
|
||||||
|
boundingBox.width,
|
||||||
|
boundingBox.height );
|
||||||
|
|
||||||
|
cvSaveImage( imgFullPath, &img);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
#ifndef CVSAMPLESOUTPUT_H
|
||||||
|
#define CVSAMPLESOUTPUT_H
|
||||||
|
|
||||||
|
#include "ioutput.h"
|
||||||
|
|
||||||
|
class PngDatasetOutput: public IOutput
|
||||||
|
{
|
||||||
|
friend IOutput* IOutput::createOutput(const char *filename, OutputType type);
|
||||||
|
public:
|
||||||
|
virtual bool write( const CvMat& img,
|
||||||
|
const CvRect& boundingBox);
|
||||||
|
|
||||||
|
virtual ~PngDatasetOutput(){}
|
||||||
|
private:
|
||||||
|
PngDatasetOutput()
|
||||||
|
: extension("png")
|
||||||
|
, destImgWidth(640)
|
||||||
|
, destImgHeight(480)
|
||||||
|
{}
|
||||||
|
|
||||||
|
virtual bool init(const char* annotationsListFileName );
|
||||||
|
|
||||||
|
CvRect addBoundingboxBorder(const CvRect& bbox) const;
|
||||||
|
private:
|
||||||
|
|
||||||
|
char annotationFullPath[PATH_MAX];
|
||||||
|
char* annotationFileName;
|
||||||
|
char* annotationRelativePath;
|
||||||
|
char* imgRelativePath;
|
||||||
|
const char* extension;
|
||||||
|
|
||||||
|
int destImgWidth;
|
||||||
|
int destImgHeight ;
|
||||||
|
};
|
||||||
|
|
||||||
|
class JpgDatasetOutput: public IOutput
|
||||||
|
{
|
||||||
|
friend IOutput* IOutput::createOutput(const char *filename, OutputType type);
|
||||||
|
public:
|
||||||
|
virtual bool write( const CvMat& img,
|
||||||
|
const CvRect& boundingBox );
|
||||||
|
virtual ~JpgDatasetOutput(){}
|
||||||
|
private:
|
||||||
|
JpgDatasetOutput(){}
|
||||||
|
};
|
||||||
|
#endif // CVSAMPLESOUTPUT_H
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#ifndef IOUTPUT_H
|
||||||
|
#define IOUTPUT_H
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
#include "_cvcommon.h"
|
||||||
|
|
||||||
|
struct CvMat;
|
||||||
|
struct CvRect;
|
||||||
|
|
||||||
|
class IOutput
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum OutputType {PNG_DATASET, JPG_DATASET};
|
||||||
|
public:
|
||||||
|
virtual bool write( const CvMat& img,
|
||||||
|
const CvRect& boundingBox ) =0;
|
||||||
|
|
||||||
|
virtual ~IOutput();
|
||||||
|
|
||||||
|
static IOutput* createOutput( const char *filename, OutputType type );
|
||||||
|
protected:
|
||||||
|
IOutput();
|
||||||
|
/* finds the beginning of the last token in the path */
|
||||||
|
void findFilePathPart( char **partOfPath, char *fullPath );
|
||||||
|
virtual bool init( const char* filename );
|
||||||
|
protected:
|
||||||
|
int currentIdx;
|
||||||
|
char imgFullPath[PATH_MAX];
|
||||||
|
char* imgFileName;
|
||||||
|
FILE* annotationsList;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // IOUTPUT_H
|
||||||
@@ -26,7 +26,6 @@ set_target_properties(${the_target} PROPERTIES
|
|||||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
||||||
INSTALL_NAME_DIR lib
|
|
||||||
OUTPUT_NAME "opencv_traincascade")
|
OUTPUT_NAME "opencv_traincascade")
|
||||||
|
|
||||||
if(ENABLE_SOLUTION_FOLDERS)
|
if(ENABLE_SOLUTION_FOLDERS)
|
||||||
@@ -35,8 +34,8 @@ endif()
|
|||||||
|
|
||||||
if(INSTALL_CREATE_DISTRIB)
|
if(INSTALL_CREATE_DISTRIB)
|
||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
|
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
|
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
+28
-28
@@ -374,7 +374,7 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
|
|||||||
if (is_buf_16u)
|
if (is_buf_16u)
|
||||||
{
|
{
|
||||||
unsigned short* udst_idx = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
|
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++ )
|
for( int i = 0; i < num_valid; i++ )
|
||||||
{
|
{
|
||||||
idx = src_idx[i];
|
idx = src_idx[i];
|
||||||
@@ -387,7 +387,7 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int* idst_idx = buf->data.i + root->buf_idx*get_length_subbuf() +
|
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++ )
|
for( int i = 0; i < num_valid; i++ )
|
||||||
{
|
{
|
||||||
idx = src_idx[i];
|
idx = src_idx[i];
|
||||||
@@ -404,14 +404,14 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
|
|||||||
if (is_buf_16u)
|
if (is_buf_16u)
|
||||||
{
|
{
|
||||||
unsigned short* udst = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
|
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++ )
|
for( int i = 0; i < count; i++ )
|
||||||
udst[i] = (unsigned short)src_lbls[sidx[i]];
|
udst[i] = (unsigned short)src_lbls[sidx[i]];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int* idst = buf->data.i + root->buf_idx*get_length_subbuf() +
|
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++ )
|
for( int i = 0; i < count; i++ )
|
||||||
idst[i] = src_lbls[sidx[i]];
|
idst[i] = src_lbls[sidx[i]];
|
||||||
}
|
}
|
||||||
@@ -421,14 +421,14 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
|
|||||||
if (is_buf_16u)
|
if (is_buf_16u)
|
||||||
{
|
{
|
||||||
unsigned short* sample_idx_dst = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
|
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++ )
|
for( int i = 0; i < count; i++ )
|
||||||
sample_idx_dst[i] = (unsigned short)sample_idx_src[sidx[i]];
|
sample_idx_dst[i] = (unsigned short)sample_idx_src[sidx[i]];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int* sample_idx_dst = buf->data.i + root->buf_idx*get_length_subbuf() +
|
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++ )
|
for( int i = 0; i < count; i++ )
|
||||||
sample_idx_dst[i] = sample_idx_src[sidx[i]];
|
sample_idx_dst[i] = sample_idx_src[sidx[i]];
|
||||||
}
|
}
|
||||||
@@ -614,9 +614,9 @@ void CvCascadeBoostTrainData::setData( const CvFeatureEvaluator* _featureEvaluat
|
|||||||
|
|
||||||
// set sample labels
|
// set sample labels
|
||||||
if (is_buf_16u)
|
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
|
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++)
|
for (int si = 0; si < sample_count; si++)
|
||||||
{
|
{
|
||||||
@@ -684,11 +684,11 @@ void CvCascadeBoostTrainData::get_ord_var_data( CvDTreeNode* n, int vi, float* o
|
|||||||
if ( vi < numPrecalcIdx )
|
if ( vi < numPrecalcIdx )
|
||||||
{
|
{
|
||||||
if( !is_buf_16u )
|
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
|
else
|
||||||
{
|
{
|
||||||
const unsigned short* shortIndices = (const unsigned short*)(buf->data.s + n->buf_idx*get_length_subbuf() +
|
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++ )
|
for( int i = 0; i < nodeSampleCount; i++ )
|
||||||
sortedIndicesBuf[i] = shortIndices[i];
|
sortedIndicesBuf[i] = shortIndices[i];
|
||||||
|
|
||||||
@@ -799,14 +799,14 @@ struct FeatureIdxOnlyPrecalc : ParallelLoopBody
|
|||||||
{
|
{
|
||||||
valCachePtr[si] = (*featureEvaluator)( fi, si );
|
valCachePtr[si] = (*featureEvaluator)( fi, si );
|
||||||
if ( is_buf_16u )
|
if ( is_buf_16u )
|
||||||
*(udst + fi*sample_count + si) = (unsigned short)si;
|
*(udst + (size_t)fi*sample_count + si) = (unsigned short)si;
|
||||||
else
|
else
|
||||||
*(idst + fi*sample_count + si) = si;
|
*(idst + (size_t)fi*sample_count + si) = si;
|
||||||
}
|
}
|
||||||
if ( is_buf_16u )
|
if ( is_buf_16u )
|
||||||
icvSortUShAux( udst + fi*sample_count, sample_count, valCachePtr );
|
icvSortUShAux( udst + (size_t)fi*sample_count, sample_count, valCachePtr );
|
||||||
else
|
else
|
||||||
icvSortIntAux( idst + fi*sample_count, sample_count, valCachePtr );
|
icvSortIntAux( idst + (size_t)fi*sample_count, sample_count, valCachePtr );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const CvFeatureEvaluator* featureEvaluator;
|
const CvFeatureEvaluator* featureEvaluator;
|
||||||
@@ -835,14 +835,14 @@ struct FeatureValAndIdxPrecalc : ParallelLoopBody
|
|||||||
{
|
{
|
||||||
valCache->at<float>(fi,si) = (*featureEvaluator)( fi, si );
|
valCache->at<float>(fi,si) = (*featureEvaluator)( fi, si );
|
||||||
if ( is_buf_16u )
|
if ( is_buf_16u )
|
||||||
*(udst + fi*sample_count + si) = (unsigned short)si;
|
*(udst + (size_t)fi*sample_count + si) = (unsigned short)si;
|
||||||
else
|
else
|
||||||
*(idst + fi*sample_count + si) = si;
|
*(idst + (size_t)fi*sample_count + si) = si;
|
||||||
}
|
}
|
||||||
if ( is_buf_16u )
|
if ( is_buf_16u )
|
||||||
icvSortUShAux( udst + fi*sample_count, sample_count, valCache->ptr<float>(fi) );
|
icvSortUShAux( udst + (size_t)fi*sample_count, sample_count, valCache->ptr<float>(fi) );
|
||||||
else
|
else
|
||||||
icvSortIntAux( idst + fi*sample_count, sample_count, valCache->ptr<float>(fi) );
|
icvSortIntAux( idst + (size_t)fi*sample_count, sample_count, valCache->ptr<float>(fi) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const CvFeatureEvaluator* featureEvaluator;
|
const CvFeatureEvaluator* featureEvaluator;
|
||||||
@@ -1165,9 +1165,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
|
|||||||
if (data->is_buf_16u)
|
if (data->is_buf_16u)
|
||||||
{
|
{
|
||||||
unsigned short *ldst = (unsigned short *)(buf->data.s + left->buf_idx*length_buf_row +
|
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 +
|
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++ )
|
for( int i = 0; i < n; i++ )
|
||||||
{
|
{
|
||||||
@@ -1188,9 +1188,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int *ldst = buf->data.i + left->buf_idx*length_buf_row +
|
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 +
|
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++ )
|
for( int i = 0; i < n; i++ )
|
||||||
{
|
{
|
||||||
@@ -1218,9 +1218,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
|
|||||||
if (data->is_buf_16u)
|
if (data->is_buf_16u)
|
||||||
{
|
{
|
||||||
unsigned short* ldst = (unsigned short*)(buf->data.s + left->buf_idx*length_buf_row +
|
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 +
|
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++)
|
for (int i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
unsigned short idx = (unsigned short)tempBuf[i];
|
unsigned short idx = (unsigned short)tempBuf[i];
|
||||||
@@ -1239,9 +1239,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int* ldst = buf->data.i + left->buf_idx*length_buf_row +
|
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 +
|
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++)
|
for (int i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
int idx = tempBuf[i];
|
int idx = tempBuf[i];
|
||||||
@@ -1410,7 +1410,7 @@ void CvCascadeBoost::update_weights( CvBoostTree* tree )
|
|||||||
if (data->is_buf_16u)
|
if (data->is_buf_16u)
|
||||||
{
|
{
|
||||||
unsigned short* labels = (unsigned short*)(buf->data.s + data->data_root->buf_idx*length_buf_row +
|
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++ )
|
for( int i = 0; i < n; i++ )
|
||||||
{
|
{
|
||||||
// save original categorical responses {0,1}, convert them to {-1,1}
|
// save original categorical responses {0,1}, convert them to {-1,1}
|
||||||
@@ -1428,7 +1428,7 @@ void CvCascadeBoost::update_weights( CvBoostTree* tree )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int* labels = buf->data.i + data->data_root->buf_idx*length_buf_row +
|
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++ )
|
for( int i = 0; i < n; i++ )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -136,7 +136,8 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
|||||||
const CvCascadeParams& _cascadeParams,
|
const CvCascadeParams& _cascadeParams,
|
||||||
const CvFeatureParams& _featureParams,
|
const CvFeatureParams& _featureParams,
|
||||||
const CvCascadeBoostParams& _stageParams,
|
const CvCascadeBoostParams& _stageParams,
|
||||||
bool baseFormatSave )
|
bool baseFormatSave,
|
||||||
|
double acceptanceRatioBreakValue)
|
||||||
{
|
{
|
||||||
// Start recording clock ticks for training time output
|
// Start recording clock ticks for training time output
|
||||||
const clock_t begin_time = clock();
|
const clock_t begin_time = clock();
|
||||||
@@ -169,6 +170,13 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
|||||||
featureEvaluator = CvFeatureEvaluator::create(cascadeParams.featureType);
|
featureEvaluator = CvFeatureEvaluator::create(cascadeParams.featureType);
|
||||||
featureEvaluator->init( (CvFeatureParams*)featureParams, numPos + numNeg, cascadeParams.winSize );
|
featureEvaluator->init( (CvFeatureParams*)featureParams, numPos + numNeg, cascadeParams.winSize );
|
||||||
stageClassifiers.reserve( numStages );
|
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 << "PARAMETERS:" << endl;
|
||||||
cout << "cascadeDirName: " << _cascadeDirName << endl;
|
cout << "cascadeDirName: " << _cascadeDirName << endl;
|
||||||
@@ -179,9 +187,11 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
|||||||
cout << "numStages: " << numStages << endl;
|
cout << "numStages: " << numStages << endl;
|
||||||
cout << "precalcValBufSize[Mb] : " << _precalcValBufSize << endl;
|
cout << "precalcValBufSize[Mb] : " << _precalcValBufSize << endl;
|
||||||
cout << "precalcIdxBufSize[Mb] : " << _precalcIdxBufSize << endl;
|
cout << "precalcIdxBufSize[Mb] : " << _precalcIdxBufSize << endl;
|
||||||
|
cout << "acceptanceRatioBreakValue : " << acceptanceRatioBreakValue << endl;
|
||||||
cascadeParams.printAttrs();
|
cascadeParams.printAttrs();
|
||||||
stageParams->printAttrs();
|
stageParams->printAttrs();
|
||||||
featureParams->printAttrs();
|
featureParams->printAttrs();
|
||||||
|
cout << "Number of unique features given windowSize [" << _cascadeParams.winSize.width << "," << _cascadeParams.winSize.height << "] : " << featureEvaluator->getNumFeatures() << "" << endl;
|
||||||
|
|
||||||
int startNumStages = (int)stageClassifiers.size();
|
int startNumStages = (int)stageClassifiers.size();
|
||||||
if ( startNumStages > 1 )
|
if ( startNumStages > 1 )
|
||||||
@@ -198,18 +208,23 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
|||||||
cout << endl << "===== TRAINING " << i << "-stage =====" << endl;
|
cout << endl << "===== TRAINING " << i << "-stage =====" << endl;
|
||||||
cout << "<BEGIN" << endl;
|
cout << "<BEGIN" << endl;
|
||||||
|
|
||||||
if ( !updateTrainingSet( tempLeafFARate ) )
|
if ( !updateTrainingSet( requiredLeafFARate, tempLeafFARate ) )
|
||||||
{
|
{
|
||||||
cout << "Train dataset for temp stage can not be filled. "
|
cout << "Train dataset for temp stage can not be filled. "
|
||||||
"Branch training terminated." << endl;
|
"Branch training terminated." << endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( tempLeafFARate <= requiredLeafFARate )
|
if( tempLeafFARate <= requiredLeafFARate )
|
||||||
{
|
{
|
||||||
cout << "Required leaf false alarm rate achieved. "
|
cout << "Required leaf false alarm rate achieved. "
|
||||||
"Branch training terminated." << endl;
|
"Branch training terminated." << endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if( (tempLeafFARate <= acceptanceRatioBreakValue) && (acceptanceRatioBreakValue >= 0) ){
|
||||||
|
cout << "The required acceptanceRatio for the model has been reached to avoid overfitting of trainingdata. "
|
||||||
|
"Branch training terminated." << endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
CvCascadeBoost* tempStage = new CvCascadeBoost;
|
CvCascadeBoost* tempStage = new CvCascadeBoost;
|
||||||
bool isStageTrained = tempStage->train( (CvFeatureEvaluator*)featureEvaluator,
|
bool isStageTrained = tempStage->train( (CvFeatureEvaluator*)featureEvaluator,
|
||||||
@@ -284,17 +299,17 @@ int CvCascadeClassifier::predict( int sampleIdx )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CvCascadeClassifier::updateTrainingSet( double& acceptanceRatio)
|
bool CvCascadeClassifier::updateTrainingSet( double minimumAcceptanceRatio, double& acceptanceRatio)
|
||||||
{
|
{
|
||||||
int64 posConsumed = 0, negConsumed = 0;
|
int64 posConsumed = 0, negConsumed = 0;
|
||||||
imgReader.restart();
|
imgReader.restart();
|
||||||
int posCount = fillPassedSamples( 0, numPos, true, posConsumed );
|
int posCount = fillPassedSamples( 0, numPos, true, 0, posConsumed );
|
||||||
if( !posCount )
|
if( !posCount )
|
||||||
return false;
|
return false;
|
||||||
cout << "POS count : consumed " << posCount << " : " << (int)posConsumed << endl;
|
cout << "POS count : consumed " << posCount << " : " << (int)posConsumed << endl;
|
||||||
|
|
||||||
int proNumNeg = cvRound( ( ((double)numNeg) * ((double)posCount) ) / numPos ); // apply only a fraction of negative samples. double is required since overflow is possible
|
int proNumNeg = cvRound( ( ((double)numNeg) * ((double)posCount) ) / numPos ); // apply only a fraction of negative samples. double is required since overflow is possible
|
||||||
int negCount = fillPassedSamples( posCount, proNumNeg, false, negConsumed );
|
int negCount = fillPassedSamples( posCount, proNumNeg, false, minimumAcceptanceRatio, negConsumed );
|
||||||
if ( !negCount )
|
if ( !negCount )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -304,7 +319,7 @@ bool CvCascadeClassifier::updateTrainingSet( double& acceptanceRatio)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositive, int64& consumed )
|
int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositive, double minimumAcceptanceRatio, int64& consumed )
|
||||||
{
|
{
|
||||||
int getcount = 0;
|
int getcount = 0;
|
||||||
Mat img(cascadeParams.winSize, CV_8UC1);
|
Mat img(cascadeParams.winSize, CV_8UC1);
|
||||||
@@ -312,6 +327,9 @@ int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositiv
|
|||||||
{
|
{
|
||||||
for( ; ; )
|
for( ; ; )
|
||||||
{
|
{
|
||||||
|
if( consumed != 0 && ((double)getcount+1)/(double)(int64)consumed <= minimumAcceptanceRatio )
|
||||||
|
return getcount;
|
||||||
|
|
||||||
bool isGetImg = isPositive ? imgReader.getPos( img ) :
|
bool isGetImg = isPositive ? imgReader.getPos( img ) :
|
||||||
imgReader.getNeg( img );
|
imgReader.getNeg( img );
|
||||||
if( !isGetImg )
|
if( !isGetImg )
|
||||||
@@ -319,7 +337,7 @@ int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositiv
|
|||||||
consumed++;
|
consumed++;
|
||||||
|
|
||||||
featureEvaluator->setImage( img, isPositive ? 1 : 0, i );
|
featureEvaluator->setImage( img, isPositive ? 1 : 0, i );
|
||||||
if( predict( i ) == 1.0F )
|
if( predict( i ) == 1 )
|
||||||
{
|
{
|
||||||
getcount++;
|
getcount++;
|
||||||
printf("%s current samples: %d\r", isPositive ? "POS":"NEG", getcount);
|
printf("%s current samples: %d\r", isPositive ? "POS":"NEG", getcount);
|
||||||
|
|||||||
@@ -96,13 +96,14 @@ public:
|
|||||||
const CvCascadeParams& _cascadeParams,
|
const CvCascadeParams& _cascadeParams,
|
||||||
const CvFeatureParams& _featureParams,
|
const CvFeatureParams& _featureParams,
|
||||||
const CvCascadeBoostParams& _stageParams,
|
const CvCascadeBoostParams& _stageParams,
|
||||||
bool baseFormatSave = false );
|
bool baseFormatSave = false,
|
||||||
|
double acceptanceRatioBreakValue = -1.0 );
|
||||||
private:
|
private:
|
||||||
int predict( int sampleIdx );
|
int predict( int sampleIdx );
|
||||||
void save( const std::string cascadeDirName, bool baseFormat = false );
|
void save( const std::string cascadeDirName, bool baseFormat = false );
|
||||||
bool load( const std::string cascadeDirName );
|
bool load( const std::string cascadeDirName );
|
||||||
bool updateTrainingSet( double& acceptanceRatio );
|
bool updateTrainingSet( double minimumAcceptanceRatio, double& acceptanceRatio );
|
||||||
int fillPassedSamples( int first, int count, bool isPositive, int64& consumed );
|
int fillPassedSamples( int first, int count, bool isPositive, double requiredAcceptanceRatio, int64& consumed );
|
||||||
|
|
||||||
void writeParams( cv::FileStorage &fs ) const;
|
void writeParams( cv::FileStorage &fs ) const;
|
||||||
void writeStages( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
|
void writeStages( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
|
||||||
|
|||||||
@@ -32,20 +32,12 @@ bool CvCascadeImageReader::NegReader::create( const string _filename, Size _winS
|
|||||||
if ( !file.is_open() )
|
if ( !file.is_open() )
|
||||||
return false;
|
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() )
|
while( !file.eof() )
|
||||||
{
|
{
|
||||||
std::getline(file, str);
|
std::getline(file, str);
|
||||||
if (str.empty()) break;
|
if (str.empty()) break;
|
||||||
if (str.at(0) == '#' ) continue; /* comment */
|
if (str.at(0) == '#' ) continue; /* comment */
|
||||||
imgFilenames.push_back(dirname + str);
|
imgFilenames.push_back(str);
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
#ifndef _OPENCV_IMAGESTORAGE_H_
|
#ifndef _OPENCV_IMAGESTORAGE_H_
|
||||||
#define _OPENCV_IMAGESTORAGE_H_
|
#define _OPENCV_IMAGESTORAGE_H_
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
#include "highgui.h"
|
#include "highgui.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CvCascadeImageReader
|
class CvCascadeImageReader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -14,9 +14,10 @@ int main( int argc, char* argv[] )
|
|||||||
int numPos = 2000;
|
int numPos = 2000;
|
||||||
int numNeg = 1000;
|
int numNeg = 1000;
|
||||||
int numStages = 20;
|
int numStages = 20;
|
||||||
int precalcValBufSize = 256,
|
int precalcValBufSize = 1024,
|
||||||
precalcIdxBufSize = 256;
|
precalcIdxBufSize = 1024;
|
||||||
bool baseFormatSave = false;
|
bool baseFormatSave = false;
|
||||||
|
double acceptanceRatioBreakValue = -1.0;
|
||||||
|
|
||||||
CvCascadeParams cascadeParams;
|
CvCascadeParams cascadeParams;
|
||||||
CvCascadeBoostParams stageParams;
|
CvCascadeBoostParams stageParams;
|
||||||
@@ -37,6 +38,7 @@ int main( int argc, char* argv[] )
|
|||||||
cout << " [-precalcValBufSize <precalculated_vals_buffer_size_in_Mb = " << precalcValBufSize << ">]" << endl;
|
cout << " [-precalcValBufSize <precalculated_vals_buffer_size_in_Mb = " << precalcValBufSize << ">]" << endl;
|
||||||
cout << " [-precalcIdxBufSize <precalculated_idxs_buffer_size_in_Mb = " << precalcIdxBufSize << ">]" << endl;
|
cout << " [-precalcIdxBufSize <precalculated_idxs_buffer_size_in_Mb = " << precalcIdxBufSize << ">]" << endl;
|
||||||
cout << " [-baseFormatSave]" << endl;
|
cout << " [-baseFormatSave]" << endl;
|
||||||
|
cout << " [-acceptanceRatioBreakValue <value> = " << acceptanceRatioBreakValue << ">]" << endl;
|
||||||
cascadeParams.printDefaults();
|
cascadeParams.printDefaults();
|
||||||
stageParams.printDefaults();
|
stageParams.printDefaults();
|
||||||
for( int fi = 0; fi < fc; fi++ )
|
for( int fi = 0; fi < fc; fi++ )
|
||||||
@@ -83,6 +85,10 @@ int main( int argc, char* argv[] )
|
|||||||
{
|
{
|
||||||
baseFormatSave = true;
|
baseFormatSave = true;
|
||||||
}
|
}
|
||||||
|
else if( !strcmp( argv[i], "-acceptanceRatioBreakValue" ) )
|
||||||
|
{
|
||||||
|
acceptanceRatioBreakValue = atof(argv[++i]);
|
||||||
|
}
|
||||||
else if ( cascadeParams.scanAttr( argv[i], argv[i+1] ) ) { i++; }
|
else if ( cascadeParams.scanAttr( argv[i], argv[i+1] ) ) { i++; }
|
||||||
else if ( stageParams.scanAttr( argv[i], argv[i+1] ) ) { i++; }
|
else if ( stageParams.scanAttr( argv[i], argv[i+1] ) ) { i++; }
|
||||||
else if ( !set )
|
else if ( !set )
|
||||||
@@ -108,6 +114,7 @@ int main( int argc, char* argv[] )
|
|||||||
cascadeParams,
|
cascadeParams,
|
||||||
*featureParams[cascadeParams.featureType],
|
*featureParams[cascadeParams.featureType],
|
||||||
stageParams,
|
stageParams,
|
||||||
baseFormatSave );
|
baseFormatSave,
|
||||||
|
acceptanceRatioBreakValue );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
SET(OPENCV_VISUALISATION_DEPS opencv_core opencv_highgui opencv_imgproc)
|
||||||
|
ocv_check_dependencies(${OPENCV_VISUALISATION_DEPS})
|
||||||
|
|
||||||
|
if(NOT OCV_DEPENDENCIES_FOUND)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
project(visualisation)
|
||||||
|
|
||||||
|
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
|
||||||
|
ocv_include_modules(${OPENCV_VISUALISATION_DEPS})
|
||||||
|
|
||||||
|
set(visualisation_files opencv_visualisation.cpp)
|
||||||
|
set(the_target opencv_visualisation)
|
||||||
|
|
||||||
|
add_executable(${the_target} ${visualisation_files})
|
||||||
|
target_link_libraries(${the_target} ${OPENCV_VISUALISATION_DEPS})
|
||||||
|
|
||||||
|
set_target_properties(${the_target} PROPERTIES
|
||||||
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
||||||
|
OUTPUT_NAME "opencv_visualisation")
|
||||||
|
|
||||||
|
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,350 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||||
|
//
|
||||||
|
// By downloading, copying, installing or using the software you agree to this license.
|
||||||
|
// If you do not agree to this license, do not download, install,
|
||||||
|
// copy or use the software.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// License Agreement
|
||||||
|
// For Open Source Computer Vision Library
|
||||||
|
//
|
||||||
|
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
|
||||||
|
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
|
||||||
|
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
|
||||||
|
// Third party copyrights are property of their respective owners.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
// are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// * Redistribution's of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer in the documentation
|
||||||
|
// and/or other materials provided with the distribution.
|
||||||
|
//
|
||||||
|
// * The name of the copyright holders may not be used to endorse or promote products
|
||||||
|
// derived from this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// This software is provided by the copyright holders and contributors "as is" and
|
||||||
|
// any express or implied warranties, including, but not limited to, the implied
|
||||||
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||||
|
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||||
|
// indirect, incidental, special, exemplary, or consequential damages
|
||||||
|
// (including, but not limited to, procurement of substitute goods or services;
|
||||||
|
// loss of use, data, or profits; or business interruption) however caused
|
||||||
|
// and on any theory of liability, whether in contract, strict liability,
|
||||||
|
// or tort (including negligence or otherwise) arising in any way out of
|
||||||
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/*****************************************************************************************************
|
||||||
|
|
||||||
|
Software for visualising cascade classifier models trained by OpenCV and to get a better
|
||||||
|
understanding of the used features.
|
||||||
|
|
||||||
|
USAGE:
|
||||||
|
./visualise_models -model <model.xml> -image <ref.png> -data <output folder>
|
||||||
|
|
||||||
|
LIMITS
|
||||||
|
- Use an absolute path for the output folder to ensure the tool works
|
||||||
|
- Only handles cascade classifier models
|
||||||
|
- Handles stumps only for the moment
|
||||||
|
- Needs a valid training/test sample window with the original model dimensions, passed as `ref.png`
|
||||||
|
- Can handle HAAR and LBP features
|
||||||
|
|
||||||
|
Created by: Puttemans Steven - April 2016
|
||||||
|
*****************************************************************************************************/
|
||||||
|
|
||||||
|
#include <opencv2/core/core.hpp>
|
||||||
|
#include <opencv2/highgui/highgui.hpp>
|
||||||
|
#include <opencv2/imgproc/imgproc.hpp>
|
||||||
|
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace cv;
|
||||||
|
|
||||||
|
struct rect_data{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int w;
|
||||||
|
int h;
|
||||||
|
float weight;
|
||||||
|
};
|
||||||
|
|
||||||
|
int main( int argc, const char** argv )
|
||||||
|
{
|
||||||
|
// Read in the input arguments
|
||||||
|
string model = "";
|
||||||
|
string output_folder = "";
|
||||||
|
string image_ref = "";
|
||||||
|
for(int i = 1; i < argc; ++i )
|
||||||
|
{
|
||||||
|
if( !strcmp( argv[i], "-model" ) )
|
||||||
|
{
|
||||||
|
model = argv[++i];
|
||||||
|
}else if( !strcmp( argv[i], "-image" ) ){
|
||||||
|
image_ref = argv[++i];
|
||||||
|
}else if( !strcmp( argv[i], "-data" ) ){
|
||||||
|
output_folder = argv[++i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Value for timing
|
||||||
|
// You can increase this to have a better visualisation during the generation
|
||||||
|
int timing = 1;
|
||||||
|
|
||||||
|
// Value for cols of storing elements
|
||||||
|
int cols_prefered = 5;
|
||||||
|
|
||||||
|
// Open the XML model
|
||||||
|
FileStorage fs;
|
||||||
|
fs.open(model, FileStorage::READ);
|
||||||
|
|
||||||
|
// Get a the required information
|
||||||
|
// First decide which feature type we are using
|
||||||
|
FileNode cascade = fs["cascade"];
|
||||||
|
string feature_type = cascade["featureType"];
|
||||||
|
bool haar = false, lbp = false;
|
||||||
|
if (feature_type.compare("HAAR") == 0){
|
||||||
|
haar = true;
|
||||||
|
}
|
||||||
|
if (feature_type.compare("LBP") == 0){
|
||||||
|
lbp = true;
|
||||||
|
}
|
||||||
|
if ( feature_type.compare("HAAR") != 0 && feature_type.compare("LBP")){
|
||||||
|
cerr << "The model is not an HAAR or LBP feature based model!" << endl;
|
||||||
|
cerr << "Please select a model that can be visualized by the software." << endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We make a visualisation mask - which increases the window to make it at least a bit more visible
|
||||||
|
int resize_factor = 10;
|
||||||
|
int resize_storage_factor = 10;
|
||||||
|
Mat reference_image = imread(image_ref, IMREAD_GRAYSCALE );
|
||||||
|
Mat visualization;
|
||||||
|
resize(reference_image, visualization, Size(reference_image.cols * resize_factor, reference_image.rows * resize_factor));
|
||||||
|
|
||||||
|
// First recover for each stage the number of weak features and their index
|
||||||
|
// Important since it is NOT sequential when using LBP features
|
||||||
|
vector< vector<int> > stage_features;
|
||||||
|
FileNode stages = cascade["stages"];
|
||||||
|
FileNodeIterator it_stages = stages.begin(), it_stages_end = stages.end();
|
||||||
|
int idx = 0;
|
||||||
|
for( ; it_stages != it_stages_end; it_stages++, idx++ ){
|
||||||
|
vector<int> current_feature_indexes;
|
||||||
|
FileNode weak_classifiers = (*it_stages)["weakClassifiers"];
|
||||||
|
FileNodeIterator it_weak = weak_classifiers.begin(), it_weak_end = weak_classifiers.end();
|
||||||
|
vector<int> values;
|
||||||
|
for(int idy = 0; it_weak != it_weak_end; it_weak++, idy++ ){
|
||||||
|
(*it_weak)["internalNodes"] >> values;
|
||||||
|
current_feature_indexes.push_back( (int)values[2] );
|
||||||
|
}
|
||||||
|
stage_features.push_back(current_feature_indexes);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the output option has been chosen than we will store a combined image plane for
|
||||||
|
// each stage, containing all weak classifiers for that stage.
|
||||||
|
bool draw_planes = false;
|
||||||
|
stringstream output_video;
|
||||||
|
output_video << output_folder << "model_visualization.avi";
|
||||||
|
VideoWriter result_video;
|
||||||
|
if( output_folder.compare("") != 0 ){
|
||||||
|
draw_planes = true;
|
||||||
|
result_video.open(output_video.str(), CV_FOURCC('X','V','I','D'), 15, Size(reference_image.cols * resize_factor, reference_image.rows * resize_factor), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(haar){
|
||||||
|
// Grab the corresponding features dimensions and weights
|
||||||
|
FileNode features = cascade["features"];
|
||||||
|
vector< vector< rect_data > > feature_data;
|
||||||
|
FileNodeIterator it_features = features.begin(), it_features_end = features.end();
|
||||||
|
for(int idf = 0; it_features != it_features_end; it_features++, idf++ ){
|
||||||
|
vector< rect_data > current_feature_rectangles;
|
||||||
|
FileNode rectangles = (*it_features)["rects"];
|
||||||
|
int nrects = (int)rectangles.size();
|
||||||
|
for(int k = 0; k < nrects; k++){
|
||||||
|
rect_data current_data;
|
||||||
|
FileNode single_rect = rectangles[k];
|
||||||
|
current_data.x = (int)single_rect[0];
|
||||||
|
current_data.y = (int)single_rect[1];
|
||||||
|
current_data.w = (int)single_rect[2];
|
||||||
|
current_data.h = (int)single_rect[3];
|
||||||
|
current_data.weight = (float)single_rect[4];
|
||||||
|
current_feature_rectangles.push_back(current_data);
|
||||||
|
}
|
||||||
|
feature_data.push_back(current_feature_rectangles);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Loop over each possible feature on its index, visualise on the mask and wait a bit,
|
||||||
|
// then continue to the next feature.
|
||||||
|
// If visualisations should be stored then do the in between calculations
|
||||||
|
Mat image_plane;
|
||||||
|
Mat metadata = Mat::zeros(150, 1000, CV_8UC1);
|
||||||
|
vector< rect_data > current_rects;
|
||||||
|
for(int sid = 0; sid < (int)stage_features.size(); sid ++){
|
||||||
|
if(draw_planes){
|
||||||
|
int features_nmbr = (int)stage_features[sid].size();
|
||||||
|
int cols = cols_prefered;
|
||||||
|
int rows = features_nmbr / cols;
|
||||||
|
if( (features_nmbr % cols) > 0){
|
||||||
|
rows++;
|
||||||
|
}
|
||||||
|
image_plane = Mat::zeros(reference_image.rows * resize_storage_factor * rows, reference_image.cols * resize_storage_factor * cols, CV_8UC1);
|
||||||
|
}
|
||||||
|
for(int fid = 0; fid < (int)stage_features[sid].size(); fid++){
|
||||||
|
stringstream meta1, meta2;
|
||||||
|
meta1 << "Stage " << sid << " / Feature " << fid;
|
||||||
|
meta2 << "Rectangles: ";
|
||||||
|
Mat temp_window = visualization.clone();
|
||||||
|
Mat temp_metadata = metadata.clone();
|
||||||
|
int current_feature_index = stage_features[sid][fid];
|
||||||
|
current_rects = feature_data[current_feature_index];
|
||||||
|
Mat single_feature = reference_image.clone();
|
||||||
|
resize(single_feature, single_feature, Size(), resize_storage_factor, resize_storage_factor);
|
||||||
|
for(int i = 0; i < (int)current_rects.size(); i++){
|
||||||
|
rect_data local = current_rects[i];
|
||||||
|
if(draw_planes){
|
||||||
|
if(local.weight >= 0){
|
||||||
|
rectangle(single_feature, Rect(local.x * resize_storage_factor, local.y * resize_storage_factor, local.w * resize_storage_factor, local.h * resize_storage_factor), Scalar(0), CV_FILLED);
|
||||||
|
}else{
|
||||||
|
rectangle(single_feature, Rect(local.x * resize_storage_factor, local.y * resize_storage_factor, local.w * resize_storage_factor, local.h * resize_storage_factor), Scalar(255), CV_FILLED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Rect part(local.x * resize_factor, local.y * resize_factor, local.w * resize_factor, local.h * resize_factor);
|
||||||
|
meta2 << part << " (w " << local.weight << ") ";
|
||||||
|
if(local.weight >= 0){
|
||||||
|
rectangle(temp_window, part, Scalar(0), CV_FILLED);
|
||||||
|
}else{
|
||||||
|
rectangle(temp_window, part, Scalar(255), CV_FILLED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
imshow("features", temp_window);
|
||||||
|
putText(temp_window, meta1.str(), Point(15,15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
|
||||||
|
result_video.write(temp_window);
|
||||||
|
// Copy the feature image if needed
|
||||||
|
if(draw_planes){
|
||||||
|
single_feature.copyTo(image_plane(Rect(0 + (fid%cols_prefered)*single_feature.cols, 0 + (fid/cols_prefered) * single_feature.rows, single_feature.cols, single_feature.rows)));
|
||||||
|
}
|
||||||
|
putText(temp_metadata, meta1.str(), Point(15,15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
|
||||||
|
putText(temp_metadata, meta2.str(), Point(15,40), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
|
||||||
|
imshow("metadata", temp_metadata);
|
||||||
|
waitKey(timing);
|
||||||
|
}
|
||||||
|
//Store the stage image if needed
|
||||||
|
if(draw_planes){
|
||||||
|
stringstream save_location;
|
||||||
|
save_location << output_folder << "stage_" << sid << ".png";
|
||||||
|
imwrite(save_location.str(), image_plane);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(lbp){
|
||||||
|
// Grab the corresponding features dimensions and weights
|
||||||
|
FileNode features = cascade["features"];
|
||||||
|
vector<Rect> feature_data;
|
||||||
|
FileNodeIterator it_features = features.begin(), it_features_end = features.end();
|
||||||
|
for(int idf = 0; it_features != it_features_end; it_features++, idf++ ){
|
||||||
|
FileNode rectangle = (*it_features)["rect"];
|
||||||
|
Rect current_feature ((int)rectangle[0], (int)rectangle[1], (int)rectangle[2], (int)rectangle[3]);
|
||||||
|
feature_data.push_back(current_feature);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Loop over each possible feature on its index, visualise on the mask and wait a bit,
|
||||||
|
// then continue to the next feature.
|
||||||
|
Mat image_plane;
|
||||||
|
Mat metadata = Mat::zeros(150, 1000, CV_8UC1);
|
||||||
|
for(int sid = 0; sid < (int)stage_features.size(); sid ++){
|
||||||
|
if(draw_planes){
|
||||||
|
int features_nmbr = (int)stage_features[sid].size();
|
||||||
|
int cols = cols_prefered;
|
||||||
|
int rows = features_nmbr / cols;
|
||||||
|
if( (features_nmbr % cols) > 0){
|
||||||
|
rows++;
|
||||||
|
}
|
||||||
|
image_plane = Mat::zeros(reference_image.rows * resize_storage_factor * rows, reference_image.cols * resize_storage_factor * cols, CV_8UC1);
|
||||||
|
}
|
||||||
|
for(int fid = 0; fid < (int)stage_features[sid].size(); fid++){
|
||||||
|
stringstream meta1, meta2;
|
||||||
|
meta1 << "Stage " << sid << " / Feature " << fid;
|
||||||
|
meta2 << "Rectangle: ";
|
||||||
|
Mat temp_window = visualization.clone();
|
||||||
|
Mat temp_metadata = metadata.clone();
|
||||||
|
int current_feature_index = stage_features[sid][fid];
|
||||||
|
Rect current_rect = feature_data[current_feature_index];
|
||||||
|
Mat single_feature = reference_image.clone();
|
||||||
|
resize(single_feature, single_feature, Size(), resize_storage_factor, resize_storage_factor);
|
||||||
|
|
||||||
|
// VISUALISATION
|
||||||
|
// The rectangle is the top left one of a 3x3 block LBP constructor
|
||||||
|
Rect resized(current_rect.x * resize_factor, current_rect.y * resize_factor, current_rect.width * resize_factor, current_rect.height * resize_factor);
|
||||||
|
meta2 << resized;
|
||||||
|
// Top left
|
||||||
|
rectangle(temp_window, resized, Scalar(255), 1);
|
||||||
|
// Top middle
|
||||||
|
rectangle(temp_window, Rect(resized.x + resized.width, resized.y, resized.width, resized.height), Scalar(255), 1);
|
||||||
|
// Top right
|
||||||
|
rectangle(temp_window, Rect(resized.x + 2*resized.width, resized.y, resized.width, resized.height), Scalar(255), 1);
|
||||||
|
// Middle left
|
||||||
|
rectangle(temp_window, Rect(resized.x, resized.y + resized.height, resized.width, resized.height), Scalar(255), 1);
|
||||||
|
// Middle middle
|
||||||
|
rectangle(temp_window, Rect(resized.x + resized.width, resized.y + resized.height, resized.width, resized.height), Scalar(255), CV_FILLED);
|
||||||
|
// Middle right
|
||||||
|
rectangle(temp_window, Rect(resized.x + 2*resized.width, resized.y + resized.height, resized.width, resized.height), Scalar(255), 1);
|
||||||
|
// Bottom left
|
||||||
|
rectangle(temp_window, Rect(resized.x, resized.y + 2*resized.height, resized.width, resized.height), Scalar(255), 1);
|
||||||
|
// Bottom middle
|
||||||
|
rectangle(temp_window, Rect(resized.x + resized.width, resized.y + 2*resized.height, resized.width, resized.height), Scalar(255), 1);
|
||||||
|
// Bottom right
|
||||||
|
rectangle(temp_window, Rect(resized.x + 2*resized.width, resized.y + 2*resized.height, resized.width, resized.height), Scalar(255), 1);
|
||||||
|
|
||||||
|
if(draw_planes){
|
||||||
|
Rect resized_inner(current_rect.x * resize_storage_factor, current_rect.y * resize_storage_factor, current_rect.width * resize_storage_factor, current_rect.height * resize_storage_factor);
|
||||||
|
// Top left
|
||||||
|
rectangle(single_feature, resized_inner, Scalar(255), 1);
|
||||||
|
// Top middle
|
||||||
|
rectangle(single_feature, Rect(resized_inner.x + resized_inner.width, resized_inner.y, resized_inner.width, resized_inner.height), Scalar(255), 1);
|
||||||
|
// Top right
|
||||||
|
rectangle(single_feature, Rect(resized_inner.x + 2*resized_inner.width, resized_inner.y, resized_inner.width, resized_inner.height), Scalar(255), 1);
|
||||||
|
// Middle left
|
||||||
|
rectangle(single_feature, Rect(resized_inner.x, resized_inner.y + resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), 1);
|
||||||
|
// Middle middle
|
||||||
|
rectangle(single_feature, Rect(resized_inner.x + resized_inner.width, resized_inner.y + resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), CV_FILLED);
|
||||||
|
// Middle right
|
||||||
|
rectangle(single_feature, Rect(resized_inner.x + 2*resized_inner.width, resized_inner.y + resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), 1);
|
||||||
|
// Bottom left
|
||||||
|
rectangle(single_feature, Rect(resized_inner.x, resized_inner.y + 2*resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), 1);
|
||||||
|
// Bottom middle
|
||||||
|
rectangle(single_feature, Rect(resized_inner.x + resized_inner.width, resized_inner.y + 2*resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), 1);
|
||||||
|
// Bottom right
|
||||||
|
rectangle(single_feature, Rect(resized_inner.x + 2*resized_inner.width, resized_inner.y + 2*resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), 1);
|
||||||
|
|
||||||
|
single_feature.copyTo(image_plane(Rect(0 + (fid%cols_prefered)*single_feature.cols, 0 + (fid/cols_prefered) * single_feature.rows, single_feature.cols, single_feature.rows)));
|
||||||
|
}
|
||||||
|
|
||||||
|
putText(temp_metadata, meta1.str(), Point(15,15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
|
||||||
|
putText(temp_metadata, meta2.str(), Point(15,40), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
|
||||||
|
imshow("metadata", temp_metadata);
|
||||||
|
imshow("features", temp_window);
|
||||||
|
putText(temp_window, meta1.str(), Point(15,15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
|
||||||
|
result_video.write(temp_window);
|
||||||
|
|
||||||
|
waitKey(timing);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Store the stage image if needed
|
||||||
|
if(draw_planes){
|
||||||
|
stringstream save_location;
|
||||||
|
save_location << output_folder << "stage_" << sid << ".png";
|
||||||
|
imwrite(save_location.str(), image_plane);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
+160
-241
@@ -31,10 +31,8 @@
|
|||||||
# The following variables affect the behavior of the macros in the
|
# The following variables affect the behavior of the macros in the
|
||||||
# script (in alphebetical order). Note that any of these flags can be
|
# script (in alphebetical order). Note that any of these flags can be
|
||||||
# changed multiple times in the same directory before calling
|
# changed multiple times in the same directory before calling
|
||||||
# CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY, CUDA_COMPILE, CUDA_COMPILE_PTX
|
# CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY, CUDA_COMPILE, CUDA_COMPILE_PTX,
|
||||||
# or CUDA_WRAP_SRCS.
|
# CUDA_COMPILE_FATBIN, CUDA_COMPILE_CUBIN or CUDA_WRAP_SRCS::
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
#
|
||||||
# CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
|
# 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.
|
# -- 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
|
# 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.
|
# file yourself, you can mix bit sizes between device and host.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
|
# 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
|
# -- 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
|
# file in Visual Studio. Turn OFF if you add the same cuda file to multiple
|
||||||
# targets.
|
# targets.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# This allows the user to build the target from the CUDA file; however, bad
|
# 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.
|
# things can happen if the CUDA source file is added to multiple targets.
|
||||||
# When performing parallel builds it is possible for the custom build
|
# 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
|
# 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.
|
# and turn the option off for the user, but no good solution could be found.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_BUILD_CUBIN (Default OFF)
|
# CUDA_BUILD_CUBIN (Default OFF)
|
||||||
# -- Set to ON to enable and extra compilation pass with the -cubin option in
|
# -- 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
|
# Device mode. The output is parsed and register, shared memory usage is
|
||||||
# printed during build.
|
# printed during build.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_BUILD_EMULATION (Default OFF for device mode)
|
# CUDA_BUILD_EMULATION (Default OFF for device mode)
|
||||||
# -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
|
# -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
|
||||||
# when CUDA_BUILD_EMULATION is TRUE.
|
# when CUDA_BUILD_EMULATION is TRUE.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
|
# CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
|
||||||
# -- Set to the path you wish to have the generated files placed. If it is
|
# -- 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.
|
# blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
|
||||||
# Intermediate files will always be placed in
|
# Intermediate files will always be placed in
|
||||||
# CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
|
# CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_HOST_COMPILATION_CPP (Default ON)
|
# CUDA_HOST_COMPILATION_CPP (Default ON)
|
||||||
# -- Set to OFF for C compilation of host code.
|
# -- Set to OFF for C compilation of host code.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER, $(VCInstallDir)/bin for VS)
|
# CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER, $(VCInstallDir)/bin for VS)
|
||||||
# -- Set the host compiler to be used by nvcc. Ignored if -ccbin or
|
# -- Set the host compiler to be used by nvcc. Ignored if -ccbin or
|
||||||
# --compiler-bindir is already present in the CUDA_NVCC_FLAGS 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
|
# $(VCInstallDir)/bin is a special value that expands out to the path when
|
||||||
# the command is run from withing VS.
|
# the command is run from withing VS.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_NVCC_FLAGS
|
# CUDA_NVCC_FLAGS
|
||||||
# CUDA_NVCC_FLAGS_<CONFIG>
|
# CUDA_NVCC_FLAGS_<CONFIG>
|
||||||
# -- Additional NVCC command line arguments. NOTE: multiple arguments must be
|
# -- Additional NVCC command line arguments. NOTE: multiple arguments must be
|
||||||
# semi-colon delimited (e.g. --compiler-options;-Wall)
|
# semi-colon delimited (e.g. --compiler-options;-Wall)
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_PROPAGATE_HOST_FLAGS (Default ON)
|
# CUDA_PROPAGATE_HOST_FLAGS (Default ON)
|
||||||
# -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
|
# -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
|
||||||
# dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
|
# 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
|
# CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for
|
||||||
# shared library compilation are not affected by this flag.
|
# shared library compilation are not affected by this flag.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_SEPARABLE_COMPILATION (Default OFF)
|
# CUDA_SEPARABLE_COMPILATION (Default OFF)
|
||||||
# -- If set this will enable separable compilation for all CUDA runtime object
|
# -- If set this will enable separable compilation for all CUDA runtime object
|
||||||
# files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY
|
# 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_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
|
||||||
# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
|
# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_VERBOSE_BUILD (Default OFF)
|
# CUDA_VERBOSE_BUILD (Default OFF)
|
||||||
# -- Set to ON to see all the commands used when building the CUDA file. When
|
# -- 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
|
# using a Makefile generator the value defaults to VERBOSE (run make
|
||||||
# VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
|
# VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
|
||||||
# always print the output.
|
# 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 )
|
# CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
|
||||||
# -- Adds the cufft library to the target (can be any target). Handles whether
|
# -- Adds the cufft library to the target (can be any target). Handles whether
|
||||||
# you are in emulation mode or not.
|
# you are in emulation mode or not.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
|
# CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
|
||||||
# -- Adds the cublas library to the target (can be any target). Handles
|
# -- Adds the cublas library to the target (can be any target). Handles
|
||||||
# whether you are in emulation mode or not.
|
# whether you are in emulation mode or not.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
|
# CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
|
||||||
# [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
|
# [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
|
||||||
# -- Creates an executable "cuda_target" which is made up of the files
|
# -- 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,
|
# nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
|
||||||
# CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
|
# CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
|
# CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
|
||||||
# [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
|
# [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
|
||||||
# -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
|
# -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_BUILD_CLEAN_TARGET()
|
# CUDA_BUILD_CLEAN_TARGET()
|
||||||
# -- Creates a convience target that deletes all the dependency files
|
# -- Creates a convience target that deletes all the dependency files
|
||||||
# generated. You should make clean after running this target to ensure the
|
# generated. You should make clean after running this target to ensure the
|
||||||
# dependency files get regenerated.
|
# dependency files get regenerated.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
|
# CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
|
||||||
# [OPTIONS ...] )
|
# [OPTIONS ...] )
|
||||||
# -- Returns a list of generated files from the input source files to be used
|
# -- Returns a list of generated files from the input source files to be used
|
||||||
# with ADD_LIBRARY or ADD_EXECUTABLE.
|
# with ADD_LIBRARY or ADD_EXECUTABLE.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
|
# CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
|
||||||
# -- Returns a list of PTX files generated from the input source files.
|
# -- 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_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var
|
||||||
# cuda_target
|
# cuda_target
|
||||||
@@ -242,10 +170,6 @@
|
|||||||
# automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that
|
# automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that
|
||||||
# this is a function and not a macro.
|
# this is a function and not a macro.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
|
# CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
|
||||||
# -- Sets the directories that should be passed to nvcc
|
# -- Sets the directories that should be passed to nvcc
|
||||||
# (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu
|
# (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
|
# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target
|
||||||
# nvcc_flags object_files)
|
# nvcc_flags object_files)
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# -- Generates the link object required by separable compilation from the given
|
# -- Generates the link object required by separable compilation from the given
|
||||||
# object files. This is called automatically for CUDA_ADD_EXECUTABLE and
|
# object files. This is called automatically for CUDA_ADD_EXECUTABLE and
|
||||||
# CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS
|
# 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
|
# specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function
|
||||||
# instead of a macro.
|
# instead of a macro.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
|
# CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
|
||||||
# [STATIC | SHARED | MODULE] [OPTIONS ...] )
|
# [STATIC | SHARED | MODULE] [OPTIONS ...] )
|
||||||
# -- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
|
# -- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
|
||||||
# CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
|
# CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
|
||||||
# function under the hood.
|
# function under the hood.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# Given the list of files (file0 file1 ... fileN) this macro generates
|
# Given the list of files (file0 file1 ... fileN) this macro generates
|
||||||
# custom commands that generate either PTX or linkable objects (use "PTX" or
|
# 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
|
# "OBJ" for the format argument to switch). Files that don't end with .cu
|
||||||
# or have the HEADER_FILE_ONLY property are ignored.
|
# or have the HEADER_FILE_ONLY property are ignored.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# The arguments passed in after OPTIONS are extra command line options to
|
# The arguments passed in after OPTIONS are extra command line options to
|
||||||
# give to nvcc. You can also specify per configuration options by
|
# give to nvcc. You can also specify per configuration options by
|
||||||
# specifying the name of the configuration followed by the options. General
|
# specifying the name of the configuration followed by the options. General
|
||||||
# options must preceed configuration specific options. Not all
|
# options must preceed configuration specific options. Not all
|
||||||
# configurations need to be specified, only the ones provided will be used.
|
# configurations need to be specified, only the ones provided will be used.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
|
# OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
|
||||||
# DEBUG -g
|
# DEBUG -g
|
||||||
# RELEASE --use_fast_math
|
# RELEASE --use_fast_math
|
||||||
# RELWITHDEBINFO --use_fast_math;-g
|
# RELWITHDEBINFO --use_fast_math;-g
|
||||||
# MINSIZEREL --use_fast_math
|
# MINSIZEREL --use_fast_math
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# For certain configurations (namely VS generating object files with
|
# For certain configurations (namely VS generating object files with
|
||||||
# CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
|
# 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
|
# 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
|
# cuda file to Visual Studio it knows that this file produces an object file
|
||||||
# and will link in the resulting object file automatically.
|
# and will link in the resulting object file automatically.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# This script will also generate a separate cmake script that is used at
|
# This script will also generate a separate cmake script that is used at
|
||||||
# build time to invoke nvcc. This is for several reasons.
|
# build time to invoke nvcc. This is for several reasons.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# 1. nvcc can return negative numbers as return values which confuses
|
# 1. nvcc can return negative numbers as return values which confuses
|
||||||
# Visual Studio into thinking that the command succeeded. The script now
|
# Visual Studio into thinking that the command succeeded. The script now
|
||||||
# checks the error codes and produces errors when there was a problem.
|
# checks the error codes and produces errors when there was a problem.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# 2. nvcc has been known to not delete incomplete results when it
|
# 2. nvcc has been known to not delete incomplete results when it
|
||||||
# encounters problems. This confuses build systems into thinking the
|
# encounters problems. This confuses build systems into thinking the
|
||||||
# target was generated when in fact an unusable file exists. The script
|
# target was generated when in fact an unusable file exists. The script
|
||||||
# now deletes the output files if there was an error.
|
# 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
|
# 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
|
# make the build rule dependent on the file, the output files will be
|
||||||
# regenerated when the options change.
|
# regenerated when the options change.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# This script also looks at optional arguments STATIC, SHARED, or MODULE to
|
# This script also looks at optional arguments STATIC, SHARED, or MODULE to
|
||||||
# determine when to target the object compilation for a shared library.
|
# 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
|
# 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
|
# <target_name>_EXPORTS is defined when a shared library compilation is
|
||||||
# detected.
|
# detected.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# Flags passed into add_definitions with -D or /D are passed along to nvcc.
|
# 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_MAJOR -- The major version of cuda as reported by nvcc.
|
||||||
# CUDA_VERSION_MINOR -- The minor version.
|
# CUDA_VERSION_MINOR -- The minor version.
|
||||||
# CUDA_VERSION
|
# CUDA_VERSION
|
||||||
# CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
|
# CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
|
# 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
|
# CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the
|
||||||
# SDK. This script will not directly support finding
|
# SDK. This script will not directly support finding
|
||||||
@@ -412,13 +278,13 @@
|
|||||||
# Only available for CUDA version 3.2+.
|
# Only available for CUDA version 3.2+.
|
||||||
# CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
|
# CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
|
||||||
# Only available for CUDA version 3.2+.
|
# 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+.
|
# 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+.
|
# 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+.
|
# 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+.
|
# Only available for CUDA version 5.5+.
|
||||||
# CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
|
# CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
|
||||||
# Only available for CUDA version 3.2+.
|
# Only available for CUDA version 3.2+.
|
||||||
@@ -427,32 +293,15 @@
|
|||||||
# Only available for CUDA version 3.2+.
|
# Only available for CUDA version 3.2+.
|
||||||
# Windows only.
|
# Windows only.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# James Bigler, NVIDIA Corp (nvidia.com - jbigler)
|
# James Bigler, NVIDIA Corp (nvidia.com - jbigler)
|
||||||
# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
|
# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
|
# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# Copyright (c) 2007-2009
|
# Copyright (c) 2007-2009
|
||||||
# Scientific Computing and Imaging Institute, University of Utah
|
# Scientific Computing and Imaging Institute, University of Utah
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# ::
|
|
||||||
#
|
|
||||||
# This code is licensed under the MIT License. See the FindCUDA.cmake script
|
# This code is licensed under the MIT License. See the FindCUDA.cmake script
|
||||||
# for the text of the license.
|
# for the text of the license.
|
||||||
|
|
||||||
@@ -481,11 +330,6 @@
|
|||||||
|
|
||||||
# FindCUDA.cmake
|
# 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
|
# This macro helps us find the location of helper files we will need the full path to
|
||||||
macro(CUDA_FIND_HELPER_FILE _name _extension)
|
macro(CUDA_FIND_HELPER_FILE _name _extension)
|
||||||
set(_full_name "${_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")
|
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
set(CUDA_HOST_COMPILER "$(VCInstallDir)bin" CACHE FILEPATH "Host side compiler used by NVCC")
|
set(CUDA_HOST_COMPILER "$(VCInstallDir)bin" CACHE FILEPATH "Host side compiler used by NVCC")
|
||||||
else()
|
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()
|
endif()
|
||||||
|
|
||||||
# Propagate the host flags to the host compiler via -Xcompiler
|
# 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,
|
# 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 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_TOOLKIT_TARGET_DIR CACHE)
|
||||||
unset(CUDA_NVCC_EXECUTABLE CACHE)
|
unset(CUDA_NVCC_EXECUTABLE CACHE)
|
||||||
unset(CUDA_VERSION CACHE)
|
unset(CUDA_VERSION CACHE)
|
||||||
cuda_unset_include_and_libraries()
|
cuda_unset_include_and_libraries()
|
||||||
endif()
|
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()
|
cuda_unset_include_and_libraries()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -758,27 +614,54 @@ endif()
|
|||||||
# Always set this convenience variable
|
# Always set this convenience variable
|
||||||
set(CUDA_VERSION_STRING "${CUDA_VERSION}")
|
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
|
# 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")
|
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()
|
else()
|
||||||
set(_cuda_target_cpu_arch_initial "")
|
set(_cuda_target_cpu_arch_initial "")
|
||||||
endif()
|
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)
|
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 "x${CUDA_TARGET_CPU_ARCH}" STREQUAL "xARM")
|
||||||
|
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 "x${CUDA_TARGET_CPU_ARCH}" STREQUAL "xAARCH64")
|
||||||
|
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
|
# CUDA_TOOLKIT_INCLUDE
|
||||||
find_path(CUDA_TOOLKIT_INCLUDE
|
find_path(CUDA_TOOLKIT_INCLUDE
|
||||||
device_functions.h # Header included in toolkit
|
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.
|
# and old paths.
|
||||||
set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" )
|
set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" )
|
||||||
endif()
|
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
|
# CUDA 3.2+ on Windows moved the library directories, so we need to new
|
||||||
# (lib/Win32) and the old path (lib).
|
# (lib/Win32) and the old path (lib).
|
||||||
find_library(${_var}
|
find_library(${_var}
|
||||||
NAMES ${_names}
|
NAMES ${_names} ${_cuda_static_lib_names}
|
||||||
PATHS "${CUDA_TOOLKIT_TARGET_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}"
|
PATHS "${CUDA_TOOLKIT_TARGET_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}"
|
||||||
ENV CUDA_PATH
|
ENV CUDA_PATH
|
||||||
ENV CUDA_LIB_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.
|
# Search default search paths, after we search our own set of paths.
|
||||||
find_library(${_var}
|
find_library(${_var}
|
||||||
NAMES ${_names}
|
NAMES ${_names} ${_cuda_static_lib_names}
|
||||||
PATHS "/usr/lib/nvidia-current"
|
PATHS "/usr/lib/nvidia-current"
|
||||||
DOC ${_doc}
|
DOC ${_doc}
|
||||||
)
|
)
|
||||||
@@ -853,18 +742,6 @@ if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
|
|||||||
else()
|
else()
|
||||||
set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
|
set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
|
||||||
endif()
|
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
|
# 1.1 toolkit on linux doesn't appear to have a separate library on
|
||||||
# some platforms.
|
# some platforms.
|
||||||
@@ -997,6 +874,8 @@ set(CUDA_FOUND TRUE)
|
|||||||
|
|
||||||
set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL
|
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)
|
"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
|
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)
|
"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
|
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( ${_options} )
|
||||||
set( _found_options FALSE )
|
set( _found_options FALSE )
|
||||||
foreach(arg ${ARGN})
|
foreach(arg ${ARGN})
|
||||||
if(arg STREQUAL "OPTIONS")
|
if("x${arg}" STREQUAL "xOPTIONS")
|
||||||
set( _found_options TRUE )
|
set( _found_options TRUE )
|
||||||
elseif(
|
elseif(
|
||||||
arg STREQUAL "WIN32" OR
|
"x${arg}" STREQUAL "xWIN32" OR
|
||||||
arg STREQUAL "MACOSX_BUNDLE" OR
|
"x${arg}" STREQUAL "xMACOSX_BUNDLE" OR
|
||||||
arg STREQUAL "EXCLUDE_FROM_ALL" OR
|
"x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR
|
||||||
arg STREQUAL "STATIC" OR
|
"x${arg}" STREQUAL "xSTATIC" OR
|
||||||
arg STREQUAL "SHARED" OR
|
"x${arg}" STREQUAL "xSHARED" OR
|
||||||
arg STREQUAL "MODULE"
|
"x${arg}" STREQUAL "xMODULE"
|
||||||
)
|
)
|
||||||
list(APPEND ${_cmake_options} ${arg})
|
list(APPEND ${_cmake_options} ${arg})
|
||||||
else()
|
else()
|
||||||
@@ -1148,7 +1027,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# This recipie is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
|
# This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
|
||||||
# CMake source.
|
# CMake source.
|
||||||
|
|
||||||
# Remove leading /
|
# Remove leading /
|
||||||
@@ -1177,7 +1056,7 @@ endfunction()
|
|||||||
# a .cpp or .ptx file.
|
# a .cpp or .ptx file.
|
||||||
# INPUT:
|
# INPUT:
|
||||||
# cuda_target - Target name
|
# 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.
|
# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped.
|
||||||
# OPTIONS - Extra options to NVCC
|
# OPTIONS - Extra options to NVCC
|
||||||
# OUTPUT:
|
# OUTPUT:
|
||||||
@@ -1223,8 +1102,14 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
|||||||
set(nvcc_flags ${nvcc_flags} -m32)
|
set(nvcc_flags ${nvcc_flags} -m32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CUDA_TARGET_CPU_ARCH)
|
if(CUDA_TARGET_CPU_ARCH AND CUDA_VERSION VERSION_LESS "7.0")
|
||||||
set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}")
|
# 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()
|
endif()
|
||||||
|
|
||||||
# This needs to be passed in at this stage, because VS needs to fill out the
|
# 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})
|
foreach(file ${ARGN})
|
||||||
# Ignore any file marked as a HEADER_FILE_ONLY
|
# Ignore any file marked as a HEADER_FILE_ONLY
|
||||||
get_source_file_property(_is_header ${file} 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.
|
# Allow per source file overrides of the format.
|
||||||
get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_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})
|
set(_cuda_source_format ${format})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( ${_cuda_source_format} MATCHES "PTX" )
|
if( ${_cuda_source_format} MATCHES "OBJ")
|
||||||
set( compile_to_ptx ON )
|
set( cuda_compile_to_external_module OFF )
|
||||||
elseif( ${_cuda_source_format} MATCHES "OBJ")
|
|
||||||
set( compile_to_ptx OFF )
|
|
||||||
else()
|
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()
|
endif()
|
||||||
|
|
||||||
|
if(cuda_compile_to_external_module)
|
||||||
if(compile_to_ptx)
|
|
||||||
# Don't use any of the host compilation flags for PTX targets.
|
# Don't use any of the host compilation flags for PTX targets.
|
||||||
set(CUDA_HOST_FLAGS)
|
set(CUDA_HOST_FLAGS)
|
||||||
set(CUDA_NVCC_FLAGS_CONFIG)
|
set(CUDA_NVCC_FLAGS_CONFIG)
|
||||||
@@ -1387,7 +1278,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
|||||||
if(CUDA_GENERATED_OUTPUT_DIR)
|
if(CUDA_GENERATED_OUTPUT_DIR)
|
||||||
set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}")
|
set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}")
|
||||||
else()
|
else()
|
||||||
if ( compile_to_ptx )
|
if ( cuda_compile_to_external_module )
|
||||||
set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}")
|
set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
else()
|
else()
|
||||||
set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}")
|
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. ######################
|
# Add a custom target to generate a c or ptx file. ######################
|
||||||
|
|
||||||
get_filename_component( basename ${file} NAME )
|
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_path "${cuda_compile_output_dir}")
|
||||||
set(generated_file_basename "${cuda_target}_generated_${basename}.ptx")
|
set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}")
|
||||||
set(format_flag "-ptx")
|
set(format_flag "-${cuda_compile_to_external_module_type}")
|
||||||
file(MAKE_DIRECTORY "${cuda_compile_output_dir}")
|
file(MAKE_DIRECTORY "${cuda_compile_output_dir}")
|
||||||
else()
|
else()
|
||||||
set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}")
|
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")
|
set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake")
|
||||||
|
|
||||||
# Setup properties for obj files:
|
# Setup properties for obj files:
|
||||||
if( NOT compile_to_ptx )
|
if( NOT cuda_compile_to_external_module )
|
||||||
set_source_files_properties("${generated_file}"
|
set_source_files_properties("${generated_file}"
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked.
|
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}")
|
set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
|
||||||
endif()
|
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}")
|
list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -1455,7 +1346,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
|||||||
# Build the NVCC made dependency file ###################################
|
# Build the NVCC made dependency file ###################################
|
||||||
set(build_cubin OFF)
|
set(build_cubin OFF)
|
||||||
if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
|
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 )
|
set ( build_cubin ON )
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -1482,8 +1373,8 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
|||||||
|
|
||||||
# Create up the comment string
|
# Create up the comment string
|
||||||
file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}")
|
file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}")
|
||||||
if(compile_to_ptx)
|
if(cuda_compile_to_external_module)
|
||||||
set(cuda_build_comment_string "Building NVCC ptx file ${generated_file_relative_path}")
|
set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}")
|
||||||
else()
|
else()
|
||||||
set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}")
|
set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}")
|
||||||
endif()
|
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.
|
# 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 "-ccbin" ccbin_found0 )
|
||||||
list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 )
|
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}\"")
|
list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
|
||||||
endif()
|
endif()
|
||||||
|
# Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG}
|
||||||
|
set(config_specific_flags)
|
||||||
set(flags)
|
set(flags)
|
||||||
foreach(config ${CUDA_configuration_types})
|
foreach(config ${CUDA_configuration_types})
|
||||||
string(TOUPPER ${config} config_upper)
|
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)
|
set(important_host_flags)
|
||||||
_cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}})
|
_cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}})
|
||||||
foreach(f ${important_host_flags})
|
foreach(f ${important_host_flags})
|
||||||
list(APPEND flags $<$<CONFIG:${config}>:-Xcompiler> $<$<CONFIG:${config}>:${f}>)
|
list(APPEND flags $<$<CONFIG:${config}>:-Xcompiler> $<$<CONFIG:${config}>:${f}>)
|
||||||
endforeach()
|
endforeach()
|
||||||
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}")
|
file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}")
|
||||||
|
|
||||||
# Some generators don't handle the multiple levels of custom command
|
# 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
|
# Separate the sources from the options
|
||||||
CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN})
|
CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN})
|
||||||
# Create custom commands and targets for each file.
|
# 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} )
|
OPTIONS ${_options} )
|
||||||
|
|
||||||
set( ${generated_files} ${_generated_files})
|
set( ${generated_files} ${_generated_files})
|
||||||
|
|
||||||
endmacro()
|
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)
|
macro(CUDA_COMPILE_PTX generated_files)
|
||||||
|
cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN})
|
||||||
# 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})
|
|
||||||
|
|
||||||
endmacro()
|
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
|
# CUDA ADD CUFFT TO TARGET
|
||||||
|
|||||||
@@ -37,12 +37,11 @@
|
|||||||
|
|
||||||
file(READ ${input_file} depend_text)
|
file(READ ${input_file} depend_text)
|
||||||
|
|
||||||
if (${depend_text} MATCHES ".+")
|
if (NOT "${depend_text}" STREQUAL "")
|
||||||
|
|
||||||
# message("FOUND DEPENDS")
|
# message("FOUND DEPENDS")
|
||||||
|
|
||||||
# Remember, four backslashes is escaped to one backslash in the string.
|
string(REPLACE "\\ " " " depend_text ${depend_text})
|
||||||
string(REGEX REPLACE "\\\\ " " " depend_text ${depend_text})
|
|
||||||
|
|
||||||
# This works for the nvcc -M generated dependency files.
|
# This works for the nvcc -M generated dependency files.
|
||||||
string(REGEX REPLACE "^.* : " "" depend_text ${depend_text})
|
string(REGEX REPLACE "^.* : " "" depend_text ${depend_text})
|
||||||
|
|||||||
@@ -37,11 +37,10 @@
|
|||||||
|
|
||||||
file(READ ${input_file} file_text)
|
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(REPLACE ";" "\\;" file_text ${file_text})
|
||||||
string(REGEX REPLACE ";" "\\\\;" file_text ${file_text})
|
string(REPLACE "\ncode" ";code" file_text ${file_text})
|
||||||
string(REGEX REPLACE "\ncode" ";code" file_text ${file_text})
|
|
||||||
|
|
||||||
list(LENGTH file_text len)
|
list(LENGTH file_text len)
|
||||||
|
|
||||||
@@ -57,7 +56,7 @@ if (${file_text} MATCHES ".+")
|
|||||||
|
|
||||||
# Extract kernel names.
|
# Extract kernel names.
|
||||||
if (${entry} MATCHES "[^g]name = ([^ ]+)")
|
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 "_"
|
# Check to see if the kernel name starts with "_"
|
||||||
set(skip FALSE)
|
set(skip FALSE)
|
||||||
@@ -76,19 +75,19 @@ if (${file_text} MATCHES ".+")
|
|||||||
|
|
||||||
# Registers
|
# Registers
|
||||||
if (${entry} MATCHES "reg([ ]+)=([ ]+)([^ ]+)")
|
if (${entry} MATCHES "reg([ ]+)=([ ]+)([^ ]+)")
|
||||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
set(entry "${CMAKE_MATCH_3}")
|
||||||
message("Registers: ${entry}")
|
message("Registers: ${entry}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Local memory
|
# Local memory
|
||||||
if (${entry} MATCHES "lmem([ ]+)=([ ]+)([^ ]+)")
|
if (${entry} MATCHES "lmem([ ]+)=([ ]+)([^ ]+)")
|
||||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
set(entry "${CMAKE_MATCH_3}")
|
||||||
message("Local: ${entry}")
|
message("Local: ${entry}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Shared memory
|
# Shared memory
|
||||||
if (${entry} MATCHES "smem([ ]+)=([ ]+)([^ ]+)")
|
if (${entry} MATCHES "smem([ ]+)=([ ]+)([^ ]+)")
|
||||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
set(entry "${CMAKE_MATCH_3}")
|
||||||
message("Shared: ${entry}")
|
message("Shared: ${entry}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ set(cmake_dependency_file "@cmake_dependency_file@") # path
|
|||||||
set(CUDA_make2cmake "@CUDA_make2cmake@") # path
|
set(CUDA_make2cmake "@CUDA_make2cmake@") # path
|
||||||
set(CUDA_parse_cubin "@CUDA_parse_cubin@") # path
|
set(CUDA_parse_cubin "@CUDA_parse_cubin@") # path
|
||||||
set(build_cubin @build_cubin@) # bool
|
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
|
# 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.
|
# order to force this file to be run again if it changes.
|
||||||
set(generated_file_path "@generated_file_path@") # path
|
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
|
# Any -ccbin existing in CUDA_NVCC_FLAGS gets highest priority
|
||||||
list( FIND CUDA_NVCC_FLAGS "-ccbin" ccbin_found0 )
|
list( FIND CUDA_NVCC_FLAGS "-ccbin" ccbin_found0 )
|
||||||
list( FIND CUDA_NVCC_FLAGS "--compiler-bindir" ccbin_found1 )
|
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)
|
if (CUDA_HOST_COMPILER STREQUAL "$(VCInstallDir)bin" AND DEFINED CCBIN)
|
||||||
set(CCBIN -ccbin "${CCBIN}")
|
set(CCBIN -ccbin "${CCBIN}")
|
||||||
else()
|
else()
|
||||||
@@ -126,7 +126,7 @@ endif()
|
|||||||
# and other return variables are present after executing the process.
|
# and other return variables are present after executing the process.
|
||||||
macro(cuda_execute_process status command)
|
macro(cuda_execute_process status command)
|
||||||
set(_command ${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})")
|
message(FATAL_ERROR "Malformed call to cuda_execute_process. Missing COMMAND as second argument. (command = ${command})")
|
||||||
endif()
|
endif()
|
||||||
if(verbose)
|
if(verbose)
|
||||||
|
|||||||
@@ -6,34 +6,62 @@ endif()
|
|||||||
|
|
||||||
set(HAVE_WINRT FALSE)
|
set(HAVE_WINRT FALSE)
|
||||||
|
|
||||||
# search Windows Platform SDK
|
# search Windows (Phone) Platform SDK
|
||||||
message(STATUS "Checking for Windows Platform SDK")
|
message(STATUS "Checking for Windows (Phone) Platform SDK 8.0/8.1")
|
||||||
GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
|
unset(WINDOWS_SDK_PATH CACHE)
|
||||||
if(WINDOWS_SDK_PATH STREQUAL "")
|
GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhoneApp\\v8.1;InstallationFolder]" ABSOLUTE CACHE)
|
||||||
set(HAVE_MSPDK FALSE)
|
if((NOT ENABLE_WINPHONESDK81) OR (NOT (MSVC_VERSION EQUAL 1800)) OR (WINDOWS_SDK_PATH STREQUAL ""))
|
||||||
message(STATUS "Windows Platform SDK 8.0 was not found")
|
unset(WINDOWS_SDK_PATH CACHE)
|
||||||
|
GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
|
||||||
|
if((NOT ENABLE_WINPHONESDK80) OR (MSVC_VERSION LESS 1700) OR (WINDOWS_SDK_PATH STREQUAL ""))
|
||||||
|
unset(WINDOWS_SDK_PATH CACHE)
|
||||||
|
GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]" ABSOLUTE CACHE)
|
||||||
|
if((NOT ENABLE_WINSDK81) OR (NOT (MSVC_VERSION EQUAL 1800)) OR (WINDOWS_SDK_PATH STREQUAL ""))
|
||||||
|
set(HAVE_MSPDK FALSE)
|
||||||
|
unset(WINDOWS_SDK_PATH CACHE)
|
||||||
|
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 (Phone) Platform SDK 8.0/8.1 was not found")
|
||||||
|
else()
|
||||||
|
set(HAVE_MSPDK TRUE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(HAVE_MSPDK TRUE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(HAVE_MSPDK TRUE)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
set(HAVE_MSPDK TRUE)
|
set(HAVE_MSPDK TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#search for Visual Studio 11.0 install directory
|
#search for Visual Studio 11.0/12.0 install directory
|
||||||
message(STATUS "Checking for Visual Studio 2012")
|
message(STATUS "Checking for Visual Studio 2012/2013")
|
||||||
GET_FILENAME_COMPONENT(VISUAL_STUDIO_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH CACHE)
|
unset(VISUAL_STUDIO_PATH CACHE)
|
||||||
if(VISUAL_STUDIO_PATH STREQUAL "")
|
GET_FILENAME_COMPONENT(VISUAL_STUDIO_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0\\Setup\\VS;ProductDir] REALPATH CACHE)
|
||||||
set(HAVE_MSVC2012 FALSE)
|
if((NOT ENABLE_LIBVS2013) OR (NOT (MSVC_VERSION EQUAL 1800)) OR (VISUAL_STUDIO_PATH STREQUAL ""))
|
||||||
message(STATUS "Visual Studio 2012 was not found")
|
set(HAVE_MSVC2013 FALSE)
|
||||||
|
unset(VISUAL_STUDIO_PATH CACHE)
|
||||||
|
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/2013 not found")
|
||||||
|
else()
|
||||||
|
set(HAVE_MSVC2012 TRUE)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
set(HAVE_MSVC2012 TRUE)
|
set(HAVE_MSVC2013 TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
try_compile(HAVE_WINRT_SDK
|
try_compile(HAVE_WINRT_SDK
|
||||||
"${OpenCV_BINARY_DIR}"
|
"${OpenCV_BINARY_DIR}"
|
||||||
"${OpenCV_SOURCE_DIR}/cmake/checks/winrttest.cpp")
|
"${OpenCV_SOURCE_DIR}/cmake/checks/winrttest.cpp")
|
||||||
|
|
||||||
if(ENABLE_WINRT_MODE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
|
if(ENABLE_WINRT_MODE AND HAVE_WINRT_SDK AND (HAVE_MSVC2012 OR HAVE_MSVC2013) AND HAVE_MSPDK)
|
||||||
set(HAVE_WINRT TRUE)
|
set(HAVE_WINRT TRUE)
|
||||||
set(HAVE_WINRT_CX TRUE)
|
set(HAVE_WINRT_CX TRUE)
|
||||||
elseif(ENABLE_WINRT_MODE_NATIVE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
|
elseif(ENABLE_WINRT_MODE_NATIVE AND HAVE_WINRT_SDK AND (HAVE_MSVC2012 OR HAVE_MSVC2013) AND HAVE_MSPDK)
|
||||||
set(HAVE_WINRT TRUE)
|
set(HAVE_WINRT TRUE)
|
||||||
set(HAVE_WINRT_CX FALSE)
|
set(HAVE_WINRT_CX FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ if(OPENCV_CAN_BREAK_BINARY_COMPATIBILITY)
|
|||||||
add_definitions(-DOPENCV_CAN_BREAK_BINARY_COMPATIBILITY)
|
add_definitions(-DOPENCV_CAN_BREAK_BINARY_COMPATIBILITY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_TINY_GPU_MODULE)
|
||||||
|
add_definitions(-DOPENCV_TINY_GPU_MODULE)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
# High level of warnings.
|
# High level of warnings.
|
||||||
add_extra_compiler_option(-W)
|
add_extra_compiler_option(-W)
|
||||||
@@ -91,6 +95,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
add_extra_compiler_option(-Wno-narrowing)
|
add_extra_compiler_option(-Wno-narrowing)
|
||||||
add_extra_compiler_option(-Wno-delete-non-virtual-dtor)
|
add_extra_compiler_option(-Wno-delete-non-virtual-dtor)
|
||||||
add_extra_compiler_option(-Wno-unnamed-type-template-args)
|
add_extra_compiler_option(-Wno-unnamed-type-template-args)
|
||||||
|
add_extra_compiler_option(-Wno-array-bounds)
|
||||||
|
add_extra_compiler_option(-Wno-aggressive-loop-optimizations)
|
||||||
endif()
|
endif()
|
||||||
add_extra_compiler_option(-fdiagnostics-show-option)
|
add_extra_compiler_option(-fdiagnostics-show-option)
|
||||||
|
|
||||||
@@ -112,6 +118,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
add_extra_compiler_option(-march=i686)
|
add_extra_compiler_option(-march=i686)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
add_extra_compiler_option(-Wno-semicolon-before-method-body)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Other optimizations
|
# Other optimizations
|
||||||
if(ENABLE_OMIT_FRAME_POINTER)
|
if(ENABLE_OMIT_FRAME_POINTER)
|
||||||
add_extra_compiler_option(-fomit-frame-pointer)
|
add_extra_compiler_option(-fomit-frame-pointer)
|
||||||
@@ -140,7 +150,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
# SSE3 and further should be disabled under MingW because it generates compiler errors
|
# SSE3 and further should be disabled under MingW because it generates compiler errors
|
||||||
if(NOT MINGW)
|
if(NOT MINGW)
|
||||||
if(ENABLE_AVX)
|
if(ENABLE_AVX)
|
||||||
add_extra_compiler_option(-mavx)
|
add_extra_compiler_option("-mavx")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_AVX2)
|
||||||
|
add_extra_compiler_option("-mavx2")
|
||||||
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.
|
# GCC depresses SSEx instructions when -mavx is used. Instead, it generates new AVX instructions or AVX equivalence for all SSEx instructions when needed.
|
||||||
@@ -187,6 +201,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
add_extra_compiler_option(-ffunction-sections)
|
add_extra_compiler_option(-ffunction-sections)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_COVERAGE)
|
||||||
|
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} --coverage")
|
||||||
|
set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} --coverage")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} -DNDEBUG")
|
set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} -DNDEBUG")
|
||||||
set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -O0 -DDEBUG -D_DEBUG")
|
set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -O0 -DDEBUG -D_DEBUG")
|
||||||
endif()
|
endif()
|
||||||
@@ -211,10 +230,6 @@ if(MSVC)
|
|||||||
set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi")
|
set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_AVX AND NOT MSVC_VERSION LESS 1600)
|
|
||||||
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /arch:AVX")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_SSE4_1 AND CV_ICC AND NOT OPENCV_EXTRA_FLAGS MATCHES "/arch:")
|
if(ENABLE_SSE4_1 AND CV_ICC AND NOT OPENCV_EXTRA_FLAGS MATCHES "/arch:")
|
||||||
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /arch:SSE4.1")
|
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /arch:SSE4.1")
|
||||||
endif()
|
endif()
|
||||||
@@ -233,7 +248,7 @@ if(MSVC)
|
|||||||
endif()
|
endif()
|
||||||
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")
|
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /Oi")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -248,8 +263,13 @@ if(MSVC)
|
|||||||
endif()
|
endif()
|
||||||
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:
|
# Extra link libs if the user selects building static libs:
|
||||||
if(NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID)
|
if(NOT BUILD_SHARED_LIBS AND ((CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID) OR QNX))
|
||||||
# Android does not need these settings because they are already set by toolchain file
|
# Android does not need these settings because they are already set by toolchain file
|
||||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} stdc++)
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} stdc++)
|
||||||
set(OPENCV_EXTRA_FLAGS "-fPIC ${OPENCV_EXTRA_FLAGS}")
|
set(OPENCV_EXTRA_FLAGS "-fPIC ${OPENCV_EXTRA_FLAGS}")
|
||||||
@@ -300,5 +320,8 @@ if(MSVC)
|
|||||||
|
|
||||||
if(NOT ENABLE_NOISY_WARNINGS)
|
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
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251") #class 'std::XXX' needs to have dll-interface to be used by clients of YYY
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4275") # non dll-interface class 'std::exception' used as base for dll-interface class 'cv::Exception'
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4589") # Constructor of abstract class ... ignores initializer for virtual base class 'cv::Algorithm'
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4359") # Alignment specifier is less than actual alignment (4), and will be ignored
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ if(MSVC)
|
|||||||
set(OpenCV_RUNTIME vc11)
|
set(OpenCV_RUNTIME vc11)
|
||||||
elseif(MSVC_VERSION EQUAL 1800)
|
elseif(MSVC_VERSION EQUAL 1800)
|
||||||
set(OpenCV_RUNTIME vc12)
|
set(OpenCV_RUNTIME vc12)
|
||||||
|
elseif(MSVC_VERSION EQUAL 1900)
|
||||||
|
set(OpenCV_RUNTIME vc14)
|
||||||
endif()
|
endif()
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
set(OpenCV_RUNTIME mingw)
|
set(OpenCV_RUNTIME mingw)
|
||||||
@@ -86,7 +88,7 @@ elseif(MINGW)
|
|||||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
|
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
|
||||||
OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
|
OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
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(MINGW64 1)
|
||||||
set(OpenCV_ARCH x64)
|
set(OpenCV_ARCH x64)
|
||||||
else()
|
else()
|
||||||
|
|||||||
@@ -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)
|
# add_android_project(target_name ${path} NATIVE_DEPS opencv_core LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11)
|
||||||
macro(add_android_project target path)
|
macro(add_android_project target path)
|
||||||
# parse arguments
|
# 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 EMBED_CUDA FORCE_EMBED_OPENCV)
|
||||||
set(__varname "android_proj_")
|
set(__varname "android_proj_")
|
||||||
foreach(v ${android_proj_arglist})
|
foreach(v ${android_proj_arglist})
|
||||||
set(${__varname}${v} "")
|
set(${__varname}${v} "")
|
||||||
@@ -303,13 +303,53 @@ macro(add_android_project target path)
|
|||||||
add_custom_command(TARGET ${JNI_LIB_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "${android_proj_jni_location}")
|
add_custom_command(TARGET ${JNI_LIB_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "${android_proj_jni_location}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# copy opencv_java, tbb if it is shared and dynamicuda if present if FORCE_EMBED_OPENCV flag is set
|
||||||
|
if(android_proj_FORCE_EMBED_OPENCV)
|
||||||
|
set(native_deps ${android_proj_NATIVE_DEPS})
|
||||||
|
# filter out gpu module as it is always static library on Android
|
||||||
|
list(REMOVE_ITEM native_deps "opencv_gpu")
|
||||||
|
if(ENABLE_DYNAMIC_CUDA)
|
||||||
|
list(APPEND native_deps "opencv_dynamicuda")
|
||||||
|
endif()
|
||||||
|
foreach(lib ${native_deps})
|
||||||
|
get_property(f TARGET ${lib} PROPERTY LOCATION)
|
||||||
|
get_filename_component(f_name ${f} NAME)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}/${f_name}"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy "${f}" "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}/${f_name}"
|
||||||
|
DEPENDS "${lib}" VERBATIM
|
||||||
|
COMMENT "Embedding ${f}")
|
||||||
|
list(APPEND android_proj_file_deps "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}/${f_name}")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# copy all needed CUDA libs to project if EMBED_CUDA flag is present
|
||||||
|
if(android_proj_EMBED_CUDA)
|
||||||
|
set(android_proj_culibs ${CUDA_npp_LIBRARY_ABS} ${CUDA_LIBRARIES_ABS})
|
||||||
|
if(HAVE_CUFFT)
|
||||||
|
list(INSERT android_proj_culibs 0 ${CUDA_cufft_LIBRARY_ABS})
|
||||||
|
endif()
|
||||||
|
if(HAVE_CUBLAS)
|
||||||
|
list(INSERT android_proj_culibs 0 ${CUDA_cublas_LIBRARY_ABS})
|
||||||
|
endif()
|
||||||
|
foreach(lib ${android_proj_culibs})
|
||||||
|
get_filename_component(f "${lib}" NAME)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}/${f}"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy "${lib}" "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}/${f}"
|
||||||
|
DEPENDS "${lib}" VERBATIM
|
||||||
|
COMMENT "Embedding ${f}")
|
||||||
|
list(APPEND android_proj_file_deps "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}/${f}")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# build java part
|
# build java part
|
||||||
if(android_proj_IGNORE_JAVA)
|
if(android_proj_IGNORE_JAVA)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${android_proj_bin_dir}/bin/${target}-debug.apk"
|
OUTPUT "${android_proj_bin_dir}/bin/${target}-debug.apk"
|
||||||
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug
|
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug -Djava.target=1.6 -Djava.source=1.6
|
||||||
COMMAND ${CMAKE_COMMAND} -E touch "${android_proj_bin_dir}/bin/${target}-debug.apk" # needed because ant does not update the timestamp of updated apk
|
COMMAND ${CMAKE_COMMAND} -E touch "${android_proj_bin_dir}/bin/${target}-debug.apk" # needed because ant does not update the timestamp of updated apk
|
||||||
WORKING_DIRECTORY "${android_proj_bin_dir}"
|
WORKING_DIRECTORY "${android_proj_bin_dir}"
|
||||||
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}"
|
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}"
|
||||||
@@ -317,7 +357,7 @@ macro(add_android_project target path)
|
|||||||
else()
|
else()
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${android_proj_bin_dir}/bin/${target}-debug.apk"
|
OUTPUT "${android_proj_bin_dir}/bin/${target}-debug.apk"
|
||||||
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug
|
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug -Djava.target=1.6 -Djava.source=1.6
|
||||||
COMMAND ${CMAKE_COMMAND} -E touch "${android_proj_bin_dir}/bin/${target}-debug.apk" # needed because ant does not update the timestamp of updated apk
|
COMMAND ${CMAKE_COMMAND} -E touch "${android_proj_bin_dir}/bin/${target}-debug.apk" # needed because ant does not update the timestamp of updated apk
|
||||||
WORKING_DIRECTORY "${android_proj_bin_dir}"
|
WORKING_DIRECTORY "${android_proj_bin_dir}"
|
||||||
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}"
|
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}"
|
||||||
@@ -344,20 +384,20 @@ macro(add_android_project target path)
|
|||||||
add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${android_proj_bin_dir}/bin/${target}-debug.apk" "${OpenCV_BINARY_DIR}/bin/${target}.apk")
|
add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${android_proj_bin_dir}/bin/${target}-debug.apk" "${OpenCV_BINARY_DIR}/bin/${target}.apk")
|
||||||
if(INSTALL_ANDROID_EXAMPLES AND "${target}" MATCHES "^example-")
|
if(INSTALL_ANDROID_EXAMPLES AND "${target}" MATCHES "^example-")
|
||||||
#apk
|
#apk
|
||||||
install(FILES "${OpenCV_BINARY_DIR}/bin/${target}.apk" DESTINATION "samples" COMPONENT main)
|
install(FILES "${OpenCV_BINARY_DIR}/bin/${target}.apk" DESTINATION "samples" COMPONENT samples)
|
||||||
get_filename_component(sample_dir "${path}" NAME)
|
get_filename_component(sample_dir "${path}" NAME)
|
||||||
#java part
|
#java part
|
||||||
list(REMOVE_ITEM android_proj_files ${ANDROID_MANIFEST_FILE})
|
list(REMOVE_ITEM android_proj_files ${ANDROID_MANIFEST_FILE})
|
||||||
foreach(f ${android_proj_files} ${ANDROID_MANIFEST_FILE})
|
foreach(f ${android_proj_files} ${ANDROID_MANIFEST_FILE})
|
||||||
get_filename_component(install_subdir "${f}" PATH)
|
get_filename_component(install_subdir "${f}" PATH)
|
||||||
install(FILES "${android_proj_bin_dir}/${f}" DESTINATION "samples/${sample_dir}/${install_subdir}" COMPONENT main)
|
install(FILES "${android_proj_bin_dir}/${f}" DESTINATION "samples/${sample_dir}/${install_subdir}" COMPONENT samples)
|
||||||
endforeach()
|
endforeach()
|
||||||
#jni part + eclipse files
|
#jni part + eclipse files
|
||||||
file(GLOB_RECURSE jni_files RELATIVE "${path}" "${path}/jni/*" "${path}/.cproject")
|
file(GLOB_RECURSE jni_files RELATIVE "${path}" "${path}/jni/*" "${path}/.cproject")
|
||||||
ocv_list_filterout(jni_files "\\\\.svn")
|
ocv_list_filterout(jni_files "\\\\.svn")
|
||||||
foreach(f ${jni_files} ".classpath" ".project" ".settings/org.eclipse.jdt.core.prefs")
|
foreach(f ${jni_files} ".classpath" ".project" ".settings/org.eclipse.jdt.core.prefs")
|
||||||
get_filename_component(install_subdir "${f}" PATH)
|
get_filename_component(install_subdir "${f}" PATH)
|
||||||
install(FILES "${path}/${f}" DESTINATION "samples/${sample_dir}/${install_subdir}" COMPONENT main)
|
install(FILES "${path}/${f}" DESTINATION "samples/${sample_dir}/${install_subdir}" COMPONENT samples)
|
||||||
endforeach()
|
endforeach()
|
||||||
#update proj
|
#update proj
|
||||||
if(android_proj_lib_deps_commands)
|
if(android_proj_lib_deps_commands)
|
||||||
@@ -365,9 +405,9 @@ macro(add_android_project target path)
|
|||||||
endif()
|
endif()
|
||||||
install(CODE "EXECUTE_PROCESS(COMMAND ${ANDROID_EXECUTABLE} --silent update project --path . --target \"${android_proj_sdk_target}\" --name \"${target}\" ${inst_lib_opt}
|
install(CODE "EXECUTE_PROCESS(COMMAND ${ANDROID_EXECUTABLE} --silent update project --path . --target \"${android_proj_sdk_target}\" --name \"${target}\" ${inst_lib_opt}
|
||||||
WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}\"
|
WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}\"
|
||||||
)" COMPONENT main)
|
)" COMPONENT samples)
|
||||||
#empty 'gen'
|
#empty 'gen'
|
||||||
install(CODE "MAKE_DIRECTORY(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}/gen\")" COMPONENT main)
|
install(CODE "MAKE_DIRECTORY(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}/gen\")" COMPONENT samples)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|||||||
@@ -15,19 +15,10 @@ endif()
|
|||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${OpenCV_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
set(CMAKE_MODULE_PATH "${OpenCV_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
||||||
|
|
||||||
foreach(var INCLUDE LIBRARY PROGRAM)
|
if(ANDROID AND "${CUDA_VERSION}" VERSION_LESS "7.0")
|
||||||
set(__old_frpm_${var} "${CMAKE_FIND_ROOT_PATH_MODE_${var}}")
|
set(CUDA_TARGET_OS_VARIANT "Android")
|
||||||
endforeach()
|
endif()
|
||||||
|
find_host_package(CUDA 4.2 QUIET)
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
|
|
||||||
|
|
||||||
find_package(CUDA 4.2 QUIET)
|
|
||||||
|
|
||||||
foreach(var INCLUDE LIBRARY PROGRAM)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_${var} "${__old_frpm_${var}}")
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
list(REMOVE_AT CMAKE_MODULE_PATH 0)
|
list(REMOVE_AT CMAKE_MODULE_PATH 0)
|
||||||
|
|
||||||
@@ -44,7 +35,18 @@ if(CUDA_FOUND)
|
|||||||
|
|
||||||
if(WITH_NVCUVID)
|
if(WITH_NVCUVID)
|
||||||
find_cuda_helper_libs(nvcuvid)
|
find_cuda_helper_libs(nvcuvid)
|
||||||
set(HAVE_NVCUVID 1)
|
|
||||||
|
if(WIN32)
|
||||||
|
find_cuda_helper_libs(nvcuvenc)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CUDA_nvcuvid_LIBRARY)
|
||||||
|
set(HAVE_NVCUVID 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CUDA_nvcuvenc_LIBRARY)
|
||||||
|
set(HAVE_NVCUVENC 1)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "CUDA detected: " ${CUDA_VERSION})
|
message(STATUS "CUDA detected: " ${CUDA_VERSION})
|
||||||
@@ -91,11 +93,18 @@ if(CUDA_FOUND)
|
|||||||
|
|
||||||
if(NOT DEFINED __cuda_arch_bin)
|
if(NOT DEFINED __cuda_arch_bin)
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(__cuda_arch_bin "3.2")
|
if (ARM)
|
||||||
set(__cuda_arch_ptx "")
|
set(__cuda_arch_bin "3.2")
|
||||||
|
set(__cuda_arch_ptx "")
|
||||||
|
elseif(AARCH64)
|
||||||
|
set(__cuda_arch_bin "5.3")
|
||||||
|
set(__cuda_arch_ptx "")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
if(${CUDA_VERSION} VERSION_LESS "5.0")
|
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")
|
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()
|
else()
|
||||||
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
|
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
|
||||||
endif()
|
endif()
|
||||||
@@ -154,7 +163,6 @@ if(CUDA_FOUND)
|
|||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xptxas;-dlcm=ca")
|
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xptxas;-dlcm=ca")
|
||||||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-target-os-variant=Android")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}")
|
message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}")
|
||||||
@@ -180,6 +188,9 @@ if(CUDA_FOUND)
|
|||||||
# we remove -Wsign-promo as it generates warnings under linux
|
# we remove -Wsign-promo as it generates warnings under linux
|
||||||
string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
|
string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
|
||||||
|
|
||||||
|
# we remove -Wno-sign-promo as it generates warnings under linux
|
||||||
|
string(REPLACE "-Wno-sign-promo" "" ${var} "${${var}}")
|
||||||
|
|
||||||
# we remove -Wno-delete-non-virtual-dtor because it's used for C++ compiler
|
# we remove -Wno-delete-non-virtual-dtor because it's used for C++ compiler
|
||||||
# but NVCC uses C compiler by default
|
# but NVCC uses C compiler by default
|
||||||
string(REPLACE "-Wno-delete-non-virtual-dtor" "" ${var} "${${var}}")
|
string(REPLACE "-Wno-delete-non-virtual-dtor" "" ${var} "${${var}}")
|
||||||
@@ -216,3 +227,20 @@ else()
|
|||||||
unset(CUDA_ARCH_BIN CACHE)
|
unset(CUDA_ARCH_BIN CACHE)
|
||||||
unset(CUDA_ARCH_PTX CACHE)
|
unset(CUDA_ARCH_PTX CACHE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(HAVE_CUDA)
|
||||||
|
set(CUDA_LIBRARIES_ABS ${CUDA_LIBRARIES})
|
||||||
|
ocv_create_imported_targets(CUDA_LIBRARIES ${CUDA_LIBRARIES})
|
||||||
|
set(CUDA_npp_LIBRARY_ABS ${CUDA_npp_LIBRARY})
|
||||||
|
ocv_create_imported_targets(CUDA_npp_LIBRARY ${CUDA_npp_LIBRARY})
|
||||||
|
|
||||||
|
if(HAVE_CUBLAS)
|
||||||
|
set(CUDA_cublas_LIBRARY_ABS ${CUDA_cublas_LIBRARY})
|
||||||
|
ocv_create_imported_targets(CUDA_cublas_LIBRARY ${CUDA_cublas_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(HAVE_CUFFT)
|
||||||
|
set(CUDA_cufft_LIBRARY_ABS ${CUDA_cufft_LIBRARY})
|
||||||
|
ocv_create_imported_targets(CUDA_cufft_LIBRARY ${CUDA_cufft_LIBRARY})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -91,9 +91,9 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
|
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
|
||||||
OUTPUT_VARIABLE CMAKE_OPENCV_GCC_TARGET_MACHINE
|
OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
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)
|
set(MINGW64 1)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -109,10 +109,12 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*")
|
|||||||
set(X86 1)
|
set(X86 1)
|
||||||
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|ARM.*")
|
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|ARM.*")
|
||||||
set(ARM 1)
|
set(ARM 1)
|
||||||
|
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64.*|AARCH64.*")
|
||||||
|
set(AARCH64 1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Similar code is existed in OpenCVConfig.cmake
|
# Similar code exists in OpenCVConfig.cmake
|
||||||
if(NOT DEFINED OpenCV_STATIC)
|
if(NOT DEFINED OpenCV_STATIC)
|
||||||
# look for global setting
|
# look for global setting
|
||||||
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
|
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
|
||||||
@@ -138,15 +140,13 @@ if(MSVC)
|
|||||||
set(OpenCV_RUNTIME vc11)
|
set(OpenCV_RUNTIME vc11)
|
||||||
elseif(MSVC_VERSION EQUAL 1800)
|
elseif(MSVC_VERSION EQUAL 1800)
|
||||||
set(OpenCV_RUNTIME vc12)
|
set(OpenCV_RUNTIME vc12)
|
||||||
|
elseif(MSVC_VERSION EQUAL 1900)
|
||||||
|
set(OpenCV_RUNTIME vc14)
|
||||||
endif()
|
endif()
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
set(OpenCV_RUNTIME mingw)
|
set(OpenCV_RUNTIME mingw)
|
||||||
|
|
||||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
|
if(MINGW64)
|
||||||
OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64")
|
|
||||||
set(MINGW64 1)
|
|
||||||
set(OpenCV_ARCH x64)
|
set(OpenCV_ARCH x64)
|
||||||
else()
|
else()
|
||||||
set(OpenCV_ARCH x86)
|
set(OpenCV_ARCH x86)
|
||||||
|
|||||||
@@ -38,10 +38,12 @@ if(PYTHON_EXECUTABLE)
|
|||||||
|
|
||||||
if(NOT ANDROID AND NOT IOS)
|
if(NOT ANDROID AND NOT IOS)
|
||||||
ocv_check_environment_variables(PYTHON_LIBRARY PYTHON_INCLUDE_DIR)
|
ocv_check_environment_variables(PYTHON_LIBRARY PYTHON_INCLUDE_DIR)
|
||||||
if(CMAKE_VERSION VERSION_GREATER 2.8.8 AND PYTHON_VERSION_FULL)
|
if(CMAKE_CROSSCOMPILING)
|
||||||
find_host_package(PythonLibs ${PYTHON_VERSION_FULL} EXACT)
|
find_package(PythonLibs ${PYTHON_VERSION_MAJOR_MINOR})
|
||||||
|
elseif(CMAKE_VERSION VERSION_GREATER 2.8.8 AND PYTHON_VERSION_FULL)
|
||||||
|
find_package(PythonLibs ${PYTHON_VERSION_FULL} EXACT)
|
||||||
else()
|
else()
|
||||||
find_host_package(PythonLibs ${PYTHON_VERSION_FULL})
|
find_package(PythonLibs ${PYTHON_VERSION_FULL})
|
||||||
endif()
|
endif()
|
||||||
# cmake 2.4 (at least on Ubuntu 8.04 (hardy)) don't define PYTHONLIBS_FOUND
|
# cmake 2.4 (at least on Ubuntu 8.04 (hardy)) don't define PYTHONLIBS_FOUND
|
||||||
if(NOT PYTHONLIBS_FOUND AND PYTHON_INCLUDE_PATH)
|
if(NOT PYTHONLIBS_FOUND AND PYTHON_INCLUDE_PATH)
|
||||||
@@ -81,24 +83,39 @@ if(PYTHON_EXECUTABLE)
|
|||||||
SET(PYTHON_PACKAGES_PATH "${_PYTHON_PACKAGES_PATH}" CACHE PATH "Where to install the python packages.")
|
SET(PYTHON_PACKAGES_PATH "${_PYTHON_PACKAGES_PATH}" CACHE PATH "Where to install the python packages.")
|
||||||
|
|
||||||
if(NOT PYTHON_NUMPY_INCLUDE_DIR)
|
if(NOT PYTHON_NUMPY_INCLUDE_DIR)
|
||||||
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
|
if(CMAKE_CROSSCOMPILING)
|
||||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print numpy.distutils.misc_util.get_numpy_include_dirs()[0]"
|
message(STATUS "Cannot probe for Python/Numpy support (because we are cross-compiling OpenCV)")
|
||||||
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
|
message(STATUS "If you want to enable Python/Numpy support, set the following variables:")
|
||||||
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR
|
message(STATUS " PYTHON_INCLUDE_PATH")
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
message(STATUS " PYTHON_LIBRARIES")
|
||||||
|
message(STATUS " PYTHON_NUMPY_INCLUDE_DIR")
|
||||||
|
else()
|
||||||
|
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
|
||||||
|
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print numpy.distutils.misc_util.get_numpy_include_dirs()[0]"
|
||||||
|
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
|
||||||
|
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
if(PYTHON_NUMPY_PROCESS EQUAL 0)
|
if(NOT PYTHON_NUMPY_PROCESS EQUAL 0)
|
||||||
file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIR}" _PYTHON_NUMPY_INCLUDE_DIR)
|
unset(PYTHON_NUMPY_INCLUDE_DIR)
|
||||||
set(PYTHON_NUMPY_INCLUDE_DIR ${_PYTHON_NUMPY_INCLUDE_DIR} CACHE PATH "Path to numpy headers")
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(PYTHON_NUMPY_INCLUDE_DIR)
|
if(PYTHON_NUMPY_INCLUDE_DIR)
|
||||||
|
file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIR}" _PYTHON_NUMPY_INCLUDE_DIR)
|
||||||
|
set(PYTHON_NUMPY_INCLUDE_DIR ${_PYTHON_NUMPY_INCLUDE_DIR} CACHE PATH "Path to numpy headers")
|
||||||
set(PYTHON_USE_NUMPY TRUE)
|
set(PYTHON_USE_NUMPY TRUE)
|
||||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print numpy.version.version"
|
if(CMAKE_CROSSCOMPILING)
|
||||||
|
if(NOT PYTHON_NUMPY_VERSION)
|
||||||
|
set(PYTHON_NUMPY_VERSION "undefined - cannot be probed because of the cross-compilation")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print numpy.version.version"
|
||||||
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
|
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
|
||||||
OUTPUT_VARIABLE PYTHON_NUMPY_VERSION
|
OUTPUT_VARIABLE PYTHON_NUMPY_VERSION
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif(NOT ANDROID AND NOT IOS)
|
endif(NOT ANDROID AND NOT IOS)
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ if(NOT HAVE_TBB)
|
|||||||
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc10")
|
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc10")
|
||||||
elseif(MSVC11)
|
elseif(MSVC11)
|
||||||
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc11")
|
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc11")
|
||||||
|
elseif(MSVC12)
|
||||||
|
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc12")
|
||||||
|
elseif(MSVC14)
|
||||||
|
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc14")
|
||||||
endif()
|
endif()
|
||||||
set(TBB_LIB_DIR "${_TBB_LIB_PATH}" CACHE PATH "Full path of TBB library directory")
|
set(TBB_LIB_DIR "${_TBB_LIB_PATH}" CACHE PATH "Full path of TBB library directory")
|
||||||
link_directories("${TBB_LIB_DIR}")
|
link_directories("${TBB_LIB_DIR}")
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
if(NOT WITH_VTK)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# VTK 6.x components
|
||||||
|
find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
|
||||||
|
IF(VTK_FOUND)
|
||||||
|
IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var.
|
||||||
|
find_package(VTK QUIET COMPONENTS vtkRendering${VTK_RENDERING_BACKEND} vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
|
||||||
|
ELSE(VTK_RENDERING_BACKEND)
|
||||||
|
find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
|
||||||
|
ENDIF(VTK_RENDERING_BACKEND)
|
||||||
|
ENDIF(VTK_FOUND)
|
||||||
|
|
||||||
|
# VTK 5.x components
|
||||||
|
if(NOT VTK_FOUND)
|
||||||
|
find_package(VTK QUIET COMPONENTS vtkCommon NO_MODULE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT VTK_FOUND)
|
||||||
|
set(HAVE_VTK OFF)
|
||||||
|
message(STATUS "VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Don't support ealier VTKs
|
||||||
|
if(${VTK_VERSION} VERSION_LESS "5.8.0")
|
||||||
|
message(STATUS "VTK support is disabled. VTK ver. 5.8.0 is minimum required, but found VTK ver. ${VTK_VERSION}")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Different Qt versions can't be linked together
|
||||||
|
if(HAVE_QT5 AND ${VTK_VERSION} VERSION_LESS "6.0.0")
|
||||||
|
if(VTK_USE_QT)
|
||||||
|
message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.${VTK_VERSION} + Qt4")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Different Qt versions can't be linked together. VTK 6.0.0 doesn't provide a way to get Qt version it was linked with
|
||||||
|
if(HAVE_QT5 AND ${VTK_VERSION} VERSION_EQUAL "6.0.0" AND NOT DEFINED FORCE_VTK)
|
||||||
|
message(STATUS "VTK support is disabled. Possible incompatible combination: OpenCV+Qt5, and VTK ver.${VTK_VERSION} with Qt4")
|
||||||
|
message(STATUS "If it is known that VTK was compiled without Qt4, please define '-DFORCE_VTK=TRUE' flag in CMake")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Different Qt versions can't be linked together
|
||||||
|
if(HAVE_QT AND ${VTK_VERSION} VERSION_GREATER "6.0.0" AND NOT ${VTK_QT_VERSION} STREQUAL "")
|
||||||
|
if(HAVE_QT5 AND ${VTK_QT_VERSION} EQUAL "4")
|
||||||
|
message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.${VTK_VERSION} + Qt4")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT HAVE_QT5 AND ${VTK_QT_VERSION} EQUAL "5")
|
||||||
|
message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt4 and VTK ver.${VTK_VERSION} + Qt5")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(HAVE_VTK ON)
|
||||||
|
message(STATUS "Found VTK ver. ${VTK_VERSION} (usefile: ${VTK_USE_FILE})")
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
CONFIGURE_FILE(
|
CONFIGURE_FILE(
|
||||||
"${OpenCV_SOURCE_DIR}/cmake/templates/cmake_uninstall.cmake.in"
|
"${OpenCV_SOURCE_DIR}/cmake/templates/cmake_uninstall.cmake.in"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||||
IMMEDIATE @ONLY)
|
@ONLY)
|
||||||
|
|
||||||
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||||
if(ENABLE_SOLUTION_FOLDERS)
|
if(ENABLE_SOLUTION_FOLDERS)
|
||||||
|
|||||||
@@ -163,9 +163,16 @@ function(set_ipp_new_libraries _LATEST_VERSION)
|
|||||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPI}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPI}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPS}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPS}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
|
||||||
PARENT_SCOPE)
|
|
||||||
|
|
||||||
|
if (UNIX)
|
||||||
|
set(IPP_LIBRARIES
|
||||||
|
${IPP_LIBRARIES}
|
||||||
|
${IPP_LIB_PREFIX}irc${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||||
|
${IPP_LIB_PREFIX}imf${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||||
|
${IPP_LIB_PREFIX}svml${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||||
|
endif()
|
||||||
|
set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
|
||||||
return()
|
return()
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
@@ -208,19 +215,39 @@ function(set_ipp_variables _LATEST_VERSION)
|
|||||||
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
|
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib PARENT_SCOPE)
|
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib)
|
||||||
elseif (IPP_X64)
|
elseif (IPP_X64)
|
||||||
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/intel64)
|
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/intel64)
|
||||||
message(SEND_ERROR "IPP EM64T libraries not found")
|
message(SEND_ERROR "IPP EM64T libraries not found")
|
||||||
endif()
|
endif()
|
||||||
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/intel64 PARENT_SCOPE)
|
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/intel64)
|
||||||
else()
|
else()
|
||||||
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/ia32)
|
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/ia32)
|
||||||
message(SEND_ERROR "IPP IA32 libraries not found")
|
message(SEND_ERROR "IPP IA32 libraries not found")
|
||||||
endif()
|
endif()
|
||||||
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32 PARENT_SCOPE)
|
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (UNIX)
|
||||||
|
get_filename_component(INTEL_COMPILER_LIBRARY_DIR ${IPP_ROOT_DIR}/../lib REALPATH)
|
||||||
|
if (IPP_X64)
|
||||||
|
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/intel64)
|
||||||
|
message(SEND_ERROR "Intel compiler EM64T libraries not found")
|
||||||
|
endif()
|
||||||
|
set(IPP_LIBRARY_DIRS
|
||||||
|
${IPP_LIBRARY_DIRS}
|
||||||
|
${INTEL_COMPILER_LIBRARY_DIR}/intel64)
|
||||||
|
else()
|
||||||
|
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/ia32)
|
||||||
|
message(SEND_ERROR "Intel compiler IA32 libraries not found")
|
||||||
|
endif()
|
||||||
|
set(IPP_LIBRARY_DIRS
|
||||||
|
${IPP_LIBRARY_DIRS}
|
||||||
|
${INTEL_COMPILER_LIBRARY_DIR}/ia32)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
set(IPP_LIBRARY_DIRS ${IPP_LIBRARY_DIRS} PARENT_SCOPE)
|
||||||
|
|
||||||
# set IPP_LIBRARIES variable (7.x or 8.x lib names)
|
# set IPP_LIBRARIES variable (7.x or 8.x lib names)
|
||||||
set_ipp_new_libraries(${_LATEST_VERSION})
|
set_ipp_new_libraries(${_LATEST_VERSION})
|
||||||
set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
|
set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ if(BUILD_ZLIB)
|
|||||||
else()
|
else()
|
||||||
include(FindZLIB)
|
include(FindZLIB)
|
||||||
if(ZLIB_FOUND AND ANDROID)
|
if(ZLIB_FOUND AND ANDROID)
|
||||||
if(ZLIB_LIBRARY STREQUAL "${ANDROID_SYSROOT}/usr/lib/libz.so")
|
if(ZLIB_LIBRARIES STREQUAL "${ANDROID_SYSROOT}/usr/lib/libz.so" OR
|
||||||
|
ZLIB_LIBRARIES STREQUAL "${ANDROID_SYSROOT}/usr/lib64/libz.so")
|
||||||
set(ZLIB_LIBRARY z)
|
set(ZLIB_LIBRARY z)
|
||||||
set(ZLIB_LIBRARIES z)
|
set(ZLIB_LIBRARIES z)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -46,25 +46,15 @@ else()
|
|||||||
set(HAVE_CSTRIPES 0)
|
set(HAVE_CSTRIPES 0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# --- OpenMP ---
|
|
||||||
if(WITH_OPENMP AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
|
||||||
find_package(OpenMP)
|
|
||||||
if(OPENMP_FOUND)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
|
||||||
endif()
|
|
||||||
set(HAVE_OPENMP "${OPENMP_FOUND}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# --- GCD ---
|
# --- GCD ---
|
||||||
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
|
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||||
set(HAVE_GCD 1)
|
set(HAVE_GCD 1)
|
||||||
else()
|
else()
|
||||||
set(HAVE_GCD 0)
|
set(HAVE_GCD 0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# --- Concurrency ---
|
# --- Concurrency ---
|
||||||
if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
|
if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||||
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/concurrencytest.cpp")
|
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")
|
file(WRITE "${_fname}" "#if _MSC_VER < 1600\n#error\n#endif\nint main() { return 0; }\n")
|
||||||
try_compile(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}" "${_fname}")
|
try_compile(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}" "${_fname}")
|
||||||
@@ -72,3 +62,13 @@ if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
|
|||||||
else()
|
else()
|
||||||
set(HAVE_CONCURRENCY 0)
|
set(HAVE_CONCURRENCY 0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# --- OpenMP ---
|
||||||
|
if(WITH_OPENMP)
|
||||||
|
find_package(OpenMP)
|
||||||
|
if(OPENMP_FOUND)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||||
|
endif()
|
||||||
|
set(HAVE_OPENMP "${OPENMP_FOUND}")
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -12,15 +12,50 @@ endif(WITH_VFW)
|
|||||||
|
|
||||||
# --- GStreamer ---
|
# --- GStreamer ---
|
||||||
ocv_clear_vars(HAVE_GSTREAMER)
|
ocv_clear_vars(HAVE_GSTREAMER)
|
||||||
if(WITH_GSTREAMER)
|
# try to find gstreamer 1.x first if 0.10 was not requested
|
||||||
CHECK_MODULE(gstreamer-base-0.10 HAVE_GSTREAMER)
|
if(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10)
|
||||||
if(HAVE_GSTREAMER)
|
CHECK_MODULE(gstreamer-base-1.0 HAVE_GSTREAMER_BASE)
|
||||||
CHECK_MODULE(gstreamer-app-0.10 HAVE_GSTREAMER)
|
CHECK_MODULE(gstreamer-video-1.0 HAVE_GSTREAMER_VIDEO)
|
||||||
|
CHECK_MODULE(gstreamer-app-1.0 HAVE_GSTREAMER_APP)
|
||||||
|
CHECK_MODULE(gstreamer-riff-1.0 HAVE_GSTREAMER_RIFF)
|
||||||
|
CHECK_MODULE(gstreamer-pbutils-1.0 HAVE_GSTREAMER_PBUTILS)
|
||||||
|
|
||||||
|
if(HAVE_GSTREAMER_BASE AND HAVE_GSTREAMER_VIDEO AND HAVE_GSTREAMER_APP AND HAVE_GSTREAMER_RIFF AND HAVE_GSTREAMER_PBUTILS)
|
||||||
|
set(HAVE_GSTREAMER TRUE)
|
||||||
|
set(GSTREAMER_BASE_VERSION ${ALIASOF_gstreamer-base-1.0_VERSION})
|
||||||
|
set(GSTREAMER_VIDEO_VERSION ${ALIASOF_gstreamer-video-1.0_VERSION})
|
||||||
|
set(GSTREAMER_APP_VERSION ${ALIASOF_gstreamer-app-1.0_VERSION})
|
||||||
|
set(GSTREAMER_RIFF_VERSION ${ALIASOF_gstreamer-riff-1.0_VERSION})
|
||||||
|
set(GSTREAMER_PBUTILS_VERSION ${ALIASOF_gstreamer-pbutils-1.0_VERSION})
|
||||||
endif()
|
endif()
|
||||||
if(HAVE_GSTREAMER)
|
|
||||||
CHECK_MODULE(gstreamer-video-0.10 HAVE_GSTREAMER)
|
endif()
|
||||||
|
|
||||||
|
# gstreamer support was requested but could not find gstreamer 1.x,
|
||||||
|
# so fallback/try to find gstreamer 0.10
|
||||||
|
if(WITH_GSTREAMER AND NOT HAVE_GSTREAMER)
|
||||||
|
set(WITH_GSTREAMER_0_10 ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# if gstreamer 1.x was not found (fallback on gstreamer 0.10), or we specified
|
||||||
|
# we wanted gstreamer 0.10 support,
|
||||||
|
# then try to find it if not gstreamer support has not been found so far.
|
||||||
|
if(WITH_GSTREAMER_0_10 AND NOT HAVE_GSTREAMER)
|
||||||
|
CHECK_MODULE(gstreamer-base-0.10 HAVE_GSTREAMER_BASE)
|
||||||
|
CHECK_MODULE(gstreamer-video-0.10 HAVE_GSTREAMER_VIDEO)
|
||||||
|
CHECK_MODULE(gstreamer-app-0.10 HAVE_GSTREAMER_APP)
|
||||||
|
CHECK_MODULE(gstreamer-riff-0.10 HAVE_GSTREAMER_RIFF)
|
||||||
|
CHECK_MODULE(gstreamer-pbutils-0.10 HAVE_GSTREAMER_PBUTILS)
|
||||||
|
|
||||||
|
if(HAVE_GSTREAMER_BASE AND HAVE_GSTREAMER_VIDEO AND HAVE_GSTREAMER_APP AND HAVE_GSTREAMER_RIFF AND HAVE_GSTREAMER_PBUTILS)
|
||||||
|
set(HAVE_GSTREAMER TRUE)
|
||||||
|
set(GSTREAMER_BASE_VERSION ${ALIASOF_gstreamer-base-0.10_VERSION})
|
||||||
|
set(GSTREAMER_VIDEO_VERSION ${ALIASOF_gstreamer-video-0.10_VERSION})
|
||||||
|
set(GSTREAMER_APP_VERSION ${ALIASOF_gstreamer-app-0.10_VERSION})
|
||||||
|
set(GSTREAMER_RIFF_VERSION ${ALIASOF_gstreamer-riff-0.10_VERSION})
|
||||||
|
set(GSTREAMER_PBUTILS_VERSION ${ALIASOF_gstreamer-pbutils-0.10_VERSION})
|
||||||
endif()
|
endif()
|
||||||
endif(WITH_GSTREAMER)
|
endif(WITH_GSTREAMER_0_10 AND NOT HAVE_GSTREAMER)
|
||||||
|
|
||||||
# --- unicap ---
|
# --- unicap ---
|
||||||
ocv_clear_vars(HAVE_UNICAP)
|
ocv_clear_vars(HAVE_UNICAP)
|
||||||
@@ -126,7 +161,13 @@ endif(WITH_XINE)
|
|||||||
ocv_clear_vars(HAVE_LIBV4L HAVE_CAMV4L HAVE_CAMV4L2 HAVE_VIDEOIO)
|
ocv_clear_vars(HAVE_LIBV4L HAVE_CAMV4L HAVE_CAMV4L2 HAVE_VIDEOIO)
|
||||||
if(WITH_V4L)
|
if(WITH_V4L)
|
||||||
if(WITH_LIBV4L)
|
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()
|
endif()
|
||||||
CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L)
|
CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L)
|
||||||
CHECK_INCLUDE_FILE(linux/videodev2.h HAVE_CAMV4L2)
|
CHECK_INCLUDE_FILE(linux/videodev2.h HAVE_CAMV4L2)
|
||||||
@@ -149,7 +190,7 @@ if(WITH_XIMEA)
|
|||||||
endif(WITH_XIMEA)
|
endif(WITH_XIMEA)
|
||||||
|
|
||||||
# --- FFMPEG ---
|
# --- 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(WITH_FFMPEG)
|
||||||
if(WIN32 AND NOT ARM)
|
if(WIN32 AND NOT ARM)
|
||||||
include("${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/ffmpeg_version.cmake")
|
include("${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/ffmpeg_version.cmake")
|
||||||
@@ -158,6 +199,7 @@ if(WITH_FFMPEG)
|
|||||||
CHECK_MODULE(libavformat HAVE_FFMPEG_FORMAT)
|
CHECK_MODULE(libavformat HAVE_FFMPEG_FORMAT)
|
||||||
CHECK_MODULE(libavutil HAVE_FFMPEG_UTIL)
|
CHECK_MODULE(libavutil HAVE_FFMPEG_UTIL)
|
||||||
CHECK_MODULE(libswscale HAVE_FFMPEG_SWSCALE)
|
CHECK_MODULE(libswscale HAVE_FFMPEG_SWSCALE)
|
||||||
|
CHECK_MODULE(libavresample HAVE_FFMPEG_RESAMPLE)
|
||||||
|
|
||||||
CHECK_INCLUDE_FILE(libavformat/avformat.h HAVE_GENTOO_FFMPEG)
|
CHECK_INCLUDE_FILE(libavformat/avformat.h HAVE_GENTOO_FFMPEG)
|
||||||
CHECK_INCLUDE_FILE(ffmpeg/avformat.h HAVE_FFMPEG_FFMPEG)
|
CHECK_INCLUDE_FILE(ffmpeg/avformat.h HAVE_FFMPEG_FFMPEG)
|
||||||
@@ -177,42 +219,35 @@ if(WITH_FFMPEG)
|
|||||||
# Do an other trial
|
# Do an other trial
|
||||||
FIND_FILE(BZIP2_LIBRARIES NAMES libbz2.so.1 PATHS /lib)
|
FIND_FILE(BZIP2_LIBRARIES NAMES libbz2.so.1 PATHS /lib)
|
||||||
endif()
|
endif()
|
||||||
endif(HAVE_FFMPEG)
|
else()
|
||||||
endif()
|
find_path(FFMPEG_INCLUDE_DIR "libavformat/avformat.h"
|
||||||
|
PATHS /usr/local /usr /opt
|
||||||
if(APPLE)
|
PATH_SUFFIXES include
|
||||||
find_path(FFMPEG_INCLUDE_DIR "libavformat/avformat.h"
|
DOC "The path to FFMPEG headers")
|
||||||
PATHS /usr/local /usr /opt
|
if(FFMPEG_INCLUDE_DIR)
|
||||||
PATH_SUFFIXES include
|
set(HAVE_GENTOO_FFMPEG TRUE)
|
||||||
DOC "The path to FFMPEG headers")
|
set(FFMPEG_LIB_DIR "${FFMPEG_INCLUDE_DIR}/../lib" CACHE PATH "Full path of FFMPEG library directory")
|
||||||
if(FFMPEG_INCLUDE_DIR)
|
find_library(FFMPEG_CODEC_LIB "avcodec" HINTS "${FFMPEG_LIB_DIR}")
|
||||||
set(HAVE_GENTOO_FFMPEG TRUE)
|
find_library(FFMPEG_FORMAT_LIB "avformat" HINTS "${FFMPEG_LIB_DIR}")
|
||||||
set(FFMPEG_LIB_DIR "${FFMPEG_INCLUDE_DIR}/../lib" CACHE PATH "Full path of FFMPEG library directory")
|
find_library(FFMPEG_UTIL_LIB "avutil" HINTS "${FFMPEG_LIB_DIR}")
|
||||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavcodec.a")
|
find_library(FFMPEG_SWSCALE_LIB "swscale" HINTS "${FFMPEG_LIB_DIR}")
|
||||||
set(HAVE_FFMPEG_CODEC 1)
|
if(FFMPEG_CODEC_LIB AND FFMPEG_FORMAT_LIB AND
|
||||||
set(ALIASOF_libavcodec_VERSION "Unknown")
|
FFMPEG_UTIL_LIB AND FFMPEG_SWSCALE_LIB)
|
||||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavformat.a")
|
set(ALIASOF_libavcodec_VERSION "Unknown")
|
||||||
set(HAVE_FFMPEG_FORMAT 1)
|
|
||||||
set(ALIASOF_libavformat_VERSION "Unknown")
|
set(ALIASOF_libavformat_VERSION "Unknown")
|
||||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavutil.a")
|
set(ALIASOF_libavutil_VERSION "Unknown")
|
||||||
set(HAVE_FFMPEG_UTIL 1)
|
set(ALIASOF_libswscale_VERSION "Unknown")
|
||||||
set(ALIASOF_libavutil_VERSION "Unknown")
|
set(HAVE_FFMPEG 1)
|
||||||
if(EXISTS "${FFMPEG_LIB_DIR}/libswscale.a")
|
|
||||||
set(HAVE_FFMPEG_SWSCALE 1)
|
|
||||||
set(ALIASOF_libswscale_VERSION "Unknown")
|
|
||||||
set(HAVE_FFMPEG 1)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif(FFMPEG_INCLUDE_DIR)
|
||||||
endif(FFMPEG_INCLUDE_DIR)
|
if(HAVE_FFMPEG)
|
||||||
if(HAVE_FFMPEG)
|
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES}
|
||||||
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
|
${FFMPEG_CODEC_LIB} ${FFMPEG_FORMAT_LIB}
|
||||||
"${FFMPEG_LIB_DIR}/libavformat.a" "${FFMPEG_LIB_DIR}/libavutil.a"
|
${FFMPEG_UTIL_LIB} ${FFMPEG_SWSCALE_LIB})
|
||||||
"${FFMPEG_LIB_DIR}/libswscale.a")
|
ocv_include_directories(${FFMPEG_INCLUDE_DIR})
|
||||||
ocv_include_directories(${FFMPEG_INCLUDE_DIR})
|
endif(HAVE_FFMPEG)
|
||||||
endif()
|
endif()
|
||||||
endif(APPLE)
|
endif()
|
||||||
endif(WITH_FFMPEG)
|
endif(WITH_FFMPEG)
|
||||||
|
|
||||||
# --- VideoInput/DirectShow ---
|
# --- VideoInput/DirectShow ---
|
||||||
@@ -222,6 +257,7 @@ if(WITH_DSHOW)
|
|||||||
endif(WITH_DSHOW)
|
endif(WITH_DSHOW)
|
||||||
|
|
||||||
# --- VideoInput/Microsoft Media Foundation ---
|
# --- VideoInput/Microsoft Media Foundation ---
|
||||||
|
ocv_clear_vars(HAVE_MSMF)
|
||||||
if(WITH_MSMF)
|
if(WITH_MSMF)
|
||||||
check_include_file(Mfapi.h HAVE_MSMF)
|
check_include_file(Mfapi.h HAVE_MSMF)
|
||||||
endif(WITH_MSMF)
|
endif(WITH_MSMF)
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ if(WIN32)
|
|||||||
else()
|
else()
|
||||||
set(XIMEA_FOUND 0)
|
set(XIMEA_FOUND 0)
|
||||||
endif()
|
endif()
|
||||||
|
elseif(APPLE)
|
||||||
|
if(EXISTS /Library/Frameworks/m3api.framework)
|
||||||
|
set(XIMEA_FOUND 1)
|
||||||
|
else()
|
||||||
|
set(XIMEA_FOUND 0)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
if(EXISTS /opt/XIMEA)
|
if(EXISTS /opt/XIMEA)
|
||||||
set(XIMEA_FOUND 1)
|
set(XIMEA_FOUND 1)
|
||||||
|
|||||||
@@ -19,8 +19,26 @@ if(ANDROID)
|
|||||||
set(OPENCV_STATIC_LIBTYPE_CONFIGMAKE ${OPENCV_LIBTYPE_CONFIGMAKE})
|
set(OPENCV_STATIC_LIBTYPE_CONFIGMAKE ${OPENCV_LIBTYPE_CONFIGMAKE})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT COMMAND ANDROID_GET_ABI_RAWNAME)
|
||||||
|
macro( ANDROID_GET_ABI_RAWNAME TOOLCHAIN_FLAG VAR )
|
||||||
|
if( " ${TOOLCHAIN_FLAG}" STREQUAL " ARMEABI" )
|
||||||
|
set( ${VAR} "armeabi" )
|
||||||
|
elseif( " ${TOOLCHAIN_FLAG}" STREQUAL " ARMEABI_V7A" )
|
||||||
|
set( ${VAR} "armeabi-v7a" )
|
||||||
|
elseif( " ${TOOLCHAIN_FLAG}" STREQUAL " ARM64_V8A" )
|
||||||
|
set( ${VAR} "arm64-v8a" )
|
||||||
|
elseif( " ${TOOLCHAIN_FLAG}" STREQUAL " X86" )
|
||||||
|
set( ${VAR} "x86" )
|
||||||
|
elseif( " ${TOOLCHAIN_FLAG}" STREQUAL " MIPS" )
|
||||||
|
set( ${VAR} "mips" )
|
||||||
|
else()
|
||||||
|
set( ${VAR} "unknown" )
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
endif()
|
||||||
|
|
||||||
# setup lists of camera libs
|
# setup lists of camera libs
|
||||||
foreach(abi ARMEABI ARMEABI_V7A X86 MIPS)
|
foreach(abi ARMEABI ARMEABI_V7A ARM64_V8A X86 MIPS)
|
||||||
ANDROID_GET_ABI_RAWNAME(${abi} ndkabi)
|
ANDROID_GET_ABI_RAWNAME(${abi} ndkabi)
|
||||||
if(BUILD_ANDROID_CAMERA_WRAPPER)
|
if(BUILD_ANDROID_CAMERA_WRAPPER)
|
||||||
if(ndkabi STREQUAL ANDROID_NDK_ABI_NAME)
|
if(ndkabi STREQUAL ANDROID_NDK_ABI_NAME)
|
||||||
@@ -30,6 +48,7 @@ if(ANDROID)
|
|||||||
endif()
|
endif()
|
||||||
elseif(HAVE_opencv_androidcamera)
|
elseif(HAVE_opencv_androidcamera)
|
||||||
set(OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE "")
|
set(OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE "")
|
||||||
|
# TODO: add prebuild camera libs for arm64-v8a
|
||||||
file(GLOB OPENCV_CAMERA_LIBS "${OpenCV_SOURCE_DIR}/3rdparty/lib/${ndkabi}/libnative_camera_r*.so")
|
file(GLOB OPENCV_CAMERA_LIBS "${OpenCV_SOURCE_DIR}/3rdparty/lib/${ndkabi}/libnative_camera_r*.so")
|
||||||
if(OPENCV_CAMERA_LIBS)
|
if(OPENCV_CAMERA_LIBS)
|
||||||
list(SORT OPENCV_CAMERA_LIBS)
|
list(SORT OPENCV_CAMERA_LIBS)
|
||||||
@@ -56,8 +75,29 @@ if(ANDROID)
|
|||||||
|
|
||||||
# remove CUDA runtime and NPP from regular deps
|
# remove CUDA runtime and NPP from regular deps
|
||||||
# it can be added separately if needed.
|
# it can be added separately if needed.
|
||||||
ocv_list_filterout(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "libcu")
|
ocv_list_filterout(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "cusparse")
|
||||||
ocv_list_filterout(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "libnpp")
|
ocv_list_filterout(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "cufft")
|
||||||
|
ocv_list_filterout(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "cublas")
|
||||||
|
ocv_list_filterout(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "npp")
|
||||||
|
ocv_list_filterout(OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "cudart")
|
||||||
|
|
||||||
|
if(HAVE_CUDA)
|
||||||
|
# CUDA runtime libraries and are required always
|
||||||
|
set(culibs ${CUDA_LIBRARIES})
|
||||||
|
|
||||||
|
# right now NPP is requared always too
|
||||||
|
list(INSERT culibs 0 ${CUDA_npp_LIBRARY})
|
||||||
|
|
||||||
|
if(HAVE_CUFFT)
|
||||||
|
list(INSERT culibs 0 ${CUDA_cufft_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(HAVE_CUBLAS)
|
||||||
|
list(INSERT culibs 0 ${CUDA_cublas_LIBRARY})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ocv_convert_to_lib_name(CUDA_RUNTIME_LIBS_CONFIGMAKE ${culibs})
|
||||||
|
|
||||||
# split 3rdparty libs and modules
|
# split 3rdparty libs and modules
|
||||||
foreach(mod ${OPENCV_MODULES_CONFIGMAKE})
|
foreach(mod ${OPENCV_MODULES_CONFIGMAKE})
|
||||||
@@ -69,6 +109,10 @@ if(ANDROID)
|
|||||||
list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE})
|
list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_DYNAMIC_CUDA)
|
||||||
|
set(OPENCV_DYNAMICUDA_MODULE_CONFIGMAKE "dynamicuda")
|
||||||
|
endif()
|
||||||
|
|
||||||
# GPU module enabled separately
|
# GPU module enabled separately
|
||||||
list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE "opencv_gpu")
|
list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE "opencv_gpu")
|
||||||
list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE "opencv_dynamicuda")
|
list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE "opencv_dynamicuda")
|
||||||
@@ -84,6 +128,7 @@ if(ANDROID)
|
|||||||
string(REPLACE ";" " " ${lst} "${${lst}}")
|
string(REPLACE ";" " " ${lst} "${${lst}}")
|
||||||
endforeach()
|
endforeach()
|
||||||
string(REPLACE "opencv_" "" OPENCV_MODULES_CONFIGMAKE "${OPENCV_MODULES_CONFIGMAKE}")
|
string(REPLACE "opencv_" "" OPENCV_MODULES_CONFIGMAKE "${OPENCV_MODULES_CONFIGMAKE}")
|
||||||
|
string(REPLACE ";" " " CUDA_RUNTIME_LIBS_CONFIGMAKE "${CUDA_RUNTIME_LIBS_CONFIGMAKE}")
|
||||||
|
|
||||||
# prepare 3rd-party component list without TBB for armeabi and mips platforms. TBB is useless there.
|
# 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})
|
set(OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE})
|
||||||
@@ -105,7 +150,7 @@ if(ANDROID)
|
|||||||
set(OPENCV_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/lib/\$(OPENCV_TARGET_ARCH_ABI)")
|
set(OPENCV_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/lib/\$(OPENCV_TARGET_ARCH_ABI)")
|
||||||
set(OPENCV_3RDPARTY_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/3rdparty/lib/\$(OPENCV_TARGET_ARCH_ABI)")
|
set(OPENCV_3RDPARTY_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/3rdparty/lib/\$(OPENCV_TARGET_ARCH_ABI)")
|
||||||
|
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCV.mk.in" "${CMAKE_BINARY_DIR}/OpenCV.mk" IMMEDIATE @ONLY)
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCV.mk.in" "${CMAKE_BINARY_DIR}/OpenCV.mk" @ONLY)
|
||||||
|
|
||||||
# -------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------
|
||||||
# Part 2/2: ${BIN_DIR}/unix-install/OpenCV.mk -> For use with "make install"
|
# Part 2/2: ${BIN_DIR}/unix-install/OpenCV.mk -> For use with "make install"
|
||||||
@@ -115,6 +160,6 @@ if(ANDROID)
|
|||||||
set(OPENCV_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/../libs/\$(OPENCV_TARGET_ARCH_ABI)")
|
set(OPENCV_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/../libs/\$(OPENCV_TARGET_ARCH_ABI)")
|
||||||
set(OPENCV_3RDPARTY_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/../3rdparty/libs/\$(OPENCV_TARGET_ARCH_ABI)")
|
set(OPENCV_3RDPARTY_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/../3rdparty/libs/\$(OPENCV_TARGET_ARCH_ABI)")
|
||||||
|
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCV.mk.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk" IMMEDIATE @ONLY)
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCV.mk.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk" @ONLY)
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk DESTINATION ${OPENCV_CONFIG_INSTALL_PATH})
|
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk DESTINATION ${OPENCV_CONFIG_INSTALL_PATH} COMPONENT dev)
|
||||||
endif(ANDROID)
|
endif(ANDROID)
|
||||||
|
|||||||
+19
-19
@@ -83,9 +83,9 @@ endif()
|
|||||||
|
|
||||||
export(TARGETS ${OpenCVModules_TARGETS} FILE "${CMAKE_BINARY_DIR}/OpenCVModules${modules_file_suffix}.cmake")
|
export(TARGETS ${OpenCVModules_TARGETS} FILE "${CMAKE_BINARY_DIR}/OpenCVModules${modules_file_suffix}.cmake")
|
||||||
|
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig.cmake" IMMEDIATE @ONLY)
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig.cmake" @ONLY)
|
||||||
#support for version checking when finding opencv. find_package(OpenCV 2.3.1 EXACT) should now work.
|
#support for version checking when finding opencv. find_package(OpenCV 2.3.1 EXACT) should now work.
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig-version.cmake" IMMEDIATE @ONLY)
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig-version.cmake" @ONLY)
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------------
|
||||||
# Part 2/3: ${BIN_DIR}/unix-install/OpenCVConfig.cmake -> For use *with* "make install"
|
# Part 2/3: ${BIN_DIR}/unix-install/OpenCVConfig.cmake -> For use *with* "make install"
|
||||||
@@ -98,8 +98,8 @@ if(INSTALL_TO_MANGLED_PATHS)
|
|||||||
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE}\"")
|
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE}\"")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
|
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" IMMEDIATE @ONLY)
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY)
|
||||||
|
|
||||||
if(UNIX) # ANDROID configuration is created here also
|
if(UNIX) # ANDROID configuration is created here also
|
||||||
#http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference
|
#http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference
|
||||||
@@ -109,18 +109,18 @@ if(UNIX) # ANDROID configuration is created here also
|
|||||||
# <prefix>/(share|lib)/<name>*/ (U)
|
# <prefix>/(share|lib)/<name>*/ (U)
|
||||||
# <prefix>/(share|lib)/<name>*/(cmake|CMake)/ (U)
|
# <prefix>/(share|lib)/<name>*/(cmake|CMake)/ (U)
|
||||||
if(INSTALL_TO_MANGLED_PATHS)
|
if(INSTALL_TO_MANGLED_PATHS)
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/)
|
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}/)
|
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)
|
install(EXPORT OpenCVModules DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
||||||
else()
|
else()
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/)
|
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}/)
|
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)
|
install(EXPORT OpenCVModules DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
install(FILES "${OpenCV_SOURCE_DIR}/platforms/android/android.toolchain.cmake" DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/)
|
install(FILES "${OpenCV_SOURCE_DIR}/platforms/android/android.toolchain.cmake" DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------------
|
||||||
@@ -131,15 +131,15 @@ if(WIN32)
|
|||||||
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
|
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
|
||||||
|
|
||||||
exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/win-install/\"" OUTPUT_VARIABLE RET_VAL)
|
exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/win-install/\"" OUTPUT_VARIABLE RET_VAL)
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" @ONLY)
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" IMMEDIATE @ONLY)
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" @ONLY)
|
||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib")
|
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" COMPONENT dev)
|
||||||
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" FILE OpenCVModules${modules_file_suffix}.cmake)
|
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
||||||
else()
|
else()
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib")
|
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" COMPONENT dev)
|
||||||
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" FILE OpenCVModules${modules_file_suffix}.cmake)
|
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}")
|
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION "." COMPONENT dev)
|
||||||
install(FILES "${OpenCV_SOURCE_DIR}/cmake/OpenCVConfig.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/")
|
install(FILES "${OpenCV_SOURCE_DIR}/cmake/OpenCVConfig.cmake" DESTINATION "." COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -23,4 +23,4 @@ set(OPENCV_MODULE_DEFINITIONS_CONFIGMAKE "${OPENCV_MODULE_DEFINITIONS_CONFIGMAKE
|
|||||||
#endforeach()
|
#endforeach()
|
||||||
|
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/opencv_modules.hpp.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp")
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/opencv_modules.hpp.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp")
|
||||||
install(FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT main)
|
install(FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT dev)
|
||||||
|
|||||||
@@ -8,10 +8,6 @@
|
|||||||
#
|
#
|
||||||
# ${BIN_DIR}/unix-install/opencv.pc -> For use *with* "make install"
|
# ${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")
|
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||||
set(ocv_optkind OPT)
|
set(ocv_optkind OPT)
|
||||||
@@ -35,42 +31,67 @@ ocv_list_reverse(OpenCV_LIB_COMPONENTS)
|
|||||||
ocv_list_reverse(OpenCV_EXTRA_COMPONENTS)
|
ocv_list_reverse(OpenCV_EXTRA_COMPONENTS)
|
||||||
|
|
||||||
#build the list of components
|
#build the list of components
|
||||||
set(OpenCV_LIB_COMPONENTS_ "")
|
|
||||||
|
# Note:
|
||||||
|
# when linking against static libraries, if libfoo depends on libbar, then
|
||||||
|
# libfoo must come first in the linker flags.
|
||||||
|
|
||||||
|
# world is a special target whose library should come first, especially for
|
||||||
|
# static link.
|
||||||
|
if(OpenCV_LIB_COMPONENTS MATCHES "opencv_world")
|
||||||
|
list(REMOVE_ITEM OpenCV_LIB_COMPONENTS "opencv_world")
|
||||||
|
list(INSERT OpenCV_LIB_COMPONENTS 0 "opencv_world")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(OpenCV_LIB_COMPONENTS_)
|
||||||
foreach(CVLib ${OpenCV_LIB_COMPONENTS})
|
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)
|
get_target_property(libloc ${CVLib} LOCATION_${CMAKE_BUILD_TYPE})
|
||||||
set(libname "${libname}.${OPENCV_VERSION}")
|
if(libloc MATCHES "3rdparty")
|
||||||
endif()
|
set(libpath "\${exec_prefix}/share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}")
|
||||||
|
|
||||||
#need better solution....
|
|
||||||
if(libpath MATCHES "3rdparty")
|
|
||||||
set(installDir "share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}")
|
|
||||||
else()
|
else()
|
||||||
set(installDir "${OPENCV_LIB_INSTALL_PATH}")
|
set(libpath "\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}")
|
||||||
endif()
|
endif()
|
||||||
|
list(APPEND OpenCV_LIB_COMPONENTS_ "-L${libpath}")
|
||||||
|
|
||||||
|
get_filename_component(libname ${CVLib} NAME_WE)
|
||||||
|
string(REGEX REPLACE "^lib" "" libname "${libname}")
|
||||||
|
list(APPEND OpenCV_LIB_COMPONENTS_ "-l${libname}")
|
||||||
|
|
||||||
set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} \${exec_prefix}/${installDir}/${libname}")
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# add extra dependencies required for OpenCV
|
# add extra dependencies required for OpenCV
|
||||||
set(OpenCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS_})
|
|
||||||
if(OpenCV_EXTRA_COMPONENTS)
|
if(OpenCV_EXTRA_COMPONENTS)
|
||||||
foreach(extra_component ${OpenCV_EXTRA_COMPONENTS})
|
foreach(extra_component ${OpenCV_EXTRA_COMPONENTS})
|
||||||
|
if(TARGET "${extra_component}")
|
||||||
if(extra_component MATCHES "^-[lL]" OR extra_component MATCHES "[\\/]")
|
get_target_property(extra_component_is_imported "${extra_component}" IMPORTED)
|
||||||
set(maybe_l_prefix "")
|
if(extra_component_is_imported)
|
||||||
else()
|
get_target_property(extra_component "${extra_component}" LOCATION)
|
||||||
set(maybe_l_prefix "-l")
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${maybe_l_prefix}${extra_component}")
|
if(extra_component MATCHES "^-l")
|
||||||
|
list(APPEND OpenCV_LIB_COMPONENTS_ "${extra_component}")
|
||||||
|
elseif(extra_component MATCHES "[\\/]")
|
||||||
|
get_filename_component(libdir "${extra_component}" PATH)
|
||||||
|
get_filename_component(libname "${extra_component}" NAME_WE)
|
||||||
|
string(REGEX REPLACE "^lib" "" libname "${libname}")
|
||||||
|
list(APPEND OpenCV_LIB_COMPONENTS_ "-L${libdir}" "-l${libname}")
|
||||||
|
else()
|
||||||
|
list(APPEND OpenCV_LIB_COMPONENTS_ "-l${extra_component}")
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
list(REMOVE_DUPLICATES OpenCV_LIB_COMPONENTS_)
|
||||||
|
string(REPLACE ";" " " OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS_}")
|
||||||
|
|
||||||
#generate the .pc file
|
#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)
|
if(INSTALL_TO_MANGLED_PATHS)
|
||||||
set(OPENCV_PC_FILE_NAME "opencv-${OPENCV_VERSION}.pc")
|
set(OPENCV_PC_FILE_NAME "opencv-${OPENCV_VERSION}.pc")
|
||||||
else()
|
else()
|
||||||
@@ -78,8 +99,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/opencv-XXX.pc.in"
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/opencv-XXX.pc.in"
|
||||||
"${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME}"
|
"${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME}"
|
||||||
@ONLY IMMEDIATE)
|
@ONLY)
|
||||||
|
|
||||||
if(UNIX AND NOT ANDROID)
|
if(UNIX AND NOT ANDROID)
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME} DESTINATION ${OPENCV_LIB_INSTALL_PATH}/pkgconfig)
|
install(FILES ${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME} DESTINATION ${OPENCV_LIB_INSTALL_PATH}/pkgconfig COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
+143
-48
@@ -27,7 +27,8 @@
|
|||||||
# The verbose template for OpenCV module:
|
# The verbose template for OpenCV module:
|
||||||
#
|
#
|
||||||
# ocv_add_module(modname <dependencies>)
|
# ocv_add_module(modname <dependencies>)
|
||||||
# ocv_glob_module_sources() or glob them manually and ocv_set_module_sources(...)
|
# ocv_glob_module_sources(([EXCLUDE_CUDA] <extra sources&headers>)
|
||||||
|
# or glob them manually and ocv_set_module_sources(...)
|
||||||
# ocv_module_include_directories(<extra include directories>)
|
# ocv_module_include_directories(<extra include directories>)
|
||||||
# ocv_create_module()
|
# ocv_create_module()
|
||||||
# <add extra link dependencies, compiler options, etc>
|
# <add extra link dependencies, compiler options, etc>
|
||||||
@@ -48,6 +49,8 @@ foreach(mod ${OPENCV_MODULES_BUILD} ${OPENCV_MODULES_DISABLED_USER} ${OPENCV_MOD
|
|||||||
if(HAVE_${mod})
|
if(HAVE_${mod})
|
||||||
unset(HAVE_${mod} CACHE)
|
unset(HAVE_${mod} CACHE)
|
||||||
endif()
|
endif()
|
||||||
|
unset(OPENCV_MODULE_${mod}_DEPS CACHE)
|
||||||
|
unset(OPENCV_MODULE_${mod}_DEPS_EXT CACHE)
|
||||||
unset(OPENCV_MODULE_${mod}_REQ_DEPS CACHE)
|
unset(OPENCV_MODULE_${mod}_REQ_DEPS CACHE)
|
||||||
unset(OPENCV_MODULE_${mod}_OPT_DEPS CACHE)
|
unset(OPENCV_MODULE_${mod}_OPT_DEPS CACHE)
|
||||||
unset(OPENCV_MODULE_${mod}_PRIVATE_REQ_DEPS CACHE)
|
unset(OPENCV_MODULE_${mod}_PRIVATE_REQ_DEPS CACHE)
|
||||||
@@ -105,7 +108,6 @@ endmacro()
|
|||||||
# ocv_add_module(yaom INTERNAL opencv_core opencv_highgui opencv_flann OPTIONAL opencv_gpu)
|
# ocv_add_module(yaom INTERNAL opencv_core opencv_highgui opencv_flann OPTIONAL opencv_gpu)
|
||||||
macro(ocv_add_module _name)
|
macro(ocv_add_module _name)
|
||||||
string(TOLOWER "${_name}" name)
|
string(TOLOWER "${_name}" name)
|
||||||
string(REGEX REPLACE "^opencv_" "" ${name} "${name}")
|
|
||||||
set(the_module opencv_${name})
|
set(the_module opencv_${name})
|
||||||
|
|
||||||
# the first pass - collect modules info, the second pass - create targets
|
# the first pass - collect modules info, the second pass - create targets
|
||||||
@@ -135,13 +137,13 @@ macro(ocv_add_module _name)
|
|||||||
|
|
||||||
# parse list of dependencies
|
# parse list of dependencies
|
||||||
if("${ARGV1}" STREQUAL "INTERNAL" OR "${ARGV1}" STREQUAL "BINDINGS")
|
if("${ARGV1}" STREQUAL "INTERNAL" OR "${ARGV1}" STREQUAL "BINDINGS")
|
||||||
set(OPENCV_MODULE_${the_module}_CLASS "${ARGV1}" CACHE INTERNAL "The cathegory of the module")
|
set(OPENCV_MODULE_${the_module}_CLASS "${ARGV1}" CACHE INTERNAL "The category of the module")
|
||||||
set(__ocv_argn__ ${ARGN})
|
set(__ocv_argn__ ${ARGN})
|
||||||
list(REMOVE_AT __ocv_argn__ 0)
|
list(REMOVE_AT __ocv_argn__ 0)
|
||||||
ocv_add_dependencies(${the_module} ${__ocv_argn__})
|
ocv_add_dependencies(${the_module} ${__ocv_argn__})
|
||||||
unset(__ocv_argn__)
|
unset(__ocv_argn__)
|
||||||
else()
|
else()
|
||||||
set(OPENCV_MODULE_${the_module}_CLASS "PUBLIC" CACHE INTERNAL "The cathegory of the module")
|
set(OPENCV_MODULE_${the_module}_CLASS "PUBLIC" CACHE INTERNAL "The category of the module")
|
||||||
ocv_add_dependencies(${the_module} ${ARGN})
|
ocv_add_dependencies(${the_module} ${ARGN})
|
||||||
if(BUILD_${the_module})
|
if(BUILD_${the_module})
|
||||||
set(OPENCV_MODULES_PUBLIC ${OPENCV_MODULES_PUBLIC} "${the_module}" CACHE INTERNAL "List of OpenCV modules marked for export")
|
set(OPENCV_MODULES_PUBLIC ${OPENCV_MODULES_PUBLIC} "${the_module}" CACHE INTERNAL "List of OpenCV modules marked for export")
|
||||||
@@ -478,22 +480,38 @@ endmacro()
|
|||||||
|
|
||||||
# finds and sets headers and sources for the standard OpenCV module
|
# finds and sets headers and sources for the standard OpenCV module
|
||||||
# Usage:
|
# Usage:
|
||||||
# ocv_glob_module_sources(<extra sources&headers in the same format as used in ocv_set_module_sources>)
|
# ocv_glob_module_sources([EXCLUDE_CUDA] <extra sources&headers in the same format as used in ocv_set_module_sources>)
|
||||||
macro(ocv_glob_module_sources)
|
macro(ocv_glob_module_sources)
|
||||||
|
set(_argn ${ARGN})
|
||||||
|
list(FIND _argn "EXCLUDE_CUDA" exclude_cuda)
|
||||||
|
if(NOT exclude_cuda EQUAL -1)
|
||||||
|
list(REMOVE_AT _argn ${exclude_cuda})
|
||||||
|
endif()
|
||||||
|
|
||||||
file(GLOB_RECURSE lib_srcs "src/*.cpp")
|
file(GLOB_RECURSE lib_srcs "src/*.cpp")
|
||||||
file(GLOB_RECURSE lib_int_hdrs "src/*.hpp" "src/*.h")
|
file(GLOB_RECURSE lib_int_hdrs "src/*.hpp" "src/*.h")
|
||||||
file(GLOB lib_hdrs "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h")
|
file(GLOB lib_hdrs "include/opencv2/*.hpp" "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h")
|
||||||
file(GLOB lib_hdrs_detail "include/opencv2/${name}/detail/*.hpp" "include/opencv2/${name}/detail/*.h")
|
file(GLOB lib_hdrs_detail "include/opencv2/${name}/detail/*.hpp" "include/opencv2/${name}/detail/*.h")
|
||||||
|
file(GLOB_RECURSE lib_srcs_apple "src/*.mm")
|
||||||
|
if (APPLE)
|
||||||
|
list(APPEND lib_srcs ${lib_srcs_apple})
|
||||||
|
endif()
|
||||||
|
|
||||||
file(GLOB lib_cuda_srcs "src/cuda/*.cu")
|
if (exclude_cuda EQUAL -1)
|
||||||
set(cuda_objs "")
|
file(GLOB lib_cuda_srcs "src/cuda/*.cu")
|
||||||
set(lib_cuda_hdrs "")
|
set(cuda_objs "")
|
||||||
if(HAVE_CUDA)
|
set(lib_cuda_hdrs "")
|
||||||
ocv_include_directories(${CUDA_INCLUDE_DIRS})
|
if(HAVE_CUDA)
|
||||||
file(GLOB lib_cuda_hdrs "src/cuda/*.hpp")
|
ocv_include_directories(${CUDA_INCLUDE_DIRS})
|
||||||
|
file(GLOB lib_cuda_hdrs "src/cuda/*.hpp")
|
||||||
|
|
||||||
ocv_cuda_compile(cuda_objs ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
ocv_cuda_compile(cuda_objs ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
||||||
source_group("Src\\Cuda" FILES ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
source_group("Src\\Cuda" FILES ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(cuda_objs "")
|
||||||
|
set(lib_cuda_srcs "")
|
||||||
|
set(lib_cuda_hdrs "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
source_group("Src" FILES ${lib_srcs} ${lib_int_hdrs})
|
source_group("Src" FILES ${lib_srcs} ${lib_int_hdrs})
|
||||||
@@ -509,11 +527,33 @@ macro(ocv_glob_module_sources)
|
|||||||
list(APPEND lib_srcs ${cl_kernels} "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp")
|
list(APPEND lib_srcs ${cl_kernels} "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_AVX)
|
||||||
|
file(GLOB avx_srcs "src/avx/*.cpp")
|
||||||
|
foreach(src ${avx_srcs})
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS -mavx)
|
||||||
|
elseif(MSVC AND NOT MSVC_VERSION LESS 1600)
|
||||||
|
set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS /arch:AVX)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_AVX2)
|
||||||
|
file(GLOB avx2_srcs "src/avx2/*.cpp")
|
||||||
|
foreach(src ${avx2_srcs})
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS -mavx2)
|
||||||
|
elseif(MSVC AND NOT MSVC_VERSION LESS 1800)
|
||||||
|
set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS /arch:AVX2)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
source_group("Include" FILES ${lib_hdrs})
|
source_group("Include" FILES ${lib_hdrs})
|
||||||
source_group("Include\\detail" FILES ${lib_hdrs_detail})
|
source_group("Include\\detail" FILES ${lib_hdrs_detail})
|
||||||
|
|
||||||
ocv_set_module_sources(${ARGN} HEADERS ${lib_hdrs} ${lib_hdrs_detail}
|
ocv_set_module_sources(${_argn} HEADERS ${lib_hdrs} ${lib_hdrs_detail}
|
||||||
SOURCES ${lib_srcs} ${lib_int_hdrs} ${cuda_objs} ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
SOURCES ${lib_srcs} ${lib_int_hdrs} ${cuda_objs} ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# creates OpenCV module in current folder
|
# creates OpenCV module in current folder
|
||||||
@@ -536,7 +576,10 @@ macro(ocv_create_module)
|
|||||||
if(NOT "${ARGN}" STREQUAL "SKIP_LINK")
|
if(NOT "${ARGN}" STREQUAL "SKIP_LINK")
|
||||||
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS})
|
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS})
|
||||||
target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${OPENCV_MODULE_${the_module}_DEPS})
|
target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${OPENCV_MODULE_${the_module}_DEPS})
|
||||||
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
|
set(extra_deps ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
|
||||||
|
ocv_extract_simple_libs(extra_deps _simple_deps _other_deps)
|
||||||
|
target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${_simple_deps}) # this list goes to "export"
|
||||||
|
target_link_libraries(${the_module} ${extra_deps})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_dependencies(opencv_modules ${the_module})
|
add_dependencies(opencv_modules ${the_module})
|
||||||
@@ -551,7 +594,6 @@ macro(ocv_create_module)
|
|||||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
||||||
LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
||||||
INSTALL_NAME_DIR lib
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# For dynamic link numbering convenions
|
# For dynamic link numbering convenions
|
||||||
@@ -577,17 +619,22 @@ macro(ocv_create_module)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
ocv_install_target(${the_module} EXPORT OpenCVModules
|
ocv_install_target(${the_module} EXPORT OpenCVModules
|
||||||
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main
|
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs
|
||||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main
|
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs NAMELINK_SKIP
|
||||||
ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main
|
ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT dev
|
||||||
)
|
)
|
||||||
|
get_target_property(_target_type ${the_module} TYPE)
|
||||||
|
if("${_target_type}" STREQUAL "SHARED_LIBRARY")
|
||||||
|
install(TARGETS ${the_module}
|
||||||
|
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT dev NAMELINK_ONLY)
|
||||||
|
endif()
|
||||||
|
|
||||||
# only "public" headers need to be installed
|
# only "public" headers need to be installed
|
||||||
if(OPENCV_MODULE_${the_module}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${the_module};")
|
if(OPENCV_MODULE_${the_module}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${the_module};")
|
||||||
foreach(hdr ${OPENCV_MODULE_${the_module}_HEADERS})
|
foreach(hdr ${OPENCV_MODULE_${the_module}_HEADERS})
|
||||||
string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}")
|
string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}")
|
||||||
if(hdr2 MATCHES "^(opencv2/.*)/[^/]+.h(..)?$")
|
if(hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$")
|
||||||
install(FILES ${hdr} DESTINATION "${OPENCV_INCLUDE_INSTALL_PATH}/${CMAKE_MATCH_1}" COMPONENT main)
|
install(FILES ${hdr} DESTINATION "${OPENCV_INCLUDE_INSTALL_PATH}/${CMAKE_MATCH_1}" COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
@@ -612,11 +659,20 @@ endmacro()
|
|||||||
# short command for adding simple OpenCV module
|
# short command for adding simple OpenCV module
|
||||||
# see ocv_add_module for argument details
|
# see ocv_add_module for argument details
|
||||||
# Usage:
|
# Usage:
|
||||||
# ocv_define_module(module_name [INTERNAL] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
|
# ocv_define_module(module_name [INTERNAL] [EXCLUDE_CUDA] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
|
||||||
macro(ocv_define_module module_name)
|
macro(ocv_define_module module_name)
|
||||||
ocv_add_module(${module_name} ${ARGN})
|
set(_argn ${ARGN})
|
||||||
|
set(exclude_cuda "")
|
||||||
|
foreach(arg ${_argn})
|
||||||
|
if("${arg}" STREQUAL "EXCLUDE_CUDA")
|
||||||
|
set(exclude_cuda "${arg}")
|
||||||
|
list(REMOVE_ITEM _argn ${arg})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
ocv_add_module(${module_name} ${_argn})
|
||||||
ocv_module_include_directories()
|
ocv_module_include_directories()
|
||||||
ocv_glob_module_sources()
|
ocv_glob_module_sources(${exclude_cuda})
|
||||||
ocv_create_module()
|
ocv_create_module()
|
||||||
ocv_add_precompiled_headers(${the_module})
|
ocv_add_precompiled_headers(${the_module})
|
||||||
|
|
||||||
@@ -654,7 +710,7 @@ macro(__ocv_parse_test_sources tests_type)
|
|||||||
set(__file_group_sources "")
|
set(__file_group_sources "")
|
||||||
elseif(arg STREQUAL "DEPENDS_ON")
|
elseif(arg STREQUAL "DEPENDS_ON")
|
||||||
set(__currentvar "OPENCV_TEST_${the_module}_DEPS")
|
set(__currentvar "OPENCV_TEST_${the_module}_DEPS")
|
||||||
elseif("${__currentvar}" STREQUAL "__file_group_sources" AND NOT __file_group_name)
|
elseif(" ${__currentvar}" STREQUAL " __file_group_sources" AND NOT __file_group_name) # spaces to avoid CMP0054
|
||||||
set(__file_group_name "${arg}")
|
set(__file_group_name "${arg}")
|
||||||
else()
|
else()
|
||||||
list(APPEND ${__currentvar} "${arg}")
|
list(APPEND ${__currentvar} "${arg}")
|
||||||
@@ -708,9 +764,28 @@ function(ocv_add_perf_tests)
|
|||||||
|
|
||||||
ocv_add_precompiled_headers(${the_target})
|
ocv_add_precompiled_headers(${the_target})
|
||||||
|
|
||||||
|
if(CMAKE_VERSION VERSION_GREATER "2.8" AND OPENCV_TEST_DATA_PATH)
|
||||||
|
add_test(NAME ${the_target} COMMAND ${the_target} --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity)
|
||||||
|
|
||||||
|
get_filename_component(cur_modules_loc "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
|
||||||
|
get_filename_component(default_modules_loc "${CMAKE_SOURCE_DIR}/modules" ABSOLUTE)
|
||||||
|
if("${cur_modules_loc}" STREQUAL "${default_modules_loc}")
|
||||||
|
set(test_category "Public")
|
||||||
|
else()
|
||||||
|
set(test_category "Extra")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_tests_properties(${the_target} PROPERTIES
|
||||||
|
LABELS "${test_category};Sanity"
|
||||||
|
ENVIRONMENT "OPENCV_TEST_DATA_PATH=${OPENCV_TEST_DATA_PATH}")
|
||||||
|
endif()
|
||||||
|
|
||||||
else(OCV_DEPENDENCIES_FOUND)
|
else(OCV_DEPENDENCIES_FOUND)
|
||||||
# TODO: warn about unsatisfied dependencies
|
# TODO: warn about unsatisfied dependencies
|
||||||
endif(OCV_DEPENDENCIES_FOUND)
|
endif(OCV_DEPENDENCIES_FOUND)
|
||||||
|
if(INSTALL_TESTS)
|
||||||
|
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
@@ -741,8 +816,8 @@ function(ocv_add_accuracy_tests)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
get_native_precompiled_header(${the_target} test_precomp.hpp)
|
get_native_precompiled_header(${the_target} test_precomp.hpp)
|
||||||
|
|
||||||
add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch})
|
add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch})
|
||||||
|
|
||||||
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
|
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
|
||||||
add_dependencies(opencv_tests ${the_target})
|
add_dependencies(opencv_tests ${the_target})
|
||||||
|
|
||||||
@@ -756,14 +831,31 @@ function(ocv_add_accuracy_tests)
|
|||||||
set_target_properties(${the_target} PROPERTIES FOLDER "tests accuracy")
|
set_target_properties(${the_target} PROPERTIES FOLDER "tests accuracy")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
enable_testing()
|
|
||||||
get_target_property(LOC ${the_target} LOCATION)
|
|
||||||
add_test(${the_target} "${LOC}")
|
|
||||||
|
|
||||||
ocv_add_precompiled_headers(${the_target})
|
ocv_add_precompiled_headers(${the_target})
|
||||||
|
|
||||||
|
if(CMAKE_VERSION VERSION_GREATER "2.8" AND OPENCV_TEST_DATA_PATH AND NOT "${the_target}" MATCHES "opencv_test_viz")
|
||||||
|
add_test(NAME ${the_target} COMMAND ${the_target})
|
||||||
|
|
||||||
|
get_filename_component(cur_modules_loc "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
|
||||||
|
get_filename_component(default_modules_loc "${CMAKE_SOURCE_DIR}/modules" ABSOLUTE)
|
||||||
|
if("${cur_modules_loc}" STREQUAL "${default_modules_loc}")
|
||||||
|
set(test_category "Public")
|
||||||
|
else()
|
||||||
|
set(test_category "Extra")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_tests_properties(${the_target} PROPERTIES
|
||||||
|
LABELS "${test_category};Accuracy"
|
||||||
|
ENVIRONMENT "OPENCV_TEST_DATA_PATH=${OPENCV_TEST_DATA_PATH}")
|
||||||
|
endif()
|
||||||
|
|
||||||
else(OCV_DEPENDENCIES_FOUND)
|
else(OCV_DEPENDENCIES_FOUND)
|
||||||
# TODO: warn about unsatisfied dependencies
|
# TODO: warn about unsatisfied dependencies
|
||||||
endif(OCV_DEPENDENCIES_FOUND)
|
endif(OCV_DEPENDENCIES_FOUND)
|
||||||
|
|
||||||
|
if(INSTALL_TESTS)
|
||||||
|
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
@@ -795,7 +887,7 @@ function(ocv_add_samples)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
install(TARGETS ${the_target} RUNTIME DESTINATION "samples/${module_id}" COMPONENT main)
|
install(TARGETS ${the_target} RUNTIME DESTINATION "samples/${module_id}" COMPONENT samples)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
@@ -804,8 +896,8 @@ function(ocv_add_samples)
|
|||||||
if(INSTALL_C_EXAMPLES AND NOT WIN32 AND EXISTS "${samples_path}")
|
if(INSTALL_C_EXAMPLES AND NOT WIN32 AND EXISTS "${samples_path}")
|
||||||
file(GLOB sample_files "${samples_path}/*")
|
file(GLOB sample_files "${samples_path}/*")
|
||||||
install(FILES ${sample_files}
|
install(FILES ${sample_files}
|
||||||
DESTINATION share/OpenCV/samples/${module_id}
|
DESTINATION ${OPENCV_SAMPLES_SRC_INSTALL_PATH}/${module_id}
|
||||||
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
|
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
@@ -831,25 +923,28 @@ macro(__ocv_track_module_link_dependencies the_module optkind)
|
|||||||
list(REMOVE_AT __mod_depends 0)
|
list(REMOVE_AT __mod_depends 0)
|
||||||
if(__dep STREQUAL the_module)
|
if(__dep STREQUAL the_module)
|
||||||
set(__has_cycle TRUE)
|
set(__has_cycle TRUE)
|
||||||
else()#if("${OPENCV_MODULES_BUILD}" MATCHES "(^|;)${__dep}(;|$)")
|
else()
|
||||||
ocv_regex_escape(__rdep "${__dep}")
|
ocv_regex_escape(__rdep "${__dep}")
|
||||||
if(__resolved_deps MATCHES "(^|;)${__rdep}(;|$)")
|
if(__resolved_deps MATCHES "(^|;)${__rdep}(;|$)")
|
||||||
#all dependencies of this module are already resolved
|
#all dependencies of this module are already resolved
|
||||||
list(APPEND ${the_module}_MODULE_DEPS_${optkind} "${__dep}")
|
list(APPEND ${the_module}_MODULE_DEPS_${optkind} "${__dep}")
|
||||||
else()
|
elseif(TARGET ${__dep})
|
||||||
get_target_property(__module_type ${__dep} TYPE)
|
get_target_property(__dep_imported ${__dep} IMPORTED)
|
||||||
if(__module_type STREQUAL "STATIC_LIBRARY")
|
if(__dep_imported)
|
||||||
if(NOT DEFINED ${__dep}_LIB_DEPENDS_${optkind})
|
list(APPEND ${the_module}_EXTRA_DEPS_${optkind} "${__dep}")
|
||||||
ocv_split_libs_list(${__dep}_LIB_DEPENDS ${__dep}_LIB_DEPENDS_DBG ${__dep}_LIB_DEPENDS_OPT)
|
else()
|
||||||
|
get_target_property(__module_type ${__dep} TYPE)
|
||||||
|
if(__module_type STREQUAL "STATIC_LIBRARY")
|
||||||
|
if(NOT DEFINED ${__dep}_LIB_DEPENDS_${optkind})
|
||||||
|
ocv_split_libs_list(${__dep}_LIB_DEPENDS ${__dep}_LIB_DEPENDS_DBG ${__dep}_LIB_DEPENDS_OPT)
|
||||||
|
endif()
|
||||||
|
list(INSERT __mod_depends 0 ${${__dep}_LIB_DEPENDS_${optkind}} ${__dep})
|
||||||
|
list(APPEND __resolved_deps "${__dep}")
|
||||||
endif()
|
endif()
|
||||||
list(INSERT __mod_depends 0 ${${__dep}_LIB_DEPENDS_${optkind}} ${__dep})
|
|
||||||
list(APPEND __resolved_deps "${__dep}")
|
|
||||||
elseif(NOT __module_type)
|
|
||||||
list(APPEND ${the_module}_EXTRA_DEPS_${optkind} "${__dep}")
|
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
list(APPEND ${the_module}_EXTRA_DEPS_${optkind} "${__dep}")
|
||||||
endif()
|
endif()
|
||||||
#else()
|
|
||||||
# get_target_property(__dep_location "${__dep}" LOCATION)
|
|
||||||
endif()
|
endif()
|
||||||
endwhile()
|
endwhile()
|
||||||
|
|
||||||
@@ -863,7 +958,7 @@ macro(__ocv_track_module_link_dependencies the_module optkind)
|
|||||||
list(APPEND ${the_module}_MODULE_DEPS_${optkind} "${the_module}")
|
list(APPEND ${the_module}_MODULE_DEPS_${optkind} "${the_module}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
unset(__dep_location)
|
unset(__dep_imported)
|
||||||
unset(__mod_depends)
|
unset(__mod_depends)
|
||||||
unset(__resolved_deps)
|
unset(__resolved_deps)
|
||||||
unset(__has_cycle)
|
unset(__has_cycle)
|
||||||
|
|||||||
@@ -41,12 +41,30 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
|
|||||||
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
|
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
|
||||||
SET(${_out_compile_flags} ${${_flags_var_name}} )
|
SET(${_out_compile_flags} ${${_flags_var_name}} )
|
||||||
|
|
||||||
|
GET_TARGET_PROPERTY(_targetPIC ${_PCH_current_target} POSITION_INDEPENDENT_CODE)
|
||||||
|
if (_targetPIC AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
|
||||||
|
LIST(APPEND ${_out_compile_flags} "${CMAKE_CXX_COMPILE_OPTIONS_PIC}")
|
||||||
|
elseif(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
|
||||||
|
IF(${_targetType} STREQUAL SHARED_LIBRARY AND NOT WIN32)
|
||||||
|
LIST(APPEND ${_out_compile_flags} "-fPIC")
|
||||||
|
ENDIF()
|
||||||
|
endif()
|
||||||
|
|
||||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
|
GET_PROPERTY(_definitions DIRECTORY PROPERTY COMPILE_DEFINITIONS)
|
||||||
IF(${_targetType} STREQUAL SHARED_LIBRARY AND NOT WIN32)
|
if(_definitions)
|
||||||
LIST(APPEND ${_out_compile_flags} "-fPIC")
|
foreach(_def ${_definitions})
|
||||||
ENDIF()
|
LIST(APPEND ${_out_compile_flags} "\"-D${_def}\"")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
GET_TARGET_PROPERTY(_target_definitions ${_PCH_current_target} COMPILE_DEFINITIONS)
|
||||||
|
if(_target_definitions)
|
||||||
|
foreach(_def ${_target_definitions})
|
||||||
|
LIST(APPEND ${_out_compile_flags} "\"-D${_def}\"")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
ELSE()
|
ELSE()
|
||||||
## TODO ... ? or does it work out of the box
|
## TODO ... ? or does it work out of the box
|
||||||
@@ -61,11 +79,15 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
|
|||||||
endif()
|
endif()
|
||||||
ENDFOREACH(item)
|
ENDFOREACH(item)
|
||||||
|
|
||||||
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
|
get_target_property(DIRINC ${_PCH_current_target} INCLUDE_DIRECTORIES )
|
||||||
GET_DIRECTORY_PROPERTY(_global_definitions DIRECTORY ${OpenCV_SOURCE_DIR} DEFINITIONS)
|
FOREACH(item ${DIRINC})
|
||||||
#MESSAGE("_directory_flags ${_directory_flags} ${_global_definitions}" )
|
if(item MATCHES "^${OpenCV_SOURCE_DIR}/modules/")
|
||||||
LIST(APPEND ${_out_compile_flags} ${_directory_flags})
|
LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}\"${item}\"")
|
||||||
LIST(APPEND ${_out_compile_flags} ${_global_definitions})
|
else()
|
||||||
|
LIST(APPEND ${_out_compile_flags} "${_PCH_isystem_prefix}\"${item}\"")
|
||||||
|
endif()
|
||||||
|
ENDFOREACH(item)
|
||||||
|
|
||||||
LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS})
|
LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS})
|
||||||
|
|
||||||
SEPARATE_ARGUMENTS(${_out_compile_flags})
|
SEPARATE_ARGUMENTS(${_out_compile_flags})
|
||||||
@@ -147,9 +169,9 @@ MACRO(_PCH_GET_TARGET_COMPILE_FLAGS _cflags _header_name _pch_path _dowarn )
|
|||||||
# if you have different versions of the headers for different build types
|
# if you have different versions of the headers for different build types
|
||||||
# you may set _pch_dowarn
|
# you may set _pch_dowarn
|
||||||
IF (_dowarn)
|
IF (_dowarn)
|
||||||
SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include \"${CMAKE_CURRENT_BINARY_DIR}/${_header_name}\" -Winvalid-pch " )
|
SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -Winvalid-pch " )
|
||||||
ELSE (_dowarn)
|
ELSE (_dowarn)
|
||||||
SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include \"${CMAKE_CURRENT_BINARY_DIR}/${_header_name}\" " )
|
SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} " )
|
||||||
ENDIF (_dowarn)
|
ENDIF (_dowarn)
|
||||||
|
|
||||||
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
@@ -247,12 +269,15 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
get_target_property(DIRINC ${_targetName} INCLUDE_DIRECTORIES)
|
||||||
|
set_target_properties(${_targetName}_pch_dephelp PROPERTIES INCLUDE_DIRECTORIES "${DIRINC}")
|
||||||
|
|
||||||
#MESSAGE("_compile_FLAGS: ${_compile_FLAGS}")
|
#MESSAGE("_compile_FLAGS: ${_compile_FLAGS}")
|
||||||
#message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}")
|
#message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}")
|
||||||
|
|
||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_name}"
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_name}"
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy "${_input}" "${CMAKE_CURRENT_BINARY_DIR}/${_name}" # ensure same directory! Required by gcc
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_input}" "${CMAKE_CURRENT_BINARY_DIR}/${_name}" # ensure same directory! Required by gcc
|
||||||
DEPENDS "${_input}"
|
DEPENDS "${_input}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,354 @@
|
|||||||
|
# Use patched version of CPACK to build accurate set of Debian packages
|
||||||
|
# https://github.com/asmorkalov/CMake/tree/deb_generator_improvement
|
||||||
|
|
||||||
|
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||||
|
set(CPACK_set_DESTDIR "on")
|
||||||
|
|
||||||
|
if(NOT OPENCV_CUSTOM_PACKAGE_INFO)
|
||||||
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Computer Vision Library")
|
||||||
|
set(CPACK_PACKAGE_DESCRIPTION
|
||||||
|
"OpenCV (Open Source Computer Vision Library) is an open source computer vision
|
||||||
|
and machine learning software library. OpenCV was built to provide a common
|
||||||
|
infrastructure for computer vision applications and to accelerate the use of
|
||||||
|
machine perception in the commercial products. Being a BSD-licensed product,
|
||||||
|
OpenCV makes it easy for businesses to utilize and modify the code.")
|
||||||
|
set(CPACK_PACKAGE_VENDOR "OpenCV Foundation")
|
||||||
|
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
||||||
|
set(CPACK_PACKAGE_CONTACT "OpenCV Developers <admin@opencv.org>")
|
||||||
|
set(CPACK_PACKAGE_VERSION_MAJOR "${OPENCV_VERSION_MAJOR}")
|
||||||
|
set(CPACK_PACKAGE_VERSION_MINOR "${OPENCV_VERSION_MINOR}")
|
||||||
|
set(CPACK_PACKAGE_VERSION_PATCH "${OPENCV_VERSION_PATCH}")
|
||||||
|
set(CPACK_PACKAGE_VERSION "${OPENCV_VCSVERSION}")
|
||||||
|
if (NOT "${OPENCV_VCSVERSION}" MATCHES "^${OPENCV_VERSION}.*")
|
||||||
|
message(WARNING "CPACK_PACKAGE_VERSION does not match version provided by version.hpp header!")
|
||||||
|
endif()
|
||||||
|
set(OPENCV_DEBIAN_COPYRIGHT_FILE "")
|
||||||
|
endif(NOT OPENCV_CUSTOM_PACKAGE_INFO)
|
||||||
|
|
||||||
|
set(CPACK_STRIP_FILES 1)
|
||||||
|
|
||||||
|
#arch
|
||||||
|
if(X86)
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
|
||||||
|
set(CPACK_RPM_PACKAGE_ARCHITECTURE "i686")
|
||||||
|
elseif(X86_64)
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
|
||||||
|
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
|
||||||
|
elseif(ARM)
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf")
|
||||||
|
set(CPACK_RPM_PACKAGE_ARCHITECTURE "armhf")
|
||||||
|
elseif(AARCH64)
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
|
||||||
|
set(CPACK_RPM_PACKAGE_ARCHITECTURE "aarch64")
|
||||||
|
else()
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
set(CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CPACK_GENERATOR STREQUAL "DEB")
|
||||||
|
set(OPENCV_PACKAGE_ARCH_SUFFIX ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
|
||||||
|
elseif(CPACK_GENERATOR STREQUAL "RPM")
|
||||||
|
set(OPENCV_PACKAGE_ARCH_SUFFIX ${CPACK_RPM_PACKAGE_ARCHITECTURE})
|
||||||
|
else()
|
||||||
|
set(OPENCV_PACKAGE_ARCH_SUFFIX ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${OPENCV_VCSVERSION}-${OPENCV_PACKAGE_ARCH_SUFFIX}")
|
||||||
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${OPENCV_VCSVERSION}-${OPENCV_PACKAGE_ARCH_SUFFIX}")
|
||||||
|
|
||||||
|
#rpm options
|
||||||
|
set(CPACK_RPM_COMPONENT_INSTALL TRUE)
|
||||||
|
set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||||
|
set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
|
||||||
|
set(CPACK_RPM_PACKAGE_URL "http://opencv.org")
|
||||||
|
set(CPACK_RPM_PACKAGE_LICENSE "BSD")
|
||||||
|
|
||||||
|
#deb options
|
||||||
|
set(CPACK_DEB_COMPONENT_INSTALL TRUE)
|
||||||
|
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_LIBS_REQUIRED TRUE)
|
||||||
|
set(CPACK_COMPONENT_SAMPLES_DEPENDS libs dev)
|
||||||
|
set(CPACK_COMPONENT_DEV_DEPENDS libs)
|
||||||
|
set(CPACK_COMPONENT_DOCS_DEPENDS libs)
|
||||||
|
set(CPACK_COMPONENT_JAVA_DEPENDS libs)
|
||||||
|
set(CPACK_COMPONENT_PYTHON_DEPENDS libs)
|
||||||
|
set(CPACK_DEB_PYTHON_PACKAGE_DEPENDS "python-numpy (>=${PYTHON_NUMPY_VERSION}), python${PYTHON_VERSION_MAJOR_MINOR}")
|
||||||
|
set(CPACK_COMPONENT_TESTS_DEPENDS libs)
|
||||||
|
if (HAVE_opencv_python)
|
||||||
|
set(CPACK_DEB_TESTS_PACKAGE_DEPENDS "python-numpy (>=${PYTHON_NUMPY_VERSION}), python${PYTHON_VERSION_MAJOR_MINOR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(HAVE_CUDA)
|
||||||
|
string(REPLACE "." "-" cuda_version_suffix ${CUDA_VERSION})
|
||||||
|
if(CUDA_VERSION VERSION_LESS "6.5")
|
||||||
|
set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
|
||||||
|
set(CPACK_DEB_DEV_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
|
||||||
|
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()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(HAVE_TBB AND NOT BUILD_TBB)
|
||||||
|
if(CPACK_DEB_DEV_PACKAGE_DEPENDS)
|
||||||
|
set(CPACK_DEB_DEV_PACKAGE_DEPENDS "${CPACK_DEB_DEV_PACKAGE_DEPENDS}, libtbb-dev")
|
||||||
|
else()
|
||||||
|
set(CPACK_DEB_DEV_PACKAGE_DEPENDS "libtbb-dev")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(STD_OPENCV_LIBS opencv-data)
|
||||||
|
set(STD_OPENCV_DEV libopencv-dev)
|
||||||
|
|
||||||
|
foreach(module calib3d contrib core features2d flann gpu highgui imgproc legacy
|
||||||
|
ml objdetect ocl photo stitching superres ts video videostab)
|
||||||
|
if(HAVE_opencv_${module})
|
||||||
|
list(APPEND STD_OPENCV_LIBS "libopencv-${module}2.4")
|
||||||
|
list(APPEND STD_OPENCV_DEV "libopencv-${module}-dev")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
list(APPEND STD_OPENCV_DEV "libhighgui-dev" "libcv-dev" "libcvaux-dev")
|
||||||
|
|
||||||
|
string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_CONFLICTS "${STD_OPENCV_LIBS}")
|
||||||
|
string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_PROVIDES "${STD_OPENCV_LIBS}")
|
||||||
|
string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_REPLACES "${STD_OPENCV_LIBS}")
|
||||||
|
|
||||||
|
string(REPLACE ";" ", " CPACK_COMPONENT_DEV_CONFLICTS "${STD_OPENCV_DEV}")
|
||||||
|
string(REPLACE ";" ", " CPACK_COMPONENT_DEV_PROVIDES "${STD_OPENCV_DEV}")
|
||||||
|
string(REPLACE ";" ", " CPACK_COMPONENT_DEV_REPLACES "${STD_OPENCV_DEV}")
|
||||||
|
|
||||||
|
set(CPACK_COMPONENT_PYTHON_CONFLICTS python-opencv)
|
||||||
|
set(CPACK_COMPONENT_PYTHON_PROVIDES python-opencv)
|
||||||
|
set(CPACK_COMPONENT_PYTHON_REPLACES python-opencv)
|
||||||
|
|
||||||
|
set(CPACK_COMPONENT_JAVA_CONFLICTS "libopencv2.4-java, libopencv2.4-jni")
|
||||||
|
set(CPACK_COMPONENT_JAVA_PROVIDES "libopencv2.4-java, libopencv2.4-jni")
|
||||||
|
set(CPACK_COMPONENT_JAVA_REPLACES "libopencv2.4-java, libopencv2.4-jni")
|
||||||
|
|
||||||
|
set(CPACK_COMPONENT_DOCS_CONFLICTS opencv-doc)
|
||||||
|
set(CPACK_COMPONENT_SAMPLES_CONFLICTS opencv-doc)
|
||||||
|
|
||||||
|
if(NOT OPENCV_CUSTOM_PACKAGE_INFO)
|
||||||
|
set(CPACK_COMPONENT_LIBS_DESCRIPTION "Open Computer Vision Library")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_LIBS_NAME "libopencv")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_LIBS_SECTION "libs")
|
||||||
|
|
||||||
|
set(CPACK_COMPONENT_PYTHON_DESCRIPTION "Python bindings for Open Source Computer Vision Library")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_PYTHON_NAME "libopencv-python")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_PYTHON_SECTION "python")
|
||||||
|
|
||||||
|
set(CPACK_COMPONENT_JAVA_DESCRIPTION "Java bindings for Open Source Computer Vision Library")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_JAVA_NAME "libopencv-java")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_JAVA_SECTION "java")
|
||||||
|
|
||||||
|
set(CPACK_COMPONENT_DEV_DESCRIPTION "Development files for Open Source Computer Vision Library")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_DEV_NAME "libopencv-dev")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_DEV_SECTION "libdevel")
|
||||||
|
|
||||||
|
set(CPACK_COMPONENT_DOCS_DESCRIPTION "Documentation for Open Source Computer Vision Library")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_DOCS_NAME "libopencv-docs")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_DOCS_SECTION "doc")
|
||||||
|
|
||||||
|
set(CPACK_COMPONENT_SAMPLES_DESCRIPTION "Samples for Open Source Computer Vision Library")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_SAMPLES_NAME "libopencv-samples")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_SAMPLES_SECTION "devel")
|
||||||
|
|
||||||
|
set(CPACK_COMPONENT_TESTS_DESCRIPTION "Accuracy and performance tests for Open Source Computer Vision Library")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_TESTS_NAME "libopencv-tests")
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_TESTS_SECTION "misc")
|
||||||
|
endif(NOT OPENCV_CUSTOM_PACKAGE_INFO)
|
||||||
|
|
||||||
|
set(CPACK_DEBIAN_COMPONENT_DOCS_ARCHITECTURE "all")
|
||||||
|
|
||||||
|
# lintian stuff
|
||||||
|
|
||||||
|
#
|
||||||
|
# ocv_generate_lintian_overrides_file: generates lintian overrides file for
|
||||||
|
# the specified component (deb-package). It's assumed that <comp>_LINTIAN_OVERRIDES
|
||||||
|
# variable with suppressed tags is defined.
|
||||||
|
#
|
||||||
|
# Usage: ocv_generate_lintian_overrides_file(<component name>)
|
||||||
|
#
|
||||||
|
|
||||||
|
function(ocv_generate_lintian_overrides_file comp)
|
||||||
|
string(TOUPPER ${comp} comp_upcase)
|
||||||
|
|
||||||
|
set(package_name ${CPACK_DEBIAN_COMPONENT_${comp_upcase}_NAME})
|
||||||
|
set(suppressions ${${comp_upcase}_LINTIAN_OVERRIDES})
|
||||||
|
|
||||||
|
if(suppressions)
|
||||||
|
if(NOT package_name)
|
||||||
|
message(FATAL_ERROR "Package name for the ${comp} component is not defined")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# generate content of lintian overrides file
|
||||||
|
|
||||||
|
foreach(suppression ${suppressions})
|
||||||
|
set(line "${package_name}: ${suppression}")
|
||||||
|
if(content)
|
||||||
|
set(content "${content}\n${line}")
|
||||||
|
else()
|
||||||
|
set(content "${line}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# create file and install it
|
||||||
|
set(cpack_tmp_dir "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}")
|
||||||
|
set(overrides_filename "${cpack_tmp_dir}/${package_name}")
|
||||||
|
|
||||||
|
file(WRITE "${overrides_filename}" "${content}")
|
||||||
|
|
||||||
|
# install generated file
|
||||||
|
install(FILES "${overrides_filename}"
|
||||||
|
DESTINATION share/lintian/overrides/
|
||||||
|
COMPONENT ${comp})
|
||||||
|
|
||||||
|
unset(content)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(ocv_get_lintian_version version)
|
||||||
|
find_program(LINTIAN_EXECUTABLE lintian)
|
||||||
|
|
||||||
|
if(NOT LINTIAN_EXECUTABLE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(COMMAND ${LINTIAN_EXECUTABLE} --version
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
RESULT_VARIABLE LINTIAN_EXITCODE
|
||||||
|
OUTPUT_VARIABLE LINTIAN_VERSION
|
||||||
|
ERROR_QUIET)
|
||||||
|
|
||||||
|
if(NOT LINTIAN_EXITCODE EQUAL 0)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(LINTIAN_VERSION MATCHES "([0-9]+\\.[0-9]+\\.[0-9]+)")
|
||||||
|
set(LINTIAN_VERSION "${CMAKE_MATCH_1}" CACHE INTERNAL "Lintian version")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set("${version}" "${LINTIAN_VERSION}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
ocv_get_lintian_version(LINTIAN_VERSION)
|
||||||
|
|
||||||
|
set(LIBS_LINTIAN_OVERRIDES "binary-or-shlib-defines-rpath" # usr/lib/libopencv_core.so.2.4.12
|
||||||
|
"package-name-doesnt-match-sonames") # libopencv-calib3d2.4 libopencv-contrib2.4
|
||||||
|
|
||||||
|
if(HAVE_opencv_python)
|
||||||
|
set(PYTHON_LINTIAN_OVERRIDES "binary-or-shlib-defines-rpath" # usr/lib/python2.7/dist-packages/cv2.so
|
||||||
|
"missing-dependency-on-numpy-abi")
|
||||||
|
else()
|
||||||
|
set(PYTHON_LINTIAN_OVERRIDES "empty-binary-package") # python module is off
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT HAVE_opencv_java)
|
||||||
|
set(JAVA_LINTIAN_OVERRIDES "empty-binary-package") # Java is off
|
||||||
|
else()
|
||||||
|
# TODO: add smht here
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(DEV_LINTIAN_OVERRIDES "binary-or-shlib-defines-rpath" # usr/bin/opencv_traincascade
|
||||||
|
"binary-without-manpage") # usr/bin/opencv_traincascade
|
||||||
|
|
||||||
|
if(LINTIAN_VERSION VERSION_GREATER "2.5.30" OR
|
||||||
|
LINTIAN_VERSION VERSION_EQUAL "2.5.30")
|
||||||
|
list(APPEND DEV_LINTIAN_OVERRIDES "pkg-config-bad-directive") # usr/lib/pkgconfig/opencv.pc -L/usr/local/cuda-7.0/lib64
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT INSTALL_C_EXAMPLES)
|
||||||
|
set(SAMPLES_LINTIAN_OVERRIDES "empty-binary-package") # samples are not installed
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(INSTALL_TESTS)
|
||||||
|
set(TESTS_LINTIAN_OVERRIDES "arch-dependent-file-in-usr-share" # usr/share/OpenCV/bin/opencv_test_ml
|
||||||
|
"binary-or-shlib-defines-rpath" # usr/share/OpenCV/bin/opencv_test_ml
|
||||||
|
"python-script-but-no-python-dep") # usr/share/OpenCV/bin/calchist.py
|
||||||
|
else()
|
||||||
|
set(TESTS_LINTIAN_OVERRIDES "empty-binary-package") # there is no tests
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(ALL_COMPONENTS "libs" "dev" "docs" "python" "java" "samples" "tests")
|
||||||
|
|
||||||
|
foreach (comp ${ALL_COMPONENTS})
|
||||||
|
string(TOUPPER ${comp} comp_upcase)
|
||||||
|
list(APPEND ${comp_upcase}_LINTIAN_OVERRIDES "misplaced-extra-member-in-deb") # for signed packages
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if(CPACK_GENERATOR STREQUAL "DEB")
|
||||||
|
find_program(GZIP_TOOL NAMES "gzip" PATHS "/bin" "/usr/bin" "/usr/local/bin")
|
||||||
|
if(NOT GZIP_TOOL)
|
||||||
|
message(FATAL_ERROR "Unable to find 'gzip' program")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(COMMAND "date" "-R"
|
||||||
|
OUTPUT_VARIABLE CHANGELOG_PACKAGE_DATE
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
set(CHANGELOG_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
|
||||||
|
foreach (comp ${ALL_COMPONENTS})
|
||||||
|
string(TOUPPER "${comp}" comp_upcase)
|
||||||
|
|
||||||
|
set(DEBIAN_CHANGELOG_OUT_FILE "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.Debian")
|
||||||
|
set(DEBIAN_CHANGELOG_OUT_FILE_GZ "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.Debian.gz")
|
||||||
|
set(CHANGELOG_PACKAGE_NAME "${CPACK_DEBIAN_COMPONENT_${comp_upcase}_NAME}")
|
||||||
|
configure_file("${CMAKE_SOURCE_DIR}/cmake/templates/changelog.Debian.in" "${DEBIAN_CHANGELOG_OUT_FILE}" @ONLY)
|
||||||
|
|
||||||
|
execute_process(COMMAND "${GZIP_TOOL}" "-cf9" "${DEBIAN_CHANGELOG_OUT_FILE}"
|
||||||
|
OUTPUT_FILE "${DEBIAN_CHANGELOG_OUT_FILE_GZ}"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||||
|
|
||||||
|
install(FILES "${DEBIAN_CHANGELOG_OUT_FILE_GZ}"
|
||||||
|
DESTINATION "share/doc/${CPACK_DEBIAN_COMPONENT_${comp_upcase}_NAME}"
|
||||||
|
COMPONENT "${comp}")
|
||||||
|
|
||||||
|
set(CHANGELOG_OUT_FILE "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog")
|
||||||
|
set(CHANGELOG_OUT_FILE_GZ "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.gz")
|
||||||
|
file(WRITE ${CHANGELOG_OUT_FILE} "Upstream changelog stub. See https://github.com/Itseez/opencv/wiki/ChangeLog")
|
||||||
|
|
||||||
|
execute_process(COMMAND "${GZIP_TOOL}" "-cf9" "${CHANGELOG_OUT_FILE}"
|
||||||
|
OUTPUT_FILE "${CHANGELOG_OUT_FILE_GZ}"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||||
|
|
||||||
|
install(FILES "${CHANGELOG_OUT_FILE_GZ}"
|
||||||
|
DESTINATION "share/doc/${CPACK_DEBIAN_COMPONENT_${comp_upcase}_NAME}"
|
||||||
|
COMPONENT "${comp}")
|
||||||
|
|
||||||
|
if(OPENCV_DEBIAN_COPYRIGHT_FILE)
|
||||||
|
install(FILES "${OPENCV_DEBIAN_COPYRIGHT_FILE}"
|
||||||
|
DESTINATION "share/doc/${CPACK_DEBIAN_COMPONENT_${comp_upcase}_NAME}"
|
||||||
|
COMPONENT "${comp}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ocv_generate_lintian_overrides_file("${comp}")
|
||||||
|
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(CPack)
|
||||||
|
|
||||||
|
ENDif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||||
+45
-2
@@ -200,12 +200,12 @@ macro(OCV_OPTION variable description value)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
unset(__varname)
|
unset(__varname)
|
||||||
if("${__condition}" STREQUAL "")
|
if(__condition STREQUAL "")
|
||||||
set(__condition 2 GREATER 1)
|
set(__condition 2 GREATER 1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${__condition})
|
if(${__condition})
|
||||||
if("${__value}" MATCHES ";")
|
if(__value MATCHES ";")
|
||||||
if(${__value})
|
if(${__value})
|
||||||
option(${variable} "${description}" ON)
|
option(${variable} "${description}" ON)
|
||||||
else()
|
else()
|
||||||
@@ -448,6 +448,31 @@ macro(ocv_convert_to_full_paths VAR)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
# convert list of paths to libraries names without lib prefix
|
||||||
|
function(ocv_convert_to_lib_name var)
|
||||||
|
set(tmp "")
|
||||||
|
foreach(path ${ARGN})
|
||||||
|
get_filename_component(tmp_name "${path}" NAME_WE)
|
||||||
|
string(REGEX REPLACE "^lib" "" tmp_name "${tmp_name}")
|
||||||
|
list(APPEND tmp "${tmp_name}")
|
||||||
|
endforeach()
|
||||||
|
set(${var} ${tmp} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# create imported targets for a list of external libraries
|
||||||
|
function(ocv_create_imported_targets var)
|
||||||
|
set(target_list "")
|
||||||
|
|
||||||
|
foreach(library ${ARGN})
|
||||||
|
ocv_convert_to_lib_name(libname "${library}")
|
||||||
|
add_library("opencv_dep_${libname}" UNKNOWN IMPORTED)
|
||||||
|
set_target_properties("opencv_dep_${libname}" PROPERTIES IMPORTED_LOCATION "${library}")
|
||||||
|
list(APPEND target_list "opencv_dep_${libname}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set("${var}" "${target_list}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# add install command
|
# add install command
|
||||||
function(ocv_install_target)
|
function(ocv_install_target)
|
||||||
install(TARGETS ${ARGN})
|
install(TARGETS ${ARGN})
|
||||||
@@ -605,3 +630,21 @@ function(ocv_source_group group)
|
|||||||
file(GLOB srcs ${OCV_SOURCE_GROUP_GLOB})
|
file(GLOB srcs ${OCV_SOURCE_GROUP_GLOB})
|
||||||
source_group(${group} FILES ${srcs})
|
source_group(${group} FILES ${srcs})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# build the list of simple dependencies, that links via "-l"
|
||||||
|
# _all_libs - name of variable with input list
|
||||||
|
# _simple - name of variable with output list of simple libs
|
||||||
|
# _other - name of variable with _all_libs - _simple
|
||||||
|
macro(ocv_extract_simple_libs _all_libs _simple _other)
|
||||||
|
set(${_simple} "")
|
||||||
|
set(${_other} "")
|
||||||
|
foreach(_l ${${_all_libs}})
|
||||||
|
if(TARGET ${_l})
|
||||||
|
list(APPEND ${_other} ${_l})
|
||||||
|
elseif(EXISTS "${_l}")
|
||||||
|
list(APPEND ${_other} ${_l})
|
||||||
|
else()
|
||||||
|
list(APPEND ${_simple} ${_l})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
# you might need to define NDK_USE_CYGPATH=1 before calling the ndk-build
|
# you might need to define NDK_USE_CYGPATH=1 before calling the ndk-build
|
||||||
|
|
||||||
USER_LOCAL_PATH:=$(LOCAL_PATH)
|
USER_LOCAL_PATH:=$(LOCAL_PATH)
|
||||||
|
|
||||||
|
USER_LOCAL_C_INCLUDES:=$(LOCAL_C_INCLUDES)
|
||||||
|
USER_LOCAL_CFLAGS:=$(LOCAL_CFLAGS)
|
||||||
|
USER_LOCAL_STATIC_LIBRARIES:=$(LOCAL_STATIC_LIBRARIES)
|
||||||
|
USER_LOCAL_SHARED_LIBRARIES:=$(LOCAL_SHARED_LIBRARIES)
|
||||||
|
USER_LOCAL_LDLIBS:=$(LOCAL_LDLIBS)
|
||||||
|
|
||||||
LOCAL_PATH:=$(subst ?,,$(firstword ?$(subst \, ,$(subst /, ,$(call my-dir)))))
|
LOCAL_PATH:=$(subst ?,,$(firstword ?$(subst \, ,$(subst /, ,$(call my-dir)))))
|
||||||
|
|
||||||
OPENCV_TARGET_ARCH_ABI:=$(TARGET_ARCH_ABI)
|
OPENCV_TARGET_ARCH_ABI:=$(TARGET_ARCH_ABI)
|
||||||
@@ -13,7 +20,7 @@ OPENCV_BASEDIR:=@OPENCV_BASE_INCLUDE_DIR_CONFIGCMAKE@
|
|||||||
OPENCV_LOCAL_C_INCLUDES:=@OPENCV_INCLUDE_DIRS_CONFIGCMAKE@
|
OPENCV_LOCAL_C_INCLUDES:=@OPENCV_INCLUDE_DIRS_CONFIGCMAKE@
|
||||||
OPENCV_MODULES:=@OPENCV_MODULES_CONFIGMAKE@
|
OPENCV_MODULES:=@OPENCV_MODULES_CONFIGMAKE@
|
||||||
|
|
||||||
OPENCV_HAVE_GPU_MODULE=@OPENCV_HAVE_GPU_MODULE_CONFIGMAKE@
|
OPENCV_HAVE_GPU_MODULE:=@OPENCV_HAVE_GPU_MODULE_CONFIGMAKE@
|
||||||
OPENCV_USE_GPU_MODULE:=
|
OPENCV_USE_GPU_MODULE:=
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||||
@@ -22,9 +29,21 @@ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
|||||||
OPENCV_USE_GPU_MODULE:=on
|
OPENCV_USE_GPU_MODULE:=on
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
OPENCV_DYNAMICUDA_MODULE:=@OPENCV_DYNAMICUDA_MODULE_CONFIGMAKE@
|
||||||
|
else
|
||||||
|
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||||
|
ifeq ($(OPENCV_HAVE_GPU_MODULE),on)
|
||||||
|
ifneq ($(CUDA_TOOLKIT_DIR),)
|
||||||
|
OPENCV_USE_GPU_MODULE:=on
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
OPENCV_DYNAMICUDA_MODULE:=@OPENCV_DYNAMICUDA_MODULE_CONFIGMAKE@
|
||||||
|
else
|
||||||
|
OPENCV_DYNAMICUDA_MODULE:=
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CUDA_RUNTIME_LIBS:=cufft npps nppi nppc cudart
|
CUDA_RUNTIME_LIBS:=@CUDA_RUNTIME_LIBS_CONFIGMAKE@
|
||||||
|
|
||||||
ifeq ($(OPENCV_LIB_TYPE),)
|
ifeq ($(OPENCV_LIB_TYPE),)
|
||||||
OPENCV_LIB_TYPE:=@OPENCV_LIBTYPE_CONFIGMAKE@
|
OPENCV_LIB_TYPE:=@OPENCV_LIBTYPE_CONFIGMAKE@
|
||||||
@@ -46,6 +65,10 @@ else
|
|||||||
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
||||||
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||||
|
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
||||||
|
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
||||||
|
endif
|
||||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||||
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
||||||
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
||||||
@@ -60,13 +83,16 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq (${OPENCV_CAMERA_MODULES},on)
|
ifeq ($(OPENCV_CAMERA_MODULES),on)
|
||||||
ifeq ($(TARGET_ARCH_ABI),armeabi)
|
ifeq ($(TARGET_ARCH_ABI),armeabi)
|
||||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_CONFIGCMAKE@
|
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_CONFIGCMAKE@
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_V7A_CONFIGCMAKE@
|
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_V7A_CONFIGCMAKE@
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||||
|
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARM64_V8A_CONFIGCMAKE@
|
||||||
|
endif
|
||||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_X86_CONFIGCMAKE@
|
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_X86_CONFIGCMAKE@
|
||||||
endif
|
endif
|
||||||
@@ -91,6 +117,21 @@ define add_opencv_module
|
|||||||
include $(PREBUILT_$(OPENCV_LIB_TYPE)_LIBRARY)
|
include $(PREBUILT_$(OPENCV_LIB_TYPE)_LIBRARY)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
ifndef CUDA_LIBS_DIR
|
||||||
|
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||||
|
CUDA_LIBS_DIR := $(CUDA_TOOLKIT_DIR)/targets/aarch64-linux-androideabi/lib
|
||||||
|
else
|
||||||
|
CUDA_LIBS_DIR := $(CUDA_TOOLKIT_DIR)/targets/armv7-linux-androideabi/lib
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
define add_cuda_module
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE:=$1
|
||||||
|
LOCAL_SRC_FILES:=$(CUDA_LIBS_DIR)/lib$(1:opencv_dep_%=%).so
|
||||||
|
include $(PREBUILT_SHARED_LIBRARY)
|
||||||
|
endef
|
||||||
|
|
||||||
define add_opencv_3rdparty_component
|
define add_opencv_3rdparty_component
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE:=$1
|
LOCAL_MODULE:=$1
|
||||||
@@ -108,6 +149,17 @@ endef
|
|||||||
ifeq ($(OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED),)
|
ifeq ($(OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED),)
|
||||||
ifeq ($(OPENCV_INSTALL_MODULES),on)
|
ifeq ($(OPENCV_INSTALL_MODULES),on)
|
||||||
$(foreach module,$(OPENCV_LIBS),$(eval $(call add_opencv_module,$(module))))
|
$(foreach module,$(OPENCV_LIBS),$(eval $(call add_opencv_module,$(module))))
|
||||||
|
ifneq ($(OPENCV_DYNAMICUDA_MODULE),)
|
||||||
|
ifeq ($(OPENCV_LIB_TYPE),SHARED)
|
||||||
|
$(eval $(call add_opencv_module,$(OPENCV_DYNAMICUDA_MODULE)))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
||||||
|
ifeq ($(INSTALL_CUDA_LIBRARIES),on)
|
||||||
|
$(foreach module,$(CUDA_RUNTIME_LIBS),$(eval $(call add_cuda_module,$(module))))
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(foreach module,$(OPENCV_3RDPARTY_COMPONENTS),$(eval $(call add_opencv_3rdparty_component,$(module))))
|
$(foreach module,$(OPENCV_3RDPARTY_COMPONENTS),$(eval $(call add_opencv_3rdparty_component,$(module))))
|
||||||
@@ -124,11 +176,14 @@ ifeq ($(OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED),)
|
|||||||
OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED:=on
|
OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED:=on
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
ifeq ($(OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_GPU_ALREADY_INCLUDED),)
|
||||||
include $(CLEAR_VARS)
|
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
||||||
LOCAL_MODULE:=opencv_gpu
|
include $(CLEAR_VARS)
|
||||||
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/libopencv_gpu.a
|
LOCAL_MODULE:=opencv_gpu
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/libopencv_gpu.a
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
endif
|
||||||
|
OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_GPU_ALREADY_INCLUDED:=on
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OPENCV_LOCAL_CFLAGS),)
|
ifeq ($(OPENCV_LOCAL_CFLAGS),)
|
||||||
@@ -136,6 +191,13 @@ ifeq ($(OPENCV_LOCAL_CFLAGS),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
LOCAL_C_INCLUDES:=$(USER_LOCAL_C_INCLUDES)
|
||||||
|
LOCAL_CFLAGS:=$(USER_LOCAL_CFLAGS)
|
||||||
|
LOCAL_STATIC_LIBRARIES:=$(USER_LOCAL_STATIC_LIBRARIES)
|
||||||
|
LOCAL_SHARED_LIBRARIES:=$(USER_LOCAL_SHARED_LIBRARIES)
|
||||||
|
LOCAL_LDLIBS:=$(USER_LOCAL_LDLIBS)
|
||||||
|
|
||||||
LOCAL_C_INCLUDES += $(OPENCV_LOCAL_C_INCLUDES)
|
LOCAL_C_INCLUDES += $(OPENCV_LOCAL_C_INCLUDES)
|
||||||
LOCAL_CFLAGS += $(OPENCV_LOCAL_CFLAGS)
|
LOCAL_CFLAGS += $(OPENCV_LOCAL_CFLAGS)
|
||||||
|
|
||||||
@@ -145,6 +207,11 @@ endif
|
|||||||
|
|
||||||
ifeq ($(OPENCV_INSTALL_MODULES),on)
|
ifeq ($(OPENCV_INSTALL_MODULES),on)
|
||||||
LOCAL_$(OPENCV_LIB_TYPE)_LIBRARIES += $(foreach mod, $(OPENCV_LIBS), opencv_$(mod))
|
LOCAL_$(OPENCV_LIB_TYPE)_LIBRARIES += $(foreach mod, $(OPENCV_LIBS), opencv_$(mod))
|
||||||
|
ifeq ($(OPENCV_LIB_TYPE),SHARED)
|
||||||
|
ifneq ($(OPENCV_DYNAMICUDA_MODULE),)
|
||||||
|
LOCAL_$(OPENCV_LIB_TYPE)_LIBRARIES += $(OPENCV_DYNAMICUDA_MODULE)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
LOCAL_LDLIBS += -L$(call host-path,$(LOCAL_PATH)/$(OPENCV_LIBS_DIR)) $(foreach lib, $(OPENCV_LIBS), -lopencv_$(lib))
|
LOCAL_LDLIBS += -L$(call host-path,$(LOCAL_PATH)/$(OPENCV_LIBS_DIR)) $(foreach lib, $(OPENCV_LIBS), -lopencv_$(lib))
|
||||||
endif
|
endif
|
||||||
@@ -156,8 +223,13 @@ endif
|
|||||||
LOCAL_LDLIBS += $(foreach lib,$(OPENCV_EXTRA_COMPONENTS), -l$(lib))
|
LOCAL_LDLIBS += $(foreach lib,$(OPENCV_EXTRA_COMPONENTS), -l$(lib))
|
||||||
|
|
||||||
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
ifeq ($(OPENCV_USE_GPU_MODULE),on)
|
||||||
|
ifeq ($(INSTALL_CUDA_LIBRARIES),on)
|
||||||
|
LOCAL_SHARED_LIBRARIES += $(foreach mod, $(CUDA_RUNTIME_LIBS), $(mod))
|
||||||
|
else
|
||||||
|
LOCAL_LDLIBS += -L$(CUDA_LIBS_DIR) \
|
||||||
|
$(foreach lib, $(CUDA_RUNTIME_LIBS), -l$(lib:opencv_dep_%=%))
|
||||||
|
endif
|
||||||
LOCAL_STATIC_LIBRARIES+=libopencv_gpu
|
LOCAL_STATIC_LIBRARIES+=libopencv_gpu
|
||||||
LOCAL_LDLIBS += -L$(CUDA_TOOLKIT_DIR)/lib $(foreach lib, $(CUDA_RUNTIME_LIBS), -l$(lib))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#restore the LOCAL_PATH
|
#restore the LOCAL_PATH
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
# This file will define the following variables:
|
# This file will define the following variables:
|
||||||
# - OpenCV_LIBS : The list of all imported targets for OpenCV modules.
|
# - OpenCV_LIBS : The list of all imported targets for OpenCV modules.
|
||||||
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
|
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
|
||||||
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability
|
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability.
|
||||||
# - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API
|
# - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API.
|
||||||
# - OpenCV_VERSION : The version of this OpenCV build: "@OPENCV_VERSION@"
|
# - OpenCV_VERSION : The version of this OpenCV build: "@OPENCV_VERSION@"
|
||||||
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION: "@OPENCV_VERSION_MAJOR@"
|
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION: "@OPENCV_VERSION_MAJOR@"
|
||||||
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION: "@OPENCV_VERSION_MINOR@"
|
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION: "@OPENCV_VERSION_MINOR@"
|
||||||
@@ -27,22 +27,48 @@
|
|||||||
# - OpenCV_VERSION_TWEAK : Tweak version part of OpenCV_VERSION: "@OPENCV_VERSION_TWEAK@"
|
# - OpenCV_VERSION_TWEAK : Tweak version part of OpenCV_VERSION: "@OPENCV_VERSION_TWEAK@"
|
||||||
#
|
#
|
||||||
# Advanced variables:
|
# Advanced variables:
|
||||||
# - OpenCV_SHARED
|
# - OpenCV_SHARED : Use OpenCV as shared library
|
||||||
# - OpenCV_CONFIG_PATH
|
# - OpenCV_CONFIG_PATH : Path to this OpenCVConfig.cmake
|
||||||
# - OpenCV_INSTALL_PATH (not set on Windows)
|
# - OpenCV_INSTALL_PATH : OpenCV location (not set on Windows)
|
||||||
# - OpenCV_LIB_COMPONENTS
|
# - OpenCV_LIB_COMPONENTS : Present OpenCV modules list
|
||||||
# - OpenCV_USE_MANGLED_PATHS
|
# - OpenCV_USE_MANGLED_PATHS : Mangled OpenCV path flag
|
||||||
# - OpenCV_HAVE_ANDROID_CAMERA
|
# - OpenCV_MODULES_SUFFIX : The suffix for OpenCVModules-XXX.cmake file
|
||||||
|
# - OpenCV_HAVE_ANDROID_CAMERA : Presence of Android native camera wrappers
|
||||||
#
|
#
|
||||||
# ===================================================================================
|
# ===================================================================================
|
||||||
|
|
||||||
set(modules_file_suffix "")
|
# Search packages for host system instead of packages for target system.
|
||||||
if(ANDROID)
|
# in case of cross compilation thess macro should be defined by toolchain file
|
||||||
string(REPLACE - _ modules_file_suffix "_${ANDROID_NDK_ABI_NAME}")
|
|
||||||
|
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}")
|
||||||
|
else()
|
||||||
|
set(OpenCV_MODULES_SUFFIX "")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT TARGET opencv_core)
|
if(NOT TARGET opencv_core)
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${modules_file_suffix}.cmake)
|
# 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()
|
endif()
|
||||||
|
|
||||||
# TODO All things below should be reviewed. What is about of moving this code into related modules (special vars/hooks/files)
|
# TODO All things below should be reviewed. What is about of moving this code into related modules (special vars/hooks/files)
|
||||||
@@ -56,7 +82,11 @@ set(OpenCV_USE_CUFFT @HAVE_CUFFT@)
|
|||||||
set(OpenCV_USE_NVCUVID @HAVE_NVCUVID@)
|
set(OpenCV_USE_NVCUVID @HAVE_NVCUVID@)
|
||||||
|
|
||||||
# Android API level from which OpenCV has been compiled is remembered
|
# Android API level from which OpenCV has been compiled is remembered
|
||||||
set(OpenCV_ANDROID_NATIVE_API_LEVEL @OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE@)
|
if(ANDROID)
|
||||||
|
set(OpenCV_ANDROID_NATIVE_API_LEVEL @OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE@)
|
||||||
|
else()
|
||||||
|
set(OpenCV_ANDROID_NATIVE_API_LEVEL 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Some additional settings are required if OpenCV is built as static libs
|
# Some additional settings are required if OpenCV is built as static libs
|
||||||
set(OpenCV_SHARED @BUILD_SHARED_LIBS@)
|
set(OpenCV_SHARED @BUILD_SHARED_LIBS@)
|
||||||
@@ -67,8 +97,8 @@ set(OpenCV_USE_MANGLED_PATHS @OpenCV_USE_MANGLED_PATHS_CONFIGCMAKE@)
|
|||||||
# Extract the directory where *this* file has been installed (determined at cmake run-time)
|
# Extract the directory where *this* file has been installed (determined at cmake run-time)
|
||||||
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE)
|
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE)
|
||||||
|
|
||||||
if(NOT WIN32 OR OpenCV_ANDROID_NATIVE_API_LEVEL GREATER 0)
|
if(NOT WIN32 OR ANDROID)
|
||||||
if(OpenCV_ANDROID_NATIVE_API_LEVEL GREATER 0)
|
if(ANDROID)
|
||||||
set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../..")
|
set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../..")
|
||||||
else()
|
else()
|
||||||
set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../..")
|
set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../..")
|
||||||
@@ -204,45 +234,54 @@ endif()
|
|||||||
foreach(__opttype OPT DBG)
|
foreach(__opttype OPT DBG)
|
||||||
SET(OpenCV_LIBS_${__opttype} "${OpenCV_LIBS}")
|
SET(OpenCV_LIBS_${__opttype} "${OpenCV_LIBS}")
|
||||||
SET(OpenCV_EXTRA_LIBS_${__opttype} "")
|
SET(OpenCV_EXTRA_LIBS_${__opttype} "")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# CUDA
|
# Configure CUDA targets
|
||||||
if(OpenCV_CUDA_VERSION AND (CMAKE_CROSSCOMPILING OR (WIN32 AND NOT OpenCV_SHARED)))
|
if(OpenCV_CUDA_VERSION)
|
||||||
if(NOT CUDA_FOUND)
|
if(NOT CUDA_FOUND)
|
||||||
find_package(CUDA ${OpenCV_CUDA_VERSION} EXACT REQUIRED)
|
find_host_package(CUDA ${OpenCV_CUDA_VERSION} EXACT REQUIRED)
|
||||||
else()
|
else()
|
||||||
if(NOT CUDA_VERSION_STRING VERSION_EQUAL OpenCV_CUDA_VERSION)
|
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}")
|
message(FATAL_ERROR "OpenCV static library was compiled with CUDA ${OpenCV_CUDA_VERSION} support. Please, use the same version or rebuild OpenCV with CUDA ${CUDA_VERSION_STRING}")
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_LIBRARIES})
|
|
||||||
|
|
||||||
if(${CUDA_VERSION} VERSION_LESS "5.5")
|
|
||||||
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_npp_LIBRARY})
|
|
||||||
else()
|
|
||||||
find_cuda_helper_libs(nppc)
|
|
||||||
find_cuda_helper_libs(nppi)
|
|
||||||
find_cuda_helper_libs(npps)
|
|
||||||
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_nppc_LIBRARY} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(OpenCV_USE_CUBLAS)
|
|
||||||
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_CUBLAS_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(OpenCV_USE_CUFFT)
|
|
||||||
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_CUFFT_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(OpenCV_USE_NVCUVID)
|
|
||||||
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_nvcuvid_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
list(APPEND OpenCV_EXTRA_LIBS_${__opttype} ${CUDA_nvcuvenc_LIBRARIES})
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
|
||||||
|
set(OpenCV_CUDA_LIBS_ABSPATH ${CUDA_LIBRARIES})
|
||||||
|
|
||||||
|
if(${CUDA_VERSION} VERSION_LESS "5.5")
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_npp_LIBRARY})
|
||||||
|
else()
|
||||||
|
find_cuda_helper_libs(nppc)
|
||||||
|
find_cuda_helper_libs(nppi)
|
||||||
|
find_cuda_helper_libs(npps)
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nppc_LIBRARY} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OpenCV_USE_CUBLAS)
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUBLAS_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OpenCV_USE_CUFFT)
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUFFT_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OpenCV_USE_NVCUVID)
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvid_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvenc_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
foreach(l ${OpenCV_CUDA_LIBS_ABSPATH})
|
||||||
|
get_filename_component(_tmp "${l}" NAME_WE)
|
||||||
|
string(REGEX REPLACE "^lib" "" _tmp "${_tmp}")
|
||||||
|
if(NOT TARGET "opencv_dep_${_tmp}") # protect against repeated inclusions
|
||||||
|
add_library("opencv_dep_${_tmp}" UNKNOWN IMPORTED)
|
||||||
|
set_target_properties("opencv_dep_${_tmp}" PROPERTIES IMPORTED_LOCATION "${l}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
# Android camera helper macro
|
# Android camera helper macro
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
@CHANGELOG_PACKAGE_NAME@ (@CPACK_PACKAGE_VERSION@) unstable; urgency=low
|
||||||
|
* Debian changelog stub. See https://github.com/Itseez/opencv/wiki/ChangeLog
|
||||||
|
or release notes in user
|
||||||
|
documentation for more details.
|
||||||
|
-- @CPACK_PACKAGE_CONTACT@ @CHANGELOG_PACKAGE_DATE@
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
Format: http://dep.debian.net/deps/dep5
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: 2000-2015, Intel Corporation
|
||||||
|
2009-2011, Willow Garage Inc.
|
||||||
|
2009-2015, NVIDIA Corporation
|
||||||
|
2010-2013, Advanced Micro Devices, Inc.
|
||||||
|
2015, OpenCV Foundation
|
||||||
|
2015, Itseez Inc.
|
||||||
|
License: BSD-3-clause
|
||||||
|
By downloading, copying, installing or using the software you agree to this
|
||||||
|
license. If you do not agree to this license, do not download, install, copy
|
||||||
|
or use the software.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
License Agreement
|
||||||
|
For Open Source Computer Vision Library
|
||||||
|
(3-clause BSD License)
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
.
|
||||||
|
\* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
.
|
||||||
|
\* Redistributions 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.
|
||||||
|
.
|
||||||
|
\* Neither the names of the copyright holders nor the names of the
|
||||||
|
contributors may 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 copyright holders 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.
|
||||||
@@ -109,6 +109,9 @@
|
|||||||
/* NVidia Video Decoding API*/
|
/* NVidia Video Decoding API*/
|
||||||
#cmakedefine HAVE_NVCUVID
|
#cmakedefine HAVE_NVCUVID
|
||||||
|
|
||||||
|
/* NVidia Video Encoding API*/
|
||||||
|
#cmakedefine HAVE_NVCUVENC
|
||||||
|
|
||||||
/* OpenCL Support */
|
/* OpenCL Support */
|
||||||
#cmakedefine HAVE_OPENCL
|
#cmakedefine HAVE_OPENCL
|
||||||
#cmakedefine HAVE_OPENCL_STATIC
|
#cmakedefine HAVE_OPENCL_STATIC
|
||||||
@@ -161,6 +164,6 @@
|
|||||||
/* Xine video library */
|
/* Xine video library */
|
||||||
#cmakedefine HAVE_XINE
|
#cmakedefine HAVE_XINE
|
||||||
|
|
||||||
/* Define to 1 if your processor stores words with the most significant byte
|
/* Define if your processor stores words with the most significant byte
|
||||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||||
#cmakedefine WORDS_BIGENDIAN
|
#cmakedefine WORDS_BIGENDIAN
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
BASE_DIR=`dirname $0`
|
||||||
|
OPENCV_TEST_PATH=$BASE_DIR/@TEST_PATH@
|
||||||
|
OPENCV_TEST_DATA_PATH=$BASE_DIR/sdk/etc/testdata/
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "Device architecture is not preset in command line"
|
||||||
|
echo "Tests are available for architectures: `ls -m ${OPENCV_TEST_PATH}`"
|
||||||
|
echo "Usage: $0 <target_device_arch>"
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
TARGET_ARCH=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z `which adb` ]; then
|
||||||
|
echo "adb command was not found in PATH"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
accuracy=`find "$OPENCV_TEST_PATH/$TARGET_ARCH" -maxdepth 1 -executable -name "opencv_test_*" -not -name opencv_test_ocl`
|
||||||
|
performance=`find "$OPENCV_TEST_PATH/$TARGET_ARCH" -maxdepth 1 -executable -name "opencv_perf_*" -not -name opencv_perf_ocl`
|
||||||
|
|
||||||
|
adb push $OPENCV_TEST_DATA_PATH /sdcard/opencv_testdata
|
||||||
|
|
||||||
|
adb shell "mkdir -p /data/local/tmp/opencv_test"
|
||||||
|
SUMMARY_STATUS=0
|
||||||
|
for t in $accuracy $performance;
|
||||||
|
do
|
||||||
|
test_name=`basename "$t"`
|
||||||
|
report="$test_name-`date --rfc-3339=date`.xml"
|
||||||
|
adb push $t /data/local/tmp/opencv_test/
|
||||||
|
adb shell "export OPENCV_TEST_DATA_PATH=/sdcard/opencv_testdata && /data/local/tmp/opencv_test/$test_name --perf_min_samples=1 --perf_force_samples=1 --gtest_output=xml:/data/local/tmp/opencv_test/$report"
|
||||||
|
adb pull "/data/local/tmp/opencv_test/$report" $report
|
||||||
|
TEST_STATUS=0
|
||||||
|
if [ -e $report ]; then
|
||||||
|
if [ `grep -c "<fail" $report` -ne 0 ]; then
|
||||||
|
TEST_STATUS=2
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
TEST_STATUS=3
|
||||||
|
fi
|
||||||
|
if [ $TEST_STATUS -ne 0 ]; then
|
||||||
|
SUMMARY_STATUS=$TEST_STATUS
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $SUMMARY_STATUS -eq 0 ]; then
|
||||||
|
echo "All OpenCV tests finished successfully"
|
||||||
|
else
|
||||||
|
echo "OpenCV tests finished with status $SUMMARY_STATUS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
return $SUMMARY_STATUS
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user