Start typing to search...

Experimenting with HTC Vive camera tracking using Unreal scene


Note that this documentation only presents a helper compound that enables performing your own experiments with HTC Vive. Aximmetry does not officially support using HTC Vive as a camera tracking system. We strive to create the means for your experiments in Aximmetry, but we cannot provide any support for these and we cannot guarantee any result.

Also note that this environment only provides a basic image composition method, where the camera image is simply overlayed onto the virtual background. No talent covering, reflections and shadows can be achieved, these features will only be available in the future releases of the Aximmetry DE editions.

This documentation assumes that you are already familiar with how to add and handle Unreal scene to your Aximmetry compound. If not please see these: Getting started with The Unreal Engine based DE edition and How to install and work with the Unreal Engine base DE edition.

Tracking-specific control board

You can find a compound supporting camera tracking with Unreal at [Common_Studio]:Compounds\TrackedCam_Unreal\TrackedCam_Unreal_Prev_3-Cam.xcomp

Annotation 2020-06-01 204315.png

Drag and drop this compound into your scene (instead of the VirtualCam one presented by the previous documentation. You won’t need that.)

Annotation 2020-06-01 204722.png

Connect the Camera pins:

Annotation 2020-06-01 204859.png

Wire back Unreal output to Rendered:

Annotation 2020-06-01 205625.png

Expose Preview and Out.

Annotation 2020-06-01 205726.png

You’ll see the Unreal scene with the camera being in the origin.

Setting up camera input and keying

Use the INPUT and KEYER panels for this. It works exactly the same way as you do with VirtualCam, please see the relevant documentation.

Annotation 2020-06-01 210350.png

As you may notice the CROP panel is missing. The reason is that with a moving camera you cannot use static cropping. Instead, a 3D studio mask is provided, see below.

Adding HTC Vive tracking

Switch to Studio mode in order to easily see any camera movements.

Annotation 2020-06-01 210703.png

On the INPUT panel find the Tracking Device property and select the tracker mounted on your camera:

Annotation 2020-06-01 210828.png Annotation 2020-06-01 210933.png

At this points, you already have some tracking. If you move your Vive tracker the virtual camera will move according to it.

Adjusting the tracking delay

Place a talent or any object into the green.

On the INPUT panel adjust Tracking Delay while you move your camera back and forth. It’s expressed in frames. The value is correct if the starting and stopping of the motion of the real object and the virtual pattern happens at the same time on the screen.

Annotation 2020-06-01 211316.png Annotation 2020-06-01 211417.png

Calibrating the tracker position

Please make sure that your Vive system is properly calibrated so that the origin is on the floor.

At this point, you must have mounted your Vive tracker onto your camera. Since the position and most likely the exact orientation of the tracker differ from the position and orientation of the actual camera sensor, you need to do some adjustments. Select the ORIGIN panel.

Annotation 2020-06-01 211647.png

Adjust Delta Head Transf according to the position and rotation of the tracker relative to the camera sensor. The rotation is the most sensitive parameter, try to be as precise as you can. This is the hardest part of the process.

Annotation 2020-06-01 211805.png

Calibrating the camera zoom

Since in this environment you cannot provide zoom encoder data, you’ll have to use a fixed camera zoom of your choice. When you’ve set it up you have to synchronize the virtual camera zoom to it.

Switch to Studio mode, because watching the virtual patterns and/or markers is the easiest way to do this.

Annotation 2020-06-01 212052.png

Annotation 2020-06-01 212137.png

You can use either a talent or any object placed into the green.

Select the INPUT panel, and turn on Manual Lens.

Annotation 2020-06-01 212242.png Annotation 2020-06-01 212325.png

You have to adjust Manual Zoom, while you rotate your camera from left to right back and forth.

Annotation 2020-06-01 212451.png

When you experience the least gliding between the real object and the virtual pattern, that will be the right value.

Note that this is a rudimentary method, and also it does not take lens distortion into account, but in this experimental environment it might be enough.

Studio setup

If you only have a limited size green you need 3D masks that move and rotate with the camera to always ensure the cropping of the out-of-green parts of your studio.

Switch to Studio mode.

Annotation 2020-06-01 212901.png

In this mode, you’ll see a box-shaped schematic studio model overlayed on the camera input image. You can use the properties of the STUDIO panel to mark the green and non-green areas of your physical studio on this schematic model.

Annotation 2020-06-01 213023.png Annotation 2020-06-01 213114.png

Via Base Cam Transform you can align the orientation of your physical room to the walls of the schematic model.

By adjusting Front WallLeft Wall etc. you can set a size for the model to approximate the walls of your studio.

With the Green * properties you can approximate the green surface on the front and side walls and on the floor. The numbers represents the distance of the edges of the green from the corners.

You do not have to be absolute precise to the millimeters. The point is that wherever you move or rotate the camera the green surface of the model always remain in the boundaries of the real green screen.

The result should look something like this:

Annotation 2020-06-01 213416.png

Annotation 2020-06-01 213525.png

As you can see you can also use two virtual markes to mark certain features of the physical room, thus you can check the quality of the tracking more precisely. Also you can set the opacity of the schematic model.

Annotation 2020-06-01 213715.png

Aligning the virtual set

Having set up the studio mask you can switch to Final mode to adjust the final composite image.

Annotation 2020-06-01 213851.png

On the SCENE panel you can align the orientation of virtual set and the talent using the Base Cam Transf property.

IMPORTANT: do not confuse this property with the one on the STUDIO panel with the same name. The latter aligns the schematic studio model with the studio room, while this one places the talent within the virtual set.

Annotation 2020-06-01 213950.png Annotation 2020-06-01 214024.png

Article content