├── .gitignore ├── LICENSE ├── README.md ├── doc └── images │ ├── ArchitectureDiagram.png │ ├── img-unity-ViSPUnity-plugin.png │ ├── img-unity-cube.jpg │ ├── img-unity-scene_ar-settings.png │ ├── img-unity-scene_ar.png │ ├── img-unity-scene_mbt-settings.png │ ├── img-unity-scene_mbt.png │ └── img-unity-scenes.png ├── examples └── blob │ ├── CMakeLists.txt │ ├── test-blob-opencv.cpp │ └── test-blob-v4l2.cpp ├── unityProject ├── .gitignore ├── .vs │ └── UnityProject │ │ └── v14 │ │ └── .suo ├── Assets │ ├── Materials.meta │ ├── Materials │ │ ├── CubeMaterial.mat │ │ ├── CubeMaterial.mat.meta │ │ ├── LineMaterial.mat │ │ └── LineMaterial.mat.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── scene_ar.unity │ │ ├── scene_ar.unity.meta │ │ ├── scene_mbt.unity │ │ └── scene_mbt.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── Script_ar.cs │ │ ├── Script_ar.cs.meta │ │ ├── Script_mbt.cs │ │ └── Script_mbt.cs.meta ├── Packages │ └── manifest.json └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ └── UnityConnectSettings.asset └── vispWrapper ├── CMakeLists.txt ├── ViSPUnity.cpp ├── ViSPUnity.h ├── cmake └── cmake_uninstall.cmake.in └── doc └── config-doxygen.cmake /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | PresetManager.asset 3 | VFXManager.asset 4 | unityProject/Assets/ViSPUnity.* 5 | *[Bb]uild 6 | *[Bb]uilds 7 | [Ll]ibrary 8 | [Tt]emp 9 | [Oo]bj 10 | [Ll]ogs 11 | cube.cao 12 | AssetStoreTools* 13 | *~ 14 | 15 | # Visual Studio 2015 cache directory 16 | .vs 17 | 18 | # Autogenerated VS/MD/Consulo solution and project files 19 | ExportedObj/ 20 | .consulo/ 21 | *.csproj 22 | *.unityproj 23 | *.sln 24 | *.suo 25 | *.tmp 26 | *.user 27 | *.userprefs 28 | *.pidb 29 | *.booproj 30 | *.svd 31 | *.pdb 32 | 33 | # Unity3D generated meta files 34 | *.pidb.meta 35 | 36 | # Unity3D Generated File On Crash Reports 37 | sysinfo.txt 38 | 39 | # Builds 40 | *.apk 41 | *.unitypackage 42 | 43 | # Plugins we develop, frequently changing 44 | /Assets/plugins/ 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Developement of a wrapper between ViSP and Unity engine 2 | 3 | ### Introduction 4 | 5 | This project contains: 6 | - a C++ wrapper between ViSP and Unity. This wrapper available in `vispWrapper` folder needs to be linked with [ViSP](https://visp.inria.fr). 7 | - a Unity project available in `unityProject` folder that shows how to use this wrapper to build a demo to illustrate: 8 | - augmented reality displaying a virtual cube over an AprilTag 9 | - generic model-based tracking of a cube with an AprilTag glued on one cube face. 10 | 11 | This project is compatible with Ubuntu, MacOS and Windows platforms. 12 | 13 | ### Augmented Reality in Unity using ViSP 14 | 15 | * The corresponding Unity scene is available in `unityProject/Assets/Scenes/scene_ar.unity`. 16 | * On each new image AprilTag is detected and localized in 3D. 17 | * A virtual red cube is projected in the scene over the tag thanks to the tag pose estimated with respect to the camera frame. 18 | * Check the video demonstration on YouTube: https://youtu.be/iuD8syhNoGU 19 | 20 | ### Generic Model-Based Tracking in Unity using ViSP 21 | 22 | * The corresponding Unity scene is available in `unityProject/Assets/Scenes/scene_mbt.unity`. 23 | * The tracker initialization is performed using the AprilTag pose. When tracking fails, the tag is again used to initialize the tracker. Thus to start the demo or to recover from a tracking failure, the user has to present the face of the cube that has the tag toward the camera. 24 | * When selecting `Plane > Inspector` the user can modify camera parameters, cube size and tag size to make the demo working with its own material. 25 | * Check the video demonstration on YouTube: https://youtu.be/eLG9B7MHixU 26 | 27 | Check [wiki](https://github.com/lagadic/visp_unity/wiki) of repository for more details about this project usage: implementation, tutorial on building using Visual Studio and running demo on Unity. 28 | -------------------------------------------------------------------------------- /doc/images/ArchitectureDiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lagadic/visp_unity/85fc07437924bdd4487efafb6edc28d0c7a1d9af/doc/images/ArchitectureDiagram.png -------------------------------------------------------------------------------- /doc/images/img-unity-ViSPUnity-plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lagadic/visp_unity/85fc07437924bdd4487efafb6edc28d0c7a1d9af/doc/images/img-unity-ViSPUnity-plugin.png -------------------------------------------------------------------------------- /doc/images/img-unity-cube.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lagadic/visp_unity/85fc07437924bdd4487efafb6edc28d0c7a1d9af/doc/images/img-unity-cube.jpg -------------------------------------------------------------------------------- /doc/images/img-unity-scene_ar-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lagadic/visp_unity/85fc07437924bdd4487efafb6edc28d0c7a1d9af/doc/images/img-unity-scene_ar-settings.png -------------------------------------------------------------------------------- /doc/images/img-unity-scene_ar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lagadic/visp_unity/85fc07437924bdd4487efafb6edc28d0c7a1d9af/doc/images/img-unity-scene_ar.png -------------------------------------------------------------------------------- /doc/images/img-unity-scene_mbt-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lagadic/visp_unity/85fc07437924bdd4487efafb6edc28d0c7a1d9af/doc/images/img-unity-scene_mbt-settings.png -------------------------------------------------------------------------------- /doc/images/img-unity-scene_mbt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lagadic/visp_unity/85fc07437924bdd4487efafb6edc28d0c7a1d9af/doc/images/img-unity-scene_mbt.png -------------------------------------------------------------------------------- /doc/images/img-unity-scenes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lagadic/visp_unity/85fc07437924bdd4487efafb6edc28d0c7a1d9af/doc/images/img-unity-scenes.png -------------------------------------------------------------------------------- /examples/blob/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(test-blob) 2 | 3 | cmake_minimum_required(VERSION 3.0) 4 | 5 | find_package(VISP REQUIRED visp_core visp_blob visp_sensor visp_gui visp_vision) 6 | 7 | include_directories(${VISP_INCLUDE_DIRS}) 8 | 9 | add_executable(test-blob-opencv test-blob-opencv.cpp) 10 | target_link_libraries(test-blob-opencv ${VISP_LIBRARIES}) 11 | 12 | add_executable(test-blob-v4l2 test-blob-v4l2.cpp) 13 | target_link_libraries(test-blob-v4l2 ${VISP_LIBRARIES}) 14 | 15 | -------------------------------------------------------------------------------- /examples/blob/test-blob-opencv.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | /* 9 | This example detects blobs in an image acquired by an usb camera. 10 | When 4 blobs are detected, we compute the pose of the target wrt the camera. 11 | 12 | See tutorials: 13 | - http://visp-doc.inria.fr/doxygen/visp-daily/tutorial-grabber.html 14 | - http://visp-doc.inria.fr/doxygen/visp-daily/tutorial-tracking-blob.html#tracking_blob_auto 15 | - http://visp-doc.inria.fr/doxygen/visp-daily/tutorial-pose-estimation.html 16 | */ 17 | void computePose(std::vector &point, const std::list &dot, 18 | const vpCameraParameters &cam, bool init, vpHomogeneousMatrix &cMo) 19 | { 20 | vpPose pose; 21 | double x=0, y=0; 22 | unsigned int i = 0; 23 | for (std::list::const_iterator it=dot.begin(); it != dot.end(); ++it) { 24 | vpPixelMeterConversion::convertPoint(cam, (*it).getCog(), x, y); 25 | point[i].set_x(x); 26 | point[i].set_y(y); 27 | pose.addPoint(point[i]); 28 | i++; 29 | } 30 | 31 | if (init == true) { 32 | vpHomogeneousMatrix cMo_dem; 33 | vpHomogeneousMatrix cMo_lag; 34 | pose.computePose(vpPose::DEMENTHON, cMo_dem); 35 | pose.computePose(vpPose::LAGRANGE, cMo_lag); 36 | double residual_dem = pose.computeResidual(cMo_dem); 37 | double residual_lag = pose.computeResidual(cMo_lag); 38 | if (residual_dem < residual_lag) 39 | cMo = cMo_dem; 40 | else 41 | cMo = cMo_lag; 42 | } 43 | pose.computePose(vpPose::VIRTUAL_VS, cMo); 44 | } 45 | 46 | 47 | /*! 48 | Usage : 49 | To get the help : ./tutorial-grabber-v4l2 --help 50 | To set the device : ./tutorial-grabber-v4l2 --device 1 (to use /dev/video1) 51 | To subsample images: ./tutorial-grabber-v4l2 --scale 2 52 | */ 53 | int main(int argc, const char* argv[]) 54 | { 55 | #ifdef VISP_HAVE_OPENCV 56 | try { 57 | unsigned int opt_device = 0; 58 | unsigned int opt_scale = 2; // Default value is 2 in the constructor. Turn it to 1 to avoid subsampling 59 | 60 | for (int i=0; i] [--scale ] [--help]" << std::endl; 67 | return 0; 68 | } 69 | } 70 | 71 | cv::VideoCapture cap(opt_device); // open the default camera 72 | if (!cap.isOpened()) { // check if we succeeded 73 | std::cout << "Failed to open the camera" << std::endl; 74 | return -1; 75 | } 76 | 77 | // trick to rescale image to be able to acquire 320x240 images 78 | double cap_width = cap.get(cv::CAP_PROP_FRAME_WIDTH); 79 | double cap_height = cap.get(cv::CAP_PROP_FRAME_HEIGHT); 80 | std::cout << "Capture width: " << cap_width << std::endl; 81 | std::cout << "Capture height: " << cap_height << std::endl; 82 | int scale_width = (int)(cap_width / 320.); 83 | int scale_height = (int)(cap_height / 240.); 84 | int scale = std::max(scale_width, scale_height); 85 | if (scale > 1) { 86 | cap.set(cv::CAP_PROP_FRAME_WIDTH, cap_width / scale); 87 | cap.set(cv::CAP_PROP_FRAME_HEIGHT, cap_height / scale); 88 | } 89 | 90 | cv::Mat frame; 91 | int i = 0; 92 | while ((i++ < 100) && !cap.read(frame)) {}; // warm up camera by skiping unread frames 93 | 94 | vpImage I; 95 | vpImageConvert::convert(frame, I); 96 | 97 | std::cout << "Image size: " << I.getWidth() << " " << I.getHeight() << std::endl; 98 | 99 | vpDisplayOpenCV d(I); 100 | 101 | if (0) { // code used to learn the characteristics of a blob that we want to retrieve auto;atically 102 | vpDot2 blob; 103 | cap >> frame; // get a new frame from camera 104 | // Convert the image in ViSP format and display it 105 | vpImageConvert::convert(frame, I); 106 | vpDisplay::display(I); 107 | vpDisplay::flush(I); 108 | 109 | // Learn the characteristics of the blob to auto detect 110 | blob.setGraphics(true); 111 | blob.setGraphicsThickness(1); 112 | blob.initTracking(I); 113 | blob.track(I); 114 | std::cout << "Blob characteristics: " << std::endl; 115 | std::cout << " width : " << blob.getWidth() << std::endl; 116 | std::cout << " height: " << blob.getHeight() << std::endl; 117 | #if VISP_VERSION_INT > VP_VERSION_INT(2,7,0) 118 | std::cout << " area: " << blob.getArea() << std::endl; 119 | #endif 120 | std::cout << " gray level min: " << blob.getGrayLevelMin() << std::endl; 121 | std::cout << " gray level max: " << blob.getGrayLevelMax() << std::endl; 122 | std::cout << " grayLevelPrecision: " << blob.getGrayLevelPrecision() << std::endl; 123 | std::cout << " sizePrecision: " << blob.getSizePrecision() << std::endl; 124 | std::cout << " ellipsoidShapePrecision: " << blob.getEllipsoidShapePrecision() << std::endl; 125 | return EXIT_SUCCESS; 126 | // Produces the following output on 4.5cm diameter black dot at 30cm from an usb sphere camera 127 | /* 128 | Image size: 320 240 129 | Blob characteristics: 130 | width : 38 131 | height: 35 132 | area: 977.5 133 | gray level min: 26 134 | gray level max: 123 135 | grayLevelPrecision: 0.8 136 | sizePrecision: 0.65 137 | ellipsoidShapePrecision: 0.65 138 | */ 139 | } 140 | 141 | vpDot2 blob; 142 | blob.setWidth(40); 143 | blob.setHeight(40); 144 | blob.setArea(1000); 145 | blob.setGrayLevelMin(0); 146 | blob.setGrayLevelMax(150); 147 | blob.setSizePrecision(0.65); 148 | blob.setEllipsoidShapePrecision(0.65); 149 | 150 | // Define the 3D model of a target defined by 4 blobs arranged as a square 151 | std::vector point; 152 | point.push_back( vpPoint(-0.06, -0.06, 0) ); 153 | point.push_back( vpPoint( 0.06, -0.06, 0) ); 154 | point.push_back( vpPoint( 0.06, 0.06, 0) ); 155 | point.push_back( vpPoint(-0.06, 0.06, 0) ); 156 | vpHomogeneousMatrix cMo; 157 | 158 | // Define the camera parameters (should be obtained by calibration) 159 | vpCameraParameters cam(840, 840, I.getWidth()/2, I.getHeight()/2); 160 | 161 | bool pose_init = true; 162 | 163 | while(1) { 164 | cap >> frame; // get a new frame from camera 165 | // Convert the image in ViSP format and display it 166 | vpImageConvert::convert(frame, I); 167 | vpDisplay::display(I); 168 | vpDisplay::displayText(I, 10, 10, "A click to quit", vpColor::red); 169 | std::list blob_list; 170 | blob.searchDotsInArea(I, 0, 0, I.getWidth(), I.getHeight(), blob_list); 171 | 172 | std::cout << "Found " << blob_list.size() << " blob(s)" << std::endl; 173 | 174 | // track the blobs that are found (could be skiped) 175 | for(std::list::iterator it=blob_list.begin(); it != blob_list.end(); ++it) { 176 | (*it).setGraphics(true); 177 | (*it).setGraphicsThickness(3); 178 | (*it).track(I); 179 | } 180 | 181 | // Compute pose from 4 blobs 182 | if (blob_list.size() == 4) { 183 | computePose(point, blob_list, cam, pose_init, cMo); 184 | vpDisplay::displayFrame(I, cMo, cam, 0.05, vpColor::none); 185 | pose_init = false; 186 | } 187 | else { 188 | pose_init = true; 189 | } 190 | 191 | vpDisplay::flush(I); 192 | if (vpDisplay::getClick(I, false)) break; 193 | } 194 | return EXIT_SUCCESS; 195 | } 196 | catch(vpException &e) { 197 | std::cout << "Catch an exception: " << e << std::endl; 198 | return EXIT_FAILURE; 199 | } 200 | #else 201 | (void)argc; 202 | (void)argv; 203 | 204 | std::cout << "ViSP is not build with OpenCV as 3rd party..." << std::endl; 205 | #endif 206 | } 207 | -------------------------------------------------------------------------------- /examples/blob/test-blob-v4l2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | /* 9 | This example detects blobs in an image acquired by an usb camera. 10 | When 4 blobs are detected, we compute the pose of the target wrt the camera. 11 | 12 | See tutorials: 13 | - http://visp-doc.inria.fr/doxygen/visp-daily/tutorial-grabber.html 14 | - http://visp-doc.inria.fr/doxygen/visp-daily/tutorial-tracking-blob.html#tracking_blob_auto 15 | - http://visp-doc.inria.fr/doxygen/visp-daily/tutorial-pose-estimation.html 16 | */ 17 | void computePose(std::vector &point, const std::list &dot, 18 | const vpCameraParameters &cam, bool init, vpHomogeneousMatrix &cMo) 19 | { 20 | vpPose pose; 21 | double x=0, y=0; 22 | unsigned int i = 0; 23 | for (std::list::const_iterator it=dot.begin(); it != dot.end(); ++it) { 24 | vpPixelMeterConversion::convertPoint(cam, (*it).getCog(), x, y); 25 | point[i].set_x(x); 26 | point[i].set_y(y); 27 | pose.addPoint(point[i]); 28 | i++; 29 | } 30 | 31 | if (init == true) { 32 | vpHomogeneousMatrix cMo_dem; 33 | vpHomogeneousMatrix cMo_lag; 34 | pose.computePose(vpPose::DEMENTHON, cMo_dem); 35 | pose.computePose(vpPose::LAGRANGE, cMo_lag); 36 | double residual_dem = pose.computeResidual(cMo_dem); 37 | double residual_lag = pose.computeResidual(cMo_lag); 38 | if (residual_dem < residual_lag) 39 | cMo = cMo_dem; 40 | else 41 | cMo = cMo_lag; 42 | } 43 | pose.computePose(vpPose::VIRTUAL_VS, cMo); 44 | } 45 | 46 | 47 | /*! 48 | Usage : 49 | To get the help : ./tutorial-grabber-v4l2 --help 50 | To set the device : ./tutorial-grabber-v4l2 --device 1 (to use /dev/video1) 51 | To subsample images: ./tutorial-grabber-v4l2 --scale 2 52 | */ 53 | int main(int argc, const char* argv[]) 54 | { 55 | #ifdef VISP_HAVE_V4L2 56 | try { 57 | unsigned int opt_device = 0; 58 | unsigned int opt_scale = 2; // Default value is 2 in the constructor. Turn it to 1 to avoid subsampling 59 | 60 | for (int i=0; i] [--scale ] [--help]" << std::endl; 67 | return 0; 68 | } 69 | } 70 | 71 | vpImage I; 72 | 73 | vpV4l2Grabber g; 74 | std::ostringstream device; 75 | device << "/dev/video" << opt_device; 76 | g.setDevice(device.str()); 77 | g.setScale(opt_scale); 78 | g.open(I); 79 | 80 | std::cout << "Image size: " << I.getWidth() << " " << I.getHeight() << std::endl; 81 | 82 | #ifdef VISP_HAVE_X11 83 | vpDisplayX d(I); 84 | #else 85 | std::cout << "No image viewer is available..." << std::endl; 86 | #endif 87 | 88 | if (0) { // code used to learn the characteristics of a blob that we want to retrieve auto;atically 89 | vpDot2 blob; 90 | for(int i=0; i<10;i++) 91 | g.acquire(I); 92 | vpDisplay::display(I); 93 | vpDisplay::flush(I); 94 | 95 | // Learn the characteristics of the blob to auto detect 96 | blob.setGraphics(true); 97 | blob.setGraphicsThickness(1); 98 | blob.initTracking(I); 99 | blob.track(I); 100 | std::cout << "Blob characteristics: " << std::endl; 101 | std::cout << " width : " << blob.getWidth() << std::endl; 102 | std::cout << " height: " << blob.getHeight() << std::endl; 103 | #if VISP_VERSION_INT > VP_VERSION_INT(2,7,0) 104 | std::cout << " area: " << blob.getArea() << std::endl; 105 | #endif 106 | std::cout << " gray level min: " << blob.getGrayLevelMin() << std::endl; 107 | std::cout << " gray level max: " << blob.getGrayLevelMax() << std::endl; 108 | std::cout << " grayLevelPrecision: " << blob.getGrayLevelPrecision() << std::endl; 109 | std::cout << " sizePrecision: " << blob.getSizePrecision() << std::endl; 110 | std::cout << " ellipsoidShapePrecision: " << blob.getEllipsoidShapePrecision() << std::endl; 111 | return EXIT_SUCCESS; 112 | // Produces the following output on 4.5cm diameter black dot at 30cm from an usb sphere camera 113 | /* 114 | Image size: 320 240 115 | Blob characteristics: 116 | width : 38 117 | height: 35 118 | area: 977.5 119 | gray level min: 26 120 | gray level max: 123 121 | grayLevelPrecision: 0.8 122 | sizePrecision: 0.65 123 | ellipsoidShapePrecision: 0.65 124 | */ 125 | } 126 | 127 | vpDot2 blob; 128 | blob.setWidth(40); 129 | blob.setHeight(40); 130 | blob.setArea(1000); 131 | blob.setGrayLevelMin(0); 132 | blob.setGrayLevelMax(150); 133 | blob.setSizePrecision(0.65); 134 | blob.setEllipsoidShapePrecision(0.65); 135 | 136 | // Define the 3D model of a target defined by 4 blobs arranged as a square 137 | std::vector point; 138 | point.push_back( vpPoint(-0.06, -0.06, 0) ); 139 | point.push_back( vpPoint( 0.06, -0.06, 0) ); 140 | point.push_back( vpPoint( 0.06, 0.06, 0) ); 141 | point.push_back( vpPoint(-0.06, 0.06, 0) ); 142 | vpHomogeneousMatrix cMo; 143 | 144 | // Define the camera parameters (should be obtained by calibration) 145 | vpCameraParameters cam(840, 840, I.getWidth()/2, I.getHeight()/2); 146 | 147 | bool pose_init = true; 148 | 149 | while(1) { 150 | g.acquire(I); 151 | vpDisplay::display(I); 152 | vpDisplay::displayText(I, 10, 10, "A click to quit", vpColor::red); 153 | std::list blob_list; 154 | blob.searchDotsInArea(I, 0, 0, I.getWidth(), I.getHeight(), blob_list); 155 | 156 | std::cout << "Found " << blob_list.size() << " blob(s)" << std::endl; 157 | 158 | // track the blobs that are found (could be skiped) 159 | for(std::list::iterator it=blob_list.begin(); it != blob_list.end(); ++it) { 160 | (*it).setGraphics(true); 161 | (*it).setGraphicsThickness(3); 162 | (*it).track(I); 163 | } 164 | 165 | // Compute pose from 4 blobs 166 | if (blob_list.size() == 4) { 167 | computePose(point, blob_list, cam, pose_init, cMo); 168 | vpDisplay::displayFrame(I, cMo, cam, 0.05, vpColor::none); 169 | pose_init = false; 170 | } 171 | else { 172 | pose_init = true; 173 | } 174 | 175 | vpDisplay::flush(I); 176 | if (vpDisplay::getClick(I, false)) break; 177 | } 178 | return EXIT_SUCCESS; 179 | } 180 | catch(vpException &e) { 181 | std::cout << "Catch an exception: " << e << std::endl; 182 | return EXIT_FAILURE; 183 | } 184 | #else 185 | (void)argc; 186 | (void)argv; 187 | #endif 188 | } 189 | -------------------------------------------------------------------------------- /unityProject/.gitignore: -------------------------------------------------------------------------------- 1 | -/[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /Assets/AssetStoreTools* 7 | 8 | # Visual Studio 2015 cache directory 9 | /.vs/ 10 | 11 | # Autogenerated VS/MD/Consulo solution and project files 12 | ExportedObj/ 13 | .consulo/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.pdb 25 | 26 | # Unity3D generated meta files 27 | *.pidb.meta 28 | 29 | # Unity3D Generated File On Crash Reports 30 | sysinfo.txt 31 | 32 | # Builds 33 | *.apk 34 | *.unitypackage 35 | 36 | # Plugins we develop, frequently changing 37 | /Assets/plugins/ -------------------------------------------------------------------------------- /unityProject/.vs/UnityProject/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lagadic/visp_unity/85fc07437924bdd4487efafb6edc28d0c7a1d9af/unityProject/.vs/UnityProject/v14/.suo -------------------------------------------------------------------------------- /unityProject/Assets/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a8b7196a30cc5b479c61c8a30f08a2c 3 | folderAsset: yes 4 | timeCreated: 1531375891 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /unityProject/Assets/Materials/CubeMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: CubeMaterial 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 1, g: 0, b: 0, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /unityProject/Assets/Materials/CubeMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27c06bc4f47c95b45a651b2bad53924b 3 | timeCreated: 1531303957 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 2100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /unityProject/Assets/Materials/LineMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: LineMaterial 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 0, g: 1, b: 0.91724133, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /unityProject/Assets/Materials/LineMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b62b0bdc600007438488e1d388f7c1d 3 | timeCreated: 1519902907 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /unityProject/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 496ab96368abb4846919bda3cedfcda1 3 | folderAsset: yes 4 | timeCreated: 1531375902 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /unityProject/Assets/Scenes/scene_ar.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641275, b: 0.5748172, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 10 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_FinalGather: 0 70 | m_FinalGatherFiltering: 1 71 | m_FinalGatherRayCount: 256 72 | m_ReflectionCompression: 2 73 | m_MixedBakeMode: 2 74 | m_BakeBackend: 0 75 | m_PVRSampling: 1 76 | m_PVRDirectSampleCount: 32 77 | m_PVRSampleCount: 500 78 | m_PVRBounces: 2 79 | m_PVRFilterTypeDirect: 0 80 | m_PVRFilterTypeIndirect: 0 81 | m_PVRFilterTypeAO: 0 82 | m_PVRFilteringMode: 1 83 | m_PVRCulling: 1 84 | m_PVRFilteringGaussRadiusDirect: 1 85 | m_PVRFilteringGaussRadiusIndirect: 5 86 | m_PVRFilteringGaussRadiusAO: 2 87 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 88 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 89 | m_PVRFilteringAtrousPositionSigmaAO: 1 90 | m_ShowResolutionOverlay: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &139875282 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 139875283} 124 | m_Layer: 0 125 | m_Name: Cube_pivot 126 | m_TagString: Cube_pivot 127 | m_Icon: {fileID: 0} 128 | m_NavMeshLayer: 0 129 | m_StaticEditorFlags: 0 130 | m_IsActive: 1 131 | --- !u!4 &139875283 132 | Transform: 133 | m_ObjectHideFlags: 0 134 | m_CorrespondingSourceObject: {fileID: 0} 135 | m_PrefabInstance: {fileID: 0} 136 | m_PrefabAsset: {fileID: 0} 137 | m_GameObject: {fileID: 139875282} 138 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 139 | m_LocalPosition: {x: 0, y: 0, z: 0} 140 | m_LocalScale: {x: 1, y: 1, z: 1} 141 | m_Children: 142 | - {fileID: 1533144828} 143 | m_Father: {fileID: 0} 144 | m_RootOrder: 3 145 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 146 | --- !u!1 &331354800 147 | GameObject: 148 | m_ObjectHideFlags: 0 149 | m_CorrespondingSourceObject: {fileID: 0} 150 | m_PrefabInstance: {fileID: 0} 151 | m_PrefabAsset: {fileID: 0} 152 | serializedVersion: 6 153 | m_Component: 154 | - component: {fileID: 331354804} 155 | - component: {fileID: 331354803} 156 | - component: {fileID: 331354802} 157 | - component: {fileID: 331354801} 158 | m_Layer: 0 159 | m_Name: Main Camera 160 | m_TagString: MainCamera 161 | m_Icon: {fileID: 0} 162 | m_NavMeshLayer: 0 163 | m_StaticEditorFlags: 0 164 | m_IsActive: 1 165 | --- !u!81 &331354801 166 | AudioListener: 167 | m_ObjectHideFlags: 0 168 | m_CorrespondingSourceObject: {fileID: 0} 169 | m_PrefabInstance: {fileID: 0} 170 | m_PrefabAsset: {fileID: 0} 171 | m_GameObject: {fileID: 331354800} 172 | m_Enabled: 1 173 | --- !u!124 &331354802 174 | Behaviour: 175 | m_ObjectHideFlags: 0 176 | m_CorrespondingSourceObject: {fileID: 0} 177 | m_PrefabInstance: {fileID: 0} 178 | m_PrefabAsset: {fileID: 0} 179 | m_GameObject: {fileID: 331354800} 180 | m_Enabled: 1 181 | --- !u!20 &331354803 182 | Camera: 183 | m_ObjectHideFlags: 0 184 | m_CorrespondingSourceObject: {fileID: 0} 185 | m_PrefabInstance: {fileID: 0} 186 | m_PrefabAsset: {fileID: 0} 187 | m_GameObject: {fileID: 331354800} 188 | m_Enabled: 1 189 | serializedVersion: 2 190 | m_ClearFlags: 2 191 | m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} 192 | m_projectionMatrixMode: 1 193 | m_SensorSize: {x: 36, y: 24} 194 | m_LensShift: {x: 0, y: 0} 195 | m_GateFitMode: 2 196 | m_FocalLength: 50 197 | m_NormalizedViewPortRect: 198 | serializedVersion: 2 199 | x: 0 200 | y: 0 201 | width: 1 202 | height: 1 203 | near clip plane: 0.3 204 | far clip plane: 1000 205 | field of view: 100 206 | orthographic: 1 207 | orthographic size: 5 208 | m_Depth: -1 209 | m_CullingMask: 210 | serializedVersion: 2 211 | m_Bits: 4294967295 212 | m_RenderingPath: -1 213 | m_TargetTexture: {fileID: 0} 214 | m_TargetDisplay: 0 215 | m_TargetEye: 3 216 | m_HDR: 1 217 | m_AllowMSAA: 1 218 | m_AllowDynamicResolution: 0 219 | m_ForceIntoRT: 0 220 | m_OcclusionCulling: 1 221 | m_StereoConvergence: 10 222 | m_StereoSeparation: 0.022 223 | --- !u!4 &331354804 224 | Transform: 225 | m_ObjectHideFlags: 0 226 | m_CorrespondingSourceObject: {fileID: 0} 227 | m_PrefabInstance: {fileID: 0} 228 | m_PrefabAsset: {fileID: 0} 229 | m_GameObject: {fileID: 331354800} 230 | m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} 231 | m_LocalPosition: {x: 0, y: 0, z: 0} 232 | m_LocalScale: {x: 1, y: 1, z: 1} 233 | m_Children: [] 234 | m_Father: {fileID: 0} 235 | m_RootOrder: 0 236 | m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} 237 | --- !u!1 &1063809645 238 | GameObject: 239 | m_ObjectHideFlags: 0 240 | m_CorrespondingSourceObject: {fileID: 0} 241 | m_PrefabInstance: {fileID: 0} 242 | m_PrefabAsset: {fileID: 0} 243 | serializedVersion: 6 244 | m_Component: 245 | - component: {fileID: 1063809650} 246 | - component: {fileID: 1063809649} 247 | - component: {fileID: 1063809648} 248 | - component: {fileID: 1063809647} 249 | - component: {fileID: 1063809646} 250 | m_Layer: 0 251 | m_Name: Plane 252 | m_TagString: Untagged 253 | m_Icon: {fileID: 0} 254 | m_NavMeshLayer: 0 255 | m_StaticEditorFlags: 0 256 | m_IsActive: 1 257 | --- !u!114 &1063809646 258 | MonoBehaviour: 259 | m_ObjectHideFlags: 0 260 | m_CorrespondingSourceObject: {fileID: 0} 261 | m_PrefabInstance: {fileID: 0} 262 | m_PrefabAsset: {fileID: 0} 263 | m_GameObject: {fileID: 1063809645} 264 | m_Enabled: 1 265 | m_EditorHideFlags: 0 266 | m_Script: {fileID: 11500000, guid: 47996b32f03cc504f805edab8767f594, type: 3} 267 | m_Name: 268 | m_EditorClassIdentifier: 269 | camera_id: 0 270 | cam_px: 600 271 | cam_py: 600 272 | cam_u0: 345 273 | cam_v0: 240 274 | tag_size: 0.048 275 | quad_decimate: 1 276 | nthreads: 1 277 | debug_display: 1 278 | --- !u!23 &1063809647 279 | MeshRenderer: 280 | m_ObjectHideFlags: 0 281 | m_CorrespondingSourceObject: {fileID: 0} 282 | m_PrefabInstance: {fileID: 0} 283 | m_PrefabAsset: {fileID: 0} 284 | m_GameObject: {fileID: 1063809645} 285 | m_Enabled: 1 286 | m_CastShadows: 1 287 | m_ReceiveShadows: 1 288 | m_DynamicOccludee: 1 289 | m_MotionVectors: 1 290 | m_LightProbeUsage: 1 291 | m_ReflectionProbeUsage: 1 292 | m_RenderingLayerMask: 1 293 | m_RendererPriority: 0 294 | m_Materials: 295 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 296 | m_StaticBatchInfo: 297 | firstSubMesh: 0 298 | subMeshCount: 0 299 | m_StaticBatchRoot: {fileID: 0} 300 | m_ProbeAnchor: {fileID: 0} 301 | m_LightProbeVolumeOverride: {fileID: 0} 302 | m_ScaleInLightmap: 1 303 | m_PreserveUVs: 1 304 | m_IgnoreNormalsForChartDetection: 0 305 | m_ImportantGI: 0 306 | m_StitchLightmapSeams: 0 307 | m_SelectedEditorRenderState: 3 308 | m_MinimumChartSize: 4 309 | m_AutoUVMaxDistance: 0.5 310 | m_AutoUVMaxAngle: 89 311 | m_LightmapParameters: {fileID: 0} 312 | m_SortingLayerID: 0 313 | m_SortingLayer: 0 314 | m_SortingOrder: 0 315 | --- !u!64 &1063809648 316 | MeshCollider: 317 | m_ObjectHideFlags: 0 318 | m_CorrespondingSourceObject: {fileID: 0} 319 | m_PrefabInstance: {fileID: 0} 320 | m_PrefabAsset: {fileID: 0} 321 | m_GameObject: {fileID: 1063809645} 322 | m_Material: {fileID: 0} 323 | m_IsTrigger: 0 324 | m_Enabled: 1 325 | serializedVersion: 3 326 | m_Convex: 0 327 | m_CookingOptions: 14 328 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 329 | --- !u!33 &1063809649 330 | MeshFilter: 331 | m_ObjectHideFlags: 0 332 | m_CorrespondingSourceObject: {fileID: 0} 333 | m_PrefabInstance: {fileID: 0} 334 | m_PrefabAsset: {fileID: 0} 335 | m_GameObject: {fileID: 1063809645} 336 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 337 | --- !u!4 &1063809650 338 | Transform: 339 | m_ObjectHideFlags: 0 340 | m_CorrespondingSourceObject: {fileID: 0} 341 | m_PrefabInstance: {fileID: 0} 342 | m_PrefabAsset: {fileID: 0} 343 | m_GameObject: {fileID: 1063809645} 344 | m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} 345 | m_LocalPosition: {x: 0, y: 0, z: -20} 346 | m_LocalScale: {x: 1, y: 1, z: 1} 347 | m_Children: [] 348 | m_Father: {fileID: 0} 349 | m_RootOrder: 2 350 | m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} 351 | --- !u!1 &1533144824 352 | GameObject: 353 | m_ObjectHideFlags: 0 354 | m_CorrespondingSourceObject: {fileID: 0} 355 | m_PrefabInstance: {fileID: 0} 356 | m_PrefabAsset: {fileID: 0} 357 | serializedVersion: 6 358 | m_Component: 359 | - component: {fileID: 1533144828} 360 | - component: {fileID: 1533144827} 361 | - component: {fileID: 1533144826} 362 | - component: {fileID: 1533144825} 363 | m_Layer: 0 364 | m_Name: Cube 365 | m_TagString: Cube 366 | m_Icon: {fileID: 0} 367 | m_NavMeshLayer: 0 368 | m_StaticEditorFlags: 0 369 | m_IsActive: 1 370 | --- !u!23 &1533144825 371 | MeshRenderer: 372 | m_ObjectHideFlags: 0 373 | m_CorrespondingSourceObject: {fileID: 0} 374 | m_PrefabInstance: {fileID: 0} 375 | m_PrefabAsset: {fileID: 0} 376 | m_GameObject: {fileID: 1533144824} 377 | m_Enabled: 1 378 | m_CastShadows: 1 379 | m_ReceiveShadows: 1 380 | m_DynamicOccludee: 1 381 | m_MotionVectors: 1 382 | m_LightProbeUsage: 1 383 | m_ReflectionProbeUsage: 1 384 | m_RenderingLayerMask: 1 385 | m_RendererPriority: 0 386 | m_Materials: 387 | - {fileID: 2100000, guid: 27c06bc4f47c95b45a651b2bad53924b, type: 2} 388 | m_StaticBatchInfo: 389 | firstSubMesh: 0 390 | subMeshCount: 0 391 | m_StaticBatchRoot: {fileID: 0} 392 | m_ProbeAnchor: {fileID: 0} 393 | m_LightProbeVolumeOverride: {fileID: 0} 394 | m_ScaleInLightmap: 1 395 | m_PreserveUVs: 1 396 | m_IgnoreNormalsForChartDetection: 0 397 | m_ImportantGI: 0 398 | m_StitchLightmapSeams: 0 399 | m_SelectedEditorRenderState: 3 400 | m_MinimumChartSize: 4 401 | m_AutoUVMaxDistance: 0.5 402 | m_AutoUVMaxAngle: 89 403 | m_LightmapParameters: {fileID: 0} 404 | m_SortingLayerID: 0 405 | m_SortingLayer: 0 406 | m_SortingOrder: 0 407 | --- !u!65 &1533144826 408 | BoxCollider: 409 | m_ObjectHideFlags: 0 410 | m_CorrespondingSourceObject: {fileID: 0} 411 | m_PrefabInstance: {fileID: 0} 412 | m_PrefabAsset: {fileID: 0} 413 | m_GameObject: {fileID: 1533144824} 414 | m_Material: {fileID: 0} 415 | m_IsTrigger: 0 416 | m_Enabled: 1 417 | serializedVersion: 2 418 | m_Size: {x: 1, y: 1, z: 1} 419 | m_Center: {x: 0, y: 0, z: 0} 420 | --- !u!33 &1533144827 421 | MeshFilter: 422 | m_ObjectHideFlags: 0 423 | m_CorrespondingSourceObject: {fileID: 0} 424 | m_PrefabInstance: {fileID: 0} 425 | m_PrefabAsset: {fileID: 0} 426 | m_GameObject: {fileID: 1533144824} 427 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 428 | --- !u!4 &1533144828 429 | Transform: 430 | m_ObjectHideFlags: 0 431 | m_CorrespondingSourceObject: {fileID: 0} 432 | m_PrefabInstance: {fileID: 0} 433 | m_PrefabAsset: {fileID: 0} 434 | m_GameObject: {fileID: 1533144824} 435 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 436 | m_LocalPosition: {x: 0.5, y: 0, z: 0} 437 | m_LocalScale: {x: 1, y: 1, z: 1} 438 | m_Children: [] 439 | m_Father: {fileID: 139875283} 440 | m_RootOrder: 0 441 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 442 | --- !u!1 &1956072303 443 | GameObject: 444 | m_ObjectHideFlags: 0 445 | m_CorrespondingSourceObject: {fileID: 0} 446 | m_PrefabInstance: {fileID: 0} 447 | m_PrefabAsset: {fileID: 0} 448 | serializedVersion: 6 449 | m_Component: 450 | - component: {fileID: 1956072305} 451 | - component: {fileID: 1956072304} 452 | m_Layer: 0 453 | m_Name: Directional Light 454 | m_TagString: Untagged 455 | m_Icon: {fileID: 0} 456 | m_NavMeshLayer: 0 457 | m_StaticEditorFlags: 0 458 | m_IsActive: 1 459 | --- !u!108 &1956072304 460 | Light: 461 | m_ObjectHideFlags: 0 462 | m_CorrespondingSourceObject: {fileID: 0} 463 | m_PrefabInstance: {fileID: 0} 464 | m_PrefabAsset: {fileID: 0} 465 | m_GameObject: {fileID: 1956072303} 466 | m_Enabled: 1 467 | serializedVersion: 8 468 | m_Type: 1 469 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 470 | m_Intensity: 1 471 | m_Range: 10 472 | m_SpotAngle: 30 473 | m_CookieSize: 10 474 | m_Shadows: 475 | m_Type: 2 476 | m_Resolution: -1 477 | m_CustomResolution: -1 478 | m_Strength: 1 479 | m_Bias: 0.05 480 | m_NormalBias: 0.4 481 | m_NearPlane: 0.2 482 | m_Cookie: {fileID: 0} 483 | m_DrawHalo: 0 484 | m_Flare: {fileID: 0} 485 | m_RenderMode: 0 486 | m_CullingMask: 487 | serializedVersion: 2 488 | m_Bits: 4294967295 489 | m_Lightmapping: 4 490 | m_LightShadowCasterMode: 0 491 | m_AreaSize: {x: 1, y: 1} 492 | m_BounceIntensity: 1 493 | m_ColorTemperature: 6570 494 | m_UseColorTemperature: 0 495 | m_ShadowRadius: 0 496 | m_ShadowAngle: 0 497 | --- !u!4 &1956072305 498 | Transform: 499 | m_ObjectHideFlags: 0 500 | m_CorrespondingSourceObject: {fileID: 0} 501 | m_PrefabInstance: {fileID: 0} 502 | m_PrefabAsset: {fileID: 0} 503 | m_GameObject: {fileID: 1956072303} 504 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 505 | m_LocalPosition: {x: 0, y: 3, z: 0} 506 | m_LocalScale: {x: 1, y: 1, z: 1} 507 | m_Children: [] 508 | m_Father: {fileID: 0} 509 | m_RootOrder: 1 510 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 511 | -------------------------------------------------------------------------------- /unityProject/Assets/Scenes/scene_ar.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74cf63aacff5c438abb38d26c7ecf541 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unityProject/Assets/Scenes/scene_mbt.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0fdb2f9c90ca493b99dde74334e88f1 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unityProject/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90a8bfbdac044124dbd1895852111ee3 3 | folderAsset: yes 4 | timeCreated: 1531375914 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /unityProject/Assets/Scripts/Script_ar.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ViSP, open source Visual Servoing Platform software. 4 | * Copyright (C) 2005 - 2020 by Inria. All rights reserved. 5 | * 6 | * This software is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * See the file LICENSE.txt at the root directory of this source 11 | * distribution for additional information about the GNU GPL. 12 | * 13 | * For using ViSP with software that can not be combined with the GNU 14 | * GPL, please contact Inria about acquiring a ViSP Professional 15 | * Edition License. 16 | * 17 | * See http://visp.inria.fr for more information. 18 | * 19 | * This software was developed at: 20 | * Inria Rennes - Bretagne Atlantique 21 | * Campus Universitaire de Beaulieu 22 | * 35042 Rennes Cedex 23 | * France 24 | * 25 | * If you have questions regarding the use of this file, please contact 26 | * Inria at visp@inria.fr 27 | * 28 | * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 29 | * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 30 | * 31 | * Description: 32 | * Unity application that shows how to use ViSPUnity plugin. 33 | * 34 | *****************************************************************************/ 35 | 36 | /*! 37 |  \example Script_ar.cs 38 |  Unity CSharp script that allows to detect and AprilTag and display a cube in Augmented Reality using ViSPUnity plugin. 39 | */ 40 | 41 | using System; 42 | using System.Collections; 43 | using System.Collections.Generic; 44 | using System.Runtime.InteropServices; 45 | using UnityEngine; 46 | using UnityEngine.UI; 47 | 48 | public class Script_ar : MonoBehaviour 49 | { 50 | // Functions imported FROM ViSPUnity wrapper (DLL on Windows, Bundle on OSX) 51 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_EnableDisplayForDebug")] 52 | public static extern void Visp_EnableDisplayForDebug(bool enable_display); 53 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_WrapperFreeMemory")] 54 | public static extern void Visp_WrapperFreeMemory(); 55 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_ImageUchar_SetFromColor32Array")] 56 | public static extern void Visp_ImageUchar_SetFromColor32Array(Color32[] bitmap, int height, int width); 57 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_CameraParameters_Init")] 58 | public static extern void Visp_CameraParameters_Init(double cam_px, double cam_py, double cam_u0, double cam_v0); 59 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_DetectorAprilTag_Init")] 60 | public static extern void Visp_DetectorAprilTag_Init(float quad_decimate, int nthreads); 61 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_DetectorAprilTag_Process")] 62 | public static extern bool Visp_DetectorAprilTag_Process(double tag_size, float[] tag_cog, float[] tag_length, float[] tag_cMo, double[] detection_time); 63 | 64 | public enum DebugType { 65 | Enabled, 66 | Disabled 67 | }; 68 | 69 | WebCamTexture m_webCamTexture; 70 | Renderer m_renderer; 71 | WebCamDevice[] m_devices; 72 | // Reference for GameObject Cube, that is to be moved on the plane 73 | GameObject m_cube; 74 | // Reference for GameObject Cube_pivot, that is to be rotated 75 | GameObject m_cube_pivot; 76 | 77 | // For storing tag characteristics returned by ViSPunity wrapper 78 | float[] m_tag_cog = new float[2]; 79 | float[] m_tag_length = new float[6]; 80 | float[] m_tag_cMo = new float[16]; 81 | double[] m_detection_time = new double[1]; 82 | 83 | bool m_wct_resolution_updated = false; 84 | float m_aspect_ratio; 85 | // For debug log 86 | bool m_log_start = true; 87 | bool m_log_process = true; 88 | 89 | //Quaternion m_baseRotation; 90 | 91 | [Header("Camera Identifier")] 92 | public int camera_id = 0; 93 | 94 | [Header("Camera Parameters")] //some default values provided 95 | public double cam_px = 600; 96 | public double cam_py = 600; 97 | public double cam_u0 = 320; 98 | public double cam_v0 = 240; 99 | 100 | [Header("Tag Size in [m]")] 101 | public double tag_size = 0.053; 102 | 103 | [Header("Tag Detection Settings")] 104 | public float quad_decimate = 1; 105 | public int nthreads = 1; 106 | 107 | [Header("Debugging Settings")] 108 | public Script_ar.DebugType debug_display = DebugType.Disabled; 109 | 110 | void Start() 111 | { 112 | m_devices = WebCamTexture.devices; 113 | 114 | if (m_devices.Length == 0) { 115 | throw new Exception("No camera device found"); 116 | } 117 | 118 | int max_id = m_devices.Length - 1; 119 | if (camera_id > max_id) { 120 | if (m_devices.Length == 1) { 121 | throw new Exception("Camera with id " + camera_id + " not found. camera_id value should be 0"); 122 | } 123 | else { 124 | throw new Exception("Camera with id " + camera_id + " not found. camera_id value should be between 0 and " + max_id.ToString()); 125 | } 126 | } 127 | 128 | m_webCamTexture = new WebCamTexture(WebCamTexture.devices[camera_id].name, 640, 480, 30); 129 | 130 | m_renderer = GetComponent(); 131 | m_renderer.material.mainTexture = m_webCamTexture; 132 | //m_baseRotation = transform.rotation; 133 | m_webCamTexture.Play(); //Start capturing image using webcam 134 | 135 | m_cube = GameObject.Find("Cube"); 136 | m_cube_pivot = GameObject.Find("Cube_pivot"); 137 | 138 | Visp_EnableDisplayForDebug((debug_display == DebugType.Enabled) ? true : false); 139 | // Initialize tag detection 140 | Visp_CameraParameters_Init(cam_px, cam_py, cam_u0, cam_v0); 141 | Visp_DetectorAprilTag_Init(quad_decimate, nthreads); 142 | 143 | // For debugging purposes, prints available devices to the console 144 | if(m_log_start) { 145 | for(int i = 0; i < m_devices.Length; i++) { 146 | Debug.Log("Webcam " + i + " available: " + m_devices[i].name); 147 | } 148 | Debug.Log("Device name: " + m_webCamTexture.deviceName); 149 | Debug.Log("Web Cam Texture Resolution init : " + m_webCamTexture.width + " " + m_webCamTexture.height); 150 | //Debug.Log("Screen resolution : " + Screen.currentResolution.width + " " + Screen.currentResolution.height); 151 | //Debug.Log("Base rotation : " + m_baseRotation); 152 | //Debug.Log("Video rotation angle: " + m_webCamTexture.videoRotationAngle); 153 | Debug.Log("Tag detection settings: quad_decimate=" + quad_decimate + " nthreads=" + nthreads); 154 | Debug.Log("Camera parameters: u0=" + cam_u0 + " v0=" + cam_v0 + " px=" + cam_px + " py=" + cam_py); 155 | Debug.Log("Tag size [m]: " + tag_size); 156 | } 157 | } 158 | 159 | /* 160 | When more than one camera is connected, create a square button on the top 161 | left part of the display that allows to change the device. 162 | */ 163 | void OnGUI() 164 | { 165 | if (m_devices.Length > 1) { 166 | if( GUI.Button( new Rect(0,0,100,100), "Switch\nto next\ncamera" )) { 167 | camera_id ++; 168 | int id = (camera_id % m_devices.Length); 169 | Debug.Log("Camera id: " + id); 170 | m_webCamTexture.Stop(); 171 | m_webCamTexture.deviceName = m_devices[id].name; 172 | Debug.Log("Switch to new device name: " + m_webCamTexture.deviceName); 173 | m_webCamTexture.Play(); 174 | } 175 | } 176 | } 177 | 178 | void Update() 179 | { 180 | if (m_webCamTexture == null) { 181 | return; 182 | } 183 | // Warmup camera to get an updated web cam texture resolution up to Update 184 | // On OSX, m_webCamTexture.width and m_webCamTexture.height returns always 16 for width and height. 185 | // After a couple of seconds, Web Cam Texture size is updated 186 | if (! m_wct_resolution_updated) { 187 | if (m_webCamTexture.width > 100 && m_webCamTexture.height > 100) { 188 | 189 | Debug.Log("Web Cam Texture Resolution: " + m_webCamTexture.width + " " + m_webCamTexture.height); 190 | 191 | m_wct_resolution_updated = true; 192 | 193 | // Change height and width of m_webCamTexture plane according to the camera resolution 194 | m_aspect_ratio = (float) m_webCamTexture.width / m_webCamTexture.height; 195 | transform.localScale = new Vector3(m_aspect_ratio, 1f, 1f); 196 | } 197 | else { 198 | return; 199 | } 200 | } 201 | 202 | //transform.rotation = m_baseRotation * Quaternion.AngleAxis(m_webCamTexture.videoRotationAngle, Vector3.up); 203 | 204 | if (m_log_start) { 205 | Debug.Log("Image size: " + m_webCamTexture.width + " x " + m_webCamTexture.height); 206 | m_log_start = false; 207 | } 208 | // Update image 209 | Visp_ImageUchar_SetFromColor32Array(m_webCamTexture.GetPixels32(), m_webCamTexture.height, m_webCamTexture.width); 210 | // Detect tag 211 | bool success = Visp_DetectorAprilTag_Process(tag_size, m_tag_cog, m_tag_length, m_tag_cMo, m_detection_time); 212 | 213 | if (success) { 214 | if (m_log_process) { 215 | Debug.Log("tag cog: " + m_tag_cog[0] + " " + m_tag_cog[1]); 216 | Debug.Log("tag length: " + m_tag_length[0] + " " + m_tag_length[1] + " " + m_tag_length[2] + " " + m_tag_length[3] + " " + m_tag_length[4] + " " + m_tag_length[5]); 217 | Debug.Log("cMo:\n" + m_tag_cMo[0] + " " + m_tag_cMo[1] + " " + m_tag_cMo[2] + " " + m_tag_cMo[3] + "\n" 218 | + m_tag_cMo[4] + " " + m_tag_cMo[5] + " " + m_tag_cMo[6] + " " + m_tag_cMo[7] + "\n" 219 | + m_tag_cMo[8] + " " + m_tag_cMo[9] + " " + m_tag_cMo[10] + " " + m_tag_cMo[11]); 220 | Debug.Log("Detection process time: " + m_detection_time[0] + " ms"); 221 | m_log_process = false; 222 | } 223 | 224 | // Height of m_webCamTexture plane remains fixed (10 units) but width = 10*m_aspect_ratio 225 | float x = -10f * m_aspect_ratio * (m_tag_cog[0] / m_webCamTexture.width - 1f / 2f); 226 | float y = -10f * (m_tag_cog[1] / m_webCamTexture.height - 1f / 2f); 227 | 228 | Vector3 vec = new Vector3(x, y, -9); 229 | 230 | // Show game objects 231 | m_cube.SetActive(true); 232 | m_cube_pivot.SetActive(true); 233 | 234 | // Change the coordinates of Cube by setting them equal to vector3 vec 235 | //m_cube.GetComponent().position = vec; 236 | m_cube_pivot.GetComponent().position = vec; 237 | 238 | // Comparing the value of diagonals of polygon: this is more accurate than comparing sides of bounding box. 239 | float max_dim = System.Math.Max(m_tag_length[4], m_tag_length[5]); 240 | 241 | // Scaling factor for Cube: {scale the cube by a factor of 10 if the value of side (diagonal/sqrt(2)) is 480} 242 | float scale = 10.0f / m_webCamTexture.height * max_dim / (float)Math.Sqrt(2); 243 | 244 | m_cube.GetComponent().localPosition = new Vector3(0.5f * scale, 0, 0); 245 | 246 | m_cube.transform.localScale = new Vector3(scale, scale, scale); 247 | 248 | Vector3 forward; 249 | forward.x = m_tag_cMo[0]; 250 | forward.y = m_tag_cMo[4]; 251 | forward.z = m_tag_cMo[8]; 252 | Vector3 upwards; 253 | upwards.x = m_tag_cMo[1]; 254 | upwards.y = m_tag_cMo[5]; 255 | upwards.z = m_tag_cMo[9]; 256 | 257 | m_cube_pivot.transform.rotation = Quaternion.LookRotation(forward, upwards); 258 | } 259 | else { 260 | // Hide game objects 261 | m_cube.SetActive(false); 262 | m_cube_pivot.SetActive(false); 263 | } 264 | } 265 | 266 | void OnApplicationQuit() 267 | { 268 | Visp_WrapperFreeMemory(); 269 | Debug.Log("Application ending after " + Time.time + " seconds"); 270 | } 271 | } 272 | -------------------------------------------------------------------------------- /unityProject/Assets/Scripts/Script_ar.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47996b32f03cc504f805edab8767f594 3 | timeCreated: 1531303991 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /unityProject/Assets/Scripts/Script_mbt.cs: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ViSP, open source Visual Servoing Platform software. 4 | * Copyright (C) 2005 - 2020 by Inria. All rights reserved. 5 | * 6 | * This software is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * See the file LICENSE.txt at the root directory of this source 11 | * distribution for additional information about the GNU GPL. 12 | * 13 | * For using ViSP with software that can not be combined with the GNU 14 | * GPL, please contact Inria about acquiring a ViSP Professional 15 | * Edition License. 16 | * 17 | * See http://visp.inria.fr for more information. 18 | * 19 | * This software was developed at: 20 | * Inria Rennes - Bretagne Atlantique 21 | * Campus Universitaire de Beaulieu 22 | * 35042 Rennes Cedex 23 | * France 24 | * 25 | * If you have questions regarding the use of this file, please contact 26 | * Inria at visp@inria.fr 27 | * 28 | * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 29 | * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 30 | * 31 | * Description: 32 | * Unity application that shows how to use ViSPUnity plugin. 33 | * 34 | *****************************************************************************/ 35 | 36 | /*! 37 |  \example Script_mbt.cs 38 |  Unity CSharp script that allows tracking a cube using ViSPUnity plugin. 39 | The cube has on one face an ArilTag. For optimal tracking the cube should be textured on the other faces. 40 | */ 41 | using System; 42 | using System.Collections; 43 | using System.Collections.Generic; 44 | using System.Runtime.InteropServices; 45 | using UnityEngine; 46 | using UnityEngine.UI; 47 | 48 | public class Script_mbt : MonoBehaviour 49 | { 50 | // Functions imported FROM ViSPUnity wrapper (DLL on Windows, Bundle on OSX) 51 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_EnableDisplayForDebug")] 52 | public static extern void Visp_EnableDisplayForDebug(bool enable_display); 53 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_WrapperFreeMemory")] 54 | public static extern void Visp_WrapperFreeMemory(); 55 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_ImageUchar_SetFromColor32Array")] 56 | public static extern void Visp_ImageUchar_SetFromColor32Array(Color32[] bitmap, int height, int width); 57 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_CameraParameters_Init")] 58 | public static extern void Visp_CameraParameters_Init(double cam_px, double cam_py, double cam_u0, double cam_v0); 59 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_DetectorAprilTag_Init")] 60 | public static extern void Visp_DetectorAprilTag_Init(float quad_decimate, int nthreads); 61 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_MbGenericTracker_CreateCaoFile")] 62 | public static extern void Visp_MbGenericTracker_CreateCaoFile(double cube_edge_size); 63 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_MbGenericTracker_SetFeatureType")] 64 | public static extern void Visp_MbGenericTracker_SetFeatureType(int feature_type); 65 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_MbGenericTracker_SetMovingEdgesSettings")] 66 | public static extern void Visp_MbGenericTracker_SetMovingEdgesSettings(int range, double sample_step); 67 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_MbGenericTracker_SetKeypointSettings")] 68 | public static extern void Visp_MbGenericTracker_SetKeypointSettings(double quality, int mask_border); 69 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_MbGenericTracker_Init")] 70 | public static extern void Visp_MbGenericTracker_Init(double angle_appear, double angle_disappear, double projection_error_threshold); 71 | [DllImport("ViSPUnity", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Visp_MbGenericTracker_Process")] 72 | public static extern bool Visp_MbGenericTracker_Process(double tag_size, float[] visible_edges_pointx, float[] visible_edges_pointy, 73 | int[] visible_edges_number, float[] cube_cMo, double[] tracking_time); 74 | 75 | WebCamTexture m_webCamTexture; 76 | Renderer m_renderer; 77 | WebCamDevice[] m_devices; 78 | GameObject[] m_line; 79 | 80 | bool m_wct_resolution_updated = false; 81 | float m_aspect_ratio; 82 | // For debug log 83 | bool m_log_start = true; 84 | bool m_log_process = true; 85 | 86 | // For results returned by the tracker 87 | double[] m_tracking_time = new double[1]; 88 | float[] m_visible_edges_pointx = new float[24]; 89 | float[] m_visible_edges_pointy = new float[24]; 90 | int[] m_visible_edges_number = new int[1]; // number of visisble and tracked edges 91 | float[] m_cube_cMo = new float[16]; 92 | 93 | public enum FeatureType { 94 | Edge_Tracking, 95 | Hybrid_Tracking 96 | }; 97 | public enum DebugType { 98 | Enabled, 99 | Disabled 100 | }; 101 | 102 | [Header("Camera Identifier")] 103 | public int camera_id = 0; 104 | 105 | [Header("Camera Parameters")] //some default values provided 106 | public double cam_px = 600; 107 | public double cam_py = 600; 108 | public double cam_u0 = 320; 109 | public double cam_v0 = 240; 110 | 111 | [Header("Cube Settings in [m]")] 112 | public double tag_size = 0.053; 113 | public double cube_size = 0.125; 114 | 115 | [Header("Tag Detection Settings")] 116 | public float quad_decimate = 1; 117 | public int nthreads = 1; 118 | 119 | [Header("Model-Based Tracker Settings")] 120 | public Script_mbt.FeatureType feature_type = FeatureType.Hybrid_Tracking; // selected by default 121 | public int range = 8; 122 | public double sample_step = 4; 123 | public double quality=0.01; 124 | public int mask_border=5; 125 | public double angle_appear=80; 126 | public double angle_disappear=85; 127 | public double projection_error_threshold=30; 128 | 129 | [Header("Debugging Settings")] 130 | public Script_mbt.DebugType debug_display = DebugType.Disabled; 131 | 132 | void Start() 133 | { 134 | m_devices = WebCamTexture.devices; 135 | 136 | if (m_devices.Length == 0) { 137 | throw new Exception("No camera device found"); 138 | } 139 | 140 | int max_id = m_devices.Length - 1; 141 | if (camera_id > max_id) { 142 | if (m_devices.Length == 1) { 143 | throw new Exception("Camera with id " + camera_id + " not found. camera_id value should be 0"); 144 | } 145 | else { 146 | throw new Exception("Camera with id " + camera_id + " not found. camera_id value should be between 0 and " + max_id.ToString()); 147 | } 148 | } 149 | 150 | m_webCamTexture = new WebCamTexture(WebCamTexture.devices[camera_id].name, 640, 480, 30); 151 | 152 | m_renderer = GetComponent(); 153 | m_renderer.material.mainTexture = m_webCamTexture; 154 | m_webCamTexture.Play(); //Start capturing image using webcam 155 | 156 | m_line = GameObject.FindGameObjectsWithTag("Line"); 157 | 158 | Visp_EnableDisplayForDebug((debug_display == DebugType.Enabled) ? true : false); 159 | Visp_CameraParameters_Init(cam_px, cam_py, cam_u0, cam_v0); 160 | Visp_DetectorAprilTag_Init(quad_decimate, nthreads); 161 | Visp_MbGenericTracker_CreateCaoFile(cube_size); 162 | Visp_MbGenericTracker_SetFeatureType((feature_type == FeatureType.Hybrid_Tracking) ? 1 : 0); 163 | Visp_MbGenericTracker_SetMovingEdgesSettings(range, sample_step); 164 | Visp_MbGenericTracker_SetKeypointSettings(quality, mask_border); 165 | Visp_MbGenericTracker_Init(angle_appear, angle_disappear, projection_error_threshold); 166 | 167 | // For debugging purposes, prints available devices to the console 168 | if(m_log_start) { 169 | for(int i = 0; i < m_devices.Length; i++) { 170 | Debug.Log("Webcam " + i + " available: " + m_devices[i].name); 171 | } 172 | Debug.Log("Device name: " + m_webCamTexture.deviceName); 173 | Debug.Log("Web Cam Texture Resolution init : " + m_webCamTexture.width + " " + m_webCamTexture.height); 174 | //Debug.Log("Screen resolution : " + Screen.currentResolution.width + " " + Screen.currentResolution.height); 175 | //Debug.Log("Video rotation angle: " + m_webCamTexture.videoRotationAngle); 176 | Debug.Log("Tag detection settings: quad_decimate=" + quad_decimate + " nthreads=" + nthreads); 177 | Debug.Log("Camera parameters: u0=" + cam_u0 + " v0=" + cam_v0 + " px=" + cam_px + " py=" + cam_py); 178 | Debug.Log("Tag size [m]: " + tag_size); 179 | Debug.Log("Cube size [m]: " + cube_size); 180 | Debug.Log("line length [m]: " + m_line.Length); 181 | } 182 | } 183 | 184 | /* 185 | When more than one camera is connected, create a square button on the top 186 | left part of the display that allows to change the device. 187 | */ 188 | void OnGUI() 189 | { 190 | if (m_devices.Length > 1) { 191 | if( GUI.Button( new Rect(0,0,100,100), "Switch\nto next\ncamera" )) { 192 | camera_id ++; 193 | int id = (camera_id % m_devices.Length); 194 | Debug.Log("Camera id: " + id); 195 | m_webCamTexture.Stop(); 196 | m_webCamTexture.deviceName = m_devices[id].name; 197 | Debug.Log("Switch to new device name: " + m_webCamTexture.deviceName); 198 | m_webCamTexture.Play(); 199 | } 200 | } 201 | } 202 | 203 | void Update() 204 | { 205 | if (m_webCamTexture == null) { 206 | return; 207 | } 208 | // Warmup camera to get an updated web cam texture resolution up to Update 209 | // On OSX, m_webCamTexture.width and m_webCamTexture.height returns always 16 for width and height. 210 | // After a couple of seconds, Web Cam Texture size is updated 211 | if (! m_wct_resolution_updated) { 212 | if (m_webCamTexture.width > 100 && m_webCamTexture.height > 100) { 213 | 214 | Debug.Log("Web Cam Texture Resolution: " + m_webCamTexture.width + " " + m_webCamTexture.height); 215 | 216 | m_wct_resolution_updated = true; 217 | 218 | // Change height and width of m_webCamTexture plane according to the camera resolution 219 | m_aspect_ratio = (float)m_webCamTexture.width / m_webCamTexture.height; 220 | transform.localScale = new Vector3(m_aspect_ratio, 1f, 1f); 221 | } 222 | else { 223 | return; 224 | } 225 | } 226 | 227 | if (m_log_start) { 228 | Debug.Log("Image size: " + m_webCamTexture.width + " x " + m_webCamTexture.height); 229 | m_log_start = false; 230 | } 231 | 232 | // Update image 233 | Visp_ImageUchar_SetFromColor32Array(m_webCamTexture.GetPixels32(), m_webCamTexture.height, m_webCamTexture.width); 234 | // Cube tracking 235 | bool success = Visp_MbGenericTracker_Process(tag_size, m_visible_edges_pointx, m_visible_edges_pointy, m_visible_edges_number, m_cube_cMo, m_tracking_time); 236 | if (success) { 237 | if (m_log_process) { 238 | Debug.Log("cMo:\n" + m_cube_cMo[0] + " " + m_cube_cMo[1] + " " + m_cube_cMo[2] + " " + m_cube_cMo[3] + "\n" 239 | + m_cube_cMo[4] + " " + m_cube_cMo[5] + " " + m_cube_cMo[6] + " " + m_cube_cMo[7] + "\n" 240 | + m_cube_cMo[8] + " " + m_cube_cMo[9] + " " + m_cube_cMo[10] + " " + m_cube_cMo[11]); 241 | Debug.Log("Tracking process time: " + m_tracking_time[0] + " ms"); 242 | m_log_process = false; 243 | } 244 | 245 | // Debug.Log("Num of Edges: "+ m_visible_edges_number[0]); 246 | 247 | // Draw lines that are visible and tracked currently: controlled by m_edges_number 248 | for (int i = 0; i < m_visible_edges_number[0]; i++) { 249 | // Scaling according to plane 250 | // Height of m_webCamTexture plane remains fixed (10 units) but width = 10*m_aspect_ratio 251 | // Debug.Log("Edge " + i + ": " + m_visible_edges_pointx[2 * i] + " , " + m_visible_edges_pointy[2 * i] + " - " + m_visible_edges_pointx[2 * i+1] + " , " + m_visible_edges_pointy[2 * i + 1]); 252 | float x1 = -10f * m_aspect_ratio * (m_visible_edges_pointx[2 * i] / m_webCamTexture.width - 1f / 2f); 253 | float x2 = -10f * m_aspect_ratio * (m_visible_edges_pointx[2 * i + 1] / m_webCamTexture.width - 1f / 2f); 254 | float y1 = -10f * (m_visible_edges_pointy[2 * i] / m_webCamTexture.height - 1f / 2f); 255 | float y2 = -10f * (m_visible_edges_pointy[2 * i + 1] / m_webCamTexture.height - 1f / 2f); 256 | 257 | // Draw visible edges 258 | m_line[i].SetActive(true); 259 | m_line[i].GetComponent().SetPosition(0, new Vector3(x1, y1, -9f)); 260 | m_line[i].GetComponent().SetPosition(1, new Vector3(x2, y2, -9f)); 261 | 262 | //Following line is for debugging purpose only: shows lines only in the 'Scene' view, not in 'Game' view: 263 | Debug.DrawLine(new Vector3(x1, y1, -19f), new Vector3(x2, y2, -19f)); 264 | } 265 | // Hide non visible edges 266 | for (int i = m_visible_edges_number[0]; i < m_line.Length; i++) { 267 | m_line[i].SetActive(false); 268 | } 269 | } 270 | else { 271 | // When cube is not tracked hide all the edges 272 | for (int i = 0; i < m_line.Length; i++) { 273 | m_line[i].SetActive(false); 274 | } 275 | } 276 | } 277 | 278 | void OnApplicationQuit() 279 | { 280 | Visp_WrapperFreeMemory(); 281 | Debug.Log("Application ending after " + Time.time + " seconds"); 282 | } 283 | } 284 | -------------------------------------------------------------------------------- /unityProject/Assets/Scripts/Script_mbt.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3ad72b2930213444a6d77f799db2c62 3 | timeCreated: 1519902907 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /unityProject/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "3.2.3", 5 | "com.unity.collab-proxy": "1.2.15", 6 | "com.unity.package-manager-ui": "2.0.8", 7 | "com.unity.purchasing": "2.0.3", 8 | "com.unity.textmeshpro": "1.4.1", 9 | "com.unity.modules.ai": "1.0.0", 10 | "com.unity.modules.animation": "1.0.0", 11 | "com.unity.modules.assetbundle": "1.0.0", 12 | "com.unity.modules.audio": "1.0.0", 13 | "com.unity.modules.cloth": "1.0.0", 14 | "com.unity.modules.director": "1.0.0", 15 | "com.unity.modules.imageconversion": "1.0.0", 16 | "com.unity.modules.imgui": "1.0.0", 17 | "com.unity.modules.jsonserialize": "1.0.0", 18 | "com.unity.modules.particlesystem": "1.0.0", 19 | "com.unity.modules.physics": "1.0.0", 20 | "com.unity.modules.physics2d": "1.0.0", 21 | "com.unity.modules.screencapture": "1.0.0", 22 | "com.unity.modules.terrain": "1.0.0", 23 | "com.unity.modules.terrainphysics": "1.0.0", 24 | "com.unity.modules.tilemap": "1.0.0", 25 | "com.unity.modules.ui": "1.0.0", 26 | "com.unity.modules.uielements": "1.0.0", 27 | "com.unity.modules.umbra": "1.0.0", 28 | "com.unity.modules.unityanalytics": "1.0.0", 29 | "com.unity.modules.unitywebrequest": "1.0.0", 30 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 31 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 32 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 33 | "com.unity.modules.unitywebrequestwww": "1.0.0", 34 | "com.unity.modules.vehicles": "1.0.0", 35 | "com.unity.modules.video": "1.0.0", 36 | "com.unity.modules.vr": "1.0.0", 37 | "com.unity.modules.wind": "1.0.0", 38 | "com.unity.modules.xr": "1.0.0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | - {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0} 41 | m_PreloadedShaders: [] 42 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 43 | type: 0} 44 | m_CustomRenderPipeline: {fileID: 0} 45 | m_TransparencySortMode: 0 46 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 47 | m_DefaultRenderingPath: 1 48 | m_DefaultMobileRenderingPath: 1 49 | m_TierSettings: [] 50 | m_LightmapStripping: 0 51 | m_FogStripping: 0 52 | m_InstancingStripping: 0 53 | m_LightmapKeepPlain: 1 54 | m_LightmapKeepDirCombined: 1 55 | m_LightmapKeepDynamicPlain: 1 56 | m_LightmapKeepDynamicDirCombined: 1 57 | m_LightmapKeepShadowMask: 1 58 | m_LightmapKeepSubtractive: 1 59 | m_FogKeepLinear: 1 60 | m_FogKeepExp: 1 61 | m_FogKeepExp2: 1 62 | m_AlbedoSwatchInfos: [] 63 | m_LightsUseLinearIntensity: 0 64 | m_LightsUseColorTemperature: 0 65 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 14 7 | productGUID: 7752810165ea3184fa7e676bc7b88681 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | defaultScreenOrientation: 4 11 | targetDevice: 2 12 | useOnDemandResources: 0 13 | accelerometerFrequency: 60 14 | companyName: visp 15 | productName: ARProject 16 | defaultCursor: {fileID: 0} 17 | cursorHotspot: {x: 0, y: 0} 18 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 19 | m_ShowUnitySplashScreen: 1 20 | m_ShowUnitySplashLogo: 1 21 | m_SplashScreenOverlayOpacity: 1 22 | m_SplashScreenAnimation: 1 23 | m_SplashScreenLogoStyle: 1 24 | m_SplashScreenDrawMode: 0 25 | m_SplashScreenBackgroundAnimationZoom: 1 26 | m_SplashScreenLogoAnimationZoom: 1 27 | m_SplashScreenBackgroundLandscapeAspect: 1 28 | m_SplashScreenBackgroundPortraitAspect: 1 29 | m_SplashScreenBackgroundLandscapeUvs: 30 | serializedVersion: 2 31 | x: 0 32 | y: 0 33 | width: 1 34 | height: 1 35 | m_SplashScreenBackgroundPortraitUvs: 36 | serializedVersion: 2 37 | x: 0 38 | y: 0 39 | width: 1 40 | height: 1 41 | m_SplashScreenLogos: [] 42 | m_VirtualRealitySplashScreen: {fileID: 0} 43 | m_HolographicTrackingLossScreen: {fileID: 0} 44 | defaultScreenWidth: 1024 45 | defaultScreenHeight: 768 46 | defaultScreenWidthWeb: 960 47 | defaultScreenHeightWeb: 600 48 | m_StereoRenderingPath: 0 49 | m_ActiveColorSpace: 0 50 | m_MTRendering: 1 51 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 52 | iosShowActivityIndicatorOnLoading: -1 53 | androidShowActivityIndicatorOnLoading: -1 54 | tizenShowActivityIndicatorOnLoading: -1 55 | iosAppInBackgroundBehavior: 0 56 | displayResolutionDialog: 1 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidBlitType: 0 67 | defaultIsFullScreen: 1 68 | defaultIsNativeResolution: 1 69 | macRetinaSupport: 1 70 | runInBackground: 0 71 | captureSingleScreen: 0 72 | muteOtherAudioSources: 0 73 | Prepare IOS For Recording: 0 74 | Force IOS Speakers When Recording: 0 75 | deferSystemGesturesMode: 0 76 | hideHomeButton: 0 77 | submitAnalytics: 1 78 | usePlayerLog: 1 79 | bakeCollisionMeshes: 0 80 | forceSingleInstance: 0 81 | resizableWindow: 0 82 | useMacAppStoreValidation: 0 83 | macAppStoreCategory: public.app-category.games 84 | gpuSkinning: 0 85 | graphicsJobs: 0 86 | xboxPIXTextureCapture: 0 87 | xboxEnableAvatar: 0 88 | xboxEnableKinect: 0 89 | xboxEnableKinectAutoTracking: 0 90 | xboxEnableFitness: 0 91 | visibleInBackground: 1 92 | allowFullscreenSwitch: 1 93 | graphicsJobMode: 0 94 | macFullscreenMode: 2 95 | d3d11FullscreenMode: 1 96 | xboxSpeechDB: 0 97 | xboxEnableHeadOrientation: 0 98 | xboxEnableGuest: 0 99 | xboxEnablePIXSampling: 0 100 | metalFramebufferOnly: 0 101 | n3dsDisableStereoscopicView: 0 102 | n3dsEnableSharedListOpt: 1 103 | n3dsEnableVSync: 0 104 | xboxOneResolution: 0 105 | xboxOneSResolution: 0 106 | xboxOneXResolution: 3 107 | xboxOneMonoLoggingLevel: 0 108 | xboxOneLoggingLevel: 1 109 | xboxOneDisableEsram: 0 110 | xboxOnePresentImmediateThreshold: 0 111 | videoMemoryForVertexBuffers: 0 112 | psp2PowerMode: 0 113 | psp2AcquireBGM: 1 114 | wiiUTVResolution: 0 115 | wiiUGamePadMSAA: 1 116 | wiiUSupportsNunchuk: 0 117 | wiiUSupportsClassicController: 0 118 | wiiUSupportsBalanceBoard: 0 119 | wiiUSupportsMotionPlus: 0 120 | wiiUSupportsProController: 0 121 | wiiUAllowScreenCapture: 1 122 | wiiUControllerCount: 0 123 | m_SupportedAspectRatios: 124 | 4:3: 1 125 | 5:4: 1 126 | 16:10: 1 127 | 16:9: 1 128 | Others: 1 129 | bundleVersion: 1.0 130 | preloadedAssets: [] 131 | metroInputSource: 0 132 | wsaTransparentSwapchain: 0 133 | m_HolographicPauseOnTrackingLoss: 1 134 | xboxOneDisableKinectGpuReservation: 0 135 | xboxOneEnable7thCore: 0 136 | vrSettings: 137 | cardboard: 138 | depthFormat: 0 139 | enableTransitionView: 0 140 | daydream: 141 | depthFormat: 0 142 | useSustainedPerformanceMode: 0 143 | enableVideoLayer: 0 144 | useProtectedVideoMemory: 0 145 | minimumSupportedHeadTracking: 0 146 | maximumSupportedHeadTracking: 1 147 | hololens: 148 | depthFormat: 1 149 | depthBufferSharingEnabled: 0 150 | oculus: 151 | sharedDepthBuffer: 0 152 | dashSupport: 0 153 | protectGraphicsMemory: 0 154 | useHDRDisplay: 0 155 | m_ColorGamuts: 00000000 156 | targetPixelDensity: 30 157 | resolutionScalingMode: 0 158 | androidSupportedAspectRatio: 1 159 | androidMaxAspectRatio: 2.1 160 | applicationIdentifier: 161 | Standalone: com.visp.ARProject 162 | buildNumber: {} 163 | AndroidBundleVersionCode: 1 164 | AndroidMinSdkVersion: 16 165 | AndroidTargetSdkVersion: 0 166 | AndroidPreferredInstallLocation: 1 167 | aotOptions: 168 | stripEngineCode: 1 169 | iPhoneStrippingLevel: 0 170 | iPhoneScriptCallOptimization: 0 171 | ForceInternetPermission: 0 172 | ForceSDCardPermission: 0 173 | CreateWallpaper: 0 174 | APKExpansionFiles: 0 175 | keepLoadedShadersAlive: 0 176 | StripUnusedMeshComponents: 0 177 | VertexChannelCompressionMask: 178 | serializedVersion: 2 179 | m_Bits: 238 180 | iPhoneSdkVersion: 988 181 | iOSTargetOSVersionString: 7.0 182 | tvOSSdkVersion: 0 183 | tvOSRequireExtendedGameController: 0 184 | tvOSTargetOSVersionString: 9.0 185 | uIPrerenderedIcon: 0 186 | uIRequiresPersistentWiFi: 0 187 | uIRequiresFullScreen: 1 188 | uIStatusBarHidden: 1 189 | uIExitOnSuspend: 0 190 | uIStatusBarStyle: 0 191 | iPhoneSplashScreen: {fileID: 0} 192 | iPhoneHighResSplashScreen: {fileID: 0} 193 | iPhoneTallHighResSplashScreen: {fileID: 0} 194 | iPhone47inSplashScreen: {fileID: 0} 195 | iPhone55inPortraitSplashScreen: {fileID: 0} 196 | iPhone55inLandscapeSplashScreen: {fileID: 0} 197 | iPhone58inPortraitSplashScreen: {fileID: 0} 198 | iPhone58inLandscapeSplashScreen: {fileID: 0} 199 | iPadPortraitSplashScreen: {fileID: 0} 200 | iPadHighResPortraitSplashScreen: {fileID: 0} 201 | iPadLandscapeSplashScreen: {fileID: 0} 202 | iPadHighResLandscapeSplashScreen: {fileID: 0} 203 | appleTVSplashScreen: {fileID: 0} 204 | appleTVSplashScreen2x: {fileID: 0} 205 | tvOSSmallIconLayers: [] 206 | tvOSSmallIconLayers2x: [] 207 | tvOSLargeIconLayers: [] 208 | tvOSTopShelfImageLayers: [] 209 | tvOSTopShelfImageLayers2x: [] 210 | tvOSTopShelfImageWideLayers: [] 211 | tvOSTopShelfImageWideLayers2x: [] 212 | iOSLaunchScreenType: 0 213 | iOSLaunchScreenPortrait: {fileID: 0} 214 | iOSLaunchScreenLandscape: {fileID: 0} 215 | iOSLaunchScreenBackgroundColor: 216 | serializedVersion: 2 217 | rgba: 0 218 | iOSLaunchScreenFillPct: 100 219 | iOSLaunchScreenSize: 100 220 | iOSLaunchScreenCustomXibPath: 221 | iOSLaunchScreeniPadType: 0 222 | iOSLaunchScreeniPadImage: {fileID: 0} 223 | iOSLaunchScreeniPadBackgroundColor: 224 | serializedVersion: 2 225 | rgba: 0 226 | iOSLaunchScreeniPadFillPct: 100 227 | iOSLaunchScreeniPadSize: 100 228 | iOSLaunchScreeniPadCustomXibPath: 229 | iOSUseLaunchScreenStoryboard: 0 230 | iOSLaunchScreenCustomStoryboardPath: 231 | iOSDeviceRequirements: [] 232 | iOSURLSchemes: [] 233 | iOSBackgroundModes: 0 234 | iOSMetalForceHardShadows: 0 235 | metalEditorSupport: 1 236 | metalAPIValidation: 1 237 | iOSRenderExtraFrameOnPause: 0 238 | appleDeveloperTeamID: 239 | iOSManualSigningProvisioningProfileID: 240 | tvOSManualSigningProvisioningProfileID: 241 | appleEnableAutomaticSigning: 0 242 | clonedFromGUID: 00000000000000000000000000000000 243 | AndroidTargetDevice: 0 244 | AndroidSplashScreenScale: 0 245 | androidSplashScreen: {fileID: 0} 246 | AndroidKeystoreName: 247 | AndroidKeyaliasName: 248 | AndroidTVCompatibility: 1 249 | AndroidIsGame: 1 250 | AndroidEnableTango: 0 251 | androidEnableBanner: 1 252 | androidUseLowAccuracyLocation: 0 253 | m_AndroidBanners: 254 | - width: 320 255 | height: 180 256 | banner: {fileID: 0} 257 | androidGamepadSupportLevel: 0 258 | resolutionDialogBanner: {fileID: 0} 259 | m_BuildTargetIcons: [] 260 | m_BuildTargetBatching: [] 261 | m_BuildTargetGraphicsAPIs: [] 262 | m_BuildTargetVRSettings: [] 263 | m_BuildTargetEnableVuforiaSettings: [] 264 | openGLRequireES31: 0 265 | openGLRequireES31AEP: 0 266 | m_TemplateCustomTags: {} 267 | mobileMTRendering: 268 | Android: 1 269 | iPhone: 1 270 | tvOS: 1 271 | m_BuildTargetGroupLightmapEncodingQuality: [] 272 | wiiUTitleID: 0005000011000000 273 | wiiUGroupID: 00010000 274 | wiiUCommonSaveSize: 4096 275 | wiiUAccountSaveSize: 2048 276 | wiiUOlvAccessKey: 0 277 | wiiUTinCode: 0 278 | wiiUJoinGameId: 0 279 | wiiUJoinGameModeMask: 0000000000000000 280 | wiiUCommonBossSize: 0 281 | wiiUAccountBossSize: 0 282 | wiiUAddOnUniqueIDs: [] 283 | wiiUMainThreadStackSize: 3072 284 | wiiULoaderThreadStackSize: 1024 285 | wiiUSystemHeapSize: 128 286 | wiiUTVStartupScreen: {fileID: 0} 287 | wiiUGamePadStartupScreen: {fileID: 0} 288 | wiiUDrcBufferDisabled: 0 289 | wiiUProfilerLibPath: 290 | playModeTestRunnerEnabled: 0 291 | actionOnDotNetUnhandledException: 1 292 | enableInternalProfiler: 0 293 | logObjCUncaughtExceptions: 1 294 | enableCrashReportAPI: 0 295 | cameraUsageDescription: 296 | locationUsageDescription: 297 | microphoneUsageDescription: 298 | switchNetLibKey: 299 | switchSocketMemoryPoolSize: 6144 300 | switchSocketAllocatorPoolSize: 128 301 | switchSocketConcurrencyLimit: 14 302 | switchScreenResolutionBehavior: 2 303 | switchUseCPUProfiler: 0 304 | switchApplicationID: 0x01004b9000490000 305 | switchNSODependencies: 306 | switchTitleNames_0: 307 | switchTitleNames_1: 308 | switchTitleNames_2: 309 | switchTitleNames_3: 310 | switchTitleNames_4: 311 | switchTitleNames_5: 312 | switchTitleNames_6: 313 | switchTitleNames_7: 314 | switchTitleNames_8: 315 | switchTitleNames_9: 316 | switchTitleNames_10: 317 | switchTitleNames_11: 318 | switchTitleNames_12: 319 | switchTitleNames_13: 320 | switchTitleNames_14: 321 | switchPublisherNames_0: 322 | switchPublisherNames_1: 323 | switchPublisherNames_2: 324 | switchPublisherNames_3: 325 | switchPublisherNames_4: 326 | switchPublisherNames_5: 327 | switchPublisherNames_6: 328 | switchPublisherNames_7: 329 | switchPublisherNames_8: 330 | switchPublisherNames_9: 331 | switchPublisherNames_10: 332 | switchPublisherNames_11: 333 | switchPublisherNames_12: 334 | switchPublisherNames_13: 335 | switchPublisherNames_14: 336 | switchIcons_0: {fileID: 0} 337 | switchIcons_1: {fileID: 0} 338 | switchIcons_2: {fileID: 0} 339 | switchIcons_3: {fileID: 0} 340 | switchIcons_4: {fileID: 0} 341 | switchIcons_5: {fileID: 0} 342 | switchIcons_6: {fileID: 0} 343 | switchIcons_7: {fileID: 0} 344 | switchIcons_8: {fileID: 0} 345 | switchIcons_9: {fileID: 0} 346 | switchIcons_10: {fileID: 0} 347 | switchIcons_11: {fileID: 0} 348 | switchIcons_12: {fileID: 0} 349 | switchIcons_13: {fileID: 0} 350 | switchIcons_14: {fileID: 0} 351 | switchSmallIcons_0: {fileID: 0} 352 | switchSmallIcons_1: {fileID: 0} 353 | switchSmallIcons_2: {fileID: 0} 354 | switchSmallIcons_3: {fileID: 0} 355 | switchSmallIcons_4: {fileID: 0} 356 | switchSmallIcons_5: {fileID: 0} 357 | switchSmallIcons_6: {fileID: 0} 358 | switchSmallIcons_7: {fileID: 0} 359 | switchSmallIcons_8: {fileID: 0} 360 | switchSmallIcons_9: {fileID: 0} 361 | switchSmallIcons_10: {fileID: 0} 362 | switchSmallIcons_11: {fileID: 0} 363 | switchSmallIcons_12: {fileID: 0} 364 | switchSmallIcons_13: {fileID: 0} 365 | switchSmallIcons_14: {fileID: 0} 366 | switchManualHTML: 367 | switchAccessibleURLs: 368 | switchLegalInformation: 369 | switchMainThreadStackSize: 1048576 370 | switchPresenceGroupId: 371 | switchLogoHandling: 0 372 | switchReleaseVersion: 0 373 | switchDisplayVersion: 1.0.0 374 | switchStartupUserAccount: 0 375 | switchTouchScreenUsage: 0 376 | switchSupportedLanguagesMask: 0 377 | switchLogoType: 0 378 | switchApplicationErrorCodeCategory: 379 | switchUserAccountSaveDataSize: 0 380 | switchUserAccountSaveDataJournalSize: 0 381 | switchApplicationAttribute: 0 382 | switchCardSpecSize: -1 383 | switchCardSpecClock: -1 384 | switchRatingsMask: 0 385 | switchRatingsInt_0: 0 386 | switchRatingsInt_1: 0 387 | switchRatingsInt_2: 0 388 | switchRatingsInt_3: 0 389 | switchRatingsInt_4: 0 390 | switchRatingsInt_5: 0 391 | switchRatingsInt_6: 0 392 | switchRatingsInt_7: 0 393 | switchRatingsInt_8: 0 394 | switchRatingsInt_9: 0 395 | switchRatingsInt_10: 0 396 | switchRatingsInt_11: 0 397 | switchLocalCommunicationIds_0: 398 | switchLocalCommunicationIds_1: 399 | switchLocalCommunicationIds_2: 400 | switchLocalCommunicationIds_3: 401 | switchLocalCommunicationIds_4: 402 | switchLocalCommunicationIds_5: 403 | switchLocalCommunicationIds_6: 404 | switchLocalCommunicationIds_7: 405 | switchParentalControl: 0 406 | switchAllowsScreenshot: 1 407 | switchAllowsVideoCapturing: 1 408 | switchAllowsRuntimeAddOnContentInstall: 0 409 | switchDataLossConfirmation: 0 410 | switchSupportedNpadStyles: 3 411 | switchSocketConfigEnabled: 0 412 | switchTcpInitialSendBufferSize: 32 413 | switchTcpInitialReceiveBufferSize: 64 414 | switchTcpAutoSendBufferSizeMax: 256 415 | switchTcpAutoReceiveBufferSizeMax: 256 416 | switchUdpSendBufferSize: 9 417 | switchUdpReceiveBufferSize: 42 418 | switchSocketBufferEfficiency: 4 419 | switchSocketInitializeEnabled: 1 420 | switchNetworkInterfaceManagerInitializeEnabled: 1 421 | switchPlayerConnectionEnabled: 1 422 | ps4NPAgeRating: 12 423 | ps4NPTitleSecret: 424 | ps4NPTrophyPackPath: 425 | ps4ParentalLevel: 11 426 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 427 | ps4Category: 0 428 | ps4MasterVersion: 01.00 429 | ps4AppVersion: 01.00 430 | ps4AppType: 0 431 | ps4ParamSfxPath: 432 | ps4VideoOutPixelFormat: 0 433 | ps4VideoOutInitialWidth: 1920 434 | ps4VideoOutBaseModeInitialWidth: 1920 435 | ps4VideoOutReprojectionRate: 60 436 | ps4PronunciationXMLPath: 437 | ps4PronunciationSIGPath: 438 | ps4BackgroundImagePath: 439 | ps4StartupImagePath: 440 | ps4StartupImagesFolder: 441 | ps4IconImagesFolder: 442 | ps4SaveDataImagePath: 443 | ps4SdkOverride: 444 | ps4BGMPath: 445 | ps4ShareFilePath: 446 | ps4ShareOverlayImagePath: 447 | ps4PrivacyGuardImagePath: 448 | ps4NPtitleDatPath: 449 | ps4RemotePlayKeyAssignment: -1 450 | ps4RemotePlayKeyMappingDir: 451 | ps4PlayTogetherPlayerCount: 0 452 | ps4EnterButtonAssignment: 1 453 | ps4ApplicationParam1: 0 454 | ps4ApplicationParam2: 0 455 | ps4ApplicationParam3: 0 456 | ps4ApplicationParam4: 0 457 | ps4DownloadDataSize: 0 458 | ps4GarlicHeapSize: 2048 459 | ps4ProGarlicHeapSize: 2560 460 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 461 | ps4pnSessions: 1 462 | ps4pnPresence: 1 463 | ps4pnFriends: 1 464 | ps4pnGameCustomData: 1 465 | playerPrefsSupport: 0 466 | restrictedAudioUsageRights: 0 467 | ps4UseResolutionFallback: 0 468 | ps4ReprojectionSupport: 0 469 | ps4UseAudio3dBackend: 0 470 | ps4SocialScreenEnabled: 0 471 | ps4ScriptOptimizationLevel: 0 472 | ps4Audio3dVirtualSpeakerCount: 14 473 | ps4attribCpuUsage: 0 474 | ps4PatchPkgPath: 475 | ps4PatchLatestPkgPath: 476 | ps4PatchChangeinfoPath: 477 | ps4PatchDayOne: 0 478 | ps4attribUserManagement: 0 479 | ps4attribMoveSupport: 0 480 | ps4attrib3DSupport: 0 481 | ps4attribShareSupport: 0 482 | ps4attribExclusiveVR: 0 483 | ps4disableAutoHideSplash: 0 484 | ps4videoRecordingFeaturesUsed: 0 485 | ps4contentSearchFeaturesUsed: 0 486 | ps4attribEyeToEyeDistanceSettingVR: 0 487 | ps4IncludedModules: [] 488 | monoEnv: 489 | psp2Splashimage: {fileID: 0} 490 | psp2NPTrophyPackPath: 491 | psp2NPSupportGBMorGJP: 0 492 | psp2NPAgeRating: 12 493 | psp2NPTitleDatPath: 494 | psp2NPCommsID: 495 | psp2NPCommunicationsID: 496 | psp2NPCommsPassphrase: 497 | psp2NPCommsSig: 498 | psp2ParamSfxPath: 499 | psp2ManualPath: 500 | psp2LiveAreaGatePath: 501 | psp2LiveAreaBackroundPath: 502 | psp2LiveAreaPath: 503 | psp2LiveAreaTrialPath: 504 | psp2PatchChangeInfoPath: 505 | psp2PatchOriginalPackage: 506 | psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui 507 | psp2KeystoneFile: 508 | psp2MemoryExpansionMode: 0 509 | psp2DRMType: 0 510 | psp2StorageType: 0 511 | psp2MediaCapacity: 0 512 | psp2DLCConfigPath: 513 | psp2ThumbnailPath: 514 | psp2BackgroundPath: 515 | psp2SoundPath: 516 | psp2TrophyCommId: 517 | psp2TrophyPackagePath: 518 | psp2PackagedResourcesPath: 519 | psp2SaveDataQuota: 10240 520 | psp2ParentalLevel: 1 521 | psp2ShortTitle: Not Set 522 | psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF 523 | psp2Category: 0 524 | psp2MasterVersion: 01.00 525 | psp2AppVersion: 01.00 526 | psp2TVBootMode: 0 527 | psp2EnterButtonAssignment: 2 528 | psp2TVDisableEmu: 0 529 | psp2AllowTwitterDialog: 1 530 | psp2Upgradable: 0 531 | psp2HealthWarning: 0 532 | psp2UseLibLocation: 0 533 | psp2InfoBarOnStartup: 0 534 | psp2InfoBarColor: 0 535 | psp2ScriptOptimizationLevel: 0 536 | psmSplashimage: {fileID: 0} 537 | splashScreenBackgroundSourceLandscape: {fileID: 0} 538 | splashScreenBackgroundSourcePortrait: {fileID: 0} 539 | spritePackerPolicy: 540 | webGLMemorySize: 256 541 | webGLExceptionSupport: 1 542 | webGLNameFilesAsHashes: 0 543 | webGLDataCaching: 0 544 | webGLDebugSymbols: 0 545 | webGLEmscriptenArgs: 546 | webGLModulesDirectory: 547 | webGLTemplate: APPLICATION:Default 548 | webGLAnalyzeBuildSize: 0 549 | webGLUseEmbeddedResources: 0 550 | webGLUseWasm: 0 551 | webGLCompressionFormat: 1 552 | scriptingDefineSymbols: {} 553 | platformArchitecture: {} 554 | scriptingBackend: {} 555 | incrementalIl2cppBuild: {} 556 | additionalIl2CppArgs: 557 | scriptingRuntimeVersion: 0 558 | apiCompatibilityLevelPerPlatform: {} 559 | m_RenderingPath: 1 560 | m_MobileRenderingPath: 1 561 | metroPackageName: UnityProject 562 | metroPackageVersion: 563 | metroCertificatePath: 564 | metroCertificatePassword: 565 | metroCertificateSubject: 566 | metroCertificateIssuer: 567 | metroCertificateNotAfter: 0000000000000000 568 | metroApplicationDescription: UnityProject 569 | wsaImages: {} 570 | metroTileShortName: 571 | metroCommandLineArgsFile: 572 | metroTileShowName: 0 573 | metroMediumTileShowName: 0 574 | metroLargeTileShowName: 0 575 | metroWideTileShowName: 0 576 | metroDefaultTileSize: 1 577 | metroTileForegroundText: 2 578 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 579 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 580 | a: 1} 581 | metroSplashScreenUseBackgroundColor: 0 582 | platformCapabilities: {} 583 | metroFTAName: 584 | metroFTAFileTypes: [] 585 | metroProtocolName: 586 | metroCompilationOverrides: 1 587 | tizenProductDescription: 588 | tizenProductURL: 589 | tizenSigningProfileName: 590 | tizenGPSPermissions: 0 591 | tizenMicrophonePermissions: 0 592 | tizenDeploymentTarget: 593 | tizenDeploymentTargetType: -1 594 | tizenMinOSVersion: 1 595 | n3dsUseExtSaveData: 0 596 | n3dsCompressStaticMem: 1 597 | n3dsExtSaveDataNumber: 0x12345 598 | n3dsStackSize: 131072 599 | n3dsTargetPlatform: 2 600 | n3dsRegion: 7 601 | n3dsMediaSize: 0 602 | n3dsLogoStyle: 3 603 | n3dsTitle: GameName 604 | n3dsProductCode: 605 | n3dsApplicationId: 0xFF3FF 606 | XboxOneProductId: 607 | XboxOneUpdateKey: 608 | XboxOneSandboxId: 609 | XboxOneContentId: 610 | XboxOneTitleId: 611 | XboxOneSCId: 612 | XboxOneGameOsOverridePath: 613 | XboxOnePackagingOverridePath: 614 | XboxOneAppManifestOverridePath: 615 | XboxOnePackageEncryption: 0 616 | XboxOnePackageUpdateGranularity: 2 617 | XboxOneDescription: 618 | XboxOneLanguage: 619 | - enus 620 | XboxOneCapability: [] 621 | XboxOneGameRating: {} 622 | XboxOneIsContentPackage: 0 623 | XboxOneEnableGPUVariability: 0 624 | XboxOneSockets: {} 625 | XboxOneSplashScreen: {fileID: 0} 626 | XboxOneAllowedProductIds: [] 627 | XboxOnePersistentLocalStorageSize: 0 628 | XboxOneXTitleMemory: 8 629 | xboxOneScriptCompiler: 0 630 | vrEditorSettings: 631 | daydream: 632 | daydreamIconForeground: {fileID: 0} 633 | daydreamIconBackground: {fileID: 0} 634 | cloudServicesEnabled: {} 635 | facebookSdkVersion: 7.9.4 636 | apiCompatibilityLevel: 2 637 | cloudProjectId: 638 | projectName: 639 | organizationId: 640 | cloudEnabled: 0 641 | enableNativePlatformBackendsForNewInputSystem: 0 642 | disableOldInputManagerSupport: 0 643 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.4.7f1 2 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 0 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 70 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 2 136 | antiAliasing: 2 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSM: 5 183 | PSP2: 2 184 | Standalone: 5 185 | Tizen: 2 186 | WebGL: 3 187 | WiiU: 5 188 | Windows Store Apps: 5 189 | XboxOne: 5 190 | iPhone: 2 191 | tvOS: 2 192 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: 7 | - Line 8 | - kltPoint 9 | - Cube 10 | - Cube_pivot 11 | layers: 12 | - Default 13 | - TransparentFX 14 | - Ignore Raycast 15 | - 16 | - Water 17 | - UI 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | - 41 | - 42 | - 43 | - 44 | m_SortingLayers: 45 | - name: Default 46 | uniqueID: 0 47 | locked: 0 48 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /unityProject/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 0 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /vispWrapper/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # 3 | # ViSP, open source Visual Servoing Platform software. 4 | # Copyright (C) 2005 - 2019 by Inria. All rights reserved. 5 | # 6 | # This software is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2 of the License, or 9 | # (at your option) any later version. 10 | # See the file LICENSE.txt at the root directory of this source 11 | # distribution for additional information about the GNU GPL. 12 | # 13 | # For using ViSP with software that can not be combined with the GNU 14 | # GPL, please contact Inria about acquiring a ViSP Professional 15 | # Edition License. 16 | # 17 | # See http://visp.inria.fr for more information. 18 | # 19 | # This software was developed at: 20 | # Inria Rennes - Bretagne Atlantique 21 | # Campus Universitaire de Beaulieu 22 | # 35042 Rennes Cedex 23 | # France 24 | # 25 | # If you have questions regarding the use of this file, please contact 26 | # Inria at visp@inria.fr 27 | # 28 | # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 29 | # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 30 | # 31 | # Description: 32 | # Unity plugin that wraps some ViSP functionalities. 33 | # 34 | ############################################################################# 35 | 36 | project(ViSPUnity) 37 | 38 | cmake_minimum_required(VERSION 3.0) 39 | 40 | #---------------------------------------------------------------------- 41 | # Project version number. 42 | #---------------------------------------------------------------------- 43 | set(PROJECT_VERSION_MAJOR 1) 44 | set(PROJECT_VERSION_MINOR 0) 45 | set(PROJECT_VERSION_PATCH 0) 46 | set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") 47 | set(PROJECT_VERSION_FULL "${PROJECT_VERSION}.${PROJECT_VERSION_PATCH}") 48 | 49 | # By default set release configuration 50 | if(NOT CMAKE_BUILD_TYPE) 51 | set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) 52 | endif() 53 | 54 | if(APPLE) 55 | set(CMAKE_MACOSX_RPATH ON) 56 | endif() 57 | 58 | find_package(VISP REQUIRED visp_core visp_io visp_detection visp_mbt) 59 | 60 | include_directories(${VISP_INCLUDE_DIRS}) 61 | 62 | add_library(ViSPUnity SHARED ViSPUnity.cpp ViSPUnity.h) 63 | target_link_libraries(ViSPUnity ${VISP_LIBRARIES}) 64 | 65 | if(APPLE) 66 | set_target_properties(ViSPUnity PROPERTIES BUNDLE TRUE) 67 | set_target_properties(ViSPUnity PROPERTIES PREFIX "") 68 | set_target_properties(ViSPUnity PROPERTIES SUFFIX ".bundle") 69 | elseif(UNIX) 70 | set_target_properties(ViSPUnity PROPERTIES PREFIX "") 71 | endif() 72 | 73 | # ---------------------------------------------------------------------------- 74 | # Install target, for "make install" 75 | # ---------------------------------------------------------------------------- 76 | install(FILES $ DESTINATION ${PROJECT_SOURCE_DIR}/../unityProject/Assets) 77 | 78 | # ---------------------------------------------------------------------------- 79 | # Uninstall target, for "make uninstall" 80 | # ---------------------------------------------------------------------------- 81 | configure_file( 82 | cmake/cmake_uninstall.cmake.in 83 | "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" 84 | IMMEDIATE @ONLY) 85 | 86 | add_custom_target(uninstall 87 | "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") 88 | 89 | #---------------------------------------------------------------------- 90 | # add "doc" target for doxygen documentation building 91 | #---------------------------------------------------------------------- 92 | find_package(Doxygen) 93 | if (DOXYGEN_FOUND) 94 | if(DOXYGEN_DOT_EXECUTABLE) 95 | set(PROJECT_HAVE_DOT "yes") 96 | else() 97 | set(PROJECT_HAVE_DOT "no") 98 | endif() 99 | ## we need latex for doxygen because of the formulas 100 | find_package(LATEX) 101 | if(NOT LATEX_COMPILER) 102 | message(STATUS "latex command LATEX_COMPILER not found but usually required. You will probably get warnings and user interaction on doxy run.") 103 | endif () 104 | if(NOT MAKEINDEX_COMPILER) 105 | message(STATUS "makeindex command MAKEINDEX_COMPILER not found but usually required.") 106 | endif () 107 | if(NOT DVIPS_CONVERTER) 108 | message(STATUS "dvips command DVIPS_CONVERTER not found but usually required.") 109 | endif () 110 | 111 | configure_file(${PROJECT_SOURCE_DIR}/doc/config-doxygen.cmake 112 | ${PROJECT_BINARY_DIR}/doc/config-doxygen 113 | @ONLY ) 114 | 115 | add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/doc/config-doxygen 116 | DEPENDS ${PROJECT_BINARY_DIR}/doc/config-doxygen) 117 | 118 | endif() 119 | -------------------------------------------------------------------------------- /vispWrapper/ViSPUnity.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ViSP, open source Visual Servoing Platform software. 4 | * Copyright (C) 2005 - 2020 by Inria. All rights reserved. 5 | * 6 | * This software is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * See the file LICENSE.txt at the root directory of this source 11 | * distribution for additional information about the GNU GPL. 12 | * 13 | * For using ViSP with software that can not be combined with the GNU 14 | * GPL, please contact Inria about acquiring a ViSP Professional 15 | * Edition License. 16 | * 17 | * See http://visp.inria.fr for more information. 18 | * 19 | * This software was developed at: 20 | * Inria Rennes - Bretagne Atlantique 21 | * Campus Universitaire de Beaulieu 22 | * 35042 Rennes Cedex 23 | * France 24 | * 25 | * If you have questions regarding the use of this file, please contact 26 | * Inria at visp@inria.fr 27 | * 28 | * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 29 | * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 30 | * 31 | * Description: 32 | * Unity plugin that wraps some ViSP functionalities. 33 | * 34 | *****************************************************************************/ 35 | #include "ViSPUnity.h" 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | /*! 42 | \file 43 | \brief ViSPUnity plugin functions definition. 44 | */ 45 | 46 | extern "C" { 47 | 48 | /*! 49 | * Global variables for debug 50 | */ 51 | #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) 52 | static vpDisplay *m_debug_display = nullptr; //!< Display associated to internal image m_I. 53 | #else 54 | static vpDisplay *m_debug_display = NULL; //!< Display associated to image m_I. 55 | #endif 56 | static bool m_debug_enable_display = false; //!< Flag used to enable/disable display associated to internal image m_I. 57 | static bool m_debug_display_is_initialized = false; //!< Flag used to know if display associated to internal image m_I is initialized. 58 | 59 | /*! 60 | * Global variables that are common. 61 | */ 62 | static vpImage m_I; //!< Internal image updated using Visp_ImageUchar_SetFromColor32Array(). 63 | static vpCameraParameters m_cam; //!< Internal camera parameters updated using Visp_CameraParameters_Init(). 64 | 65 | /*! 66 | * Global variables for vpDetectorAprilTag 67 | */ 68 | static vpDetectorAprilTag m_detector; //!< Internal AprilTag detector instance initialized using Visp_DetectorAprilTag_Init(). 69 | static float m_detector_quad_decimate = 1.0; //!< Internal parameter associated to AprilTag detector instance modified using Visp_DetectorAprilTag_Init(). 70 | static int m_detector_nthreads = 1; //!< Internal parameter associated to AprilTag detector instance modified using Visp_DetectorAprilTag_Init(). 71 | 72 | /*! 73 | * Global variables for vpMbGenericTracker 74 | */ 75 | typedef enum { 76 | state_detection, //!< Tracker is in detection state until an AprilTag is detected. This state can also be reached when tracking fails. 77 | state_tracking, //!< Tracker is in tracking state when AprilTag pose allows to initialize the tracker and when tracking succeed. 78 | } state_t; 79 | 80 | static vpMbGenericTracker m_tracker; //!< Internal generic based-model tracker instance initialized using Visp_MbGenericTracker_Init(). 81 | static double m_projection_error_threshold = 40.; //!< Internal parameter associated to generic based-model tracker instance and updated using Visp_MbGenericTracker_Init(). 82 | static state_t m_state = state_detection; //!< Internal generic based-model tracker state updated during tracking using Visp_MbGenericTracker_Process(). 83 | 84 | void Visp_EnableDisplayForDebug(bool enable_display) 85 | { 86 | m_debug_enable_display = enable_display; 87 | } 88 | 89 | void Visp_WrapperFreeMemory() 90 | { 91 | if (m_debug_display) { 92 | delete m_debug_display; 93 | m_debug_enable_display = false; 94 | m_debug_display_is_initialized = false; 95 | #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) 96 | m_debug_display = nullptr; 97 | #else 98 | m_debug_display = NULL; 99 | #endif 100 | } 101 | } 102 | 103 | /*! 104 | * Set vpImage from Unity Color32 array image. 105 | * \param bitmap : Bitmap color 32 array that contains the color RGBA [height x width] image. 106 | * \param height : Image height. 107 | * \param width : Image width. 108 | */ 109 | void Visp_ImageUchar_SetFromColor32Array(unsigned char *bitmap, int height, int width) 110 | { 111 | m_I.resize(static_cast(height), static_cast(width)); 112 | vpImageConvert::RGBaToGrey(bitmap, m_I.bitmap, static_cast(width * height)); 113 | vpImageTools::flip(m_I); 114 | 115 | if (m_debug_enable_display && ! m_debug_display_is_initialized) { 116 | #if defined(VISP_HAVE_X11) 117 | m_debug_display = new vpDisplayX(m_I); 118 | m_debug_display_is_initialized = true; 119 | #elif defined VISP_HAVE_GDI 120 | m_debug_display = new vpDisplayGDI(m_I); 121 | m_debug_display_is_initialized = true; 122 | #elif defined VISP_HAVE_OPENCV 123 | m_debug_display = new vpDisplayOpenCV(m_I); 124 | m_debug_display_is_initialized = true; 125 | #endif 126 | } 127 | } 128 | 129 | void Visp_MbGenericTracker_SetFeatureType(int feature_type) 130 | { 131 | if (feature_type == 0) 132 | m_tracker.setTrackerType(vpMbGenericTracker::EDGE_TRACKER); 133 | #ifdef VISP_HAVE_OPENCV 134 | else if (feature_type == 1) 135 | m_tracker.setTrackerType(vpMbGenericTracker::EDGE_TRACKER | vpMbGenericTracker::KLT_TRACKER); 136 | #endif 137 | } 138 | 139 | void Visp_MbGenericTracker_SetMovingEdgesSettings(int range, double sample_step) 140 | { 141 | vpMe me; 142 | me.setMaskSize(5); 143 | me.setMaskNumber(180); 144 | me.setRange(static_cast(range)); 145 | me.setThreshold(10000); 146 | me.setMu1(0.5); 147 | me.setMu2(0.5); 148 | me.setSampleStep(sample_step); 149 | m_tracker.setMovingEdge(me); 150 | } 151 | 152 | void Visp_MbGenericTracker_SetKeypointSettings(double quality, int mask_border) 153 | { 154 | if (m_tracker.getTrackerType() & vpMbGenericTracker::KLT_TRACKER) { 155 | vpKltOpencv klt_settings; 156 | klt_settings.setMaxFeatures(300); 157 | klt_settings.setWindowSize(5); 158 | klt_settings.setQuality(quality); 159 | klt_settings.setMinDistance(8); 160 | klt_settings.setHarrisFreeParameter(0.01); 161 | klt_settings.setBlockSize(3); 162 | klt_settings.setPyramidLevels(3); 163 | m_tracker.setKltOpencv(klt_settings); 164 | m_tracker.setKltMaskBorder(static_cast(mask_border)); 165 | } 166 | } 167 | 168 | void Visp_MbGenericTracker_Init(double angle_appear, double angle_disappear, double projection_error_threshold) 169 | { 170 | m_projection_error_threshold = projection_error_threshold; 171 | // camera calibration params 172 | m_tracker.setCameraParameters(m_cam); 173 | 174 | // model definition 175 | m_tracker.loadModel("cube.cao"); 176 | m_tracker.setDisplayFeatures(m_debug_enable_display); 177 | m_tracker.setAngleAppear(vpMath::rad(angle_appear)); 178 | m_tracker.setAngleDisappear(vpMath::rad(angle_disappear)); 179 | m_tracker.setProjectionErrorComputation(true); 180 | 181 | m_state = state_detection; 182 | } 183 | 184 | bool Visp_MbGenericTracker_Process(double tag_size, 185 | float *visible_edges_pointx, float *visible_edges_pointy, int *visible_edges_number, 186 | float *cube_cMo, double *tracking_time) 187 | { 188 | double t_start = vpTime::measureTimeMs(); 189 | 190 | vpHomogeneousMatrix cMo; 191 | 192 | // If the image contains an aprilTag we pick the first one 193 | unsigned int tag_id = 0; 194 | 195 | if (m_debug_enable_display && m_debug_display_is_initialized) { 196 | vpDisplay::display(m_I); 197 | } 198 | 199 | if (m_state == state_detection) { 200 | std::vector cMo_vec; 201 | 202 | // Detection 203 | bool tag_detected = m_detector.detect(m_I, tag_size, m_cam, cMo_vec); 204 | if (tag_detected && m_detector.getNbObjects() > 0) { // if tag detected, we pick the first one 205 | cMo = cMo_vec[tag_id]; 206 | m_state = state_tracking; 207 | } 208 | 209 | // Initialize the tracker with the result of the detection 210 | if (m_state == state_tracking) { 211 | m_tracker.initFromPose(m_I, cMo); 212 | } 213 | } 214 | 215 | if (m_state == state_tracking) { 216 | try { 217 | m_tracker.track(m_I); 218 | 219 | m_tracker.getPose(cMo); 220 | 221 | int visible_edges_counter = 0; // counter of the number of edges actually visible and currently tracked 222 | 223 | // Get the lines currently tracked of the model 224 | std::list edges; 225 | m_tracker.getLline("Camera", edges, 0); 226 | int i = 0; 227 | 228 | //*nEdges = edges.size(); 229 | for (std::list::const_iterator it = edges.begin(); it != edges.end(); ++it) { 230 | 231 | // Part of the functionality from the display() function is implemented from the following source: 232 | // http://visp-doc.inria.fr/doxygen/visp-daily/vpMbtDistanceLine_8cpp_source.html 233 | if ((*it)->isvisible && (*it)->isTracked()) { 234 | visible_edges_counter ++; // increment count of number of edges that are visible and being tracked with visibility 235 | vpPoint *P1 = (*it)->p1; 236 | vpPoint *P2 = (*it)->p2; 237 | P1->project(cMo); 238 | P2->project(cMo); 239 | vpImagePoint iP1, iP2; 240 | vpMeterPixelConversion::convertPoint(m_cam, P1->get_x(), P1->get_y(), iP1); 241 | vpMeterPixelConversion::convertPoint(m_cam, P2->get_x(), P2->get_y(), iP2); 242 | visible_edges_pointx[i] = static_cast(iP1.get_u()); 243 | visible_edges_pointy[i] = static_cast(iP1.get_v()); 244 | i ++; 245 | visible_edges_pointx[i] = static_cast(iP2.get_u()); 246 | visible_edges_pointy[i] = static_cast(iP2.get_v()); 247 | i ++; 248 | } 249 | } 250 | 251 | // Update number of visible edges 252 | *visible_edges_number = visible_edges_counter; 253 | 254 | if (m_debug_enable_display && m_debug_display_is_initialized) { 255 | m_tracker.display(m_I, cMo, m_cam, vpColor::red, 2); 256 | vpDisplay::displayFrame(m_I, cMo, m_cam, tag_size / 2, vpColor::none, 3); 257 | } 258 | 259 | // Detect tracking error 260 | double projection_error = m_tracker.computeCurrentProjectionError(m_I, cMo, m_cam); 261 | if (m_debug_enable_display && m_debug_display_is_initialized) { 262 | std::stringstream ss; 263 | ss << "Projection error: " << projection_error << std::endl; 264 | vpDisplay::displayText(m_I, 40, 20, ss.str(), vpColor::red); 265 | } 266 | if (projection_error > m_projection_error_threshold) { 267 | m_state = state_detection; 268 | } 269 | else { 270 | m_state = state_tracking; 271 | } 272 | } 273 | catch (...) { 274 | m_state = state_detection; 275 | } 276 | } 277 | 278 | // Update output pose array 279 | for (unsigned int i = 0; i < 16; i++) { 280 | cube_cMo[i] = static_cast(cMo.data[i]); 281 | } 282 | *tracking_time = vpTime::measureTimeMs() - t_start; 283 | 284 | if (m_debug_enable_display && m_debug_display_is_initialized) { 285 | std::stringstream ss; 286 | ss << "Loop time: " << *tracking_time << std::endl; 287 | vpDisplay::displayText(m_I, 20, 20, ss.str(), vpColor::red); 288 | vpDisplay::flush(m_I); 289 | } 290 | 291 | return (m_state == state_tracking ? true : false); 292 | } 293 | 294 | void Visp_MbGenericTracker_CreateCaoFile(double cube_edge_size) 295 | { 296 | std::ofstream fileStream; 297 | fileStream.open("cube.cao", std::ofstream::out | std::ofstream::trunc); 298 | fileStream << "V1\n"; 299 | fileStream << "# 3D Points\n"; 300 | fileStream << "8 # Number of points\n"; 301 | fileStream << cube_edge_size / 2 << " " << cube_edge_size / 2 << " " << 0 << " # Point 0: (X, Y, Z)\n"; 302 | fileStream << cube_edge_size / 2 << " " << -cube_edge_size / 2 << " " << 0 << " # Point 1\n"; 303 | fileStream << -cube_edge_size / 2 << " " << -cube_edge_size / 2 << " " << 0 << " # Point 2\n"; 304 | fileStream << -cube_edge_size / 2 << " " << cube_edge_size / 2 << " " << 0 << " # Point 3\n"; 305 | fileStream << -cube_edge_size / 2 << " " << cube_edge_size / 2 << " " << -cube_edge_size << " # Point 4\n"; 306 | fileStream << -cube_edge_size / 2 << " " << -cube_edge_size / 2 << " " << -cube_edge_size << " # Point 5\n"; 307 | fileStream << cube_edge_size / 2 << " " << -cube_edge_size / 2 << " " << -cube_edge_size << " # Point 6\n"; 308 | fileStream << cube_edge_size / 2 << " " << cube_edge_size / 2 << " " << -cube_edge_size << " # Point 7\n"; 309 | fileStream << "# 3D Lines\n"; 310 | fileStream << "0 # Number of lines\n"; 311 | fileStream << "# Faces from 3D lines\n"; 312 | fileStream << "0 # Number of faces\n"; 313 | fileStream << "# Faces from 3D points\n"; 314 | fileStream << "6 # Number of faces\n"; 315 | fileStream << "4 0 3 2 1 # Face 0: [number of points] [index of the 3D points]...\n"; 316 | fileStream << "4 1 2 5 6\n"; 317 | fileStream << "4 4 7 6 5\n"; 318 | fileStream << "4 0 7 4 3\n"; 319 | fileStream << "4 5 2 3 4\n"; 320 | fileStream << "4 0 1 6 7 # Face 5\n"; 321 | fileStream << "# 3D cylinders\n"; 322 | fileStream << "0 # Number of cylinders\n"; 323 | fileStream << "# 3D circles\n"; 324 | fileStream << "0 # Number of circles\n"; 325 | fileStream.close(); 326 | } 327 | 328 | void Visp_CameraParameters_Init(double cam_px, double cam_py, double cam_u0, double cam_v0) 329 | { 330 | m_cam.initPersProjWithoutDistortion(cam_px, cam_py, cam_u0, cam_v0); 331 | } 332 | 333 | void Visp_DetectorAprilTag_Init(float quad_decimate, int nthreads) 334 | { 335 | // Initialize AprilTag detector 336 | m_detector_quad_decimate = quad_decimate; 337 | m_detector_nthreads = nthreads; 338 | m_detector.setAprilTagFamily(vpDetectorAprilTag::TAG_36h11); 339 | m_detector.setAprilTagQuadDecimate(m_detector_quad_decimate); 340 | m_detector.setAprilTagNbThreads(m_detector_nthreads); 341 | m_detector.setDisplayTag(m_debug_enable_display, vpColor::none, 3); 342 | } 343 | 344 | bool Visp_DetectorAprilTag_Process(double tag_size, float *tag_cog, float *tag_length, float *tag_cMo, double *detection_time) 345 | { 346 | double t_start = vpTime::measureTimeMs(); 347 | 348 | if (m_debug_enable_display && m_debug_display_is_initialized) { 349 | vpDisplay::display(m_I); 350 | } 351 | // Detection 352 | std::vector cMo_v; 353 | bool tag_detected = m_detector.detect(m_I, tag_size, m_cam, cMo_v); 354 | 355 | if (tag_detected) { 356 | // If the image contains an aprilTag we pick the first one 357 | unsigned int tag_id = 0; 358 | // Tag characteristics 359 | vpImagePoint cog = m_detector.getCog(tag_id); 360 | tag_cog[0] = static_cast(cog.get_u()); 361 | tag_cog[1] = static_cast(cog.get_v()); 362 | 363 | std::vector corners = m_detector.getPolygon(tag_id); 364 | tag_length[0] = static_cast(vpImagePoint::distance(corners[0], corners[1])); // side1 365 | tag_length[1] = static_cast(vpImagePoint::distance(corners[1], corners[2])); // side2 366 | tag_length[2] = static_cast(vpImagePoint::distance(corners[2], corners[3])); // side3 367 | tag_length[3] = static_cast(vpImagePoint::distance(corners[3], corners[0])); // side4 368 | tag_length[4] = static_cast(vpImagePoint::distance(corners[0], corners[2])); // diagonal1 369 | tag_length[5] = static_cast(vpImagePoint::distance(corners[1], corners[3])); // diagonal2 370 | 371 | // Update output pose array 372 | for (unsigned int i = 0; i < 16; i++) { 373 | tag_cMo[i] = static_cast(cMo_v[tag_id].data[i]); 374 | } 375 | 376 | if (m_debug_enable_display && m_debug_display_is_initialized) { 377 | vpDisplay::displayFrame(m_I, cMo_v[tag_id], m_cam, tag_size / 2, vpColor::none, 3); 378 | } 379 | } 380 | 381 | *detection_time = vpTime::measureTimeMs() - t_start; 382 | 383 | if (m_debug_enable_display && m_debug_display_is_initialized) { 384 | std::stringstream ss; 385 | ss << "Loop time: " << *detection_time << std::endl; 386 | vpDisplay::displayText(m_I, 20, 20, ss.str(), vpColor::red); 387 | vpDisplay::flush(m_I); 388 | } 389 | 390 | return tag_detected; 391 | } 392 | } 393 | -------------------------------------------------------------------------------- /vispWrapper/ViSPUnity.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ViSP, open source Visual Servoing Platform software. 4 | * Copyright (C) 2005 - 2020 by Inria. All rights reserved. 5 | * 6 | * This software is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * See the file LICENSE.txt at the root directory of this source 11 | * distribution for additional information about the GNU GPL. 12 | * 13 | * For using ViSP with software that can not be combined with the GNU 14 | * GPL, please contact Inria about acquiring a ViSP Professional 15 | * Edition License. 16 | * 17 | * See http://visp.inria.fr for more information. 18 | * 19 | * This software was developed at: 20 | * Inria Rennes - Bretagne Atlantique 21 | * Campus Universitaire de Beaulieu 22 | * 35042 Rennes Cedex 23 | * France 24 | * 25 | * If you have questions regarding the use of this file, please contact 26 | * Inria at visp@inria.fr 27 | * 28 | * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 29 | * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 30 | * 31 | * Description: 32 | * Unity plugin that wraps some ViSP functionalities. 33 | * 34 | *****************************************************************************/ 35 | #ifndef VISPUnity_h 36 | #define VISPUnity_h 37 | 38 | /*! 39 | \file 40 | \brief ViSPUnity plugin functions declaration. 41 | */ 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | 54 | # ifdef ViSPUnity_EXPORTS 55 | # define VISP_UNITY_EXPORT VISP_DLLEXPORT 56 | # else 57 | # define VISP_UNITY_EXPORT VISP_DLLIMPORT 58 | # endif 59 | 60 | extern "C" { 61 | 62 | /*! 63 | * Allows to enable ViSP display for debugging. 64 | * \param enable_display : true to enable displaying images during process. 65 | * 66 | * \warning When set to true, it opens a window that will show the image that is processed. 67 | * The focus comes on that windows and freezes Unity. To unfreeze Unity, just click on Unity 68 | * to recover focus. 69 | */ 70 | VISP_UNITY_EXPORT 71 | void Visp_EnableDisplayForDebug(bool enable_display=false); 72 | 73 | /*! 74 | * Free memory allocated by the wrapper. 75 | */ 76 | VISP_UNITY_EXPORT 77 | void Visp_WrapperFreeMemory(); 78 | 79 | /*! 80 | * Set vpImage from Unity Color32 array image. 81 | * \param bitmap : Bitmap color 32 array that contains the color RGBA [height x width] image. 82 | * \param height : Image height. 83 | * \param width : Image width. 84 | */ 85 | VISP_UNITY_EXPORT 86 | void Visp_ImageUchar_SetFromColor32Array(unsigned char *bitmap, int height, int width); 87 | 88 | /*! 89 | * Create a CAD model of a cube in CAO format. 90 | * \param cube_edge_size : Size of the cube edges in meters. 91 | */ 92 | VISP_UNITY_EXPORT 93 | void Visp_MbGenericTracker_CreateCaoFile(double cube_edge_size); 94 | 95 | /*! 96 | * Set the feature type used by the tracker. 97 | * \param feature_type : Type of features used by the tracker: 0 for edges, 1 for hybrid tracking (edges+keypoints). 98 | * Note that hybrid tracking is only possible if ViSP was built with OpenCV support. 99 | */ 100 | VISP_UNITY_EXPORT 101 | void Visp_MbGenericTracker_SetFeatureType(int feature_type); 102 | 103 | /*! 104 | * Set generic tracker moving-edges settings. 105 | * 106 | * \param range : Search range on both sides of the reference pixel. 107 | * \param sample_step : Minimum distance in pixel between two discretized points. 108 | * 109 | */ 110 | VISP_UNITY_EXPORT 111 | void Visp_MbGenericTracker_SetMovingEdgesSettings(int range=8, double sample_step=4); 112 | 113 | /*! 114 | * Set generic tracker keypoint settings. 115 | * \param quality : Minimal accepted quality of image corners detected usinh KLT algorithm. 116 | * \param mask_border : Erosion of the mask used on the model faces. 117 | */ 118 | VISP_UNITY_EXPORT 119 | void Visp_MbGenericTracker_SetKeypointSettings(double quality=0.01, int mask_border=5); 120 | 121 | /*! 122 | * Initialize generic model-based tracker. 123 | * 124 | * \param angle_appear : Angle in degrees used to test polygons appearance. If the angle between the normal 125 | * of the polygon and the line going from the camera to the polygon center has a value lower than this 126 | * parameter, the polygon is considered as appearing. The polygon will then be tracked. 127 | * \param angle_disappear : Angle in degrees used to test polygons disappearance. If the angle between 128 | * the normal of the polygon and the line going from the camera to the polygon center has a value greater 129 | * than this parameter, the polygon is considered as disappearing. The tracking of the polygon will then be stopped. 130 | * \param projection_error_threshold : Allowed error angle between the gradient direction of the model features 131 | * projected at the resulting pose and their normal. The error is expressed in degree between 0 and 90. 132 | */ 133 | VISP_UNITY_EXPORT 134 | void Visp_MbGenericTracker_Init(double angle_appear=70, double angle_disappear=80, double projection_error_threshold=30); 135 | 136 | /*! 137 | * Launch generic model-based tracker. 138 | * \param tag_size : Tag size in [m]. This is the lenght of the black external shape of the tag. 139 | * \param visible_edges_pointx : Coordinates in x of each visible edge pair of points stored in a 24-dim 140 | * max array [edge1_P1.x edge1_P2.x edge2_P1.x edge2.x ...]. 141 | * \param visible_edges_pointy : Coordinates in y of each visible edge pair of points stored in a 24-dim 142 | * max array [edge1_P1.y edge1_P2.y edge2_P1.y edge2.y ...]. 143 | * \param visible_edges_number : Number of visible cube edges. 144 | * \param cube_cMo : 16-dim array corresponding to the cube pose as an [4 by 4] homogeneous matrix in row-major. 145 | * \param tracking_time Tracking time in [ms]. 146 | * \return true when a tracking succeed, false otherwise. 147 | * 148 | * The following pseudo-code shows how to use this function in an Unity project: 149 | * 150 | * \code 151 | * void Start() 152 | * { 153 | * Visp_EnableDisplayForDebug(); 154 | * Visp_CameraParameters_Init(); 155 | * Visp_DetectorAprilTag_Init(); 156 | * Visp_MbGenericTracker_CreateCaoFile(); 157 | * Visp_MbGenericTracker_SetFeatureType(); 158 | * Visp_MbGenericTracker_SetMovingEdgesSettings(); 159 | * Visp_MbGenericTracker_SetKeypointSettings(); 160 | * Visp_MbGenericTracker_Init(); 161 | * } 162 | * void Update() 163 | * { 164 | * Visp_ImageUchar_SetFromColor32Array() 165 | * Visp_MbGenericTracker_Process(); 166 | * } 167 | * void OnApplicationQuit() 168 | * { 169 | * Visp_WrapperFreeMemory(); 170 | * } 171 | * \endcode 172 | 173 | */ 174 | VISP_UNITY_EXPORT 175 | bool Visp_MbGenericTracker_Process(double tag_size, 176 | float *visible_edges_pointx, float *visible_edges_pointy, int *visible_edges_number, 177 | float *cube_cMo, double *tracking_time); 178 | 179 | /*! 180 | * Initialize camera parameters 181 | * 182 | * \param cam_px, cam_py : Intrinsic camera parameter corresponding to the ratio between the focal length of the lens 183 | * in meters and the size of the pixel in meters. 184 | * \param cam_u0, cam_v0 : Coordinates of the principal point (the intersection of the optical axes with the image plane) 185 | * that is usually near the image center. 186 | */ 187 | VISP_UNITY_EXPORT 188 | void Visp_CameraParameters_Init(double cam_px=600., double cam_py=600., double cam_u0=340., double cam_v0=240.); 189 | 190 | /*! 191 | * Initialize AprilTag detector. 192 | * 193 | * \param quad_decimate : Detection of tags can be done on a lower-resolution image, improving speed 194 | * at a cost of pose accuracy and a slight decrease in detection rate. Decoding the binary payload 195 | * is still done at full resolution. Default is 1.0, increase this value to reduce the computation time. 196 | * \param nthreads : Set the number of threads for tag detection (default is 1). 197 | */ 198 | VISP_UNITY_EXPORT 199 | void Visp_DetectorAprilTag_Init(float quad_decimate = 1.f, int nthreads = 1); 200 | 201 | /*! 202 | * Detect and localize an AprilTag. 203 | * 204 | * \param tag_size : Tag size in [m]. This is the lenght of the black external shape of the tag. 205 | * \param tag_cog : 2-dim array that contains tag center of gravity coordinates (u, v) along horizontal 206 | * and vertical axis respectively. 207 | * \param tag_length : 6-dim array that contains the length in pixel of the 4 tag sides and the length of the tag diagonal. 208 | * \param tag_cMo : 16-dim array corresponding to the tag pose as an [4 by 4] homogeneous matrix in row-major. 209 | * \param detection_time : Detection time in [ms]. 210 | * \return true when a tag is detected, false otherwise. 211 | * 212 | * The following pseudo-code shows how to use this function in an Unity project: 213 | * 214 | * \code 215 | * void Start() 216 | * { 217 | * Visp_EnableDisplayForDebug(); 218 | * Visp_CameraParameters_Init(); 219 | * Visp_DetectorAprilTag_Init(); 220 | * } 221 | * void Update() 222 | * { 223 | * Visp_ImageUchar_SetFromColor32Array() 224 | * Visp_DetectorAprilTag_Process(); 225 | * } 226 | * void OnApplicationQuit() 227 | * { 228 | * Visp_WrapperFreeMemory(); 229 | * } 230 | * \endcode 231 | */ 232 | VISP_UNITY_EXPORT 233 | bool Visp_DetectorAprilTag_Process(double tag_size, float *tag_cog, float *tag_length, float *tag_cMo, 234 | double *detection_time); 235 | } 236 | 237 | #endif 238 | -------------------------------------------------------------------------------- /vispWrapper/cmake/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # 3 | # ViSP, open source Visual Servoing Platform software. 4 | # Copyright (C) 2005 - 2019 by Inria. All rights reserved. 5 | # 6 | # This software is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2 of the License, or 9 | # (at your option) any later version. 10 | # See the file LICENSE.txt at the root directory of this source 11 | # distribution for additional information about the GNU GPL. 12 | # 13 | # For using ViSP with software that can not be combined with the GNU 14 | # GPL, please contact Inria about acquiring a ViSP Professional 15 | # Edition License. 16 | # 17 | # See http://visp.inria.fr for more information. 18 | # 19 | # This software was developed at: 20 | # Inria Rennes - Bretagne Atlantique 21 | # Campus Universitaire de Beaulieu 22 | # 35042 Rennes Cedex 23 | # France 24 | # 25 | # If you have questions regarding the use of this file, please contact 26 | # Inria at visp@inria.fr 27 | # 28 | # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 29 | # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 30 | # 31 | # Description: 32 | # Comes from http://www.cmake.org/Wiki/CMake_FAQ to create an uninstall target 33 | # 34 | # Authors: 35 | # Fabien Spindler 36 | # 37 | ############################################################################# 38 | 39 | IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 40 | #MESSAGE("Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 41 | MESSAGE("There is no files to uninstall") 42 | ELSE(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 43 | FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 44 | STRING(REGEX REPLACE "\n" ";" files "${files}") 45 | FOREACH(file ${files}) 46 | MESSAGE(STATUS "Uninstalling \"${file}\"") 47 | IF(EXISTS "${file}") 48 | EXEC_PROGRAM( 49 | "@CMAKE_COMMAND@" ARGS "-E remove \"${file}\"" 50 | OUTPUT_VARIABLE rm_out 51 | RETURN_VALUE rm_retval 52 | ) 53 | IF("${rm_retval}" STREQUAL 0) 54 | ELSE("${rm_retval}" STREQUAL 0) 55 | MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"") 56 | ENDIF("${rm_retval}" STREQUAL 0) 57 | ELSE(EXISTS "${file}") 58 | MESSAGE(STATUS "File \"${file}\" does not exist.") 59 | ENDIF(EXISTS "${file}") 60 | ENDFOREACH(file) 61 | 62 | ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 63 | --------------------------------------------------------------------------------