First, AR concept:
Augmented Reality (augmented Reality, referred to as AR) is a new technology developed on the basis of virtual reality, also known as mixed reality. Is through the information provided by the computer system to increase the user's perception of the real world technology, the virtual information to the real world, and computer-generated virtual objects, scenes or system information superimposed on the real scene, so as to achieve the reality of the enhancement.
Second, tools:
Here we mainly use the Qualcomm Vuforia SDK to demonstrate how to make a simple AR Demo,vuforia SDK under Unity is a very complete set of directly called Ar API, and if you want to know more about the inside of the SDK on the AR image recognition and tracking algorithm, We need to start with the open CV.
1.unity--I'm using the unity5.3.1f version.
2.Vuforia SDK Plugin-Download the latest 5.5 Unity-specific version from the official website (HTTPS://DEVELOPER.VUFORIA.COM/DOWNLOADS/SDK)
Third, actual combat:
1. Create a new 3D project in unity named Testar
2. Import the downloaded Vuforia SDK plug-in package: Vuforia-unity-5-5-9.unitypackage
3. After the import is successful, the assets directory will be more than one Vuforia file directory and some other auxiliary files
4. Delete the main camera in the default scene and drag the Arcamera camera in the Vuforia/prefabs directory to the scene
5. In this article we are going to demonstrate the recognition of images, so we need to drag the imagetarget in the Vuforia/prefabs directory to the scene, adjust the camera position, and know that the browse page appears as follows:
Since there is no picture selected for recognition, the current panel is still blank, and after adding the image to be identified, the app will compare it with the real world footage taken by the camera.
6. Because the high-pass image recognition needs to upload the image to be recognized in its internal image library, so here we need to go to the developer backstage to complete some preparatory work.
A. Open link: Developer backend, create a new database
B. In the new database, add the target:
7. Select Imagetarget, set the data set property of the image Target behaviour component and automatically jump to the page where we just added database and Target, and we'll select one of them and click Download Database button, the Export resource's option box pops up, select Unity Editor, and then click Create to get a resource bundle with the same name as the database: Test.unitypackage
8. We go back to the Unity Project and import the newly generated test.unitypackage into the project, and we can see that in addition to some of the configuration files, the resources include the images we uploaded to the Qualcomm website, which are converted to materials:
9. After importing the resources, go back to the image target behaviour component on the Imagetarget component, and after selecting the target image specified in database, we can see that the Imagetarget shows our selected image:
10. Set Arcamera to check the load Test database and activate in the database load behaviour:
11. Drag into a model, which is the AR model that appears when we use camera alignment to identify images on mobile devices such as mobile phones, and of course this model is best used as a sub-object of Imagetarget and sets the position of this model:
11. Package the current project into an APK installed on the phone, on the PC to open the background image for recognition, the real machine run directly to the picture on the phone, see how the results. Added the "Vuforia App is missing ..." prompt when adding a real-time boot, this is because the package does not have to add to the Arcamera app License key completed the complete result, let us describe how to get this parameter:
A. Open the developer backend, select License Manager tab, here is the background of certificate management, we need to add a certificate for our app:
B. Generate the Certificate:
C. View the build certificate and get the app key:
D. Fill out the app key into the app License key for the Arcamera component in Unity:
12. RePack the APK and view the results:
Gjm:unity3d Qualcomm Vuforia SDK AR Development