Configure the AR Experience
You can configure AR through a dedicated command. Then, you can move your device
around a printed marker, and see your virtual object on top of it.
-
From the AR-VR section of the action bar, click iV Magic Window
.
- If you have a video camera, then the camera starts streaming images that are
displayed on the background of the current 3D scene. You need to print a marker to
display the 3D scene in the required position.
- Otherwise, the AR experience uses a still image with a marker as a
background.
-
In the AR Configuration dialog box, click
to access configuration options.
-
In the Source area, select the source of the image.
| Option | Description |
|---|
| Live camera |
A camera, such as a web cam. If there is more than one available camera, use
the list to select a camera. |
| Video file |
A prerecorded video footage. Click ..., and then browse
your folders to select a file. You can also select one or more still images that you
want to successively display, showing a virtual object in many different real-life
situations. |
Note:
On some devices such as the Surface Pro 2, on Windows 8.1 Pro, a conflict might
occur between the two embedded cameras and the external USB camera. To use an external
camera instead of the embedded ones, right-click .
-
In the Camera Calibration area, specify the parameters of the camera that you chose
in the Source area.
For more information, see Calibrate the Camera.
-
In the Rendering area, select the options for rendering.
| Option | Description |
|---|
| Mirror |
Instead of displaying what the camera sees, this option displays your
reflection surrounded by virtual objects. For example, moving the marker to the
right moves the virtual object in the same direction. This option is especially
useful when facing the display screen and the camera at the same time. |
| Render background |
Renders the image as a background. You can deactivate the background to make
the marker act as a tangible interface in a fully virtual world. By default, this
option is selected. |
-
In the Marker area, use the list to select a predefined marker to detect in the
current image, or click More... to select a user-defined
one.
A marker is a picture that can be detected in real-time using
image-processing techniques. Markers can be as simple as black and white bar codes, or
as complex as a photograph. Predefined markers are provided in
C:\Program Files\Dassault Systemes\B429\win_b64
\resources\graphic\ARMarkers. This
directory contains two types of files:
- Bitmap images to be used by the app.
- PDF files that the user can print.
  When you select a marker, the
Efficiency field indicates the isa global grade given to the
marker to help you compare markers.
-
In the Marker width field, indicate the physical size of the
marker in millimeters.
It is important to accurately measure the smallest side of your printed
marker with a ruler to ensure a stable tracking and a realistic model
scaling.
-
In the 3D Model area, define the appropriate options.
| Option | Description |
|---|
| Scale |
Allows you to view models at a scale other than 1:1, which is especially
useful when you need to make an entire car fit in the palm of your hand, for
example. |
| Position |
Defines the offsets in millimeters to adjust the position of the virtual model
relative to the center of the marker. |
| Orientation |
Defines the angles of the model relative to the marker frame. Make sure that
the angles are in degrees and correspond to rotations around the X, Y, and Z
axes. |
-
In the Tracking area, specify the tracking algorithm.
This algorithm is always a compromise between speed and accuracy:
- The most accurate algorithm handles partial occlusions of the marker.
- The least accurate algorithm does nothing: the video is rendered in the
background and you are free to modify the model (manually or using your own tracking
strategy).
-
Click
to start the camera.
-
Move your device around the object (be careful not to face the camera).
The exact position of the camera relative to the marker is retrieved and you
can see the real-time capture of the object on your device. Below is an example of the
result that you can obtain:

-
Click iV Magic Window
to close the command.
Calibrate the Camera
You can estimate the characteristics of a physical camera, especially its focal
length and distortion parameters. Without a calibrated camera, it is impossible to project
virtual 3D images accurately on the real-world.
-
If you already know the camera parameters (for example, if it has already been
calibrated), select Camera calibration file in the Camera
Calibration area.
This option lets you select a text file containing the camera calibration
parameters. All parameters are stored in a single line as follows:
xsize ysize cc_x cc_y fc_x fc_y kc1 kc2 kc3 kc3 kc5 kc6
iter Where:
- xsize, ysize: calibrated frame dimensions (does not need to match the frame
dimensions at runtime)
- cc_x, cc_y: principal point location (in pixels)
- fc_x, fc_y: focal length (in pixels)
- kc1..kc6: radial/tangential distortion coefficients (kc6 is not in use)
- iter: number of iterations for distortion compensation
For example:
640 480 318.613463049990120 242.528511619033760 553.111326706724300
550.790645874873350 0.053851232286206 -0.196157056647373 -0.001007178693043
0.000594343958909 0.0 0.0 0.0 The file format used is compatible with
the ARToolkitPlus library. Below is the mapping between OpenCV and ARToolkitPlus
conventions:
| ARToolkitPlus |
OpenCV |
| xsize |
- |
| ysize |
- |
| cc_x |
cx |
| cc_y |
cy |
| fc_x |
fx |
| fc_y |
fy |
| kc1 |
k1 |
| kc2 |
k2 |
| kc3 |
p1 |
| kc4 |
p2 |
| kc5 |
k3 |
-
If you do not know the camera parameters, select Interactive
in the Camera Calibration area.
This option lets you compute the camera parameters using the Camera
Calibration Wizard or the Automatic Camera
Calibration. You automatically retrieve the camera calibration parameters by
moving a calibration pattern in front of your camera.
-
This calibration technique has been implemented in OpenCV. For more information,
browse the following website: http://opencv.org. If you
choose this option, the AR component detects the camera calibration pattern (the
11x4 array of dots by default) in the images provided in the video source.
You can calibrate:
- The current camera at the selected resolution.
- A camera that has been used to create a set of images containing the
calibration pattern.
- The sequence images must contain enough valid images with the calibration
pattern.
- All provided images are considered but they might not be usable (because
of lighting conditions, for example).
- The more images, the better, provided that they are distinct enough.
-
Print the calibration pattern (ideally, using a laser printer).
This pattern is provided as a .pdf file in
C:\Program Files\Dassault Systemes\B429\win_b64
\resources\CameraCalibration\Pattern_ACircles_11x4_24mm.pdf. This
file gives a more accurate result than the usual chessboard with squares.
-
Measure the printed pattern to ensure that its size has not been scaled by the
printer.
Note:
If you do not have a printer, you can display the pattern on an LCD
monitor, or on a mobile device. But make sure that the displayed pattern has the
correct physical size.
-
Glue the pattern on a rigid surface (for example, a rigid cardboard, a piece of wood,
or glass), and make sure that the pattern remains straight.
There must be no air bubbles between the paper and the pattern.
-
When the calibration pattern is ready, choose between calibrating the camera using a
live video feed, or provided image files.
-
If you selected Live camera and
Interactive, the Camera Calibration Wizard
starts to help you calibrate your camera.
-
If you are facing the camera, switch to Mirror rendering
mode, and minimize the action bar.
In this mode, color guides are available to help you position the calibration.
Each color corresponds to an edge of the pattern in its target pose.
-
When the color guides appear, place the pattern in front of the camera until you
see it surrounded by color edges.
Some white "rubber band" links are visible between the corners of the pattern
and those of the target pose.

-
Position the pattern so that the links between the pattern and the pose do not
cross. Do not orient the pattern upside down.
The aim is to make all these links as short as possible. When the corners of the
current pose are close enough to those of the target, then the links turn cyan, and
become thicker to indicate that the distance is valid.
-
Make sure the approximate scale and orientation of the pattern are correct.
-
Move closer or further away from the camera to make the corners of the current
and target poses match as much as possible.
When the pose is successful, a snapshot is taken, and a new target pose is
displayed. Below are all the 11 target poses to obtain:

-
Repeat the steps above to define the remaining target poses.
Whatever the calibration method, the screen blinks whenever a pattern is
correctly detected. A furtive notification is also displayed to indicate the number of
remaining poses. Recommendation:
To take advantage of this feedback, leave
the AR Configuration dialog box visible during the calibration
process.
When the calibration is over, the parameters are applied to the
current view, and a calibration file is generated in
%TEMP%\CameraCalibration. This directory stores all files and
snapshots related to camera calibration. The calibration file is named after the
camera resolution and name with the *.cal extension, for example
CameraCalibration_Logitech_Webcam_C920-C_YUY2_640x480.cal.
Result: A wrong camera calibration leads to an incorrect projection of the virtual model:

A correct camera calibration improves the projection and overlay
of the virtual model on the marker:

|