Eyewear_ImageTracking

Demonstrate eyewear support and how to use image tracking on eyewear.

You can adaptive other AR eyewear referencing this sample. It use two camera rendering to display on eyewear, and the camera image display is off. Pre-calibrated ShadowCreator Action One and EPSON BT-350 can use this sample directly. Other eyewear needs to be calibrated before using.

Configurations

You need to add invision.display_mode settings in your AndroidManifest, this can also be done with enable invision.display_mode-vr.aar for Android platform.

../../_images/image_s16_8.png

Make sure to revert the change if you are running other samples on Android devices.

How to Use

../../_images/image_19.png

How It Works

This sample is for an eyewear with no VIO feature. If you are using an eyewear with VIO tracking, you can start with EasyAR_Eyewear_ExternalControl prefab which do not have a render camera because it will be handled by the eyewear SDK in most of the case.

When using eyewears like BT-350, you need to set ARSession.AssembleMode to AssembleMode.Manual, and set the assembly manually.

../../_images/image_s16_1.png ../../_images/image_s16_2.png

A CameraRoot in the scene holds two cameras. Setup the ARAssembly.CameraRoot and ARAssembly.FrameSource.

../../_images/image_s16_3.png ../../_images/image_s16_4.png

ARAssembly.RenderCameras should be setup to the two cameras under the CameraRoot.

../../_images/image_s16_6.png ../../_images/image_s16_7.png

The camera viewport are adjusted to render left and right side of the screen.

../../_images/image_s16_5.png

This sample use image tracking, so setup the ARAssembly.FrameFilters with the tracker.

Load pre-calibrated parameters into RenderCameraController.

parameterList[eyewearBT350].Add(Resources.Load<RenderCameraParameters>("Parameters/Epson BT350/LeftEye"));
parameterList[eyewearBT350].Add(Resources.Load<RenderCameraParameters>("Parameters/Epson BT350/RightEye"));

if (deviceModel == parameterList[eyewearBT350][0].DeviceModel)
{
    cameraDevice.CameraSize = new Vector2(1280, 720);

    leftEyeRenderCameraController.ExternalParameters = parameterList[eyewearBT350][0];
    rightEyeRenderCameraController.ExternalParameters = parameterList[eyewearBT350][1];
}