Tutorial Part 4

Tutorial contents:

Starting and Configuring Video and Tracking

An essential part of your augmented reality experience is getting the real world into your scene. In BuildAR Pro, video of the real world provides the backdrop into which you can add your own virtual content. Typically the video input comes from your webcam or other video capture device, meaning that the video you see is “live” and displayed in real time. In BuildAR Pro, a new feature is the ability to use pre-recorded video as well, or simply one or more static images (such as photographs). In the following sections, we will explain how to configure BuildAR Pro to use these inputs.

The Video Settings Panel

The video settings panel can be accessed by selecting Video in the scene tree.

The panel allows you to:

  • Select the video source type to use
  • Configure the selected video source
  • Start the selected video source
  • Adjust general video settings

The video source type to use can be selected from the dropdown list. Possible options are:

  • No video source: turns off video input (the default until another option is selected)
  • Camera: a webcam or other video capture device
  • Video file: a pre-recorded video
  • Image file: one or more static images (snapshots)

Each of these choices can have specific configuration options, described below.

No Video Source

This is the default option until another option is selected. It can also be chosen to disable video input, which you might want to do if you do not currently have a webcam, and just want to manually edit parameters in the scene, or use the 3D only view.

Camera

This is the typical selection as it enables what most people would consider is required for augmented reality: a live video image. When you select this option, another dropdown list will be shown containing the possible capture devices you can use. This list is generated by finding compatible DirectShow devices on your system. Therefore, if you want to use a particular device (e.g. camera, capture card, USB capture device) you should ensure it is DirectShow compatible and has the necessary drivers installed before running BuildAR Pro.

Being able to select which camera to use is particularly useful on laptops where you may wish to use an external camera of higher quality than the built-in webcam.

Once you have selected the device you wish to use, press the green “play” button to start it and set it as the current input. Another dialog window will appear where you can configure the capture parameters of the selected capture device:

Here you can select the capture resolution and framerate. With most current webcams you should be able to select at least 640×480 at 30 frames per second. These are typical settings that currently work well. Once you press OK, BuildAR Pro will start capturing from the device, and you should see a live image appear in the main view area.

Video File

Being able to use a pre-recorded video file is convenient in several situations. For example, if you don’t have a webcam on hand you can use a recording. If you know what sort of viewing behaviours your users will have (e.g. in a kiosk demonstration) you might record some examples and then be able to verify that your scene looks good in these cases.

Once you select video file in the video settings panel, a file selection panel appears which you can use to browse and select the file you want to use.

Currently the only supported format for video files is AVI. You must also have the appropriate codec installed for the AVI file you select (basically it should work if you can view the AVI file in Windows Media Player).

Once you have selected the AVI file, press the green “play” button to start using it.

Image File

The final option is to use one or more static images. In this case the video will not be live or even moving, but rather a snapshot that is frozen. Having a frozen image can make editing a lot easier because markers won’t move, and objects will only move when you tell them to.

Once you select image file in the video settings panel, the follow configuration panel will be shown:

This panel allows you to manage a list of image files that can be used as the current video input. You can add and remove items, or clear the entire list. To activate an image you can either select it and press the green “play” button, or double-click on it in the list.

The Tracking Settings Panel

The tracking settings panel can be accessed by selecting Tracker in the scene tree.

BuildAR Pro uses computer vision algorithms to find known markers in the video images and then calculates the real camera position from the image. Once this is known a virtual object can be overlaid on the marker. The tracking process depends on lighting conditions. If the light level is too bright or too dark then the markers will not be detected and tracked correctly. This problem can be solved by adjusting the tracking threshold using the slider in the tracker settings panel.

You can see the effect of the tracking threshold by checking the “Show Debug Image” box. This will activate a small sub-window withing the 3D view area which will show a black and white version of the current video image. The parts of the image that are black are below the tracking threshold, whereas the ones that are white lie above the threshold. Once you start adding and tracking markers, you can return to this tool to solve problems with poor tracking. If you can’t clearly make out your markers in the debug view, then try adjusting the threshold, as shown in the pictures below:

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Live
  • PDF
  • Reddit
  • Twitter
http://www.buildar.co.nz/wp-content/themes/bigbiz